Compendium Trading Tools Documentation
CompendiumPENDAXCompendexOfficial Links
  • ⭐Platform Overview
  • ⚫PENDAX
    • 🌐What is PENDAX?
    • 🖱️PENDAX Capabilities
    • 💾Installing PENDAX modules
    • 💡Using PENDAX SDK
      • 💻Common Functions
      • 💻OKX Functions
        • Trading & Orders
        • Funding
        • Convert
        • Account & Subaccount
        • Grid Trading
        • Market Data
        • Public Data
        • Trading Data
      • 💻Bitget Functions
        • Public (Spot)
        • Market (Spot)
        • Wallet (Spot)
        • Account (Spot)
        • Trade (Spot)
        • Market (Futures)
        • Account (Futures)
        • Trade (Futures)
        • CopyTrade (Futures)
        • Sub Account Interface (Broker)
        • Sub API Interface (Broker)
      • 💻ByBit Functions
        • Market
        • Trading
        • Position
        • Account
        • Asset
        • User
        • Spot Leverage Token
        • Spot Margin Trade (UTA)
        • Spot Margin Trade (Normal)
        • Institutional Lending
      • 💻Mexc Functions
        • Market
        • Sub-Account
        • Spot Account/Trade
        • Wallet
        • ETF
        • Rebate
        • Futures Market
        • Futures Account and Trading
      • 💻Phemex Functions
        • Contract
        • Hedged Contract
        • Spot
        • Margin Trading
        • Transfer
        • Convert
        • Deposit And Withdraw
      • 💻BloFin Functions
        • Websocket
        • Account
        • Affiliate
        • Public Data
        • Trading
        • User
      • 💻BingX Functions
        • Fund Account
        • Wallet Deposits and Withdrawals
        • Sub-Account Managenent
        • Market Data (USDT-M)
        • Account (USDT-M)
        • Trades (USDT-M)
        • Market Data (Coin-M)
        • Trades (Coin-M)
        • Market Data (Spot)
        • Fund Account (Spot)
        • Trades (Spot)
        • CopyTrader
      • ⚠️FTX Functions
    • 📜License Agreement
  • 🟣Compendium App
    • 📈Compendium Trading Tools
    • 🔗Connect An Exchange Account
      • 🗝️OKX.com API Keys
    • 🤖Verified Trading Bots
      • Explore The Marketplace
      • For Algo & Strategy Authors
        • Get Listed & Verified
        • Strategy Monetization
        • Sending Trading Signals
        • Simplified Signal Program
      • For Users & Subscribers
        • Subscribing To Bots
        • Managing A Subscription
    • 💫Copy Trading Groups
      • For Copy Group Leaders
        • Creating A Copy Group
        • Linking Leader Account
        • Important Trading Notes
        • Manage A Copy Group
        • Discord Webhooks Setup
      • For Users & Subscribers
        • Subscribe To Copy Group
        • Link Account To Group
    • 📶Signal Provider Groups
      • For Group Leaders
        • Creating A Signal Group
        • Managing A Signal Group
        • Sending Trading Signals
      • For Users & Subscribers
        • Subscribing To Signal Groups
        • Manage Signal Group Subscription
  • 🔵Compendex Suite
    • 🔮DeFi With Compendex
    • ☀️Solana Integrations
      • Supported Solana Wallets
      • Overview And News
      • Openbook Spot Markets
      • Smart Swap Aggregator
      • NFT Metaverse Markets
      • Solana DeFi Analytics Portal
      • Community Tools List
  • 🪙The CMFI Token Ecosystem
    • 📊Tokenomics Breakdown
    • 🍎Trade Incentive Program
    • 🌊Staking And Liquidity Pools
      • ✨Raydium Liquidity Pools
      • 🐳Orca Liquidity Whirlpools
      • 🐋Orca Liquidity Pools
    • 🐷Compendi-Pigs NFT
  • 👥Community Info
    • ✅Links And Social Pages
    • 🎨Branding Guidelines
Powered by GitBook
On this page
  • Create Sub UID
  • Create Sub UID API Key
  • Get Sub UID List
  • Freeze Sub UID
  • Get API Key Information
  • Modify Master API Key
  • Modify Sub API Key
  • Delete Master API Key
  • Delete Sub API Key
  1. PENDAX
  2. Using PENDAX SDK
  3. ByBit Functions

User

Documentation on interacting with ByBit's User API functions through the PENDAX Javascript SDK.

PreviousAssetNextSpot Leverage Token

Last updated 1 year ago

All parameters of type INTEGER listed in the Bybit API docs need to be passed in as a string.

Create Sub UID

Please refer to the official ByBit API Docs for the required parameters.

Function name:

createSubUid(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function createSubUid(exchange, options) {
    try {
        let result = await exchange.createSubUid(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createSubUid(myByBitAccount, 
    {
        username: "bill",
        memberType: "1"
    });

Create Sub UID API Key

Please refer to the official ByBit API Docs for the required parameters.

Function name:

createSubUidApiKey(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function createSubUidApiKey(exchange, options) {
    try {
        let result = await exchange.createSubUidApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createSubUidApiKey(myByBitAccount, 
    {
       subuid: "62874117",
       readOnly: "0",
       permissions: {
           Spot: ["SpotTrade"]
       }
   });

Get Sub UID List

Please refer to the official ByBit API Docs for the required parameters.

Function name:

getSubUidList(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getSubUidList(exchange, options) {
    try {
        let result = await exchange.getSubUidList(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSubUidList(myByBitAccount);

Freeze Sub UID

Please refer to the official ByBit API Docs for the required parameters.

Function name:

freezeSubUid(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function freezeSubUid(exchange, options) {
    try {
        let result = await exchange.freezeSubUid(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await freezeSubUid(myByBitAccount, 
    {
       subuid: "62874117",
       frozen: "1"
     });

Get API Key Information

Please refer to the official ByBit API Docs for the required parameters.

Function name:

getApiKeyInfo(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getApiKeyInfo(exchange, options) {
    try {
        let result = await exchange.getApiKeyInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getApiKeyInfo(myByBitAccount);

Modify Master API Key

Please refer to the official ByBit API Docs for the required parameters.

Function name:

modifyMasterApiKey(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function modifyMasterApiKey(exchange, options) {
    try {
        let result = await exchange.modifyMasterApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await modifyMasterApiKey(myByBitAccount, 
    {
        permissions:{
            NFT:[
                "NFTQueryProductList"
            ]
        }
    });

Modify Sub API Key

This function is under construction and may not behave as expected

Please refer to the official ByBit API Docs for the required parameters.

Function name:

modifySubApiKey(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitSubAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function modifySubApiKey(exchange, options) {
    try {
        let result = await exchange.modifySubApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await modifySubApiKey(myByBitSubAccount , 
    {
        permissions:{
            NFT:[
                "NFTQueryProductList"
            ]
        }
    });

Delete Master API Key

Please refer to the official ByBit API Docs for the required parameters.

Function name:

deleteMasterApiKey(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function deleteMasterApiKey(exchange, options) {
    try {
        let result = await exchange.deleteMasterApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await deleteMasterApiKey(myByBitAccount);

Delete Sub API Key

Please refer to the official ByBit API Docs for the required parameters.

Function name:

deleteSubApiKey(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function deleteSubApiKey(exchange, options) {
    try {
        let result = await exchange.deleteSubApiKey(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await deleteSubApiKey(myByBitAccount);

⚫
💡
💻
https://bybit-exchange.github.io/docs/v5/user/create-subuid
https://bybit-exchange.github.io/docs/v5/user/create-subuid-apikey
https://bybit-exchange.github.io/docs/v5/user/subuid-list
https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline
https://bybit-exchange.github.io/docs/v5/user/apikey-info
https://bybit-exchange.github.io/docs/v5/user/modify-master-apikey
https://bybit-exchange.github.io/docs/v5/user/modify-sub-apikey
https://bybit-exchange.github.io/docs/v5/user/rm-master-apikey
https://bybit-exchange.github.io/docs/v5/user/rm-sub-apikey