Account (Futures)
Documentation on interacting with Bitget's Futures Market Account API functions through the PENDAX Javascript SDK.
Get Single Account
Function name:
getSingleAccountFutures(options)
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBitgetAccount = createExchange({
exchange: "bitget",
authenticate: "true",
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "bitget",
marginType: "usdt",
testnet: "false"
});
async function getSingleAccountFutures(exchange, options) {
try {
let result = await exchange.getSingleAccountFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getSingleAccountFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT"
});
Get Account List
Function name:
getAccountListFutures(options)
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 getAccountListFutures(exchange, options) {
try {
let result = await exchange.getAccountListFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getAccountListFutures(myBitgetAccount,
{
productType: "umcbl"
});
Get Sub-Account Contract Assets
Function name:
getSubaccountContractAssets(options)
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 getSubaccountContractAssets(exchange, options) {
try {
let result = await exchange.getSubaccountContractAssets(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getSubaccountContractAssets(myBitgetAccount,
{
productType: "umcbl"
});
Get Open Count
Function name:
getOpenCountFutures(options)
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 getOpenCountFutures(exchange, options) {
try {
let result = await exchange.getOpenCountFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getOpenCountFutures(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
openPrice: "23189.5",
leverage: "20",
openAmount:"5000"
});
Change Leverage
Function name:
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 setLeverage(exchange, options) {
try {
let result = await exchange.setLeverage(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await setLeverage(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
leverage: "2"
});
Change Margin
Function name:
getApiKeyInfo(options)
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 changeMargin(exchange, options) {
try {
let result = await exchange.changeMargin(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await changeMargin(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
amount: "-10"
});
Change Margin Mode
Function name:
setMarginMode(options)
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 setMarginMode(exchange, options) {
try {
let result = await exchange.setMarginMode(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await setMarginMode(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
marginMode: "crossed"
});
Change Hold Mode
Function name:
changeHoldMode(options)
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 changeHoldMode(exchange, options) {
try {
let result = await exchange.changeHoldMode(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await changeHoldMode(myBitgetAccount,
{
productType: "umcbl",
holdMode: "double_hold"
});
Get Symbol Position
Function name:
getSymbolPosition(options)
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 getSymbolPosition(exchange, options) {
try {
let result = await exchange.getSymbolPosition(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getSymbolPosition(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT"
});
Get All Position
Function name:
getAllPositionsFutures(options)
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 getAllPositionsFutures(exchange, options) {
try {
let result = await exchange.getAllPositionsFutures(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getAllPositionsFutures(myBitgetAccount,
{
productType: "umcbl",
marginCoin: "USDT"
});
Get Account Bill
Function name:
getAccountBill(options)
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 getAccountBill(exchange, options) {
try {
let result = await exchange.getAccountBill(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getAccountBill(myBitgetAccount,
{
symbol: "BTCUSDT_UMCBL",
marginCoin: "USDT",
startTime: "1659403328000",
endTime: "1659406928000",
pageSize: "20"
});
Get Business Account Bill
Function name:
getBusinessAccountBill(options)
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 getBusinessAccountBill(exchange, options) {
try {
let result = await exchange.getBusinessAccountBill(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getBusinessAccountBill(myBitgetAccount,
{
productType: "umcbl",
startTime: "1659403328000",
endTime: "1659406928000",
pageSize: "20"
});
Last updated