Sub Account Interface (Broker)

This section is under construction. Some functions may not work correctly.

Get Broker Info

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

https://bitgetlimited.github.io/apidoc/en/broker/#get-broker-info

Function name:

getBrokerInfo()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getBrokerInfo(myBitgetAccount);

Create Sub Account

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

https://bitgetlimited.github.io/apidoc/en/broker/#create-sub-account

Function name:

createSubaccount()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await createSubaccount(myBitgetAccount

Get Sub List

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

https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-list

Function name:

getSubList()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSubList(myBitgetAccount

Modify Sub Account

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

https://bitgetlimited.github.io/apidoc/en/broker/#modify-sub-account

Function name:

modifySubaccount()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await modifySubaccount(myBitgetAccount

Modify Sub Email

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

https://bitgetlimited.github.io/apidoc/en/broker/#modify-sub-email

Function name:

modifySubaccountEmail()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await modifySubaccountEmail(myBitgetAccount

Get Sub Email

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

https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-email

Function name:

getSubId()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSubId(myBitgetAccount

Get Sub Spot Assets

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

https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-spot-assets

Function name:

getSubSpotAssets()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSubSpotAssets(myBitgetAccount

Get Sub Future Assets

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

https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-future-assets

Function name:

getSubFuturesAssets()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSubFuturesAssets(myBitgetAccount

Get Sub Deposit Address

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

https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-deposit-address-only-broker

Function name:

getSubDepositAddressBrokerOnly()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSubDepositAddressBrokerOnly(myBitgetAccount

Sub Withdrawal

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

https://bitgetlimited.github.io/apidoc/en/broker/#sub-withdrawal-only-broker

Function name:

subWithdrawalBrokerOnly()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await subWithdrawalBrokerOnly(myBitgetAccount

Sub Deposit Auto Transfer

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

https://bitgetlimited.github.io/apidoc/en/broker/#sub-deposit-auto-transfer-only-broker

Function name:

subDepositAutoTransferBrokerOnly()

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await subDepositAutoTransferBrokerOnly(myBitgetAccount

Last updated