This commit is contained in:
discountry
2025-10-03 15:28:16 +08:00
parent d5c4b04746
commit fcb83bd16b
925 changed files with 165721 additions and 4 deletions
@@ -0,0 +1,5 @@
"use strict";
module.exports = {
singleQuote: true,
trailingComma: 'es5',
};
@@ -0,0 +1,25 @@
// Example code in typescript
// Based on /examples/js/fetch-okex-futures.js
import * as ccxt from 'ccxt';
const log = require('ololog');
const fetchFutures = async () => {
const exchange = new ccxt.bitmex();
exchange.markets = await exchange.loadMarkets(true);
for (let symbol in exchange.markets) {
log('----------------------------------------------------');
log(`symbol = ${symbol}`);
try {
const market = exchange.markets[symbol];
if (market['future']) {
const ticker = await exchange.fetchTicker(symbol);
log('----------------------------------------------------');
log(symbol, ticker);
await ccxt.sleep(exchange.rateLimit); // Missing type information.
}
}
catch (error) {
log('error =', error);
}
}
};
fetchFutures();