All parameters of type INTEGER listed in the Bybit API docs need to be passed in as a string.
Get Coin Exchange Records
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
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
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
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
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
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
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
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
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
Function name:
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
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
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
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
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
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)
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)
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)
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
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
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
Function name:
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
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
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
Function name:
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
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"
});