v1.0.6: fix() fix type differences for spot vs futures candles. Add example for fetching last 1k futures candles
This commit is contained in:
19
examples/rest-public-spot.ts
Normal file
19
examples/rest-public-spot.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { SpotClient } from '../src/index';
|
||||
|
||||
// or
|
||||
// import { SpotClient } from 'bitget-api';
|
||||
|
||||
const spotClient = new SpotClient();
|
||||
|
||||
const symbol = 'BTCUSDT_SPBL';
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const response = await spotClient.getCandles(symbol, '1min', {
|
||||
limit: '1000',
|
||||
});
|
||||
console.log('getCandles: ', response.data.length);
|
||||
} catch (e) {
|
||||
console.error('request failed: ', e);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user