BitMart TypeScript SDK example: futures-get-klines.ts
BitMart REST Futures futures get klines 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-apiinstead of hand-written HTTP request plumbing. - Source path:
Bitmart/Rest/Futures/futures-get-klines.ts. - Example category: REST Futures.
- Imports SDK symbols including
FuturesClientV2. - Calls SDK methods such as
getFuturesKlines().
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-get-klines.ts
Source Link
Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Bitmart/Rest/Futures/futures-get-klines.ts
Related SDK Docs
Example Source
import { FuturesClientV2 } from 'bitmart-api';
const client = new FuturesClientV2();
async function getFuturesKlines() {
try {
const klines = await client.getFuturesKlines({
symbol: 'BTCUSDT',
start_time: 1709130476,
end_time: 1709131476,
});
console.log('Tickers: ', JSON.stringify(klines, null, 2));
} catch (e) {
console.error('Req error: ', e);
}
}
getFuturesKlines();