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-account
  • Query account uid
  • Get sub-account list
  • Query sub-account spot assets
  • Create an API Key for a sub-account
  • Query the API Key of a sub-account
  • Reset the API Key of a sub-account
  • Delete the API Key of sub-accounts
  • Freeze and unfreeze sub-accounts
  • Authorize sub-account internal transfers
  • Sub-account internal transfer
  • Create deposit address for sub-account
  • Get sub-account deposit address
  • Get sub-account deposit records
  • Query sub-account internal transfer records
  • Query Sub-Account Transfer History (For Master Account Operations Only)
  • Query the transferable amount of funds in the parent-child account (only for parent account operations).
  • Sub-Account Asset Transfer Interface (For Master Account Operations Only)
  • Asset overview
  • Batch inquiry of sub account asset overview
  1. PENDAX
  2. Using PENDAX SDK
  3. BingX Functions

Sub-Account Managenent

PreviousWallet Deposits and WithdrawalsNextMarket Data (USDT-M)

Last updated 7 months ago

Create sub-account

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

createSubaccount()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await createSubaccount(myBingxExchange, {
	subAccountString: "<string>",
	recvWindow: "<long>"
});

Query account uid

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getAccountUid()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getAccountUid(myBingxExchange);

Get sub-account list

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubAccountList()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubAccountList(myBingxExchange, {
	page: "<int>",
	limit: "<int>"
});

Query sub-account spot assets

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccountSpotAssets()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccountSpotAssets(myBingxExchange, {
	subUid: "<long>"
});

Create an API Key for a sub-account

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

createSubaccountApikey()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await createSubaccountApikey(myBingxExchange, {
	subUid: "<long>",
	note: "<string>",
	permissions: "<Array>"
});

Query the API Key of a sub-account

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccountApikey()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccountApikey(myBingxExchange, {
	uid: "<long>"
});

Reset the API Key of a sub-account

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

resetSubaccountApikey()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await resetSubaccountApikey(myBingxExchange, {
	subUid: "<long>",
	apiKey: "<string>",
	note: "<string>",
	permissions: "<Array>"
});

Delete the API Key of sub-accounts

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

deleteSubaccountApikey()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await deleteSubaccountApikey(myBingxExchange, {
	subUid: "<long>",
	apiKey: "<string>"
});

Freeze and unfreeze sub-accounts

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

setSubaccountFrozen()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await setSubaccountFrozen(myBingxExchange, {
	subUid: "<long>",
	freeze: "<bool>"
});

Authorize sub-account internal transfers

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

authorizeSubaccountInternalTransfers()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await authorizeSubaccountInternalTransfers(myBingxExchange, {
	subUids: "<string>",
	transferable: "<boolean>"
});

Sub-account internal transfer

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

subaccountInternalTransfer()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await subaccountInternalTransfer(myBingxExchange, {
	coin: "<string>",
	userAccountType: "<int>",
	userAccount: "<string>",
	amount: "<float64>",
	walletType: "<int>"
});

Create deposit address for sub-account

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

createSubaccountDepositAddress()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await createSubaccountDepositAddress(myBingxExchange);

Get sub-account deposit address

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccountDepositAddress()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccountDepositAddress(myBingxExchange);

Get sub-account deposit records

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccountDepositRecords()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccountDepositRecords(myBingxExchange);

Query sub-account internal transfer records

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccountInternalTransferRecords()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccountInternalTransferRecords(myBingxExchange, {
	coin: "<string>"
});

Query Sub-Account Transfer History (For Master Account Operations Only)

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccsferHistory()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccsferHistory(myBingxExchange);

Query the transferable amount of funds in the parent-child account (only for parent account operations).

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getTransferableParentChildFunds()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getTransferableParentChildFunds(myBingxExchange);

Sub-Account Asset Transfer Interface (For Master Account Operations Only)

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

subaccountAssetTransfer()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await subaccountAssetTransfer(myBingxExchange);

Asset overview

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getAssetOverview()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getAssetOverview(myBingxExchange);

Batch inquiry of sub account asset overview

Please refer to the official BingX API Docs for the Required parameters.

Function Name:

getSubaccountAssetOverviewBatchInquiry()

Usage:

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

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

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

let result = await getSubaccountAssetOverviewBatchInquiry(myBingxExchange);

⚫
💡
💻
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Create+sub-account
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+account+uid
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Get+sub-account+list
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+sub-account+spot+assets
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Create+an+API+Key+for+a+sub-account
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+the+API+Key+of+a+sub-account
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Reset+the+API+Key+of+a+sub-account
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Delete+the+API+Key+of+sub-accounts
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Freeze+and+unfreeze+sub-accounts
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Authorize+sub-account+internal+transfers
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Sub-account+internal+transfer
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Create+deposit+address+for+sub-account
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Get+sub-account+deposit+address
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Get+sub-account+deposit+records
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+sub-account+internal+transfer+records
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+Sub-Account+Transfer+History+(For+Master+Account+Operations+Only)
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Query+the+transferable+amount+of+funds+in+the+parent-child+account+(only+for+parent+account+operations).
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Sub-Account+Asset+Transfer+Interface+(For+Master+Account+Operations+Only)
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Asset+overview
https://bingx-api.github.io/docs/#/en-us/common/sub-account#Batch+inquiry+of+sub+account+asset+overview