Example: spot-get-balances.ts

Static snapshot for Bitmart/Rest/Spot/spot-get-balances.ts.

Example Path

Bitmart/Rest/Spot/spot-get-balances.ts

Source Link

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

Code Snapshot

import { RestClient } 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 RestClient({
  apiKey: account.key,
  apiSecret: account.secret,
  apiMemo: account.memo,
});

async function getSpotBalances() {
  try {
    const balances = await client.getAccountBalancesV1();

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

getSpotBalances();

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