BitMart REST futures submit order JavaScript example for the Siebly BitMart SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs.
We use environment variables in our examples for API keys. It is your responsibility to manage and secure your keys appropriately.
bitmart-api instead of hand-written HTTP request plumbing.Bitmart/Rest/Futures/futures-submit-order.ts.FuturesClientV2.submitFuturesOrder().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(); We use essential cookies and optional analytics. Read the Privacy Policy.
Essential cookies stay on. Toggle analytics if you want to share anonymous usage insights. You can revisit this anytime via Cookie Settings in the footer.