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
@@ -237,6 +237,109 @@ export default class digifinex extends Exchange {
237
237
  },
238
238
  },
239
239
  },
240
+ 'features': {
241
+ 'default': {
242
+ 'sandbox': false,
243
+ 'createOrder': {
244
+ 'marginMode': true,
245
+ 'triggerPrice': false,
246
+ 'triggerPriceType': undefined,
247
+ 'triggerDirection': false,
248
+ 'stopLossPrice': false,
249
+ 'takeProfitPrice': false,
250
+ 'attachedStopLossTakeProfit': undefined,
251
+ 'timeInForce': {
252
+ 'IOC': false,
253
+ 'FOK': false,
254
+ 'PO': true,
255
+ 'GTD': false,
256
+ },
257
+ 'hedged': false,
258
+ 'selfTradePrevention': false,
259
+ 'trailing': false,
260
+ 'leverage': false,
261
+ 'marketBuyByCost': false,
262
+ 'marketBuyRequiresPrice': false,
263
+ 'iceberg': false,
264
+ },
265
+ 'createOrders': {
266
+ 'max': 10,
267
+ 'marginMode': true,
268
+ },
269
+ 'fetchMyTrades': {
270
+ 'marginMode': true,
271
+ 'limit': 500,
272
+ 'daysBack': 100000,
273
+ 'untilDays': 30,
274
+ },
275
+ 'fetchOrder': {
276
+ 'marginMode': true,
277
+ 'trigger': false,
278
+ 'trailing': false,
279
+ 'marketType': true,
280
+ },
281
+ 'fetchOpenOrders': {
282
+ 'marginMode': true,
283
+ 'limit': undefined,
284
+ 'trigger': false,
285
+ 'trailing': false,
286
+ },
287
+ 'fetchOrders': {
288
+ 'marginMode': true,
289
+ 'limit': 100,
290
+ 'daysBack': 100000,
291
+ 'untilDays': 30,
292
+ 'trigger': false,
293
+ 'trailing': false,
294
+ },
295
+ 'fetchClosedOrders': undefined,
296
+ 'fetchOHLCV': {
297
+ 'limit': 500,
298
+ },
299
+ },
300
+ 'spot': {
301
+ 'extends': 'default',
302
+ },
303
+ 'forDerivatives': {
304
+ 'extends': 'default',
305
+ 'createOrders': {
306
+ 'max': 20,
307
+ 'marginMode': false,
308
+ },
309
+ 'fetchMyTrades': {
310
+ 'marginMode': false,
311
+ 'limit': 100,
312
+ 'daysBack': 100000,
313
+ 'untilDays': 100000, // todo
314
+ },
315
+ 'fetchOrder': {
316
+ 'marginMode': false,
317
+ },
318
+ 'fetchOpenOrders': {
319
+ 'marginMode': false,
320
+ 'limit': 100,
321
+ },
322
+ 'fetchOrders': {
323
+ 'marginMode': false,
324
+ 'daysBack': 100000, // todo
325
+ },
326
+ 'fetchOHLCV': {
327
+ 'limit': 100,
328
+ },
329
+ },
330
+ 'swap': {
331
+ 'linear': {
332
+ 'extends': 'forDerivatives',
333
+ },
334
+ 'inverse': {
335
+ 'extends': 'forDerivatives',
336
+ },
337
+ },
338
+ 'future': {
339
+ 'linear': undefined,
340
+ 'inverse': undefined,
341
+ },
342
+ },
240
343
  'fees': {
241
344
  'trading': {
242
345
  'tierBased': true,
@@ -1504,6 +1607,7 @@ export default class digifinex extends Exchange {
1504
1607
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1505
1608
  * @param {int} [limit] the maximum amount of candles to fetch
1506
1609
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1610
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
1507
1611
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1508
1612
  */
1509
1613
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -1520,22 +1624,38 @@ export default class digifinex extends Exchange {
1520
1624
  response = await this.publicSwapGetPublicCandles(this.extend(request, params));
1521
1625
  }
1522
1626
  else {
1627
+ const until = this.safeInteger(params, 'until');
1523
1628
  request['symbol'] = market['id'];
1524
1629
  request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
1525
- if (since !== undefined) {
1526
- const startTime = this.parseToInt(since / 1000);
1527
- request['start_time'] = startTime;
1528
- if (limit !== undefined) {
1529
- const duration = this.parseTimeframe(timeframe);
1530
- request['end_time'] = this.sum(startTime, limit * duration);
1630
+ let startTime = since;
1631
+ const duration = this.parseTimeframe(timeframe);
1632
+ if (startTime === undefined) {
1633
+ if ((limit !== undefined) || (until !== undefined)) {
1634
+ const endTime = (until !== undefined) ? until : this.milliseconds();
1635
+ const startLimit = (limit !== undefined) ? limit : 200;
1636
+ startTime = endTime - (startLimit * duration * 1000);
1531
1637
  }
1532
1638
  }
1533
- else if (limit !== undefined) {
1534
- const endTime = this.seconds();
1535
- const duration = this.parseTimeframe(timeframe);
1536
- const auxLimit = limit; // in c# -limit is mutating the arg
1537
- request['start_time'] = this.sum(endTime, -auxLimit * duration);
1639
+ if (startTime !== undefined) {
1640
+ startTime = this.parseToInt(startTime / 1000);
1641
+ request['start_time'] = startTime;
1642
+ if ((limit !== undefined) || (until !== undefined)) {
1643
+ if (until !== undefined) {
1644
+ const endByUntil = this.parseToInt(until / 1000);
1645
+ if (limit !== undefined) {
1646
+ const endByLimit = this.sum(startTime, limit * duration);
1647
+ request['end_time'] = Math.min(endByLimit, endByUntil);
1648
+ }
1649
+ else {
1650
+ request['end_time'] = endByUntil;
1651
+ }
1652
+ }
1653
+ else {
1654
+ request['end_time'] = this.sum(startTime, limit * duration);
1655
+ }
1656
+ }
1538
1657
  }
1658
+ params = this.omit(params, 'until');
1539
1659
  response = await this.publicSpotGetKline(this.extend(request, params));
1540
1660
  }
1541
1661
  //
@@ -56,6 +56,7 @@ export default class ellipx extends Exchange {
56
56
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
57
57
  * @param {int} [limit] the maximum amount of candles to fetch
58
58
  * @param {object} [params] extra parameters specific to the API endpoint
59
+ * @param {int} [params.until] timestamp in ms of the earliest candle to fetch
59
60
  * @returns {OHLCV[]} A list of candles ordered as timestamp, open, high, low, close, volume
60
61
  */
61
62
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
package/js/src/ellipx.js CHANGED
@@ -235,6 +235,66 @@ export default class ellipx extends Exchange {
235
235
  'ETH': 'Ethereum',
236
236
  },
237
237
  },
238
+ 'features': {
239
+ 'spot': {
240
+ 'sandbox': false,
241
+ 'createOrder': {
242
+ 'marginMode': false,
243
+ 'triggerPrice': false,
244
+ 'triggerPriceType': undefined,
245
+ 'triggerDirection': false,
246
+ 'stopLossPrice': false,
247
+ 'takeProfitPrice': false,
248
+ 'attachedStopLossTakeProfit': undefined,
249
+ 'timeInForce': {
250
+ 'IOC': false,
251
+ 'FOK': false,
252
+ 'PO': false,
253
+ 'GTD': false,
254
+ },
255
+ 'hedged': false,
256
+ 'selfTradePrevention': false,
257
+ 'trailing': false,
258
+ 'leverage': false,
259
+ 'marketBuyByCost': true,
260
+ 'marketBuyRequiresPrice': false,
261
+ 'iceberg': false,
262
+ },
263
+ 'createOrders': undefined,
264
+ 'fetchMyTrades': undefined,
265
+ 'fetchOrder': {
266
+ 'marginMode': false,
267
+ 'trigger': false,
268
+ 'trailing': false,
269
+ },
270
+ 'fetchOpenOrders': {
271
+ 'marginMode': false,
272
+ 'limit': undefined,
273
+ 'trigger': false,
274
+ 'trailing': false,
275
+ },
276
+ 'fetchOrders': {
277
+ 'marginMode': false,
278
+ 'limit': undefined,
279
+ 'daysBack': undefined,
280
+ 'untilDays': undefined,
281
+ 'trigger': false,
282
+ 'trailing': false,
283
+ },
284
+ 'fetchClosedOrders': undefined,
285
+ 'fetchOHLCV': {
286
+ 'limit': 100,
287
+ },
288
+ },
289
+ 'swap': {
290
+ 'linear': undefined,
291
+ 'inverse': undefined,
292
+ },
293
+ 'future': {
294
+ 'linear': undefined,
295
+ 'inverse': undefined,
296
+ },
297
+ },
238
298
  'commonCurrencies': {},
239
299
  'exceptions': {
240
300
  'exact': {
@@ -669,6 +729,7 @@ export default class ellipx extends Exchange {
669
729
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
670
730
  * @param {int} [limit] the maximum amount of candles to fetch
671
731
  * @param {object} [params] extra parameters specific to the API endpoint
732
+ * @param {int} [params.until] timestamp in ms of the earliest candle to fetch
672
733
  * @returns {OHLCV[]} A list of candles ordered as timestamp, open, high, low, close, volume
673
734
  */
674
735
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
package/js/src/exmo.js CHANGED
@@ -211,6 +211,64 @@ export default class exmo extends Exchange {
211
211
  'fillResponseFromRequest': true,
212
212
  },
213
213
  },
214
+ 'features': {
215
+ 'spot': {
216
+ 'sandbox': false,
217
+ 'createOrder': {
218
+ 'marginMode': true,
219
+ 'triggerPrice': true,
220
+ 'triggerPriceType': undefined,
221
+ 'triggerDirection': false,
222
+ 'stopLossPrice': false,
223
+ 'takeProfitPrice': false,
224
+ 'attachedStopLossTakeProfit': undefined,
225
+ 'timeInForce': {
226
+ 'IOC': true,
227
+ 'FOK': true,
228
+ 'PO': true,
229
+ 'GTD': true,
230
+ },
231
+ 'hedged': false,
232
+ 'selfTradePrevention': false,
233
+ 'trailing': false,
234
+ 'leverage': true,
235
+ 'marketBuyByCost': true,
236
+ 'marketBuyRequiresPrice': false,
237
+ 'iceberg': false,
238
+ },
239
+ 'createOrders': undefined,
240
+ 'fetchMyTrades': {
241
+ 'marginMode': true,
242
+ 'limit': 100,
243
+ 'daysBack': undefined,
244
+ 'untilDays': undefined,
245
+ },
246
+ 'fetchOrder': {
247
+ 'marginMode': false,
248
+ 'trigger': false,
249
+ 'trailing': false,
250
+ },
251
+ 'fetchOpenOrders': {
252
+ 'marginMode': false,
253
+ 'limit': undefined,
254
+ 'trigger': false,
255
+ 'trailing': false,
256
+ },
257
+ 'fetchOrders': undefined,
258
+ 'fetchClosedOrders': undefined,
259
+ 'fetchOHLCV': {
260
+ 'limit': 1000, // todo, not in request
261
+ },
262
+ },
263
+ 'swap': {
264
+ 'linear': undefined,
265
+ 'inverse': undefined,
266
+ },
267
+ 'future': {
268
+ 'linear': undefined,
269
+ 'inverse': undefined,
270
+ },
271
+ },
214
272
  'commonCurrencies': {
215
273
  'GMT': 'GMT Token',
216
274
  },
package/js/src/gate.d.ts CHANGED
@@ -801,6 +801,7 @@ export default class gate extends Exchange {
801
801
  */
802
802
  fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
803
803
  parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
804
+ nonce(): number;
804
805
  sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
805
806
  url: any;
806
807
  method: string;
package/js/src/gate.js CHANGED
@@ -650,6 +650,8 @@ export default class gate extends Exchange {
650
650
  'X-Gate-Channel-Id': 'ccxt',
651
651
  },
652
652
  'options': {
653
+ 'timeDifference': 0,
654
+ 'adjustForTimeDifference': false,
653
655
  'sandboxMode': false,
654
656
  'unifiedAccount': undefined,
655
657
  'createOrder': {
@@ -1163,6 +1165,9 @@ export default class gate extends Exchange {
1163
1165
  * @returns {object[]} an array of objects representing market data
1164
1166
  */
1165
1167
  async fetchMarkets(params = {}) {
1168
+ if (this.options['adjustForTimeDifference']) {
1169
+ await this.loadTimeDifference();
1170
+ }
1166
1171
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1167
1172
  let rawPromises = [
1168
1173
  this.fetchContractMarkets(params),
@@ -6667,6 +6672,9 @@ export default class gate extends Exchange {
6667
6672
  'datetime': this.iso8601(timestamp),
6668
6673
  };
6669
6674
  }
6675
+ nonce() {
6676
+ return this.milliseconds() - this.options['timeDifference'];
6677
+ }
6670
6678
  sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
6671
6679
  const authentication = api[0]; // public, private
6672
6680
  const type = api[1]; // spot, margin, future, delivery
@@ -6740,7 +6748,8 @@ export default class gate extends Exchange {
6740
6748
  }
6741
6749
  const bodyPayload = (body === undefined) ? '' : body;
6742
6750
  const bodySignature = this.hash(this.encode(bodyPayload), sha512);
6743
- const timestamp = this.seconds();
6751
+ const nonce = this.nonce();
6752
+ const timestamp = this.parseToInt(nonce / 1000);
6744
6753
  const timestampString = timestamp.toString();
6745
6754
  const signaturePath = '/api/' + this.version + entirePath;
6746
6755
  const payloadArray = [method.toUpperCase(), signaturePath, queryString, bodySignature, timestampString];
package/js/src/hitbtc.js CHANGED
@@ -290,6 +290,105 @@ export default class hitbtc extends Exchange {
290
290
  },
291
291
  },
292
292
  },
293
+ 'features': {
294
+ 'default': {
295
+ 'sandbox': true,
296
+ 'createOrder': {
297
+ 'marginMode': false,
298
+ 'triggerPrice': true,
299
+ 'triggerPriceType': undefined,
300
+ 'triggerDirection': false,
301
+ 'stopLossPrice': false,
302
+ 'takeProfitPrice': false,
303
+ 'attachedStopLossTakeProfit': undefined,
304
+ 'timeInForce': {
305
+ 'IOC': true,
306
+ 'FOK': true,
307
+ 'PO': true,
308
+ 'GTD': true,
309
+ },
310
+ 'hedged': false,
311
+ 'selfTradePrevention': false,
312
+ 'trailing': false,
313
+ 'leverage': false,
314
+ 'marketBuyByCost': false,
315
+ 'marketBuyRequiresPrice': false,
316
+ 'iceberg': true,
317
+ },
318
+ 'createOrders': undefined,
319
+ 'fetchMyTrades': {
320
+ 'marginMode': true,
321
+ 'limit': 1000,
322
+ 'daysBack': 100000,
323
+ 'untilDays': 100000,
324
+ 'marketType': true,
325
+ },
326
+ 'fetchOrder': {
327
+ 'marginMode': true,
328
+ 'trigger': false,
329
+ 'trailing': false,
330
+ 'marketType': true,
331
+ },
332
+ 'fetchOpenOrders': {
333
+ 'marginMode': true,
334
+ 'limit': 1000,
335
+ 'trigger': false,
336
+ 'trailing': false,
337
+ 'marketType': true,
338
+ },
339
+ 'fetchOrders': undefined,
340
+ 'fetchClosedOrders': {
341
+ 'marginMode': true,
342
+ 'limit': 1000,
343
+ 'daysBack': 100000,
344
+ 'daysBackCanceled': 1,
345
+ 'untilDays': 100000,
346
+ 'trigger': false,
347
+ 'trailing': false,
348
+ 'marketType': true,
349
+ },
350
+ 'fetchOHLCV': {
351
+ 'limit': 1000,
352
+ },
353
+ },
354
+ 'spot': {
355
+ 'extends': 'default',
356
+ },
357
+ 'forDerivatives': {
358
+ 'extends': 'default',
359
+ 'createOrder': {
360
+ 'marginMode': true,
361
+ },
362
+ 'fetchOrder': {
363
+ 'marginMode': false,
364
+ },
365
+ 'fetchMyTrades': {
366
+ 'marginMode': false,
367
+ },
368
+ 'fetchOpenOrders': {
369
+ 'marginMode': false,
370
+ },
371
+ 'fetchClosedOrders': {
372
+ 'marginMode': false,
373
+ },
374
+ },
375
+ 'swap': {
376
+ 'linear': {
377
+ 'extends': 'forDerivatives',
378
+ },
379
+ 'inverse': {
380
+ 'extends': 'forDerivatives',
381
+ },
382
+ },
383
+ 'future': {
384
+ 'linear': {
385
+ 'extends': 'forDerivatives',
386
+ },
387
+ 'inverse': {
388
+ 'extends': 'forDerivatives',
389
+ },
390
+ },
391
+ },
293
392
  'timeframes': {
294
393
  '1m': 'M1',
295
394
  '3m': 'M3',
package/js/src/hollaex.js CHANGED
@@ -169,6 +169,79 @@ export default class hollaex extends Exchange {
169
169
  },
170
170
  },
171
171
  },
172
+ 'features': {
173
+ 'spot': {
174
+ 'sandbox': true,
175
+ 'createOrder': {
176
+ 'marginMode': false,
177
+ 'triggerPrice': true,
178
+ 'triggerPriceType': undefined,
179
+ 'triggerDirection': false,
180
+ 'stopLossPrice': false,
181
+ 'takeProfitPrice': false,
182
+ 'attachedStopLossTakeProfit': undefined,
183
+ 'timeInForce': {
184
+ 'IOC': false,
185
+ 'FOK': false,
186
+ 'PO': true,
187
+ 'GTD': false,
188
+ },
189
+ 'hedged': false,
190
+ 'selfTradePrevention': false,
191
+ 'trailing': false,
192
+ 'leverage': false,
193
+ 'marketBuyByCost': false,
194
+ 'marketBuyRequiresPrice': false,
195
+ 'iceberg': false,
196
+ },
197
+ 'createOrders': undefined,
198
+ 'fetchMyTrades': {
199
+ 'marginMode': false,
200
+ 'limit': 100,
201
+ 'daysBack': 100000,
202
+ 'untilDays': 100000, // todo implement
203
+ },
204
+ 'fetchOrder': {
205
+ 'marginMode': false,
206
+ 'trigger': false,
207
+ 'trailing': false,
208
+ },
209
+ 'fetchOpenOrders': {
210
+ 'marginMode': false,
211
+ 'limit': 100,
212
+ 'trigger': false,
213
+ 'trailing': false,
214
+ },
215
+ 'fetchOrders': {
216
+ 'marginMode': false,
217
+ 'limit': 100,
218
+ 'daysBack': 100000,
219
+ 'untilDays': 100000,
220
+ 'trigger': false,
221
+ 'trailing': false,
222
+ },
223
+ 'fetchClosedOrders': {
224
+ 'marginMode': false,
225
+ 'limit': 100,
226
+ 'daysBack': 100000,
227
+ 'daysBackCanceled': 1,
228
+ 'untilDays': 100000,
229
+ 'trigger': false,
230
+ 'trailing': false,
231
+ },
232
+ 'fetchOHLCV': {
233
+ 'limit': 1000, // todo: no limit in request
234
+ },
235
+ },
236
+ 'swap': {
237
+ 'linear': undefined,
238
+ 'inverse': undefined,
239
+ },
240
+ 'future': {
241
+ 'linear': undefined,
242
+ 'inverse': undefined,
243
+ },
244
+ },
172
245
  'fees': {
173
246
  'trading': {
174
247
  'tierBased': true,
package/js/src/htx.d.ts CHANGED
@@ -672,6 +672,7 @@ export default class htx extends Exchange {
672
672
  */
673
673
  fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
674
674
  parseBorrowInterest(info: Dict, market?: Market): BorrowInterest;
675
+ nonce(): number;
675
676
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
676
677
  url: string;
677
678
  method: string;
package/js/src/htx.js CHANGED
@@ -953,6 +953,8 @@ export default class htx extends Exchange {
953
953
  'inverse': true,
954
954
  },
955
955
  },
956
+ 'timeDifference': 0,
957
+ 'adjustForTimeDifference': false,
956
958
  'fetchOHLCV': {
957
959
  'useHistoricalEndpointForSpot': true,
958
960
  },
@@ -1771,6 +1773,9 @@ export default class htx extends Exchange {
1771
1773
  * @returns {object[]} an array of objects representing market data
1772
1774
  */
1773
1775
  async fetchMarkets(params = {}) {
1776
+ if (this.options['adjustForTimeDifference']) {
1777
+ await this.loadTimeDifference();
1778
+ }
1774
1779
  let types = undefined;
1775
1780
  [types, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'types', {});
1776
1781
  let allMarkets = [];
@@ -7451,6 +7456,9 @@ export default class htx extends Exchange {
7451
7456
  'datetime': this.iso8601(timestamp),
7452
7457
  };
7453
7458
  }
7459
+ nonce() {
7460
+ return this.milliseconds() - this.options['timeDifference'];
7461
+ }
7454
7462
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
7455
7463
  let url = '/';
7456
7464
  const query = this.omit(params, this.extractParams(path));
@@ -7465,7 +7473,7 @@ export default class htx extends Exchange {
7465
7473
  url += '/' + this.implodeParams(path, params);
7466
7474
  if (api === 'private' || api === 'v2Private') {
7467
7475
  this.checkRequiredCredentials();
7468
- const timestamp = this.ymdhms(this.milliseconds(), 'T');
7476
+ const timestamp = this.ymdhms(this.nonce(), 'T');
7469
7477
  let request = {
7470
7478
  'SignatureMethod': 'HmacSHA256',
7471
7479
  'SignatureVersion': '2',
@@ -7545,7 +7553,7 @@ export default class htx extends Exchange {
7545
7553
  }
7546
7554
  }
7547
7555
  }
7548
- const timestamp = this.ymdhms(this.milliseconds(), 'T');
7556
+ const timestamp = this.ymdhms(this.nonce(), 'T');
7549
7557
  let request = {
7550
7558
  'SignatureMethod': 'HmacSHA256',
7551
7559
  'SignatureVersion': '2',