feat(): update basic spot/futures examples with initial types

This commit is contained in:
Tiago Siebler
2023-11-14 12:15:26 +00:00
parent b1b3ee926e
commit ea8fac777e
19 changed files with 499 additions and 63 deletions

View File

@@ -1,17 +1,19 @@
import { SpotClient } from '../src/index';
import { RestClientV2 } from '../src/index';
// or
// import { SpotClient } from 'bitget-api';
// import { RestClientV2 } from 'bitget-api';
const spotClient = new SpotClient();
const symbol = 'BTCUSDT_SPBL';
const restClient = new RestClientV2();
(async () => {
try {
const response = await spotClient.getCandles(symbol, '1min', {
const response = await restClient.getSpotCandles({
symbol: 'BTCUSDT',
granularity: '1min',
limit: '1000',
});
console.table(response.data);
console.log('getCandles: ', response.data.length);
} catch (e) {
console.error('request failed: ', e);