Binance TypeScript SDK example: rest-usdm-private-get.ts

Binance REST Futures REST usdm private get example for the Siebly Binance SDK, with TypeScript source for exchange REST API and WebSocket integration, setup, and production SDK docs.

What This Example Covers

  • Binance REST API example in TypeScript.
  • Uses the Siebly Binance SDK package binance instead of hand-written HTTP request plumbing.
  • Source path: Binance/Rest/Futures/rest-usdm-private-get.ts.
  • Example category: REST Futures.
  • Imports SDK symbols including USDMClient.
  • Calls SDK methods such as getNotionalAndLeverageBrackets().

How To Use This Example

  • Start here for the specific request or stream pattern, then check the matching SDK guide for install, credentials, and operational notes.
  • Open the repository source when you need the latest committed version: GitHub source file.

Example Path

Binance/Rest/Futures/rest-usdm-private-get.ts

Source Link

Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Binance/Rest/Futures/rest-usdm-private-get.ts

Related SDK Docs

Example Source

import { USDMClient } from 'binance';
// import axios from 'axios';

const key = process.env.API_KEY_COM || 'APIKEY';
const secret = process.env.API_SECRET_COM || 'APISECRET';

const client = new USDMClient({
  api_key: key,
  api_secret: secret,
  beautifyResponses: true,
  disableTimeSync: true,
});

(async () => {
  try {
    const allNotionalBrackets = await client.getNotionalAndLeverageBrackets();
    console.log('allNotionalBrackets: ', allNotionalBrackets);

    const btcNotionalBrackets = await client.getNotionalAndLeverageBrackets({
      symbol: 'BTCUSDT',
    });
    console.log(
      'btcNotionalBrackets: ',
      JSON.stringify(btcNotionalBrackets, null, 2),
    );
  } catch (e) {
    console.error('request failed: ', e);
  }
})();