Binance Futures JavaScript SDK example: rest-usdm-private-get.ts

Binance Futures REST usdm private get JavaScript example. Read the source code, review its SDK calls, and browse related exchange integration examples.

This example uses binance, the JavaScript and TypeScript SDK for Binance. Install it with npm install binance.

We use environment variables in our examples for API keys. It is your responsibility to manage and secure your keys appropriately.

examples/Binance/REST/Futures/rest-usdm-private-get.ts

What this example covers

  • Binance REST API JavaScript example.
  • 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: 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.
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);  }})(); 

Subscribe on Substack

Complete the Substack form below to join our newsletter. Substack handles all subscriber data directly.