Links

Asset

Documentation on interacting with ByBit's Asset API functions through the PENDAX Javascript SDK.
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);
}