ccxt 4.2.82 → 4.2.84

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 (133) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.js +823 -220
  3. package/dist/ccxt.browser.min.js +2 -2
  4. package/dist/cjs/ccxt.js +3 -1
  5. package/dist/cjs/src/bitget.js +11 -4
  6. package/dist/cjs/src/bithumb.js +1 -0
  7. package/dist/cjs/src/bitstamp.js +42 -15
  8. package/dist/cjs/src/bybit.js +3 -3
  9. package/dist/cjs/src/coinex.js +1 -2
  10. package/dist/cjs/src/deribit.js +19 -1
  11. package/dist/cjs/src/gemini.js +2 -1
  12. package/dist/cjs/src/htx.js +5 -27
  13. package/dist/cjs/src/hyperliquid.js +5 -4
  14. package/dist/cjs/src/kucoin.js +10 -1
  15. package/dist/cjs/src/kucoinfutures.js +147 -8
  16. package/dist/cjs/src/pro/bithumb.js +388 -0
  17. package/dist/cjs/src/pro/bitmart.js +1 -1
  18. package/dist/cjs/src/pro/bybit.js +1 -1
  19. package/dist/cjs/src/pro/cex.js +18 -5
  20. package/dist/cjs/src/pro/okx.js +2 -1
  21. package/dist/cjs/src/pro/p2b.js +14 -4
  22. package/dist/cjs/src/pro/woo.js +1 -1
  23. package/js/ccxt.d.ts +4 -1
  24. package/js/ccxt.js +3 -1
  25. package/js/src/abstract/bitstamp.d.ts +1 -1
  26. package/js/src/ace.d.ts +1 -1
  27. package/js/src/alpaca.d.ts +1 -1
  28. package/js/src/ascendex.d.ts +1 -1
  29. package/js/src/bigone.d.ts +1 -1
  30. package/js/src/binance.d.ts +1 -1
  31. package/js/src/bingx.d.ts +1 -1
  32. package/js/src/bitbank.d.ts +1 -1
  33. package/js/src/bitbns.d.ts +1 -1
  34. package/js/src/bitfinex.d.ts +1 -1
  35. package/js/src/bitfinex2.d.ts +1 -1
  36. package/js/src/bitflyer.d.ts +1 -1
  37. package/js/src/bitget.d.ts +1 -1
  38. package/js/src/bitget.js +11 -4
  39. package/js/src/bithumb.d.ts +1 -1
  40. package/js/src/bithumb.js +1 -0
  41. package/js/src/bitmart.d.ts +1 -1
  42. package/js/src/bitmex.d.ts +1 -1
  43. package/js/src/bitopro.d.ts +1 -1
  44. package/js/src/bitrue.d.ts +1 -1
  45. package/js/src/bitso.d.ts +1 -1
  46. package/js/src/bitstamp.d.ts +1 -1
  47. package/js/src/bitstamp.js +42 -15
  48. package/js/src/bitteam.d.ts +1 -1
  49. package/js/src/bitvavo.d.ts +1 -1
  50. package/js/src/blockchaincom.d.ts +1 -1
  51. package/js/src/blofin.d.ts +1 -1
  52. package/js/src/btcalpha.d.ts +1 -1
  53. package/js/src/btcmarkets.d.ts +1 -1
  54. package/js/src/btcturk.d.ts +1 -1
  55. package/js/src/bybit.d.ts +1 -1
  56. package/js/src/bybit.js +3 -3
  57. package/js/src/cex.d.ts +1 -1
  58. package/js/src/coinbase.d.ts +1 -1
  59. package/js/src/coinbaseinternational.d.ts +1 -1
  60. package/js/src/coinbasepro.d.ts +1 -1
  61. package/js/src/coinex.d.ts +1 -1
  62. package/js/src/coinex.js +1 -2
  63. package/js/src/coinlist.d.ts +1 -1
  64. package/js/src/coinmate.d.ts +1 -1
  65. package/js/src/coinmetro.d.ts +1 -1
  66. package/js/src/coinone.d.ts +1 -1
  67. package/js/src/coinsph.d.ts +1 -1
  68. package/js/src/cryptocom.d.ts +1 -1
  69. package/js/src/currencycom.d.ts +1 -1
  70. package/js/src/delta.d.ts +1 -1
  71. package/js/src/deribit.d.ts +1 -1
  72. package/js/src/deribit.js +19 -1
  73. package/js/src/digifinex.d.ts +1 -1
  74. package/js/src/exmo.d.ts +1 -1
  75. package/js/src/gate.d.ts +1 -1
  76. package/js/src/gemini.d.ts +1 -1
  77. package/js/src/gemini.js +2 -1
  78. package/js/src/hitbtc.d.ts +1 -1
  79. package/js/src/hollaex.d.ts +1 -1
  80. package/js/src/htx.d.ts +1 -1
  81. package/js/src/htx.js +5 -27
  82. package/js/src/huobijp.d.ts +1 -1
  83. package/js/src/hyperliquid.d.ts +1 -1
  84. package/js/src/hyperliquid.js +5 -4
  85. package/js/src/idex.d.ts +1 -1
  86. package/js/src/independentreserve.d.ts +1 -1
  87. package/js/src/indodax.d.ts +1 -1
  88. package/js/src/kraken.d.ts +1 -1
  89. package/js/src/krakenfutures.d.ts +1 -1
  90. package/js/src/kucoin.d.ts +2 -1
  91. package/js/src/kucoin.js +11 -2
  92. package/js/src/kucoinfutures.d.ts +3 -2
  93. package/js/src/kucoinfutures.js +147 -8
  94. package/js/src/kuna.d.ts +1 -1
  95. package/js/src/latoken.d.ts +1 -1
  96. package/js/src/lbank.d.ts +1 -1
  97. package/js/src/luno.d.ts +1 -1
  98. package/js/src/lykke.d.ts +1 -1
  99. package/js/src/mercado.d.ts +1 -1
  100. package/js/src/mexc.d.ts +1 -1
  101. package/js/src/ndax.d.ts +1 -1
  102. package/js/src/novadax.d.ts +1 -1
  103. package/js/src/oceanex.d.ts +1 -1
  104. package/js/src/okcoin.d.ts +1 -1
  105. package/js/src/okx.d.ts +1 -1
  106. package/js/src/onetrading.d.ts +1 -1
  107. package/js/src/p2b.d.ts +1 -1
  108. package/js/src/phemex.d.ts +1 -1
  109. package/js/src/poloniex.d.ts +1 -1
  110. package/js/src/poloniexfutures.d.ts +1 -1
  111. package/js/src/pro/bithumb.d.ts +19 -0
  112. package/js/src/pro/bithumb.js +389 -0
  113. package/js/src/pro/bitmart.js +1 -1
  114. package/js/src/pro/bybit.js +1 -1
  115. package/js/src/pro/cex.js +18 -5
  116. package/js/src/pro/okx.js +2 -1
  117. package/js/src/pro/p2b.d.ts +2 -0
  118. package/js/src/pro/p2b.js +14 -4
  119. package/js/src/pro/woo.js +1 -1
  120. package/js/src/probit.d.ts +1 -1
  121. package/js/src/timex.d.ts +1 -1
  122. package/js/src/tokocrypto.d.ts +1 -1
  123. package/js/src/tradeogre.d.ts +1 -1
  124. package/js/src/upbit.d.ts +1 -1
  125. package/js/src/wavesexchange.d.ts +1 -1
  126. package/js/src/wazirx.d.ts +1 -1
  127. package/js/src/whitebit.d.ts +1 -1
  128. package/js/src/woo.d.ts +1 -1
  129. package/js/src/yobit.d.ts +1 -1
  130. package/js/src/zaif.d.ts +1 -1
  131. package/js/src/zonda.d.ts +1 -1
  132. package/package.json +1 -1
  133. package/skip-tests.json +17 -4
package/dist/cjs/ccxt.js CHANGED
@@ -127,6 +127,7 @@ var bitcoincom$1 = require('./src/pro/bitcoincom.js');
127
127
  var bitfinex$1 = require('./src/pro/bitfinex.js');
128
128
  var bitfinex2$1 = require('./src/pro/bitfinex2.js');
129
129
  var bitget$1 = require('./src/pro/bitget.js');
130
+ var bithumb$1 = require('./src/pro/bithumb.js');
130
131
  var bitmart$1 = require('./src/pro/bitmart.js');
131
132
  var bitmex$1 = require('./src/pro/bitmex.js');
132
133
  var bitopro$1 = require('./src/pro/bitopro.js');
@@ -181,7 +182,7 @@ var woo$1 = require('./src/pro/woo.js');
181
182
 
182
183
  //-----------------------------------------------------------------------------
183
184
  // this is updated by vss.js when building
184
- const version = '4.2.82';
185
+ const version = '4.2.84';
185
186
  Exchange["default"].ccxtVersion = version;
186
187
  const exchanges = {
187
188
  'ace': ace,
@@ -301,6 +302,7 @@ const pro = {
301
302
  'bitfinex': bitfinex$1,
302
303
  'bitfinex2': bitfinex2$1,
303
304
  'bitget': bitget$1,
305
+ 'bithumb': bithumb$1,
304
306
  'bitmart': bitmart$1,
305
307
  'bitmex': bitmex$1,
306
308
  'bitopro': bitopro$1,
@@ -1293,6 +1293,7 @@ class bitget extends bitget$1 {
1293
1293
  'precisionMode': number.TICK_SIZE,
1294
1294
  'commonCurrencies': {
1295
1295
  'JADE': 'Jade Protocol',
1296
+ 'DEGEN': 'DegenReborn',
1296
1297
  },
1297
1298
  'options': {
1298
1299
  'timeframes': {
@@ -2767,6 +2768,7 @@ class bitget extends bitget$1 {
2767
2768
  * @see https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
2768
2769
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2769
2770
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2771
+ * @param {string} [params.subType] *contract only* 'linear', 'inverse'
2770
2772
  * @param {string} [params.productType] *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
2771
2773
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2772
2774
  */
@@ -2783,16 +2785,21 @@ class bitget extends bitget$1 {
2783
2785
  market = this.market(symbol);
2784
2786
  }
2785
2787
  }
2788
+ let response = undefined;
2786
2789
  const request = {};
2787
2790
  let type = undefined;
2788
2791
  [type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
2789
- let response = undefined;
2790
- if (type === 'spot') {
2792
+ // Calls like `.fetchTickers (undefined, {subType:'inverse'})` should be supported for this exchange, so
2793
+ // as "options.defaultSubType" is also set in exchange options, we should consider `params.subType`
2794
+ // with higher priority and only default to spot, if `subType` is not set in params
2795
+ const passedSubType = this.safeString(params, 'subType');
2796
+ let productType = undefined;
2797
+ [productType, params] = this.handleProductTypeAndParams(market, params);
2798
+ // only if passedSubType && productType is undefined, then use spot
2799
+ if (type === 'spot' && passedSubType === undefined) {
2791
2800
  response = await this.publicSpotGetV2SpotMarketTickers(this.extend(request, params));
2792
2801
  }
2793
2802
  else {
2794
- let productType = undefined;
2795
- [productType, params] = this.handleProductTypeAndParams(market, params);
2796
2803
  request['productType'] = productType;
2797
2804
  response = await this.publicMixGetV2MixMarketTickers(this.extend(request, params));
2798
2805
  }
@@ -19,6 +19,7 @@ class bithumb extends bithumb$1 {
19
19
  'name': 'Bithumb',
20
20
  'countries': ['KR'],
21
21
  'rateLimit': 500,
22
+ 'pro': true,
22
23
  'has': {
23
24
  'CORS': true,
24
25
  'spot': true,
@@ -163,7 +163,7 @@ class bitstamp extends bitstamp$1 {
163
163
  'transfer-from-main/': 1,
164
164
  'my_trading_pairs/': 1,
165
165
  'fees/trading/': 1,
166
- 'fees/trading/{pair}': 1,
166
+ 'fees/trading/{market_symbol}': 1,
167
167
  'fees/withdrawal/': 1,
168
168
  'fees/withdrawal/{currency}/': 1,
169
169
  'withdrawal-requests/': 1,
@@ -1163,7 +1163,7 @@ class bitstamp extends bitstamp$1 {
1163
1163
  * @method
1164
1164
  * @name bitstamp#fetchTradingFee
1165
1165
  * @description fetch the trading fees for a market
1166
- * @see https://www.bitstamp.net/api/#tag/Fees/operation/GetAllTradingFees
1166
+ * @see https://www.bitstamp.net/api/#tag/Fees/operation/GetTradingFeesForCurrency
1167
1167
  * @param {string} symbol unified market symbol
1168
1168
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1169
1169
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -1171,21 +1171,35 @@ class bitstamp extends bitstamp$1 {
1171
1171
  await this.loadMarkets();
1172
1172
  const market = this.market(symbol);
1173
1173
  const request = {
1174
- 'pair': market['id'],
1174
+ 'market_symbol': market['id'],
1175
1175
  };
1176
- const response = await this.privatePostBalancePair(this.extend(request, params));
1177
- return this.parseTradingFee(response, market);
1176
+ const response = await this.privatePostFeesTrading(this.extend(request, params));
1177
+ //
1178
+ // [
1179
+ // {
1180
+ // "currency_pair": "btcusd",
1181
+ // "fees":
1182
+ // {
1183
+ // "maker": "0.15000",
1184
+ // "taker": "0.16000"
1185
+ // },
1186
+ // "market": "btcusd"
1187
+ // }
1188
+ // ...
1189
+ // ]
1190
+ //
1191
+ const tradingFeesByMarketId = this.indexBy(response, 'currency_pair');
1192
+ const tradingFee = this.safeDict(tradingFeesByMarketId, market['id']);
1193
+ return this.parseTradingFee(tradingFee, market);
1178
1194
  }
1179
1195
  parseTradingFee(fee, market = undefined) {
1180
- market = this.safeMarket(undefined, market);
1181
- const feeString = this.safeString(fee, market['id'] + '_fee');
1182
- const dividedFeeString = Precise["default"].stringDiv(feeString, '100');
1183
- const tradeFee = this.parseNumber(dividedFeeString);
1196
+ const marketId = this.safeString(fee, 'market');
1197
+ const fees = this.safeDict(fee, 'fees', {});
1184
1198
  return {
1185
1199
  'info': fee,
1186
- 'symbol': market['symbol'],
1187
- 'maker': tradeFee,
1188
- 'taker': tradeFee,
1200
+ 'symbol': this.safeSymbol(marketId, market),
1201
+ 'maker': this.safeNumber(fees, 'maker'),
1202
+ 'taker': this.safeNumber(fees, 'taker'),
1189
1203
  };
1190
1204
  }
1191
1205
  parseTradingFees(fees) {
@@ -1193,8 +1207,7 @@ class bitstamp extends bitstamp$1 {
1193
1207
  const symbols = this.symbols;
1194
1208
  for (let i = 0; i < symbols.length; i++) {
1195
1209
  const symbol = symbols[i];
1196
- const market = this.market(symbol);
1197
- const fee = this.parseTradingFee(fees, market);
1210
+ const fee = this.parseTradingFee(fees[i]);
1198
1211
  result[symbol] = fee;
1199
1212
  }
1200
1213
  return result;
@@ -1209,7 +1222,21 @@ class bitstamp extends bitstamp$1 {
1209
1222
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
1210
1223
  */
1211
1224
  await this.loadMarkets();
1212
- const response = await this.privatePostBalance(params);
1225
+ const response = await this.privatePostFeesTrading(params);
1226
+ //
1227
+ // [
1228
+ // {
1229
+ // "currency_pair": "btcusd",
1230
+ // "fees":
1231
+ // {
1232
+ // "maker": "0.15000",
1233
+ // "taker": "0.16000"
1234
+ // },
1235
+ // "market": "btcusd"
1236
+ // }
1237
+ // ...
1238
+ // ]
1239
+ //
1213
1240
  return this.parseTradingFees(response);
1214
1241
  }
1215
1242
  async fetchTransactionFees(codes = undefined, params = {}) {
@@ -468,7 +468,7 @@ class bybit extends bybit$1 {
468
468
  'v5/account/mmp-modify': 5,
469
469
  'v5/account/mmp-reset': 5,
470
470
  // asset
471
- 'v5/asset/transfer/inter-transfer': 150,
471
+ 'v5/asset/transfer/inter-transfer': 50,
472
472
  'v5/asset/transfer/save-transfer-sub-member': 150,
473
473
  'v5/asset/transfer/universal-transfer': 10,
474
474
  'v5/asset/deposit/deposit-to-account': 5,
@@ -2840,11 +2840,11 @@ class bybit extends bybit$1 {
2840
2840
  request['category'] = 'option';
2841
2841
  }
2842
2842
  else if (market['linear']) {
2843
- // limit: [1, 200]. Default: 25
2843
+ // limit: [1, 500]. Default: 25
2844
2844
  request['category'] = 'linear';
2845
2845
  }
2846
2846
  else if (market['inverse']) {
2847
- // limit: [1, 200]. Default: 25
2847
+ // limit: [1, 500]. Default: 25
2848
2848
  request['category'] = 'inverse';
2849
2849
  }
2850
2850
  }
@@ -3760,8 +3760,7 @@ class coinex extends coinex$1 {
3760
3760
  // }
3761
3761
  //
3762
3762
  const marketId = this.safeString(position, 'market');
3763
- const defaultType = this.safeString(this.options, 'defaultType');
3764
- market = this.safeMarket(marketId, market, undefined, defaultType);
3763
+ market = this.safeMarket(marketId, market, undefined, 'swap');
3765
3764
  const symbol = market['symbol'];
3766
3765
  const positionId = this.safeInteger(position, 'position_id');
3767
3766
  const marginModeInteger = this.safeInteger(position, 'type');
@@ -1337,9 +1337,16 @@ class deribit extends deribit$1 {
1337
1337
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1338
1338
  * @param {int} [limit] the maximum amount of candles to fetch
1339
1339
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1340
+ * @param {boolean} [params.paginate] whether to paginate the results, set to false by default
1341
+ * @param {int} [params.until] the latest time in ms to fetch ohlcv for
1340
1342
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1341
1343
  */
1342
1344
  await this.loadMarkets();
1345
+ let paginate = false;
1346
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
1347
+ if (paginate) {
1348
+ return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 5000);
1349
+ }
1343
1350
  const market = this.market(symbol);
1344
1351
  const request = {
1345
1352
  'instrument_name': market['id'],
@@ -1364,6 +1371,11 @@ class deribit extends deribit$1 {
1364
1371
  request['end_timestamp'] = this.sum(since, limit * duration * 1000);
1365
1372
  }
1366
1373
  }
1374
+ const until = this.safeInteger(params, 'until');
1375
+ if (until !== undefined) {
1376
+ params = this.omit(params, 'until');
1377
+ request['end_timestamp'] = until;
1378
+ }
1367
1379
  const response = await this.publicGetGetTradingviewChartData(this.extend(request, params));
1368
1380
  //
1369
1381
  // {
@@ -1488,6 +1500,7 @@ class deribit extends deribit$1 {
1488
1500
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1489
1501
  * @param {int} [limit] the maximum amount of trades to fetch
1490
1502
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1503
+ * @param {int} [params.until] the latest time in ms to fetch trades for
1491
1504
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1492
1505
  */
1493
1506
  await this.loadMarkets();
@@ -1502,8 +1515,13 @@ class deribit extends deribit$1 {
1502
1515
  if (limit !== undefined) {
1503
1516
  request['count'] = Math.min(limit, 1000); // default 10
1504
1517
  }
1518
+ const until = this.safeInteger2(params, 'until', 'end_timestamp');
1519
+ if (until !== undefined) {
1520
+ params = this.omit(params, ['until']);
1521
+ request['end_timestamp'] = until;
1522
+ }
1505
1523
  let response = undefined;
1506
- if (since === undefined) {
1524
+ if ((since === undefined) && !('end_timestamp' in request)) {
1507
1525
  response = await this.publicGetGetLastTradesByInstrument(this.extend(request, params));
1508
1526
  }
1509
1527
  else {
@@ -248,7 +248,8 @@ class gemini extends gemini$1 {
248
248
  },
249
249
  'broad': {
250
250
  'The Gemini Exchange is currently undergoing maintenance.': errors.OnMaintenance,
251
- 'We are investigating technical issues with the Gemini Exchange.': errors.ExchangeNotAvailable, // We are investigating technical issues with the Gemini Exchange. Please check https://status.gemini.com/ for more information.
251
+ 'We are investigating technical issues with the Gemini Exchange.': errors.ExchangeNotAvailable,
252
+ 'Internal Server Error': errors.ExchangeNotAvailable,
252
253
  },
253
254
  },
254
255
  'options': {
@@ -2199,7 +2199,7 @@ class htx extends htx$1 {
2199
2199
  // "ts":1639547261293
2200
2200
  // }
2201
2201
  //
2202
- // inverse swaps, linear swaps, inverse futures
2202
+ // linear swap, linear future, inverse swap, inverse future
2203
2203
  //
2204
2204
  // {
2205
2205
  // "status":"ok",
@@ -2216,37 +2216,15 @@ class htx extends htx$1 {
2216
2216
  // "high":"0.10725",
2217
2217
  // "amount":"2340267.415144052378486261756692535687481566",
2218
2218
  // "count":882,
2219
- // "vol":"24706"
2219
+ // "vol":"24706",
2220
+ // "trade_turnover":"840726.5048", // only in linear futures
2221
+ // "business_type":"futures", // only in linear futures
2222
+ // "contract_code":"BTC-USDT-CW", // only in linear futures, instead of 'symbol'
2220
2223
  // }
2221
2224
  // ],
2222
2225
  // "ts":1637504679376
2223
2226
  // }
2224
2227
  //
2225
- // linear futures
2226
- //
2227
- // {
2228
- // "status":"ok",
2229
- // "ticks":[
2230
- // {
2231
- // "id":1640745627,
2232
- // "ts":1640745627957,
2233
- // "ask":[48079.1,20],
2234
- // "bid":[47713.8,125],
2235
- // "business_type":"futures",
2236
- // "contract_code":"BTC-USDT-CW",
2237
- // "open":"49011.8",
2238
- // "close":"47934",
2239
- // "low":"47292.3",
2240
- // "high":"49011.8",
2241
- // "amount":"17.398",
2242
- // "count":1515,
2243
- // "vol":"17398",
2244
- // "trade_turnover":"840726.5048"
2245
- // }
2246
- // ],
2247
- // "ts":1640745627988
2248
- // }
2249
- //
2250
2228
  const tickers = this.safeValue2(response, 'data', 'ticks', []);
2251
2229
  const timestamp = this.safeInteger(response, 'ts');
2252
2230
  const result = {};
@@ -1782,7 +1782,7 @@ class hyperliquid extends hyperliquid$1 {
1782
1782
  throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a leverage parameter');
1783
1783
  }
1784
1784
  const asset = this.parseToInt(market['baseId']);
1785
- const isCross = (marginMode === 'isolated');
1785
+ const isCross = (marginMode === 'cross');
1786
1786
  const nonce = this.milliseconds();
1787
1787
  params = this.omit(params, ['leverage']);
1788
1788
  const updateAction = {
@@ -1798,9 +1798,10 @@ class hyperliquid extends hyperliquid$1 {
1798
1798
  vaultAddress = vaultAddress.replace('0x', '');
1799
1799
  }
1800
1800
  }
1801
- const signature = this.signL1Action(updateAction, nonce, vaultAddress);
1801
+ const extendedAction = this.extend(updateAction, params);
1802
+ const signature = this.signL1Action(extendedAction, nonce, vaultAddress);
1802
1803
  const request = {
1803
- 'action': updateAction,
1804
+ 'action': extendedAction,
1804
1805
  'nonce': nonce,
1805
1806
  'signature': signature,
1806
1807
  // 'vaultAddress': vaultAddress,
@@ -1808,7 +1809,7 @@ class hyperliquid extends hyperliquid$1 {
1808
1809
  if (vaultAddress !== undefined) {
1809
1810
  request['vaultAddress'] = vaultAddress;
1810
1811
  }
1811
- const response = await this.privatePostExchange(this.extend(request, params));
1812
+ const response = await this.privatePostExchange(request);
1812
1813
  //
1813
1814
  // {
1814
1815
  // 'response': {
@@ -423,6 +423,7 @@ class kucoin extends kucoin$1 {
423
423
  'Order size below the minimum requirement.': errors.InvalidOrder,
424
424
  'The withdrawal amount is below the minimum requirement.': errors.ExchangeError,
425
425
  'Unsuccessful! Exceeded the max. funds out-transfer limit': errors.InsufficientFunds,
426
+ 'The amount increment is invalid.': errors.BadRequest,
426
427
  '400': errors.BadRequest,
427
428
  '401': errors.AuthenticationError,
428
429
  '403': errors.NotSupported,
@@ -2160,6 +2161,14 @@ class kucoin extends kucoin$1 {
2160
2161
  data = this.safeList(data, 'data', []);
2161
2162
  return this.parseOrders(data);
2162
2163
  }
2164
+ marketOrderAmountToPrecision(symbol, amount) {
2165
+ const market = this.market(symbol);
2166
+ const result = this.decimalToPrecision(amount, number.TRUNCATE, market['info']['quoteIncrement'], this.precisionMode, this.paddingMode);
2167
+ if (result === '0') {
2168
+ throw new errors.InvalidOrder(this.id + ' amount of ' + market['symbol'] + ' must be greater than minimum amount precision of ' + this.numberToString(market['precision']['amount']));
2169
+ }
2170
+ return result;
2171
+ }
2163
2172
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
2164
2173
  const market = this.market(symbol);
2165
2174
  // required param, cannot be used twice
@@ -2180,7 +2189,7 @@ class kucoin extends kucoin$1 {
2180
2189
  if (quoteAmount !== undefined) {
2181
2190
  params = this.omit(params, ['cost', 'funds']);
2182
2191
  // kucoin uses base precision even for quote values
2183
- costString = this.amountToPrecision(symbol, quoteAmount);
2192
+ costString = this.marketOrderAmountToPrecision(symbol, quoteAmount);
2184
2193
  request['funds'] = costString;
2185
2194
  }
2186
2195
  else {
@@ -82,7 +82,7 @@ class kucoinfutures extends kucoinfutures$1 {
82
82
  'fetchPremiumIndexOHLCV': false,
83
83
  'fetchStatus': true,
84
84
  'fetchTicker': true,
85
- 'fetchTickers': false,
85
+ 'fetchTickers': true,
86
86
  'fetchTime': true,
87
87
  'fetchTrades': true,
88
88
  'fetchTransactionFee': false,
@@ -753,6 +753,85 @@ class kucoinfutures extends kucoinfutures$1 {
753
753
  //
754
754
  return this.parseTicker(response['data'], market);
755
755
  }
756
+ async fetchTickers(symbols = undefined, params = {}) {
757
+ /**
758
+ * @method
759
+ * @name kucoinfutures#fetchTickers
760
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
761
+ * @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
762
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
763
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
764
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
765
+ */
766
+ await this.loadMarkets();
767
+ symbols = this.marketSymbols(symbols);
768
+ const response = await this.futuresPublicGetContractsActive(params);
769
+ //
770
+ // {
771
+ // "code": "200000",
772
+ // "data": {
773
+ // "symbol": "ETHUSDTM",
774
+ // "rootSymbol": "USDT",
775
+ // "type": "FFWCSX",
776
+ // "firstOpenDate": 1591086000000,
777
+ // "expireDate": null,
778
+ // "settleDate": null,
779
+ // "baseCurrency": "ETH",
780
+ // "quoteCurrency": "USDT",
781
+ // "settleCurrency": "USDT",
782
+ // "maxOrderQty": 1000000,
783
+ // "maxPrice": 1000000.0000000000,
784
+ // "lotSize": 1,
785
+ // "tickSize": 0.05,
786
+ // "indexPriceTickSize": 0.01,
787
+ // "multiplier": 0.01,
788
+ // "initialMargin": 0.01,
789
+ // "maintainMargin": 0.005,
790
+ // "maxRiskLimit": 1000000,
791
+ // "minRiskLimit": 1000000,
792
+ // "riskStep": 500000,
793
+ // "makerFeeRate": 0.00020,
794
+ // "takerFeeRate": 0.00060,
795
+ // "takerFixFee": 0.0000000000,
796
+ // "makerFixFee": 0.0000000000,
797
+ // "settlementFee": null,
798
+ // "isDeleverage": true,
799
+ // "isQuanto": true,
800
+ // "isInverse": false,
801
+ // "markMethod": "FairPrice",
802
+ // "fairMethod": "FundingRate",
803
+ // "fundingBaseSymbol": ".ETHINT8H",
804
+ // "fundingQuoteSymbol": ".USDTINT8H",
805
+ // "fundingRateSymbol": ".ETHUSDTMFPI8H",
806
+ // "indexSymbol": ".KETHUSDT",
807
+ // "settlementSymbol": "",
808
+ // "status": "Open",
809
+ // "fundingFeeRate": 0.000535,
810
+ // "predictedFundingFeeRate": 0.002197,
811
+ // "openInterest": "8724443",
812
+ // "turnoverOf24h": 341156641.03354263,
813
+ // "volumeOf24h": 74833.54000000,
814
+ // "markPrice": 4534.07,
815
+ // "indexPrice":4531.92,
816
+ // "lastTradePrice": 4545.4500000000,
817
+ // "nextFundingRateTime": 25481884,
818
+ // "maxLeverage": 100,
819
+ // "sourceExchanges": [ "huobi", "Okex", "Binance", "Kucoin", "Poloniex", "Hitbtc" ],
820
+ // "premiumsSymbol1M": ".ETHUSDTMPI",
821
+ // "premiumsSymbol8H": ".ETHUSDTMPI8H",
822
+ // "fundingBaseSymbol1M": ".ETHINT",
823
+ // "fundingQuoteSymbol1M": ".USDTINT",
824
+ // "lowPrice": 4456.90,
825
+ // "highPrice": 4674.25,
826
+ // "priceChgPct": 0.0046,
827
+ // "priceChg": 21.15
828
+ // }
829
+ // }
830
+ //
831
+ const data = this.safeList(response, 'data', []);
832
+ const tickers = this.parseTickers(data, symbols);
833
+ return this.filterByArrayTickers(tickers, 'symbol', symbols);
834
+ }
756
835
  parseTicker(ticker, market = undefined) {
757
836
  //
758
837
  // {
@@ -772,16 +851,76 @@ class kucoinfutures extends kucoinfutures$1 {
772
851
  // }
773
852
  // }
774
853
  //
775
- const last = this.safeString(ticker, 'price');
854
+ // from fetchTickers
855
+ //
856
+ // {
857
+ // symbol: "XBTUSDTM",
858
+ // rootSymbol: "USDT",
859
+ // type: "FFWCSX",
860
+ // firstOpenDate: 1585555200000,
861
+ // expireDate: null,
862
+ // settleDate: null,
863
+ // baseCurrency: "XBT",
864
+ // quoteCurrency: "USDT",
865
+ // settleCurrency: "USDT",
866
+ // maxOrderQty: 1000000,
867
+ // maxPrice: 1000000,
868
+ // lotSize: 1,
869
+ // tickSize: 0.1,
870
+ // indexPriceTickSize: 0.01,
871
+ // multiplier: 0.001,
872
+ // initialMargin: 0.008,
873
+ // maintainMargin: 0.004,
874
+ // maxRiskLimit: 100000,
875
+ // minRiskLimit: 100000,
876
+ // riskStep: 50000,
877
+ // makerFeeRate: 0.0002,
878
+ // takerFeeRate: 0.0006,
879
+ // takerFixFee: 0,
880
+ // makerFixFee: 0,
881
+ // settlementFee: null,
882
+ // isDeleverage: true,
883
+ // isQuanto: true,
884
+ // isInverse: false,
885
+ // markMethod: "FairPrice",
886
+ // fairMethod: "FundingRate",
887
+ // fundingBaseSymbol: ".XBTINT8H",
888
+ // fundingQuoteSymbol: ".USDTINT8H",
889
+ // fundingRateSymbol: ".XBTUSDTMFPI8H",
890
+ // indexSymbol: ".KXBTUSDT",
891
+ // settlementSymbol: "",
892
+ // status: "Open",
893
+ // fundingFeeRate: 0.000297,
894
+ // predictedFundingFeeRate: 0.000327,
895
+ // fundingRateGranularity: 28800000,
896
+ // openInterest: "8033200",
897
+ // turnoverOf24h: 659795309.2524643,
898
+ // volumeOf24h: 9998.54,
899
+ // markPrice: 67193.51,
900
+ // indexPrice: 67184.81,
901
+ // lastTradePrice: 67191.8,
902
+ // nextFundingRateTime: 20022985,
903
+ // maxLeverage: 125,
904
+ // premiumsSymbol1M: ".XBTUSDTMPI",
905
+ // premiumsSymbol8H: ".XBTUSDTMPI8H",
906
+ // fundingBaseSymbol1M: ".XBTINT",
907
+ // fundingQuoteSymbol1M: ".USDTINT",
908
+ // lowPrice: 64041.6,
909
+ // highPrice: 67737.3,
910
+ // priceChgPct: 0.0447,
911
+ // priceChg: 2878.7
912
+ // }
913
+ //
776
914
  const marketId = this.safeString(ticker, 'symbol');
777
915
  market = this.safeMarket(marketId, market, '-');
916
+ const last = this.safeString2(ticker, 'price', 'lastTradePrice');
778
917
  const timestamp = this.safeIntegerProduct(ticker, 'ts', 0.000001);
779
918
  return this.safeTicker({
780
919
  'symbol': market['symbol'],
781
920
  'timestamp': timestamp,
782
921
  'datetime': this.iso8601(timestamp),
783
- 'high': undefined,
784
- 'low': undefined,
922
+ 'high': this.safeString(ticker, 'highPrice'),
923
+ 'low': this.safeString(ticker, 'lowPrice'),
785
924
  'bid': this.safeString(ticker, 'bestBidPrice'),
786
925
  'bidVolume': this.safeString(ticker, 'bestBidSize'),
787
926
  'ask': this.safeString(ticker, 'bestAskPrice'),
@@ -791,11 +930,11 @@ class kucoinfutures extends kucoinfutures$1 {
791
930
  'close': last,
792
931
  'last': last,
793
932
  'previousClose': undefined,
794
- 'change': undefined,
795
- 'percentage': undefined,
933
+ 'change': this.safeString(ticker, 'priceChg'),
934
+ 'percentage': this.safeString(ticker, 'priceChgPct'),
796
935
  'average': undefined,
797
- 'baseVolume': undefined,
798
- 'quoteVolume': undefined,
936
+ 'baseVolume': this.safeString(ticker, 'volumeOf24h'),
937
+ 'quoteVolume': this.safeString(ticker, 'turnoverOf24h'),
799
938
  'info': ticker,
800
939
  }, market);
801
940
  }