Example: futures-get-balances.ts

Static snapshot for Bitmart/Rest/Futures/futures-get-balances.ts.

Example Path

Bitmart/Rest/Futures/futures-get-balances.ts

Source Link

Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Bitmart/Rest/Futures/futures-get-balances.ts

Code Snapshot

import { FuturesClientV2 } from 'bitmart-api';

const account = {
  key: process.env.API_KEY || 'apiKeyHere',
  secret: process.env.API_SECRET || 'apiSecretHere',
  memo: process.env.API_MEMO || 'apiMemoHere',
};

const client = new FuturesClientV2({
  apiKey: account.key,
  apiSecret: account.secret,
  apiMemo: account.memo,
});

async function getFuturesAssets() {
  try {
    const balances = await client.getFuturesAccountAssets();

    console.log('Balances: ', JSON.stringify(balances, null, 2));
  } catch (e) {
    console.error('Req error: ', e);
  }
}

getFuturesAssets();

This is a static, crawlable snapshot. The interactive app loads after JavaScript starts and can refresh live data.