ccxt 4.4.47 → 4.4.49

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 (135) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +16 -16
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +1 -1
  5. package/dist/cjs/src/binance.js +18 -14
  6. package/dist/cjs/src/bingx.js +88 -30
  7. package/dist/cjs/src/bitget.js +16 -12
  8. package/dist/cjs/src/bitmart.js +7 -2
  9. package/dist/cjs/src/bitmex.js +8 -5
  10. package/dist/cjs/src/bybit.js +7 -2
  11. package/dist/cjs/src/coinbase.js +11 -1
  12. package/dist/cjs/src/coincatch.js +86 -2
  13. package/dist/cjs/src/coincheck.js +52 -0
  14. package/dist/cjs/src/coinlist.js +77 -0
  15. package/dist/cjs/src/coinmate.js +63 -0
  16. package/dist/cjs/src/coinmetro.js +68 -0
  17. package/dist/cjs/src/coinone.js +56 -0
  18. package/dist/cjs/src/coinsph.js +85 -10
  19. package/dist/cjs/src/coinspot.js +47 -0
  20. package/dist/cjs/src/currencycom.js +72 -0
  21. package/dist/cjs/src/defx.js +93 -6
  22. package/dist/cjs/src/delta.js +83 -1
  23. package/dist/cjs/src/deribit.js +82 -0
  24. package/dist/cjs/src/digifinex.js +131 -11
  25. package/dist/cjs/src/ellipx.js +61 -0
  26. package/dist/cjs/src/exmo.js +58 -0
  27. package/dist/cjs/src/gate.js +10 -1
  28. package/dist/cjs/src/hitbtc.js +99 -0
  29. package/dist/cjs/src/hollaex.js +73 -0
  30. package/dist/cjs/src/htx.js +10 -2
  31. package/dist/cjs/src/huobijp.js +73 -0
  32. package/dist/cjs/src/hyperliquid.js +28 -2
  33. package/dist/cjs/src/idex.js +71 -0
  34. package/dist/cjs/src/independentreserve.js +124 -0
  35. package/dist/cjs/src/indodax.js +61 -0
  36. package/dist/cjs/src/kraken.js +1 -1
  37. package/dist/cjs/src/krakenfutures.js +4 -4
  38. package/dist/cjs/src/kuna.js +60 -1
  39. package/dist/cjs/src/latoken.js +64 -0
  40. package/dist/cjs/src/lbank.js +70 -0
  41. package/dist/cjs/src/luno.js +73 -0
  42. package/dist/cjs/src/lykke.js +64 -0
  43. package/dist/cjs/src/mercado.js +65 -0
  44. package/dist/cjs/src/mexc.js +1 -1
  45. package/dist/cjs/src/myokx.js +10 -0
  46. package/dist/cjs/src/ndax.js +71 -0
  47. package/dist/cjs/src/novadax.js +74 -0
  48. package/dist/cjs/src/oceanex.js +69 -0
  49. package/dist/cjs/src/okcoin.js +79 -2
  50. package/dist/cjs/src/okx.js +9 -1
  51. package/dist/cjs/src/onetrading.js +66 -0
  52. package/dist/cjs/src/oxfun.js +66 -0
  53. package/dist/cjs/src/p2b.js +63 -1
  54. package/dist/cjs/src/paradex.js +73 -2
  55. package/dist/cjs/src/phemex.js +103 -0
  56. package/dist/cjs/src/poloniex.js +61 -0
  57. package/dist/cjs/src/poloniexfutures.js +74 -0
  58. package/dist/cjs/src/pro/bitmart.js +6 -0
  59. package/dist/cjs/src/upbit.js +61 -0
  60. package/dist/cjs/src/woo.js +6 -1
  61. package/js/ccxt.d.ts +1 -1
  62. package/js/ccxt.js +1 -1
  63. package/js/src/abstract/independentreserve.d.ts +6 -0
  64. package/js/src/ace.js +1 -1
  65. package/js/src/binance.d.ts +7 -0
  66. package/js/src/binance.js +18 -14
  67. package/js/src/bingx.d.ts +8 -0
  68. package/js/src/bingx.js +88 -30
  69. package/js/src/bitget.d.ts +1 -0
  70. package/js/src/bitget.js +16 -12
  71. package/js/src/bitmart.js +7 -2
  72. package/js/src/bitmex.js +8 -5
  73. package/js/src/bybit.d.ts +1 -1
  74. package/js/src/bybit.js +7 -2
  75. package/js/src/coinbase.d.ts +1 -0
  76. package/js/src/coinbase.js +11 -1
  77. package/js/src/coincatch.d.ts +1 -2
  78. package/js/src/coincatch.js +86 -2
  79. package/js/src/coincheck.js +52 -0
  80. package/js/src/coinlist.js +77 -0
  81. package/js/src/coinmate.js +63 -0
  82. package/js/src/coinmetro.js +68 -0
  83. package/js/src/coinone.js +56 -0
  84. package/js/src/coinsph.d.ts +2 -1
  85. package/js/src/coinsph.js +85 -10
  86. package/js/src/coinspot.js +47 -0
  87. package/js/src/currencycom.js +72 -0
  88. package/js/src/defx.js +93 -6
  89. package/js/src/delta.js +83 -1
  90. package/js/src/deribit.js +82 -0
  91. package/js/src/digifinex.d.ts +1 -0
  92. package/js/src/digifinex.js +131 -11
  93. package/js/src/ellipx.d.ts +1 -0
  94. package/js/src/ellipx.js +61 -0
  95. package/js/src/exmo.js +58 -0
  96. package/js/src/gate.d.ts +1 -0
  97. package/js/src/gate.js +10 -1
  98. package/js/src/hitbtc.js +99 -0
  99. package/js/src/hollaex.js +73 -0
  100. package/js/src/htx.d.ts +1 -0
  101. package/js/src/htx.js +10 -2
  102. package/js/src/huobijp.js +73 -0
  103. package/js/src/hyperliquid.d.ts +1 -0
  104. package/js/src/hyperliquid.js +28 -2
  105. package/js/src/idex.js +71 -0
  106. package/js/src/independentreserve.js +124 -0
  107. package/js/src/indodax.js +61 -0
  108. package/js/src/kraken.js +1 -1
  109. package/js/src/krakenfutures.js +4 -4
  110. package/js/src/kuna.js +60 -1
  111. package/js/src/latoken.js +64 -0
  112. package/js/src/lbank.js +70 -0
  113. package/js/src/luno.js +73 -0
  114. package/js/src/lykke.js +64 -0
  115. package/js/src/mercado.js +65 -0
  116. package/js/src/mexc.js +1 -1
  117. package/js/src/myokx.js +10 -0
  118. package/js/src/ndax.js +71 -0
  119. package/js/src/novadax.js +74 -0
  120. package/js/src/oceanex.js +69 -0
  121. package/js/src/okcoin.js +79 -2
  122. package/js/src/okx.d.ts +1 -0
  123. package/js/src/okx.js +9 -1
  124. package/js/src/onetrading.js +66 -0
  125. package/js/src/oxfun.js +66 -0
  126. package/js/src/p2b.js +63 -1
  127. package/js/src/paradex.js +73 -2
  128. package/js/src/phemex.js +103 -0
  129. package/js/src/poloniex.js +61 -0
  130. package/js/src/poloniexfutures.js +74 -0
  131. package/js/src/pro/bitmart.d.ts +1 -0
  132. package/js/src/pro/bitmart.js +6 -0
  133. package/js/src/upbit.js +61 -0
  134. package/js/src/woo.js +6 -1
  135. package/package.json +2 -2
@@ -250,6 +250,87 @@ class defx extends defx$1 {
250
250
  'options': {
251
251
  'sandboxMode': false,
252
252
  },
253
+ 'features': {
254
+ 'spot': undefined,
255
+ 'forDerivatives': {
256
+ 'sandbox': true,
257
+ 'createOrder': {
258
+ 'marginMode': false,
259
+ 'triggerPrice': true,
260
+ // todo implement
261
+ 'triggerPriceType': {
262
+ 'last': true,
263
+ 'mark': true,
264
+ 'index': false,
265
+ },
266
+ 'triggerDirection': false,
267
+ 'stopLossPrice': false,
268
+ 'takeProfitPrice': false,
269
+ 'attachedStopLossTakeProfit': undefined,
270
+ 'timeInForce': {
271
+ 'IOC': true,
272
+ 'FOK': true,
273
+ 'PO': true,
274
+ 'GTD': false,
275
+ },
276
+ 'hedged': false,
277
+ 'selfTradePrevention': false,
278
+ 'trailing': false,
279
+ 'iceberg': false,
280
+ 'leverage': false,
281
+ 'marketBuyByCost': false,
282
+ 'marketBuyRequiresPrice': false,
283
+ },
284
+ 'createOrders': undefined,
285
+ 'fetchMyTrades': {
286
+ 'marginMode': false,
287
+ 'limit': 1000,
288
+ 'daysBack': undefined,
289
+ 'untilDays': undefined,
290
+ },
291
+ 'fetchOrder': {
292
+ 'marginMode': false,
293
+ 'trigger': false,
294
+ 'trailing': false,
295
+ },
296
+ 'fetchOpenOrders': {
297
+ 'marginMode': true,
298
+ 'limit': 100,
299
+ 'trigger': false,
300
+ 'trailing': false,
301
+ },
302
+ 'fetchOrders': {
303
+ 'marginMode': false,
304
+ 'limit': 500,
305
+ 'daysBack': 100000,
306
+ 'untilDays': 100000,
307
+ 'trigger': false,
308
+ 'trailing': false,
309
+ },
310
+ 'fetchClosedOrders': {
311
+ 'marginMode': false,
312
+ 'limit': 500,
313
+ 'daysBack': 100000,
314
+ 'daysBackCanceled': 1,
315
+ 'untilDays': 100000,
316
+ 'trigger': false,
317
+ 'trailing': false,
318
+ },
319
+ 'fetchOHLCV': {
320
+ 'limit': 1000,
321
+ },
322
+ },
323
+ 'swap': {
324
+ 'linear': {
325
+ 'extends': 'forDerivatives',
326
+ },
327
+ 'inverse': undefined,
328
+ },
329
+ 'future': {
330
+ 'linear': undefined,
331
+ 'inverse': undefined,
332
+ },
333
+ },
253
334
  'commonCurrencies': {},
254
335
  'exceptions': {
255
336
  'exact': {
@@ -1660,8 +1741,10 @@ class defx extends defx$1 {
1660
1741
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1661
1742
  */
1662
1743
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1663
- params['statuses'] = 'OPEN';
1664
- return await this.fetchOrders(symbol, since, limit, params);
1744
+ const req = {
1745
+ 'statuses': 'OPEN',
1746
+ };
1747
+ return await this.fetchOrders(symbol, since, limit, this.extend(req, params));
1665
1748
  }
1666
1749
  /**
1667
1750
  * @method
@@ -1676,8 +1759,10 @@ class defx extends defx$1 {
1676
1759
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1677
1760
  */
1678
1761
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1679
- params['statuses'] = 'FILLED';
1680
- return await this.fetchOrders(symbol, since, limit, params);
1762
+ const req = {
1763
+ 'statuses': 'FILLED',
1764
+ };
1765
+ return await this.fetchOrders(symbol, since, limit, this.extend(req, params));
1681
1766
  }
1682
1767
  /**
1683
1768
  * @method
@@ -1692,8 +1777,10 @@ class defx extends defx$1 {
1692
1777
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1693
1778
  */
1694
1779
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1695
- params['statuses'] = 'CANCELED';
1696
- return await this.fetchOrders(symbol, since, limit, params);
1780
+ const req = {
1781
+ 'statuses': 'CANCELED',
1782
+ };
1783
+ return await this.fetchOrders(symbol, since, limit, this.extend(req, params));
1697
1784
  }
1698
1785
  /**
1699
1786
  * @method
@@ -219,6 +219,88 @@ class delta extends delta$1 {
219
219
  'BEP20': 'BEP20(BSC)',
220
220
  },
221
221
  },
222
+ 'features': {
223
+ 'default': {
224
+ 'sandbox': true,
225
+ 'createOrder': {
226
+ 'marginMode': false,
227
+ 'triggerPrice': true,
228
+ // todo implement
229
+ 'triggerPriceType': {
230
+ 'last': true,
231
+ 'mark': true,
232
+ 'index': true,
233
+ },
234
+ 'triggerDirection': false,
235
+ 'stopLossPrice': false,
236
+ 'takeProfitPrice': false,
237
+ 'attachedStopLossTakeProfit': {
238
+ 'triggerPriceType': undefined,
239
+ 'price': true,
240
+ },
241
+ // todo implementation
242
+ 'timeInForce': {
243
+ 'IOC': true,
244
+ 'FOK': true,
245
+ 'PO': true,
246
+ 'GTD': false,
247
+ },
248
+ 'hedged': false,
249
+ 'selfTradePrevention': false,
250
+ 'trailing': false,
251
+ 'iceberg': false,
252
+ 'leverage': false,
253
+ 'marketBuyByCost': false,
254
+ 'marketBuyRequiresPrice': false,
255
+ },
256
+ 'createOrders': undefined,
257
+ 'fetchMyTrades': {
258
+ 'marginMode': false,
259
+ 'limit': 100,
260
+ 'daysBack': 100000,
261
+ 'untilDays': 100000,
262
+ },
263
+ 'fetchOrder': undefined,
264
+ 'fetchOpenOrders': {
265
+ 'marginMode': false,
266
+ 'limit': 100,
267
+ 'trigger': false,
268
+ 'trailing': false,
269
+ },
270
+ 'fetchOrders': undefined,
271
+ 'fetchClosedOrders': {
272
+ 'marginMode': false,
273
+ 'limit': 500,
274
+ 'daysBack': 100000,
275
+ 'daysBackCanceled': 1,
276
+ 'untilDays': 100000,
277
+ 'trigger': false,
278
+ 'trailing': false,
279
+ },
280
+ 'fetchOHLCV': {
281
+ 'limit': 2000, // todo: recheck
282
+ },
283
+ },
284
+ 'spot': {
285
+ 'extends': 'default',
286
+ },
287
+ 'swap': {
288
+ 'linear': {
289
+ 'extends': 'default',
290
+ },
291
+ 'inverse': {
292
+ 'extends': 'default',
293
+ },
294
+ },
295
+ 'future': {
296
+ 'linear': {
297
+ 'extends': 'default',
298
+ },
299
+ 'inverse': {
300
+ 'extends': 'default',
301
+ },
302
+ },
303
+ },
222
304
  'precisionMode': number.TICK_SIZE,
223
305
  'requiredCredentials': {
224
306
  'apiKey': true,
@@ -3485,7 +3567,7 @@ class delta extends delta$1 {
3485
3567
  'timestamp': timestamp,
3486
3568
  };
3487
3569
  let auth = method + timestamp + requestPath;
3488
- if ((method === 'GET') || (method === 'DELETE')) {
3570
+ if (method === 'GET') {
3489
3571
  if (Object.keys(query).length) {
3490
3572
  const queryString = '?' + this.urlencode(query);
3491
3573
  auth += queryString;
@@ -278,6 +278,88 @@ class deribit extends deribit$1 {
278
278
  },
279
279
  },
280
280
  },
281
+ 'features': {
282
+ 'default': {
283
+ 'sandbox': true,
284
+ 'createOrder': {
285
+ 'marginMode': false,
286
+ 'triggerPrice': true,
287
+ // todo implement
288
+ 'triggerPriceType': {
289
+ 'last': true,
290
+ 'mark': true,
291
+ 'index': true,
292
+ },
293
+ 'triggerDirection': false,
294
+ 'stopLossPrice': false,
295
+ 'takeProfitPrice': false,
296
+ 'attachedStopLossTakeProfit': undefined,
297
+ 'timeInForce': {
298
+ 'IOC': true,
299
+ 'FOK': true,
300
+ 'PO': true,
301
+ 'GTD': true,
302
+ },
303
+ 'hedged': false,
304
+ 'selfTradePrevention': false,
305
+ 'trailing': true,
306
+ 'leverage': false,
307
+ 'marketBuyByCost': true,
308
+ 'marketBuyRequiresPrice': false,
309
+ 'iceberg': true, // todo
310
+ },
311
+ 'createOrders': undefined,
312
+ 'fetchMyTrades': {
313
+ 'marginMode': false,
314
+ 'limit': 100,
315
+ 'daysBack': 100000,
316
+ 'untilDays': 100000,
317
+ },
318
+ 'fetchOrder': {
319
+ 'marginMode': false,
320
+ 'trigger': false,
321
+ 'trailing': false,
322
+ },
323
+ 'fetchOpenOrders': {
324
+ 'marginMode': false,
325
+ 'limit': undefined,
326
+ 'trigger': false,
327
+ 'trailing': false,
328
+ },
329
+ 'fetchOrders': undefined,
330
+ 'fetchClosedOrders': {
331
+ 'marginMode': false,
332
+ 'limit': 100,
333
+ 'daysBack': 100000,
334
+ 'daysBackCanceled': 1,
335
+ 'untilDays': 100000,
336
+ 'trigger': false,
337
+ 'trailing': false,
338
+ },
339
+ 'fetchOHLCV': {
340
+ 'limit': 1000, // todo: recheck
341
+ },
342
+ },
343
+ 'spot': {
344
+ 'extends': 'default',
345
+ },
346
+ 'swap': {
347
+ 'linear': {
348
+ 'extends': 'default',
349
+ },
350
+ 'inverse': {
351
+ 'extends': 'default',
352
+ },
353
+ },
354
+ 'future': {
355
+ 'linear': {
356
+ 'extends': 'default',
357
+ },
358
+ 'inverse': {
359
+ 'extends': 'default',
360
+ },
361
+ },
362
+ },
281
363
  'exceptions': {
282
364
  // 0 or absent Success, No error.
283
365
  '9999': errors.PermissionDenied,
@@ -234,6 +234,109 @@ class digifinex extends digifinex$1 {
234
234
  },
235
235
  },
236
236
  },
237
+ 'features': {
238
+ 'default': {
239
+ 'sandbox': false,
240
+ 'createOrder': {
241
+ 'marginMode': true,
242
+ 'triggerPrice': false,
243
+ 'triggerPriceType': undefined,
244
+ 'triggerDirection': false,
245
+ 'stopLossPrice': false,
246
+ 'takeProfitPrice': false,
247
+ 'attachedStopLossTakeProfit': undefined,
248
+ 'timeInForce': {
249
+ 'IOC': false,
250
+ 'FOK': false,
251
+ 'PO': true,
252
+ 'GTD': false,
253
+ },
254
+ 'hedged': false,
255
+ 'selfTradePrevention': false,
256
+ 'trailing': false,
257
+ 'leverage': false,
258
+ 'marketBuyByCost': false,
259
+ 'marketBuyRequiresPrice': false,
260
+ 'iceberg': false,
261
+ },
262
+ 'createOrders': {
263
+ 'max': 10,
264
+ 'marginMode': true,
265
+ },
266
+ 'fetchMyTrades': {
267
+ 'marginMode': true,
268
+ 'limit': 500,
269
+ 'daysBack': 100000,
270
+ 'untilDays': 30,
271
+ },
272
+ 'fetchOrder': {
273
+ 'marginMode': true,
274
+ 'trigger': false,
275
+ 'trailing': false,
276
+ 'marketType': true,
277
+ },
278
+ 'fetchOpenOrders': {
279
+ 'marginMode': true,
280
+ 'limit': undefined,
281
+ 'trigger': false,
282
+ 'trailing': false,
283
+ },
284
+ 'fetchOrders': {
285
+ 'marginMode': true,
286
+ 'limit': 100,
287
+ 'daysBack': 100000,
288
+ 'untilDays': 30,
289
+ 'trigger': false,
290
+ 'trailing': false,
291
+ },
292
+ 'fetchClosedOrders': undefined,
293
+ 'fetchOHLCV': {
294
+ 'limit': 500,
295
+ },
296
+ },
297
+ 'spot': {
298
+ 'extends': 'default',
299
+ },
300
+ 'forDerivatives': {
301
+ 'extends': 'default',
302
+ 'createOrders': {
303
+ 'max': 20,
304
+ 'marginMode': false,
305
+ },
306
+ 'fetchMyTrades': {
307
+ 'marginMode': false,
308
+ 'limit': 100,
309
+ 'daysBack': 100000,
310
+ 'untilDays': 100000, // todo
311
+ },
312
+ 'fetchOrder': {
313
+ 'marginMode': false,
314
+ },
315
+ 'fetchOpenOrders': {
316
+ 'marginMode': false,
317
+ 'limit': 100,
318
+ },
319
+ 'fetchOrders': {
320
+ 'marginMode': false,
321
+ 'daysBack': 100000, // todo
322
+ },
323
+ 'fetchOHLCV': {
324
+ 'limit': 100,
325
+ },
326
+ },
327
+ 'swap': {
328
+ 'linear': {
329
+ 'extends': 'forDerivatives',
330
+ },
331
+ 'inverse': {
332
+ 'extends': 'forDerivatives',
333
+ },
334
+ },
335
+ 'future': {
336
+ 'linear': undefined,
337
+ 'inverse': undefined,
338
+ },
339
+ },
237
340
  'fees': {
238
341
  'trading': {
239
342
  'tierBased': true,
@@ -1501,6 +1604,7 @@ class digifinex extends digifinex$1 {
1501
1604
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1502
1605
  * @param {int} [limit] the maximum amount of candles to fetch
1503
1606
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1607
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
1504
1608
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1505
1609
  */
1506
1610
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -1517,22 +1621,38 @@ class digifinex extends digifinex$1 {
1517
1621
  response = await this.publicSwapGetPublicCandles(this.extend(request, params));
1518
1622
  }
1519
1623
  else {
1624
+ const until = this.safeInteger(params, 'until');
1520
1625
  request['symbol'] = market['id'];
1521
1626
  request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
1522
- if (since !== undefined) {
1523
- const startTime = this.parseToInt(since / 1000);
1524
- request['start_time'] = startTime;
1525
- if (limit !== undefined) {
1526
- const duration = this.parseTimeframe(timeframe);
1527
- request['end_time'] = this.sum(startTime, limit * duration);
1627
+ let startTime = since;
1628
+ const duration = this.parseTimeframe(timeframe);
1629
+ if (startTime === undefined) {
1630
+ if ((limit !== undefined) || (until !== undefined)) {
1631
+ const endTime = (until !== undefined) ? until : this.milliseconds();
1632
+ const startLimit = (limit !== undefined) ? limit : 200;
1633
+ startTime = endTime - (startLimit * duration * 1000);
1528
1634
  }
1529
1635
  }
1530
- else if (limit !== undefined) {
1531
- const endTime = this.seconds();
1532
- const duration = this.parseTimeframe(timeframe);
1533
- const auxLimit = limit; // in c# -limit is mutating the arg
1534
- request['start_time'] = this.sum(endTime, -auxLimit * duration);
1636
+ if (startTime !== undefined) {
1637
+ startTime = this.parseToInt(startTime / 1000);
1638
+ request['start_time'] = startTime;
1639
+ if ((limit !== undefined) || (until !== undefined)) {
1640
+ if (until !== undefined) {
1641
+ const endByUntil = this.parseToInt(until / 1000);
1642
+ if (limit !== undefined) {
1643
+ const endByLimit = this.sum(startTime, limit * duration);
1644
+ request['end_time'] = Math.min(endByLimit, endByUntil);
1645
+ }
1646
+ else {
1647
+ request['end_time'] = endByUntil;
1648
+ }
1649
+ }
1650
+ else {
1651
+ request['end_time'] = this.sum(startTime, limit * duration);
1652
+ }
1653
+ }
1535
1654
  }
1655
+ params = this.omit(params, 'until');
1536
1656
  response = await this.publicSpotGetKline(this.extend(request, params));
1537
1657
  }
1538
1658
  //
@@ -230,6 +230,66 @@ class ellipx extends ellipx$1 {
230
230
  'ETH': 'Ethereum',
231
231
  },
232
232
  },
233
+ 'features': {
234
+ 'spot': {
235
+ 'sandbox': false,
236
+ 'createOrder': {
237
+ 'marginMode': false,
238
+ 'triggerPrice': false,
239
+ 'triggerPriceType': undefined,
240
+ 'triggerDirection': false,
241
+ 'stopLossPrice': false,
242
+ 'takeProfitPrice': false,
243
+ 'attachedStopLossTakeProfit': undefined,
244
+ 'timeInForce': {
245
+ 'IOC': false,
246
+ 'FOK': false,
247
+ 'PO': false,
248
+ 'GTD': false,
249
+ },
250
+ 'hedged': false,
251
+ 'selfTradePrevention': false,
252
+ 'trailing': false,
253
+ 'leverage': false,
254
+ 'marketBuyByCost': true,
255
+ 'marketBuyRequiresPrice': false,
256
+ 'iceberg': false,
257
+ },
258
+ 'createOrders': undefined,
259
+ 'fetchMyTrades': undefined,
260
+ 'fetchOrder': {
261
+ 'marginMode': false,
262
+ 'trigger': false,
263
+ 'trailing': false,
264
+ },
265
+ 'fetchOpenOrders': {
266
+ 'marginMode': false,
267
+ 'limit': undefined,
268
+ 'trigger': false,
269
+ 'trailing': false,
270
+ },
271
+ 'fetchOrders': {
272
+ 'marginMode': false,
273
+ 'limit': undefined,
274
+ 'daysBack': undefined,
275
+ 'untilDays': undefined,
276
+ 'trigger': false,
277
+ 'trailing': false,
278
+ },
279
+ 'fetchClosedOrders': undefined,
280
+ 'fetchOHLCV': {
281
+ 'limit': 100,
282
+ },
283
+ },
284
+ 'swap': {
285
+ 'linear': undefined,
286
+ 'inverse': undefined,
287
+ },
288
+ 'future': {
289
+ 'linear': undefined,
290
+ 'inverse': undefined,
291
+ },
292
+ },
233
293
  'commonCurrencies': {},
234
294
  'exceptions': {
235
295
  'exact': {
@@ -664,6 +724,7 @@ class ellipx extends ellipx$1 {
664
724
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
665
725
  * @param {int} [limit] the maximum amount of candles to fetch
666
726
  * @param {object} [params] extra parameters specific to the API endpoint
727
+ * @param {int} [params.until] timestamp in ms of the earliest candle to fetch
667
728
  * @returns {OHLCV[]} A list of candles ordered as timestamp, open, high, low, close, volume
668
729
  */
669
730
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -208,6 +208,64 @@ class exmo extends exmo$1 {
208
208
  'fillResponseFromRequest': true,
209
209
  },
210
210
  },
211
+ 'features': {
212
+ 'spot': {
213
+ 'sandbox': false,
214
+ 'createOrder': {
215
+ 'marginMode': true,
216
+ 'triggerPrice': true,
217
+ 'triggerPriceType': undefined,
218
+ 'triggerDirection': false,
219
+ 'stopLossPrice': false,
220
+ 'takeProfitPrice': false,
221
+ 'attachedStopLossTakeProfit': undefined,
222
+ 'timeInForce': {
223
+ 'IOC': true,
224
+ 'FOK': true,
225
+ 'PO': true,
226
+ 'GTD': true,
227
+ },
228
+ 'hedged': false,
229
+ 'selfTradePrevention': false,
230
+ 'trailing': false,
231
+ 'leverage': true,
232
+ 'marketBuyByCost': true,
233
+ 'marketBuyRequiresPrice': false,
234
+ 'iceberg': false,
235
+ },
236
+ 'createOrders': undefined,
237
+ 'fetchMyTrades': {
238
+ 'marginMode': true,
239
+ 'limit': 100,
240
+ 'daysBack': undefined,
241
+ 'untilDays': undefined,
242
+ },
243
+ 'fetchOrder': {
244
+ 'marginMode': false,
245
+ 'trigger': false,
246
+ 'trailing': false,
247
+ },
248
+ 'fetchOpenOrders': {
249
+ 'marginMode': false,
250
+ 'limit': undefined,
251
+ 'trigger': false,
252
+ 'trailing': false,
253
+ },
254
+ 'fetchOrders': undefined,
255
+ 'fetchClosedOrders': undefined,
256
+ 'fetchOHLCV': {
257
+ 'limit': 1000, // todo, not in request
258
+ },
259
+ },
260
+ 'swap': {
261
+ 'linear': undefined,
262
+ 'inverse': undefined,
263
+ },
264
+ 'future': {
265
+ 'linear': undefined,
266
+ 'inverse': undefined,
267
+ },
268
+ },
211
269
  'commonCurrencies': {
212
270
  'GMT': 'GMT Token',
213
271
  },
@@ -647,6 +647,8 @@ class gate extends gate$1 {
647
647
  'X-Gate-Channel-Id': 'ccxt',
648
648
  },
649
649
  'options': {
650
+ 'timeDifference': 0,
651
+ 'adjustForTimeDifference': false,
650
652
  'sandboxMode': false,
651
653
  'unifiedAccount': undefined,
652
654
  'createOrder': {
@@ -1160,6 +1162,9 @@ class gate extends gate$1 {
1160
1162
  * @returns {object[]} an array of objects representing market data
1161
1163
  */
1162
1164
  async fetchMarkets(params = {}) {
1165
+ if (this.options['adjustForTimeDifference']) {
1166
+ await this.loadTimeDifference();
1167
+ }
1163
1168
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1164
1169
  let rawPromises = [
1165
1170
  this.fetchContractMarkets(params),
@@ -6664,6 +6669,9 @@ class gate extends gate$1 {
6664
6669
  'datetime': this.iso8601(timestamp),
6665
6670
  };
6666
6671
  }
6672
+ nonce() {
6673
+ return this.milliseconds() - this.options['timeDifference'];
6674
+ }
6667
6675
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
6668
6676
  const authentication = api[0]; // public, private
6669
6677
  const type = api[1]; // spot, margin, future, delivery
@@ -6737,7 +6745,8 @@ class gate extends gate$1 {
6737
6745
  }
6738
6746
  const bodyPayload = (body === undefined) ? '' : body;
6739
6747
  const bodySignature = this.hash(this.encode(bodyPayload), sha512.sha512);
6740
- const timestamp = this.seconds();
6748
+ const nonce = this.nonce();
6749
+ const timestamp = this.parseToInt(nonce / 1000);
6741
6750
  const timestampString = timestamp.toString();
6742
6751
  const signaturePath = '/api/' + this.version + entirePath;
6743
6752
  const payloadArray = [method.toUpperCase(), signaturePath, queryString, bodySignature, timestampString];