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
  • Get Coin Exchange Records
  • Get Delivery Record
  • Get USDC Session Settlement
  • Get Asset Info
  • Get All Coins Balance
  • Get Single Coin Balance
  • Get Transferable Coin
  • Create Internal Transfer
  • Get Internal Transfer Records
  • Get Sub UID
  • Enable Universal Transfer for Sub UID
  • Create Universal Transfer
  • Get Universal Transfer Records
  • Get Allowed Deposit Coin Info
  • Set Deposit Account
  • Get Deposit Records (on-chain)
  • Get Sub Deposit Records (on-chain)
  • Get Internal Deposit Records (off-chain)
  • Get Master Deposit Address
  • Get Sub Deposit Address
  • Get Coin Info
  • Get Withdrawal Records
  • Get Withdrawal Records
  • Withdraw
  • Cancel Withdrawal
  1. PENDAX
  2. Using PENDAX SDK
  3. ByBit Functions

Asset

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

PreviousAccountNextUser

Last updated 8 months ago

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

Get Coin Exchange Records

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

Function name:

getCoinExchangeRecords(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 getCoinExchangeRecords(exchange, options) {
    try {
        let result = await exchange.getCoinExchangeRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getCoinExchangeRecords(myByBitAccount);

Get Delivery Record

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

Function name:

getDeliveryRecord(options)

Usage:

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

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

let j = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bybit",
      marginType: "usdt",
      testnet: "false"
});

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

const result = await getDeliveryRecord(myByBitAccount, 
    {
        category: "option"
    });

Get USDC Session Settlement

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

Function name:

getUsdcSesssionSettlement(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 getUsdcSesssionSettlement(exchange, options) {
    try {
        let result = await exchange.getUsdcSesssionSettlement(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getUsdcSesssionSettlement(myByBitAccount, 
    {
       category: "linear"
     });

Get Asset Info

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

Function name:

getAssetInfo(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 getAssetInfo(exchange, options) {
    try {
        let result = await exchange.getAssetInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getAssetInfo(myByBitAccount, {accountType: "SPOT"});

Get All Coins Balance

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

Function name:

getAllCoinsBalance(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 getAllCoinsBalance(exchange, options) {
    try {
        let result = await exchange.getAllCoinsBalance(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getAllCoinsBalance(myByBitAccount, {accountType: "SPOT"});

Get Single Coin Balance

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

Function name:

getSingleCoinBalance(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 getSingleCoinBalance(exchange, options) {
    try {
        let result = await exchange.getSingleCoinBalance(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSingleCoinBalance(myByBitAccount, 
    {
       accountType: 'UNIFIED',
       coin: 'BTC'
     });

Get Transferable Coin

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

Function name:

getTransferableCoin(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 getTransferableCoin(exchange, options) {
    try {
        let result = await exchange.getTransferableCoin(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getTransferableCoin(myByBitAccount,
    {
        fromAccountType: 'SPOT',
        toAccountType: 'UNIFIED'
    });

Create Internal Transfer

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

Function name:

createInternalTransfer(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 createInternalTransfer(exchange, options) {
    try {
        let result = await exchange.createInternalTransfer(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createInternalTransfer(myByBitAccount, 
    {
        transferID: '12345',
        coin: 'USDT',
        amount: '10',
        fromAccountType: 'UNIFIED',
        toAccountType: 'SPOT'
    });

Get Internal Transfer Records

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

Function name:

getInternalTransferRecords(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 getInternalTransferRecords(exchange, options) {
    try {
        let result = await exchange.getInternalTransferRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInternalTransferRecords(myByBitAccount);

Get Sub UID

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

Function name:

getSubUid(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 getSubUid(exchange, options) {
    try {
        let result = await exchange.getSubUid(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSubUid(myByBitAccount);

Enable Universal Transfer for Sub UID

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

Function name:

enableUniversalTransfer(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 enableUniversalTransfer(exchange, options) {
    try {
        let result = await exchange.enableUniversalTransfer(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await enableUniversalTransfer(myByBitAccount, 
    {
        subMemberIds: ["554117,592324,592334"]
    });

Create Universal Transfer

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

Function name:

createUniversalTransfer(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 createUniversalTransfer(exchange, options) {
    try {
        let result = await exchange.createUniversalTransfer(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createUniversalTransfer(myByBitAccount, 
    {
        transferId: "12345",
        coin: "USDT",
        amount: "10",
        fromMemberId: "12345",
        toMemberId: "123456",
        fromAccountType: "UNIFIED",
        toAccountType: "UNIFIED"
    });

Get Universal Transfer Records

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

Function name:

getUniversalTransferRecords(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 getUniversalTransferRecords(exchange, options) {
    try {
        let result = await exchange.getUniversalTransferRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getUniversalTransferRecords(myByBitAccount);

Get Allowed Deposit Coin Info

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

Function name:

getAllowedDepositCoinInfo(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 getAllowedDepositCoinInfo(exchange, options) {
    try {
        let result = await exchange.getAllowedDepositCoinInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getAllowedDepositCoinInfo(myByBitAccount);

Set Deposit Account

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

Function name:

setDepositAccount(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 setDepositAccount(exchange, options) {
    try {
        let result = await exchange.setDepositAccount(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await setDepositAccount(myByBitAccount, 
    {
        accountType: "UNIFIED"
    });

Get Deposit Records (on-chain)

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

Function name:

getDepositRecord(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 getDepositRecord(exchange, options) {
    try {
        let result = await exchange.getDepositRecord(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getDepositRecord(myByBitAccount);

Get Sub Deposit Records (on-chain)

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

Function name:

getSubAccountDepositRecords(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 getSubAccountDepositRecords(exchange, options) {
    try {
        let result = await exchange.getSubAccountDepositRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSubAccountDepositRecords(myByBitAccount, 
    {
        subMemberId: "12345"
    });

Get Internal Deposit Records (off-chain)

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

Function name:

getInternalDepositRecords(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 getInternalDepositRecords(exchange, options) {
    try {
        let result = await exchange.getInternalDepositRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInternalDepositRecords(myByBitAccount);

Get Master Deposit Address

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

Function name:

getMasterDepositAddress(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 getMasterDepositAddress(exchange, options) {
    try {
        let result = await exchange.getMasterDepositAddress(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getMasterDepositAddress(myByBitAccount,
    {
        coin: "USDT"
    });

Get Sub Deposit Address

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

Function name:

getSubDepositAddress(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 getSubDepositAddress(exchange, options) {
    try {
        let result = await exchange.getSubDepositAddress(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSubDepositAddress(myByBitAccount,
    {
        coin: "USDT",
        chainType: "ETH",
        subMemberId: "12345"
    });

Get Coin Info

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

Function name:

getCoinInfo(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 getCoinInfo(exchange, options) {
    try {
        let result = await exchange.getCoinInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getCoinInfo(myByBitAccount);

Get Withdrawal Records

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

Function name:

getWithdrawalRecords(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 getWithdrawalRecords(exchange, options) {
    try {
        let result = await exchange.getWithdrawalRecords(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getWithdrawalRecords(myByBitAccount);

Get Withdrawal Records

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

Function name:

getDelayWithdrawalAmount(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 getDelayWithdrawalAmount(exchange, options) {
    try {
        let result = await exchange.getDelayWithdrawalAmount(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getDelayWithdrawalAmount(myByBitAccount, 
    {
        coin: "USDT"
    });

Withdraw

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:

withdraw(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 withdraw(exchange, options) {
    try {
        let result = await exchange.withdraw(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await withdraw(myByBitAccount, 
    {
        coin: "USDT",
        chain: "ETH20",
        walletAddress: "12345",
        amount: "10",
        timestamp: "10000000000"
    });

Cancel Withdrawal

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:

cancelWithdraw(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 cancelWithdraw(exchange, options) {
    try {
        let result = await exchange.cancelWithdraw(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await cancelWithdraw(myByBitAccount, 
    {
        id: "12345"
    });

⚫
💡
💻
https://bybit-exchange.github.io/docs/v5/asset/exchange
https://bybit-exchange.github.io/docs/v5/asset/delivery
https://bybit-exchange.github.io/docs/v5/asset/settlement
https://bybit-exchange.github.io/docs/v5/asset/asset-info
https://bybit-exchange.github.io/docs/v5/asset/all-balance
https://bybit-exchange.github.io/docs/v5/asset/account-coin-balance
https://bybit-exchange.github.io/docs/v5/asset/transferable-coin
https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
https://bybit-exchange.github.io/docs/v5/asset/sub-uid-list
https://bybit-exchange.github.io/docs/v5/asset/enable-unitransfer-subuid
https://bybit-exchange.github.io/docs/v5/asset/unitransfer
https://bybit-exchange.github.io/docs/v5/asset/unitransfer-list
https://bybit-exchange.github.io/docs/v5/asset/deposit-coin-spec
https://bybit-exchange.github.io/docs/v5/asset/set-deposit-acct
https://bybit-exchange.github.io/docs/v5/asset/deposit-record
https://bybit-exchange.github.io/docs/v5/asset/sub-deposit-record
https://bybit-exchange.github.io/docs/v5/asset/internal-deposit-record
https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
https://bybit-exchange.github.io/docs/v5/asset/sub-deposit-addr
https://bybit-exchange.github.io/docs/v5/asset/coin-info
https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
https://bybit-exchange.github.io/docs/v5/asset/delay-amount
https://bybit-exchange.github.io/docs/v5/asset/withdraw
https://bybit-exchange.github.io/docs/v5/asset/cancel-withdraw