ccxt 4.5.0 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +110 -112
  2. package/dist/ccxt.browser.min.js +5 -5
  3. package/dist/cjs/ccxt.js +1 -9
  4. package/dist/cjs/src/ascendex.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +13 -0
  6. package/dist/cjs/src/binance.js +20 -14
  7. package/dist/cjs/src/bitget.js +1 -1
  8. package/dist/cjs/src/coinbase.js +46 -34
  9. package/dist/cjs/src/gate.js +39 -18
  10. package/dist/cjs/src/gemini.js +1 -1
  11. package/dist/cjs/src/hibachi.js +1 -1
  12. package/dist/cjs/src/hyperliquid.js +16 -2
  13. package/dist/cjs/src/indodax.js +11 -12
  14. package/dist/cjs/src/kraken.js +1 -12
  15. package/dist/cjs/src/krakenfutures.js +25 -25
  16. package/dist/cjs/src/mexc.js +2 -1
  17. package/dist/cjs/src/okx.js +2 -2
  18. package/dist/cjs/src/poloniex.js +1 -1
  19. package/dist/cjs/src/pro/bitget.js +352 -75
  20. package/dist/cjs/src/pro/bitmart.js +1 -1
  21. package/dist/cjs/src/pro/bybit.js +8 -15
  22. package/dist/cjs/src/pro/gate.js +6 -1
  23. package/dist/cjs/src/pro/gemini.js +7 -2
  24. package/dist/cjs/src/pro/hyperliquid.js +9 -1
  25. package/dist/cjs/src/pro/kraken.js +5 -6
  26. package/dist/cjs/src/pro/lbank.js +55 -1
  27. package/dist/cjs/src/pro/mexc.js +1 -1
  28. package/dist/cjs/src/timex.js +35 -0
  29. package/dist/cjs/src/tradeogre.js +32 -0
  30. package/dist/cjs/src/wavesexchange.js +33 -0
  31. package/dist/cjs/src/zonda.js +12 -0
  32. package/js/ccxt.d.ts +2 -11
  33. package/js/ccxt.js +2 -8
  34. package/js/src/ascendex.js +1 -1
  35. package/js/src/base/Exchange.d.ts +1 -0
  36. package/js/src/base/Exchange.js +14 -1
  37. package/js/src/binance.d.ts +1 -1
  38. package/js/src/binance.js +20 -14
  39. package/js/src/bitget.js +1 -1
  40. package/js/src/coinbase.js +46 -34
  41. package/js/src/gate.d.ts +2 -1
  42. package/js/src/gate.js +39 -18
  43. package/js/src/gemini.js +1 -1
  44. package/js/src/hibachi.js +1 -1
  45. package/js/src/hyperliquid.d.ts +1 -0
  46. package/js/src/hyperliquid.js +16 -2
  47. package/js/src/indodax.js +11 -12
  48. package/js/src/kraken.d.ts +0 -1
  49. package/js/src/kraken.js +1 -12
  50. package/js/src/krakenfutures.d.ts +24 -24
  51. package/js/src/krakenfutures.js +25 -25
  52. package/js/src/mexc.js +2 -1
  53. package/js/src/okx.js +2 -2
  54. package/js/src/poloniex.js +1 -1
  55. package/js/src/pro/bitget.d.ts +12 -2
  56. package/js/src/pro/bitget.js +358 -75
  57. package/js/src/pro/bitmart.js +1 -1
  58. package/js/src/pro/bybit.js +8 -15
  59. package/js/src/pro/gate.d.ts +5 -0
  60. package/js/src/pro/gate.js +6 -1
  61. package/js/src/pro/gemini.d.ts +1 -1
  62. package/js/src/pro/gemini.js +7 -2
  63. package/js/src/pro/hyperliquid.js +9 -1
  64. package/js/src/pro/kraken.js +5 -6
  65. package/js/src/pro/lbank.d.ts +11 -1
  66. package/js/src/pro/lbank.js +55 -1
  67. package/js/src/pro/mexc.js +1 -1
  68. package/js/src/timex.js +35 -0
  69. package/js/src/tradeogre.js +32 -0
  70. package/js/src/wavesexchange.js +33 -0
  71. package/js/src/zonda.js +12 -0
  72. package/package.json +2 -1
  73. package/js/src/abstract/ellipx.d.ts +0 -28
  74. package/js/src/abstract/ellipx.js +0 -11
  75. package/js/src/abstract/vertex.d.ts +0 -22
  76. package/js/src/abstract/vertex.js +0 -11
  77. package/js/src/ellipx.d.ts +0 -237
  78. package/js/src/ellipx.js +0 -2071
  79. package/js/src/pro/vertex.d.ts +0 -104
  80. package/js/src/pro/vertex.js +0 -999
  81. package/js/src/vertex.d.ts +0 -346
  82. package/js/src/vertex.js +0 -3146
package/dist/cjs/ccxt.js CHANGED
@@ -65,7 +65,6 @@ var delta = require('./src/delta.js');
65
65
  var deribit = require('./src/deribit.js');
66
66
  var derive = require('./src/derive.js');
67
67
  var digifinex = require('./src/digifinex.js');
68
- var ellipx = require('./src/ellipx.js');
69
68
  var exmo = require('./src/exmo.js');
70
69
  var fmfwio = require('./src/fmfwio.js');
71
70
  var foxbit = require('./src/foxbit.js');
@@ -110,7 +109,6 @@ var timex = require('./src/timex.js');
110
109
  var tokocrypto = require('./src/tokocrypto.js');
111
110
  var tradeogre = require('./src/tradeogre.js');
112
111
  var upbit = require('./src/upbit.js');
113
- var vertex = require('./src/vertex.js');
114
112
  var wavesexchange = require('./src/wavesexchange.js');
115
113
  var whitebit = require('./src/whitebit.js');
116
114
  var woo = require('./src/woo.js');
@@ -187,7 +185,6 @@ var poloniex$1 = require('./src/pro/poloniex.js');
187
185
  var probit$1 = require('./src/pro/probit.js');
188
186
  var tradeogre$1 = require('./src/pro/tradeogre.js');
189
187
  var upbit$1 = require('./src/pro/upbit.js');
190
- var vertex$1 = require('./src/pro/vertex.js');
191
188
  var whitebit$1 = require('./src/pro/whitebit.js');
192
189
  var woo$1 = require('./src/pro/woo.js');
193
190
  var woofipro$1 = require('./src/pro/woofipro.js');
@@ -195,7 +192,7 @@ var xt$1 = require('./src/pro/xt.js');
195
192
 
196
193
  //-----------------------------------------------------------------------------
197
194
  // this is updated by vss.js when building
198
- const version = '4.5.0';
195
+ const version = '4.5.2';
199
196
  Exchange["default"].ccxtVersion = version;
200
197
  const exchanges = {
201
198
  'alpaca': alpaca["default"],
@@ -251,7 +248,6 @@ const exchanges = {
251
248
  'deribit': deribit["default"],
252
249
  'derive': derive["default"],
253
250
  'digifinex': digifinex["default"],
254
- 'ellipx': ellipx["default"],
255
251
  'exmo': exmo["default"],
256
252
  'fmfwio': fmfwio["default"],
257
253
  'foxbit': foxbit["default"],
@@ -296,7 +292,6 @@ const exchanges = {
296
292
  'tokocrypto': tokocrypto["default"],
297
293
  'tradeogre': tradeogre["default"],
298
294
  'upbit': upbit["default"],
299
- 'vertex': vertex["default"],
300
295
  'wavesexchange': wavesexchange["default"],
301
296
  'whitebit': whitebit["default"],
302
297
  'woo': woo["default"],
@@ -375,7 +370,6 @@ const pro = {
375
370
  'probit': probit$1["default"],
376
371
  'tradeogre': tradeogre$1["default"],
377
372
  'upbit': upbit$1["default"],
378
- 'vertex': vertex$1["default"],
379
373
  'whitebit': whitebit$1["default"],
380
374
  'woo': woo$1["default"],
381
375
  'woofipro': woofipro$1["default"],
@@ -485,7 +479,6 @@ exports.delta = delta["default"];
485
479
  exports.deribit = deribit["default"];
486
480
  exports.derive = derive["default"];
487
481
  exports.digifinex = digifinex["default"];
488
- exports.ellipx = ellipx["default"];
489
482
  exports.exmo = exmo["default"];
490
483
  exports.fmfwio = fmfwio["default"];
491
484
  exports.foxbit = foxbit["default"];
@@ -530,7 +523,6 @@ exports.timex = timex["default"];
530
523
  exports.tokocrypto = tokocrypto["default"];
531
524
  exports.tradeogre = tradeogre["default"];
532
525
  exports.upbit = upbit["default"];
533
- exports.vertex = vertex["default"];
534
526
  exports.wavesexchange = wavesexchange["default"];
535
527
  exports.whitebit = whitebit["default"];
536
528
  exports.woo = woo["default"];
@@ -1631,7 +1631,7 @@ class ascendex extends ascendex$1["default"] {
1631
1631
  // "code": "0",
1632
1632
  // "data": {
1633
1633
  // "domain": "spot",
1634
- // "userUID": "U1479576458",
1634
+ // "userUID": "U1479576457",
1635
1635
  // "vipLevel": "0",
1636
1636
  // "fees": [
1637
1637
  // { symbol: 'HT/USDT', fee: { taker: '0.001', maker: "0.001" } },
@@ -1160,8 +1160,14 @@ class Exchange {
1160
1160
  }
1161
1161
  }
1162
1162
  async close() {
1163
+ // test by running ts/src/pro/test/base/test.close.ts
1163
1164
  const clients = Object.values(this.clients || {});
1164
1165
  const closedClients = [];
1166
+ for (let i = 0; i < clients.length; i++) {
1167
+ const client = clients[i];
1168
+ client.error = new errors.ExchangeClosedByUser(this.id + ' closedByUser');
1169
+ closedClients.push(client.close());
1170
+ }
1165
1171
  for (let i = 0; i < clients.length; i++) {
1166
1172
  const client = clients[i];
1167
1173
  delete this.clients[client.url];
@@ -1841,6 +1847,13 @@ class Exchange {
1841
1847
  // return the first index of the cache that can be applied to the orderbook or -1 if not possible
1842
1848
  return -1;
1843
1849
  }
1850
+ arraysConcat(arraysOfArrays) {
1851
+ let result = [];
1852
+ for (let i = 0; i < arraysOfArrays.length; i++) {
1853
+ result = this.arrayConcat(result, arraysOfArrays[i]);
1854
+ }
1855
+ return result;
1856
+ }
1844
1857
  findTimeframe(timeframe, timeframes = undefined) {
1845
1858
  if (timeframes === undefined) {
1846
1859
  timeframes = this.timeframes;
@@ -1287,6 +1287,7 @@ class binance extends binance$1["default"] {
1287
1287
  'defaultSubType': undefined,
1288
1288
  'hasAlreadyAuthenticatedSuccessfully': false,
1289
1289
  'warnOnFetchOpenOrdersWithoutSymbol': true,
1290
+ 'currencyToPrecisionRoundingMode': number.TRUNCATE,
1290
1291
  // not an error
1291
1292
  // https://github.com/ccxt/ccxt/issues/11268
1292
1293
  // https://github.com/ccxt/ccxt/pull/11624
@@ -2754,15 +2755,6 @@ class binance extends binance$1["default"] {
2754
2755
  costToPrecision(symbol, cost) {
2755
2756
  return this.decimalToPrecision(cost, number.TRUNCATE, this.markets[symbol]['precision']['quote'], this.precisionMode, this.paddingMode);
2756
2757
  }
2757
- currencyToPrecision(code, fee, networkCode = undefined) {
2758
- // info is available in currencies only if the user has configured his api keys
2759
- if (this.safeValue(this.currencies[code], 'precision') !== undefined) {
2760
- return this.decimalToPrecision(fee, number.TRUNCATE, this.currencies[code]['precision'], this.precisionMode, this.paddingMode);
2761
- }
2762
- else {
2763
- return this.numberToString(fee);
2764
- }
2765
- }
2766
2758
  nonce() {
2767
2759
  return this.milliseconds() - this.options['timeDifference'];
2768
2760
  }
@@ -7829,6 +7821,7 @@ class binance extends binance$1["default"] {
7829
7821
  * @param {string[]} ids order ids
7830
7822
  * @param {string} [symbol] unified market symbol
7831
7823
  * @param {object} [params] extra parameters specific to the exchange API endpoint
7824
+ * @param {string[]} [params.clientOrderIds] alternative to ids, array of client order ids
7832
7825
  *
7833
7826
  * EXCHANGE SPECIFIC PARAMETERS
7834
7827
  * @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
@@ -7846,8 +7839,16 @@ class binance extends binance$1["default"] {
7846
7839
  }
7847
7840
  const request = {
7848
7841
  'symbol': market['id'],
7849
- 'orderidlist': ids,
7842
+ // 'orderidlist': ids,
7850
7843
  };
7844
+ const origClientOrderIdList = this.safeList2(params, 'origClientOrderIdList', 'clientOrderIds');
7845
+ if (origClientOrderIdList !== undefined) {
7846
+ params = this.omit(params, ['clientOrderIds']);
7847
+ request['origClientOrderIdList'] = origClientOrderIdList;
7848
+ }
7849
+ else {
7850
+ request['orderidlist'] = ids;
7851
+ }
7851
7852
  let response = undefined;
7852
7853
  if (market['linear']) {
7853
7854
  response = await this.fapiPrivateDeleteBatchOrders(this.extend(request, params));
@@ -9433,7 +9434,6 @@ class binance extends binance$1["default"] {
9433
9434
  const request = {
9434
9435
  'coin': currency['id'],
9435
9436
  'address': address,
9436
- 'amount': this.currencyToPrecision(code, amount),
9437
9437
  // issue sapiGetCapitalConfigGetall () to get networks for withdrawing USDT ERC20 vs USDT Omni
9438
9438
  // 'network': 'ETH', // 'BTC', 'TRX', etc, optional
9439
9439
  };
@@ -9447,6 +9447,7 @@ class binance extends binance$1["default"] {
9447
9447
  request['network'] = network;
9448
9448
  params = this.omit(params, 'network');
9449
9449
  }
9450
+ request['amount'] = this.currencyToPrecision(code, amount, network);
9450
9451
  const response = await this.sapiPostCapitalWithdrawApply(this.extend(request, params));
9451
9452
  // { id: '9a67628b16ba4988ae20d329333f16bc' }
9452
9453
  return this.parseTransaction(response, currency);
@@ -12063,8 +12064,8 @@ class binance extends binance$1["default"] {
12063
12064
  else if ((path === 'batchOrders') || (path.indexOf('sub-account') >= 0) || (path === 'capital/withdraw/apply') || (path.indexOf('staking') >= 0) || (path.indexOf('simple-earn') >= 0)) {
12064
12065
  if ((method === 'DELETE') && (path === 'batchOrders')) {
12065
12066
  const orderidlist = this.safeList(extendedParams, 'orderidlist', []);
12066
- const origclientorderidlist = this.safeList(extendedParams, 'origclientorderidlist', []);
12067
- extendedParams = this.omit(extendedParams, ['orderidlist', 'origclientorderidlist']);
12067
+ const origclientorderidlist = this.safeList2(extendedParams, 'origclientorderidlist', 'origClientOrderIdList', []);
12068
+ extendedParams = this.omit(extendedParams, ['orderidlist', 'origclientorderidlist', 'origClientOrderIdList']);
12068
12069
  query = this.rawencode(extendedParams);
12069
12070
  const orderidlistLength = orderidlist.length;
12070
12071
  const origclientorderidlistLength = origclientorderidlist.length;
@@ -12072,7 +12073,12 @@ class binance extends binance$1["default"] {
12072
12073
  query = query + '&' + 'orderidlist=%5B' + orderidlist.join('%2C') + '%5D';
12073
12074
  }
12074
12075
  if (origclientorderidlistLength > 0) {
12075
- query = query + '&' + 'origclientorderidlist=%5B' + origclientorderidlist.join('%2C') + '%5D';
12076
+ // wrap clientOrderids around ""
12077
+ const newClientOrderIds = [];
12078
+ for (let i = 0; i < origclientorderidlistLength; i++) {
12079
+ newClientOrderIds.push('%22' + origclientorderidlist[i] + '%22');
12080
+ }
12081
+ query = query + '&' + 'origclientorderidlist=%5B' + newClientOrderIds.join('%2C') + '%5D';
12076
12082
  }
12077
12083
  }
12078
12084
  else {
@@ -1918,7 +1918,7 @@ class bitget extends bitget$1["default"] {
1918
1918
  const res = this.safeDict(results, i);
1919
1919
  const data = this.safeList(res, 'data', []);
1920
1920
  const firstData = this.safeDict(data, 0, {});
1921
- const isBorrowable = this.safeString(firstData, 'isBorrowable');
1921
+ const isBorrowable = this.safeBool(firstData, 'isBorrowable');
1922
1922
  if (fetchMargins && isBorrowable !== undefined) {
1923
1923
  const keysList = Object.keys(this.indexBy(data, 'symbol'));
1924
1924
  this.options['crossMarginPairsData'] = keysList;
@@ -2248,34 +2248,44 @@ class coinbase extends coinbase$1["default"] {
2248
2248
  // fetchTickersV3
2249
2249
  //
2250
2250
  // [
2251
- // {
2252
- // "product_id": "TONE-USD",
2253
- // "price": "0.01523",
2254
- // "price_percentage_change_24h": "1.94109772423025",
2255
- // "volume_24h": "19773129",
2256
- // "volume_percentage_change_24h": "437.0170530929949",
2257
- // "base_increment": "1",
2258
- // "quote_increment": "0.00001",
2259
- // "quote_min_size": "1",
2260
- // "quote_max_size": "10000000",
2261
- // "base_min_size": "26.7187147229469674",
2262
- // "base_max_size": "267187147.2294696735908216",
2263
- // "base_name": "TE-FOOD",
2264
- // "quote_name": "US Dollar",
2265
- // "watched": false,
2266
- // "is_disabled": false,
2267
- // "new": false,
2268
- // "status": "online",
2269
- // "cancel_only": false,
2270
- // "limit_only": false,
2271
- // "post_only": false,
2272
- // "trading_disabled": false,
2273
- // "auction_mode": false,
2274
- // "product_type": "SPOT",
2275
- // "quote_currency_id": "USD",
2276
- // "base_currency_id": "TONE",
2277
- // "fcm_trading_session_details": null,
2278
- // "mid_market_price": ""
2251
+ // {
2252
+ // "product_id": "ETH-USD",
2253
+ // "price": "4471.59",
2254
+ // "price_percentage_change_24h": "0.14243387238731",
2255
+ // "volume_24h": "87329.92990204",
2256
+ // "volume_percentage_change_24h": "-60.7789801794578",
2257
+ // "base_increment": "0.00000001",
2258
+ // "quote_increment": "0.01",
2259
+ // "quote_min_size": "1",
2260
+ // "quote_max_size": "150000000",
2261
+ // "base_min_size": "0.00000001",
2262
+ // "base_max_size": "42000",
2263
+ // "base_name": "Ethereum",
2264
+ // "quote_name": "US Dollar",
2265
+ // "watched": false,
2266
+ // "is_disabled": false,
2267
+ // "new": false,
2268
+ // "status": "online",
2269
+ // "cancel_only": false,
2270
+ // "limit_only": false,
2271
+ // "post_only": false,
2272
+ // "trading_disabled": false,
2273
+ // "auction_mode": false,
2274
+ // "product_type": "SPOT",
2275
+ // "quote_currency_id": "USD",
2276
+ // "base_currency_id": "ETH",
2277
+ // "fcm_trading_session_details": null,
2278
+ // "mid_market_price": "",
2279
+ // "alias": "",
2280
+ // "alias_to": [ "ETH-USDC" ],
2281
+ // "base_display_symbol": "ETH",
2282
+ // "quote_display_symbol": "USD",
2283
+ // "view_only": false,
2284
+ // "price_increment": "0.01",
2285
+ // "display_name": "ETH-USD",
2286
+ // "product_venue": "CBE",
2287
+ // "approximate_quote_24h_volume": "390503641.25",
2288
+ // "new_at": "2023-01-01T00:00:00Z"
2279
2289
  // },
2280
2290
  // ...
2281
2291
  // ]
@@ -2306,10 +2316,12 @@ class coinbase extends coinbase$1["default"] {
2306
2316
  if (('bids' in ticker)) {
2307
2317
  const bids = this.safeList(ticker, 'bids', []);
2308
2318
  const asks = this.safeList(ticker, 'asks', []);
2309
- bid = this.safeNumber(bids[0], 'price');
2310
- bidVolume = this.safeNumber(bids[0], 'size');
2311
- ask = this.safeNumber(asks[0], 'price');
2312
- askVolume = this.safeNumber(asks[0], 'size');
2319
+ const firstBid = this.safeDict(bids, 0, {});
2320
+ const firstAsk = this.safeDict(asks, 0, {});
2321
+ bid = this.safeNumber(firstBid, 'price');
2322
+ bidVolume = this.safeNumber(firstBid, 'size');
2323
+ ask = this.safeNumber(firstAsk, 'price');
2324
+ askVolume = this.safeNumber(firstAsk, 'size');
2313
2325
  }
2314
2326
  const marketId = this.safeString(ticker, 'product_id');
2315
2327
  market = this.safeMarket(marketId, market);
@@ -2333,8 +2345,8 @@ class coinbase extends coinbase$1["default"] {
2333
2345
  'change': undefined,
2334
2346
  'percentage': this.safeNumber(ticker, 'price_percentage_change_24h'),
2335
2347
  'average': undefined,
2336
- 'baseVolume': undefined,
2337
- 'quoteVolume': undefined,
2348
+ 'baseVolume': this.safeNumber(ticker, 'volume_24h'),
2349
+ 'quoteVolume': this.safeNumber(ticker, 'approximate_quote_24h_volume'),
2338
2350
  'info': ticker,
2339
2351
  }, market);
2340
2352
  }
@@ -749,6 +749,9 @@ class gate extends gate$1["default"] {
749
749
  'option': 'options',
750
750
  'options': 'options',
751
751
  },
752
+ 'fetchMarkets': {
753
+ 'types': ['spot', 'swap', 'future', 'option'],
754
+ },
752
755
  'swap': {
753
756
  'fetchMarkets': {
754
757
  'settlementCurrencies': ['usdt', 'btc'],
@@ -1226,22 +1229,30 @@ class gate extends gate$1["default"] {
1226
1229
  if (this.checkRequiredCredentials(false)) {
1227
1230
  await this.loadUnifiedStatus();
1228
1231
  }
1232
+ const rawPromises = [];
1229
1233
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1230
- let rawPromises = [
1231
- this.fetchContractMarkets(params),
1232
- this.fetchOptionMarkets(params),
1233
- ];
1234
- if (!sandboxMode) {
1235
- // gate doesn't have a sandbox for spot markets
1236
- const mainnetOnly = [this.fetchSpotMarkets(params)];
1237
- rawPromises = this.arrayConcat(rawPromises, mainnetOnly);
1238
- }
1239
- const promises = await Promise.all(rawPromises);
1240
- const spotMarkets = this.safeValue(promises, 0, []);
1241
- const contractMarkets = this.safeValue(promises, 1, []);
1242
- const optionMarkets = this.safeValue(promises, 2, []);
1243
- const markets = this.arrayConcat(spotMarkets, contractMarkets);
1244
- return this.arrayConcat(markets, optionMarkets);
1234
+ const fetchMarketsOptions = this.safeDict(this.options, 'fetchMarkets');
1235
+ const types = this.safeList(fetchMarketsOptions, 'types', ['spot', 'swap', 'future', 'option']);
1236
+ for (let i = 0; i < types.length; i++) {
1237
+ const marketType = types[i];
1238
+ if (marketType === 'spot') {
1239
+ if (!sandboxMode) {
1240
+ // gate doesn't have a sandbox for spot markets
1241
+ rawPromises.push(this.fetchSpotMarkets(params));
1242
+ }
1243
+ }
1244
+ else if (marketType === 'swap') {
1245
+ rawPromises.push(this.fetchSwapMarkets(params));
1246
+ }
1247
+ else if (marketType === 'future') {
1248
+ rawPromises.push(this.fetchFutureMarkets(params));
1249
+ }
1250
+ else if (marketType === 'option') {
1251
+ rawPromises.push(this.fetchOptionMarkets(params));
1252
+ }
1253
+ }
1254
+ const results = await Promise.all(rawPromises);
1255
+ return this.arraysConcat(results);
1245
1256
  }
1246
1257
  async fetchSpotMarkets(params = {}) {
1247
1258
  const marginPromise = this.publicMarginGetCurrencyPairs(params);
@@ -1357,10 +1368,9 @@ class gate extends gate$1["default"] {
1357
1368
  }
1358
1369
  return result;
1359
1370
  }
1360
- async fetchContractMarkets(params = {}) {
1371
+ async fetchSwapMarkets(params = {}) {
1361
1372
  const result = [];
1362
1373
  const swapSettlementCurrencies = this.getSettlementCurrencies('swap', 'fetchMarkets');
1363
- const futureSettlementCurrencies = this.getSettlementCurrencies('future', 'fetchMarkets');
1364
1374
  for (let c = 0; c < swapSettlementCurrencies.length; c++) {
1365
1375
  const settleId = swapSettlementCurrencies[c];
1366
1376
  const request = {
@@ -1372,6 +1382,11 @@ class gate extends gate$1["default"] {
1372
1382
  result.push(parsedMarket);
1373
1383
  }
1374
1384
  }
1385
+ return result;
1386
+ }
1387
+ async fetchFutureMarkets(params = {}) {
1388
+ const result = [];
1389
+ const futureSettlementCurrencies = this.getSettlementCurrencies('future', 'fetchMarkets');
1375
1390
  for (let c = 0; c < futureSettlementCurrencies.length; c++) {
1376
1391
  const settleId = futureSettlementCurrencies[c];
1377
1392
  const request = {
@@ -2598,7 +2613,13 @@ class gate extends gate$1["default"] {
2598
2613
  //
2599
2614
  const [request, query] = this.prepareRequest(market, market['type'], params);
2600
2615
  if (limit !== undefined) {
2601
- request['limit'] = limit; // default 10, max 100
2616
+ if (market['spot']) {
2617
+ limit = Math.min(limit, 1000);
2618
+ }
2619
+ else {
2620
+ limit = Math.min(limit, 300);
2621
+ }
2622
+ request['limit'] = limit;
2602
2623
  }
2603
2624
  request['with_id'] = true;
2604
2625
  let response = undefined;
@@ -263,7 +263,7 @@ class gemini extends gemini$1["default"] {
263
263
  'fetchMarketFromWebRetries': 10,
264
264
  'fetchMarketsFromAPI': {
265
265
  'fetchDetailsForAllSymbols': false,
266
- 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL'],
266
+ 'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH', 'SOL', 'USDC'],
267
267
  },
268
268
  'fetchMarkets': {
269
269
  'webApiEnable': true,
@@ -1595,7 +1595,7 @@ class hibachi extends hibachi$1["default"] {
1595
1595
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1596
1596
  const endpoint = '/' + this.implodeParams(path, params);
1597
1597
  let url = this.urls['api'][api] + endpoint;
1598
- headers = {};
1598
+ headers = { 'Hibachi-Client': 'HibachiCCXT/unversioned' };
1599
1599
  if (method === 'GET') {
1600
1600
  const request = this.omit(params, this.extractParams(path));
1601
1601
  const query = this.urlencode(request);
@@ -2380,6 +2380,7 @@ class hyperliquid extends hyperliquid$1["default"] {
2380
2380
  * @param {string} id order id
2381
2381
  * @param {string} symbol unified symbol of the market the order was made in
2382
2382
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2383
+ * @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
2383
2384
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
2384
2385
  * @param {string} [params.subAccountAddress] sub account user address
2385
2386
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2389,12 +2390,20 @@ class hyperliquid extends hyperliquid$1["default"] {
2389
2390
  [userAddress, params] = this.handlePublicAddress('fetchOrder', params);
2390
2391
  await this.loadMarkets();
2391
2392
  const market = this.safeMarket(symbol);
2392
- const isClientOrderId = id.length >= 34;
2393
+ const clientOrderId = this.safeString(params, 'clientOrderId');
2393
2394
  const request = {
2394
2395
  'type': 'orderStatus',
2395
- 'oid': isClientOrderId ? id : this.parseToNumeric(id),
2396
+ // 'oid': isClientOrderId ? id : this.parseToNumeric (id),
2396
2397
  'user': userAddress,
2397
2398
  };
2399
+ if (clientOrderId !== undefined) {
2400
+ params = this.omit(params, 'clientOrderId');
2401
+ request['oid'] = clientOrderId;
2402
+ }
2403
+ else {
2404
+ const isClientOrderId = id.length >= 34;
2405
+ request['oid'] = isClientOrderId ? id : this.parseToNumeric(id);
2406
+ }
2398
2407
  const response = await this.publicPostInfo(this.extend(request, params));
2399
2408
  //
2400
2409
  // {
@@ -3845,12 +3854,17 @@ class hyperliquid extends hyperliquid$1["default"] {
3845
3854
  // }
3846
3855
  // {"status":"ok","response":{"type":"order","data":{"statuses":[{"error":"Insufficient margin to place order. asset=84"}]}}}
3847
3856
  //
3857
+ // {"status":"unknownOid"}
3858
+ //
3848
3859
  const status = this.safeString(response, 'status', '');
3849
3860
  const error = this.safeString(response, 'error');
3850
3861
  let message = undefined;
3851
3862
  if (status === 'err') {
3852
3863
  message = this.safeString(response, 'response');
3853
3864
  }
3865
+ else if (status === 'unknownOid') {
3866
+ throw new errors.OrderNotFound(this.id + ' ' + body); // {"status":"unknownOid"}
3867
+ }
3854
3868
  else if (error !== undefined) {
3855
3869
  message = error;
3856
3870
  }
@@ -197,6 +197,16 @@ class indodax extends indodax$1["default"] {
197
197
  'Minimum order': errors.InvalidOrder,
198
198
  },
199
199
  },
200
+ 'timeframes': {
201
+ '1m': '1',
202
+ '15m': '15',
203
+ '30m': '30',
204
+ '1h': '60',
205
+ '4h': '240',
206
+ '1d': '1D',
207
+ '3d': '3D',
208
+ '1w': '1W',
209
+ },
200
210
  // exchange-specific options
201
211
  'options': {
202
212
  'recvWindow': 5 * 1000,
@@ -220,16 +230,6 @@ class indodax extends indodax$1["default"] {
220
230
  // 'ETH': 'eth'
221
231
  // 'BASE': 'base'
222
232
  },
223
- 'timeframes': {
224
- '1m': '1',
225
- '15m': '15',
226
- '30m': '30',
227
- '1h': '60',
228
- '4h': '240',
229
- '1d': '1D',
230
- '3d': '3D',
231
- '1w': '1W',
232
- },
233
233
  },
234
234
  'features': {
235
235
  'spot': {
@@ -687,8 +687,7 @@ class indodax extends indodax$1["default"] {
687
687
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
688
688
  await this.loadMarkets();
689
689
  const market = this.market(symbol);
690
- const timeframes = this.options['timeframes'];
691
- const selectedTimeframe = this.safeString(timeframes, timeframe, timeframe);
690
+ const selectedTimeframe = this.safeString(this.timeframes, timeframe, timeframe);
692
691
  const now = this.seconds();
693
692
  const until = this.safeInteger(params, 'until', now);
694
693
  params = this.omit(params, ['until']);
@@ -235,6 +235,7 @@ class kraken extends kraken$1["default"] {
235
235
  'UST': 'USTC',
236
236
  'XBT': 'BTC',
237
237
  'XDG': 'DOGE',
238
+ 'FEE': 'KFEE',
238
239
  },
239
240
  'options': {
240
241
  'timeDifference': 0,
@@ -705,18 +706,6 @@ class kraken extends kraken$1["default"] {
705
706
  this.options['marketsByAltname'] = this.indexBy(result, 'altname');
706
707
  return result;
707
708
  }
708
- safeCurrency(currencyId, currency = undefined) {
709
- if (currencyId !== undefined) {
710
- if (currencyId.length > 3) {
711
- if ((currencyId.indexOf('X') === 0) || (currencyId.indexOf('Z') === 0)) {
712
- if (!(currencyId.indexOf('.') > 0) && (currencyId !== 'ZEUS')) {
713
- currencyId = currencyId.slice(1);
714
- }
715
- }
716
- }
717
- }
718
- return super.safeCurrency(currencyId, currency);
719
- }
720
709
  /**
721
710
  * @method
722
711
  * @name kraken#fetchStatus