BitMart TypeScript SDK example: futures-submit-order.ts

BitMart REST Futures futures submit order example for the Siebly BitMart SDK, with TypeScript source for exchange REST API and WebSocket integration, setup, and production SDK docs.

What This Example Covers

  • BitMart REST API example in TypeScript.
  • Uses the Siebly BitMart SDK package bitmart-api instead of hand-written HTTP request plumbing.
  • Source path: Bitmart/Rest/Futures/futures-submit-order.ts.
  • Example category: REST Futures.
  • Imports SDK symbols including FuturesClientV2.
  • Calls SDK methods such as submitFuturesOrder().

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

Bitmart/Rest/Futures/futures-submit-order.ts

Source Link

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

Related SDK Docs

Example Source

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 SumbitFuturesOrder() {
  try {
    const order = await client.submitFuturesOrder({
      symbol: 'BTCUSDT',
      type: 'market',
      side: 1, // Order side - 1=buy_open_long  -2=buy_close_short  -3=sell_close_long  -4=sell_open_short
      size: 1,
      leverage: '1',
      open_type: 'cross',
    });

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

SumbitFuturesOrder();