ccxt 4.4.41 → 4.4.42

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 (170) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +1 -1
  5. package/dist/cjs/src/alpaca.js +0 -1
  6. package/dist/cjs/src/ascendex.js +0 -1
  7. package/dist/cjs/src/base/Exchange.js +21 -16
  8. package/dist/cjs/src/bigone.js +0 -1
  9. package/dist/cjs/src/binance.js +3 -0
  10. package/dist/cjs/src/bingx.js +3 -0
  11. package/dist/cjs/src/bitfinex.js +123 -0
  12. package/dist/cjs/src/blofin.js +16 -7
  13. package/dist/cjs/src/cex.js +1 -1
  14. package/dist/cjs/src/coinbase.js +8 -9
  15. package/dist/cjs/src/coinbaseexchange.js +5 -6
  16. package/dist/cjs/src/coinbaseinternational.js +7 -8
  17. package/dist/cjs/src/coincatch.js +0 -1
  18. package/dist/cjs/src/coincheck.js +0 -1
  19. package/dist/cjs/src/coinex.js +91 -6
  20. package/dist/cjs/src/coinlist.js +3 -4
  21. package/dist/cjs/src/coinmate.js +1 -3
  22. package/dist/cjs/src/coinmetro.js +4 -5
  23. package/dist/cjs/src/coinone.js +0 -1
  24. package/dist/cjs/src/coinsph.js +7 -8
  25. package/dist/cjs/src/cryptocom.js +3 -0
  26. package/dist/cjs/src/currencycom.js +3 -4
  27. package/dist/cjs/src/defx.js +6 -7
  28. package/dist/cjs/src/deribit.js +1 -3
  29. package/dist/cjs/src/digifinex.js +0 -1
  30. package/dist/cjs/src/ellipx.js +0 -2
  31. package/dist/cjs/src/exmo.js +1 -2
  32. package/dist/cjs/src/gate.js +1 -2
  33. package/dist/cjs/src/gemini.js +4 -5
  34. package/dist/cjs/src/hashkey.js +79 -83
  35. package/dist/cjs/src/hitbtc.js +49 -5
  36. package/dist/cjs/src/hollaex.js +4 -6
  37. package/dist/cjs/src/htx.js +1 -3
  38. package/dist/cjs/src/huobijp.js +0 -1
  39. package/dist/cjs/src/idex.js +8 -8
  40. package/dist/cjs/src/independentreserve.js +0 -1
  41. package/dist/cjs/src/indodax.js +0 -1
  42. package/dist/cjs/src/kraken.js +63 -3
  43. package/dist/cjs/src/krakenfutures.js +75 -3
  44. package/dist/cjs/src/kucoin.js +1 -3
  45. package/dist/cjs/src/kucoinfutures.js +10 -9
  46. package/dist/cjs/src/kuna.js +1 -3
  47. package/dist/cjs/src/latoken.js +1 -3
  48. package/dist/cjs/src/lbank.js +0 -1
  49. package/dist/cjs/src/luno.js +0 -1
  50. package/dist/cjs/src/lykke.js +0 -1
  51. package/dist/cjs/src/mercado.js +0 -1
  52. package/dist/cjs/src/mexc.js +3 -4
  53. package/dist/cjs/src/ndax.js +1 -1
  54. package/dist/cjs/src/novadax.js +4 -6
  55. package/dist/cjs/src/oceanex.js +0 -1
  56. package/dist/cjs/src/okcoin.js +1 -3
  57. package/dist/cjs/src/okx.js +1 -3
  58. package/dist/cjs/src/onetrading.js +1 -3
  59. package/dist/cjs/src/p2b.js +1 -1
  60. package/dist/cjs/src/paradex.js +5 -7
  61. package/dist/cjs/src/phemex.js +8 -10
  62. package/dist/cjs/src/poloniex.js +1 -3
  63. package/dist/cjs/src/poloniexfutures.js +6 -6
  64. package/dist/cjs/src/probit.js +0 -1
  65. package/dist/cjs/src/timex.js +0 -1
  66. package/dist/cjs/src/tokocrypto.js +11 -14
  67. package/dist/cjs/src/tradeogre.js +1 -1
  68. package/dist/cjs/src/upbit.js +0 -1
  69. package/dist/cjs/src/wavesexchange.js +4 -5
  70. package/dist/cjs/src/whitebit.js +8 -9
  71. package/dist/cjs/src/woo.js +99 -13
  72. package/dist/cjs/src/woofipro.js +96 -15
  73. package/dist/cjs/src/xt.js +3 -2
  74. package/dist/cjs/src/yobit.js +0 -1
  75. package/dist/cjs/src/zaif.js +0 -1
  76. package/dist/cjs/src/zonda.js +1 -2
  77. package/js/ccxt.d.ts +1 -1
  78. package/js/ccxt.js +1 -1
  79. package/js/src/abstract/binance.d.ts +3 -0
  80. package/js/src/abstract/binancecoinm.d.ts +3 -0
  81. package/js/src/abstract/binanceus.d.ts +3 -0
  82. package/js/src/abstract/binanceusdm.d.ts +3 -0
  83. package/js/src/ace.js +1 -1
  84. package/js/src/alpaca.js +0 -1
  85. package/js/src/ascendex.js +0 -1
  86. package/js/src/base/Exchange.d.ts +6 -6
  87. package/js/src/base/Exchange.js +21 -16
  88. package/js/src/bigone.js +0 -1
  89. package/js/src/binance.js +3 -0
  90. package/js/src/bingx.js +3 -0
  91. package/js/src/bitfinex.d.ts +11 -1
  92. package/js/src/bitfinex.js +123 -0
  93. package/js/src/blofin.d.ts +1 -1
  94. package/js/src/blofin.js +16 -7
  95. package/js/src/cex.js +1 -1
  96. package/js/src/coinbase.js +8 -9
  97. package/js/src/coinbaseexchange.js +5 -6
  98. package/js/src/coinbaseinternational.d.ts +1 -1
  99. package/js/src/coinbaseinternational.js +7 -8
  100. package/js/src/coincatch.js +0 -1
  101. package/js/src/coincheck.js +0 -1
  102. package/js/src/coinex.js +91 -6
  103. package/js/src/coinlist.js +3 -4
  104. package/js/src/coinmate.js +1 -3
  105. package/js/src/coinmetro.js +4 -5
  106. package/js/src/coinone.js +0 -1
  107. package/js/src/coinsph.js +7 -8
  108. package/js/src/cryptocom.js +3 -0
  109. package/js/src/currencycom.js +3 -4
  110. package/js/src/defx.js +6 -7
  111. package/js/src/deribit.js +1 -3
  112. package/js/src/digifinex.js +0 -1
  113. package/js/src/ellipx.js +0 -2
  114. package/js/src/exmo.d.ts +1 -1
  115. package/js/src/exmo.js +1 -2
  116. package/js/src/gate.d.ts +1 -1
  117. package/js/src/gate.js +1 -2
  118. package/js/src/gemini.js +4 -5
  119. package/js/src/hashkey.js +79 -83
  120. package/js/src/hitbtc.d.ts +11 -1
  121. package/js/src/hitbtc.js +49 -5
  122. package/js/src/hollaex.js +4 -6
  123. package/js/src/htx.js +1 -3
  124. package/js/src/huobijp.js +0 -1
  125. package/js/src/idex.js +8 -8
  126. package/js/src/independentreserve.js +0 -1
  127. package/js/src/indodax.js +0 -1
  128. package/js/src/kraken.d.ts +2 -2
  129. package/js/src/kraken.js +63 -3
  130. package/js/src/krakenfutures.d.ts +2 -2
  131. package/js/src/krakenfutures.js +75 -3
  132. package/js/src/kucoin.js +1 -3
  133. package/js/src/kucoinfutures.d.ts +5 -4
  134. package/js/src/kucoinfutures.js +10 -9
  135. package/js/src/kuna.js +1 -3
  136. package/js/src/latoken.js +1 -3
  137. package/js/src/lbank.js +0 -1
  138. package/js/src/luno.js +0 -1
  139. package/js/src/lykke.js +0 -1
  140. package/js/src/mercado.js +0 -1
  141. package/js/src/mexc.js +3 -4
  142. package/js/src/ndax.js +1 -1
  143. package/js/src/novadax.js +4 -6
  144. package/js/src/oceanex.js +0 -1
  145. package/js/src/okcoin.js +1 -3
  146. package/js/src/okx.js +1 -3
  147. package/js/src/onetrading.js +1 -3
  148. package/js/src/p2b.js +1 -1
  149. package/js/src/paradex.d.ts +1 -1
  150. package/js/src/paradex.js +5 -7
  151. package/js/src/phemex.js +8 -10
  152. package/js/src/poloniex.js +1 -3
  153. package/js/src/poloniexfutures.js +6 -6
  154. package/js/src/probit.js +0 -1
  155. package/js/src/timex.js +0 -1
  156. package/js/src/tokocrypto.js +11 -14
  157. package/js/src/tradeogre.js +1 -1
  158. package/js/src/upbit.js +0 -1
  159. package/js/src/wavesexchange.d.ts +1 -1
  160. package/js/src/wavesexchange.js +4 -5
  161. package/js/src/whitebit.js +8 -9
  162. package/js/src/woo.d.ts +1 -1
  163. package/js/src/woo.js +99 -13
  164. package/js/src/woofipro.js +96 -15
  165. package/js/src/xt.d.ts +2 -1
  166. package/js/src/xt.js +3 -2
  167. package/js/src/yobit.js +0 -1
  168. package/js/src/zaif.js +0 -1
  169. package/js/src/zonda.js +1 -2
  170. package/package.json +1 -1
@@ -336,6 +336,84 @@ class hashkey extends hashkey$1 {
336
336
  },
337
337
  'defaultNetwork': 'ERC20',
338
338
  },
339
+ 'features': {
340
+ 'default': {
341
+ 'sandbox': true,
342
+ 'createOrder': {
343
+ 'marginMode': false,
344
+ 'triggerPrice': false,
345
+ 'triggerPriceType': undefined,
346
+ 'triggerDirection': false,
347
+ 'stopLossPrice': false,
348
+ 'takeProfitPrice': false,
349
+ 'attachedStopLossTakeProfit': undefined,
350
+ 'timeInForce': {
351
+ 'IOC': true,
352
+ 'FOK': true,
353
+ 'PO': true,
354
+ 'GTD': false,
355
+ },
356
+ 'hedged': false,
357
+ 'trailing': false,
358
+ // exchange-supported features
359
+ // 'marketBuyRequiresPrice': false,
360
+ // 'marketBuyByCost': false,
361
+ // 'selfTradePrevention': true,
362
+ // 'twap': false,
363
+ // 'iceberg': false,
364
+ // 'oco': false,
365
+ },
366
+ 'createOrders': {
367
+ 'max': 20,
368
+ },
369
+ 'fetchMyTrades': {
370
+ 'marginMode': false,
371
+ 'limit': 1000,
372
+ 'daysBack': 30,
373
+ 'untilDays': 30,
374
+ },
375
+ 'fetchOrder': {
376
+ 'marginMode': false,
377
+ 'trigger': false,
378
+ 'trailing': false,
379
+ },
380
+ 'fetchOpenOrders': {
381
+ 'marginMode': false,
382
+ 'limit': 1000,
383
+ 'trigger': false,
384
+ 'trailing': false,
385
+ },
386
+ 'fetchOrders': undefined,
387
+ 'fetchClosedOrders': undefined,
388
+ 'fetchOHLCV': {
389
+ 'limit': 1000,
390
+ },
391
+ },
392
+ 'spot': {
393
+ 'extends': 'default',
394
+ },
395
+ 'forDerivatives': {
396
+ 'extends': 'default',
397
+ 'createOrder': {
398
+ 'triggerPrice': true,
399
+ 'selfTradePrevention': true,
400
+ },
401
+ 'fetchOpenOrders': {
402
+ 'trigger': true,
403
+ 'limit': 500,
404
+ },
405
+ },
406
+ 'swap': {
407
+ 'linear': {
408
+ 'extends': 'forDerivatives',
409
+ },
410
+ 'inverse': undefined,
411
+ },
412
+ 'future': {
413
+ 'linear': undefined,
414
+ 'inverse': undefined,
415
+ },
416
+ },
339
417
  'commonCurrencies': {},
340
418
  'exceptions': {
341
419
  'exact': {
@@ -557,12 +635,7 @@ class hashkey extends hashkey$1 {
557
635
  * @returns {object[]} an array of objects representing market data
558
636
  */
559
637
  async fetchMarkets(params = {}) {
560
- let symbol = undefined;
561
638
  const request = {};
562
- [symbol, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'symbol');
563
- if (symbol !== undefined) {
564
- request['symbol'] = symbol;
565
- }
566
639
  const response = await this.publicGetApiV1ExchangeInfo(this.extend(request, params));
567
640
  //
568
641
  // {
@@ -1247,11 +1320,6 @@ class hashkey extends hashkey$1 {
1247
1320
  if (market !== undefined) {
1248
1321
  request['symbol'] = market['id'];
1249
1322
  }
1250
- let clientOrderId = undefined;
1251
- [clientOrderId, params] = this.handleOptionAndParams(params, methodName, 'clientOrderId');
1252
- if (clientOrderId !== undefined) {
1253
- request['clientOrderId'] = clientOrderId;
1254
- }
1255
1323
  if (accountId !== undefined) {
1256
1324
  request['accountId'] = accountId;
1257
1325
  }
@@ -1611,11 +1679,6 @@ class hashkey extends hashkey$1 {
1611
1679
  await this.loadMarkets();
1612
1680
  symbols = this.marketSymbols(symbols);
1613
1681
  const request = {};
1614
- let symbol = undefined;
1615
- [symbol, params] = this.handleOptionAndParams(params, 'fetchLastPrices', 'symbol');
1616
- if (symbol !== undefined) {
1617
- request['symbol'] = symbol;
1618
- }
1619
1682
  const response = await this.publicGetQuoteV1TickerPrice(this.extend(request, params));
1620
1683
  //
1621
1684
  // [
@@ -1674,11 +1737,6 @@ class hashkey extends hashkey$1 {
1674
1737
  return this.parseSwapBalance(balance);
1675
1738
  }
1676
1739
  else if (marketType === 'spot') {
1677
- let accountId = undefined;
1678
- [accountId, params] = this.handleOptionAndParams(params, methodName, 'accountId');
1679
- if (accountId !== undefined) {
1680
- request['accountId'] = accountId;
1681
- }
1682
1740
  const response = await this.privateGetApiV1Account(this.extend(request, params));
1683
1741
  //
1684
1742
  // {
@@ -1958,21 +2016,11 @@ class hashkey extends hashkey$1 {
1958
2016
  if (tag !== undefined) {
1959
2017
  request['addressExt'] = tag;
1960
2018
  }
1961
- let clientOrderId = undefined;
1962
- [clientOrderId, params] = this.handleOptionAndParams(params, 'withdraw', 'clientOrderId');
1963
- if (clientOrderId !== undefined) {
1964
- request['clientOrderId'] = clientOrderId;
1965
- }
1966
2019
  let networkCode = undefined;
1967
2020
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
1968
2021
  if (networkCode !== undefined) {
1969
2022
  request['chainType'] = this.networkCodeToId(networkCode);
1970
2023
  }
1971
- let platform = undefined;
1972
- [platform, params] = this.handleOptionAndParams(params, 'withdraw', 'platform');
1973
- if (platform !== undefined) {
1974
- request['platform'] = platform;
1975
- }
1976
2024
  const response = await this.privatePostApiV1AccountWithdraw(this.extend(request, params));
1977
2025
  //
1978
2026
  // {
@@ -2116,16 +2164,6 @@ class hashkey extends hashkey$1 {
2116
2164
  'fromAccountId': fromAccount,
2117
2165
  'toAccountId': toAccount,
2118
2166
  };
2119
- let clientOrderId = undefined;
2120
- [clientOrderId, params] = this.handleOptionAndParams(params, 'transfer', 'clientOrderId');
2121
- if (clientOrderId !== undefined) {
2122
- request['clientOrderId'] = clientOrderId;
2123
- }
2124
- let remark = undefined;
2125
- [remark, params] = this.handleOptionAndParams(params, 'transfer', 'remark');
2126
- if (remark !== undefined) {
2127
- request['remark'] = remark;
2128
- }
2129
2167
  const response = await this.privatePostApiV1AccountAssetTransfer(this.extend(request, params));
2130
2168
  //
2131
2169
  // {
@@ -3028,11 +3066,6 @@ class hashkey extends hashkey$1 {
3028
3066
  if (clientOrderId !== undefined) {
3029
3067
  request['origClientOrderId'] = clientOrderId;
3030
3068
  }
3031
- let accountId = undefined;
3032
- [accountId, params] = this.handleOptionAndParams(params, methodName, 'accountId');
3033
- if (accountId !== undefined) {
3034
- request['accountId'] = accountId;
3035
- }
3036
3069
  response = await this.privateGetApiV1SpotOrder(this.extend(request, params));
3037
3070
  //
3038
3071
  // {
@@ -3179,16 +3212,6 @@ class hashkey extends hashkey$1 {
3179
3212
  if (limit !== undefined) {
3180
3213
  request['limit'] = limit;
3181
3214
  }
3182
- let orderId = undefined;
3183
- [orderId, params] = this.handleOptionAndParams(params, methodName, 'orderId');
3184
- if (orderId !== undefined) {
3185
- request['orderId'] = orderId;
3186
- }
3187
- let side = undefined;
3188
- [side, params] = this.handleOptionAndParams(params, methodName, 'side');
3189
- if (side !== undefined) {
3190
- request['side'] = side.toUpperCase();
3191
- }
3192
3215
  response = await this.privateGetApiV1SpotOpenOrders(this.extend(request, params));
3193
3216
  //
3194
3217
  // [
@@ -3259,11 +3282,6 @@ class hashkey extends hashkey$1 {
3259
3282
  if (limit !== undefined) {
3260
3283
  request['limit'] = limit;
3261
3284
  }
3262
- let fromOrderId = undefined;
3263
- [fromOrderId, params] = this.handleOptionAndParams(params, methodName, 'fromOrderId');
3264
- if (fromOrderId !== undefined) {
3265
- request['fromOrderId'] = fromOrderId;
3266
- }
3267
3285
  let response = undefined;
3268
3286
  let accountId = undefined;
3269
3287
  [accountId, params] = this.handleOptionAndParams(params, methodName, 'accountId');
@@ -3369,16 +3387,6 @@ class hashkey extends hashkey$1 {
3369
3387
  if (market !== undefined) {
3370
3388
  request['symbol'] = market['id'];
3371
3389
  }
3372
- let orderId = undefined;
3373
- [orderId, params] = this.handleOptionAndParams(params, methodName, 'orderId');
3374
- if (orderId !== undefined) {
3375
- request['orderId'] = orderId;
3376
- }
3377
- let side = undefined;
3378
- [side, params] = this.handleOptionAndParams(params, methodName, 'side');
3379
- if (side !== undefined) {
3380
- request['side'] = side.toUpperCase();
3381
- }
3382
3390
  if (accountId !== undefined) {
3383
3391
  request['accountId'] = accountId;
3384
3392
  }
@@ -3426,11 +3434,6 @@ class hashkey extends hashkey$1 {
3426
3434
  else {
3427
3435
  request['type'] = 'LIMIT';
3428
3436
  }
3429
- let fromOrderId = undefined;
3430
- [fromOrderId, params] = this.handleOptionAndParams(params, methodName, 'fromOrderId');
3431
- if (fromOrderId !== undefined) {
3432
- request['fromOrderId'] = fromOrderId;
3433
- }
3434
3437
  if (accountId !== undefined) {
3435
3438
  request['subAccountId'] = accountId;
3436
3439
  response = await this.privateGetApiV1FuturesSubAccountHistoryOrders(this.extend(request, params));
@@ -3625,7 +3628,6 @@ class hashkey extends hashkey$1 {
3625
3628
  if (feeCurrncyId === '') {
3626
3629
  feeCurrncyId = undefined;
3627
3630
  }
3628
- const triggerPrice = this.omitZero(this.safeString(order, 'stopPrice'));
3629
3631
  return this.safeOrder({
3630
3632
  'id': this.safeString(order, 'orderId'),
3631
3633
  'clientOrderId': this.safeString(order, 'clientOrderId'),
@@ -3643,8 +3645,7 @@ class hashkey extends hashkey$1 {
3643
3645
  'amount': this.omitZero(this.safeString(order, 'origQty')),
3644
3646
  'filled': this.safeString(order, 'executedQty'),
3645
3647
  'remaining': undefined,
3646
- 'stopPrice': triggerPrice,
3647
- 'triggerPrice': triggerPrice,
3648
+ 'triggerPrice': this.omitZero(this.safeString(order, 'stopPrice')),
3648
3649
  'takeProfitPrice': undefined,
3649
3650
  'stopLossPrice': undefined,
3650
3651
  'cost': this.omitZero(this.safeString2(order, 'cumulativeQuoteQty', 'cummulativeQuoteQty')),
@@ -3890,11 +3891,6 @@ class hashkey extends hashkey$1 {
3890
3891
  const request = {
3891
3892
  'symbol': market['id'],
3892
3893
  };
3893
- let side = undefined;
3894
- [side, params] = this.handleOptionAndParams(params, methodName, 'side');
3895
- if (side !== undefined) {
3896
- request['side'] = side.toUpperCase();
3897
- }
3898
3894
  const response = await this.privateGetApiV1FuturesPositions(this.extend(request, params));
3899
3895
  //
3900
3896
  // [
@@ -75,6 +75,7 @@ class hitbtc extends hitbtc$1 {
75
75
  'fetchOHLCV': true,
76
76
  'fetchOpenInterest': true,
77
77
  'fetchOpenInterestHistory': false,
78
+ 'fetchOpenInterests': true,
78
79
  'fetchOpenOrder': true,
79
80
  'fetchOpenOrders': true,
80
81
  'fetchOrder': true,
@@ -2374,7 +2375,7 @@ class hitbtc extends hitbtc$1 {
2374
2375
  }
2375
2376
  }
2376
2377
  else if ((type === 'stopLimit') || (type === 'stopMarket') || (type === 'takeProfitLimit') || (type === 'takeProfitMarket')) {
2377
- throw new errors.ExchangeError(this.id + ' createOrder() requires a stopPrice parameter for stop-loss and take-profit orders');
2378
+ throw new errors.ExchangeError(this.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders');
2378
2379
  }
2379
2380
  params = this.omit(params, ['triggerPrice', 'timeInForce', 'stopPrice', 'stop_price', 'reduceOnly', 'postOnly']);
2380
2381
  if (marketType === 'swap') {
@@ -2487,7 +2488,6 @@ class hitbtc extends hitbtc$1 {
2487
2488
  const postOnly = this.safeValue(order, 'post_only');
2488
2489
  const timeInForce = this.safeString(order, 'time_in_force');
2489
2490
  const rawTrades = this.safeValue(order, 'trades');
2490
- const stopPrice = this.safeString(order, 'stop_price');
2491
2491
  return this.safeOrder({
2492
2492
  'info': order,
2493
2493
  'id': id,
@@ -2511,8 +2511,7 @@ class hitbtc extends hitbtc$1 {
2511
2511
  'average': average,
2512
2512
  'trades': rawTrades,
2513
2513
  'fee': undefined,
2514
- 'stopPrice': stopPrice,
2515
- 'triggerPrice': stopPrice,
2514
+ 'triggerPrice': this.safeString(order, 'stop_price'),
2516
2515
  'takeProfitPrice': undefined,
2517
2516
  'stopLossPrice': undefined,
2518
2517
  }, market);
@@ -3113,7 +3112,7 @@ class hitbtc extends hitbtc$1 {
3113
3112
  const datetime = this.safeString(interest, 'timestamp');
3114
3113
  const value = this.safeNumber(interest, 'open_interest');
3115
3114
  return this.safeOpenInterest({
3116
- 'symbol': market['symbol'],
3115
+ 'symbol': this.safeSymbol(undefined, market),
3117
3116
  'openInterestAmount': undefined,
3118
3117
  'openInterestValue': value,
3119
3118
  'timestamp': this.parse8601(datetime),
@@ -3121,6 +3120,51 @@ class hitbtc extends hitbtc$1 {
3121
3120
  'info': interest,
3122
3121
  }, market);
3123
3122
  }
3123
+ /**
3124
+ * @method
3125
+ * @name hitbtc#fetchOpenInterests
3126
+ * @description Retrieves the open interest for a list of symbols
3127
+ * @see https://api.hitbtc.com/#futures-info
3128
+ * @param {string[]} [symbols] a list of unified CCXT market symbols
3129
+ * @param {object} [params] exchange specific parameters
3130
+ * @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
3131
+ */
3132
+ async fetchOpenInterests(symbols = undefined, params = {}) {
3133
+ await this.loadMarkets();
3134
+ const request = {};
3135
+ symbols = this.marketSymbols(symbols);
3136
+ let marketIds = undefined;
3137
+ if (symbols !== undefined) {
3138
+ marketIds = this.marketIds(symbols);
3139
+ request['symbols'] = marketIds.join(',');
3140
+ }
3141
+ const response = await this.publicGetPublicFuturesInfo(this.extend(request, params));
3142
+ //
3143
+ // {
3144
+ // "BTCUSDT_PERP": {
3145
+ // "contract_type": "perpetual",
3146
+ // "mark_price": "97291.83",
3147
+ // "index_price": "97298.61",
3148
+ // "funding_rate": "-0.000183473092423284",
3149
+ // "open_interest": "94.1503",
3150
+ // "next_funding_time": "2024-12-20T08:00:00.000Z",
3151
+ // "indicative_funding_rate": "-0.00027495203277752",
3152
+ // "premium_index": "-0.000789474900583786",
3153
+ // "avg_premium_index": "-0.000683473092423284",
3154
+ // "interest_rate": "0.0001",
3155
+ // "timestamp": "2024-12-20T04:57:33.693Z"
3156
+ // }
3157
+ // }
3158
+ //
3159
+ const results = [];
3160
+ const markets = Object.keys(response);
3161
+ for (let i = 0; i < markets.length; i++) {
3162
+ const marketId = markets[i];
3163
+ const marketInner = this.safeMarket(marketId);
3164
+ results.push(this.parseOpenInterest(response[marketId], marketInner));
3165
+ }
3166
+ return this.filterByArray(results, 'symbol', symbols);
3167
+ }
3124
3168
  /**
3125
3169
  * @method
3126
3170
  * @name hitbtc#fetchOpenInterest
@@ -1106,7 +1106,6 @@ class hollaex extends hollaex$1 {
1106
1106
  const type = this.safeString(order, 'type');
1107
1107
  const side = this.safeString(order, 'side');
1108
1108
  const price = this.safeString(order, 'price');
1109
- const stopPrice = this.safeString(order, 'stop');
1110
1109
  const amount = this.safeString(order, 'size');
1111
1110
  const filled = this.safeString(order, 'filled');
1112
1111
  const status = this.parseOrderStatus(this.safeString(order, 'status'));
@@ -1125,8 +1124,7 @@ class hollaex extends hollaex$1 {
1125
1124
  'postOnly': postOnly,
1126
1125
  'side': side,
1127
1126
  'price': price,
1128
- 'stopPrice': stopPrice,
1129
- 'triggerPrice': stopPrice,
1127
+ 'triggerPrice': this.safeString(order, 'stop'),
1130
1128
  'amount': amount,
1131
1129
  'filled': filled,
1132
1130
  'remaining': undefined,
@@ -1164,7 +1162,7 @@ class hollaex extends hollaex$1 {
1164
1162
  // 'stop': parseFloat (this.priceToPrecision (symbol, stopPrice)),
1165
1163
  // 'meta': {}, // other options such as post_only
1166
1164
  };
1167
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop']);
1165
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop']);
1168
1166
  const meta = this.safeValue(params, 'meta', {});
1169
1167
  const exchangeSpecificParam = this.safeBool(meta, 'post_only', false);
1170
1168
  const isMarketOrder = type === 'market';
@@ -1173,8 +1171,8 @@ class hollaex extends hollaex$1 {
1173
1171
  const convertedPrice = parseFloat(this.priceToPrecision(symbol, price));
1174
1172
  request['price'] = this.normalizeNumberIfNeeded(convertedPrice);
1175
1173
  }
1176
- if (stopPrice !== undefined) {
1177
- request['stop'] = this.normalizeNumberIfNeeded(parseFloat(this.priceToPrecision(symbol, stopPrice)));
1174
+ if (triggerPrice !== undefined) {
1175
+ request['stop'] = this.normalizeNumberIfNeeded(parseFloat(this.priceToPrecision(symbol, triggerPrice)));
1178
1176
  }
1179
1177
  if (postOnly) {
1180
1178
  request['meta'] = { 'post_only': true };
@@ -5262,7 +5262,6 @@ class htx extends htx$1 {
5262
5262
  'currency': feeCurrency,
5263
5263
  };
5264
5264
  }
5265
- const stopPrice = this.safeString2(order, 'stop-price', 'trigger_price');
5266
5265
  const average = this.safeString(order, 'trade_avg_price');
5267
5266
  const trades = this.safeValue(order, 'trades');
5268
5267
  const reduceOnlyInteger = this.safeInteger(order, 'reduce_only');
@@ -5283,8 +5282,7 @@ class htx extends htx$1 {
5283
5282
  'postOnly': undefined,
5284
5283
  'side': side,
5285
5284
  'price': price,
5286
- 'stopPrice': stopPrice,
5287
- 'triggerPrice': stopPrice,
5285
+ 'triggerPrice': this.safeString2(order, 'stop-price', 'trigger_price'),
5288
5286
  'average': average,
5289
5287
  'cost': cost,
5290
5288
  'amount': amount,
@@ -1351,7 +1351,6 @@ class huobijp extends huobijp$1 {
1351
1351
  'postOnly': undefined,
1352
1352
  'side': side,
1353
1353
  'price': price,
1354
- 'stopPrice': undefined,
1355
1354
  'triggerPrice': undefined,
1356
1355
  'average': undefined,
1357
1356
  'cost': cost,
@@ -1120,7 +1120,6 @@ class idex extends idex$1 {
1120
1120
  'postOnly': undefined,
1121
1121
  'side': side,
1122
1122
  'price': price,
1123
- 'stopPrice': undefined,
1124
1123
  'triggerPrice': undefined,
1125
1124
  'amount': amount,
1126
1125
  'cost': undefined,
@@ -1185,12 +1184,13 @@ class idex extends idex$1 {
1185
1184
  'takeProfit': 5,
1186
1185
  'takeProfitLimit': 6,
1187
1186
  };
1188
- let stopPriceString = undefined;
1189
- if ((type === 'stopLossLimit') || (type === 'takeProfitLimit') || ('stopPrice' in params)) {
1190
- if (!('stopPrice' in params)) {
1191
- throw new errors.BadRequest(this.id + ' createOrder() stopPrice is a required parameter for ' + type + 'orders');
1187
+ const triggerPrice = this.safeString(params, 'triggerPrice', 'stopPrice');
1188
+ let triggerPriceString = undefined;
1189
+ if ((type === 'stopLossLimit') || (type === 'takeProfitLimit')) {
1190
+ if (triggerPrice === undefined) {
1191
+ throw new errors.BadRequest(this.id + ' createOrder() triggerPrice is a required parameter for ' + type + 'orders');
1192
1192
  }
1193
- stopPriceString = this.priceToPrecision(symbol, params['stopPrice']);
1193
+ triggerPriceString = this.priceToPrecision(symbol, triggerPrice);
1194
1194
  }
1195
1195
  const limitTypeEnums = {
1196
1196
  'limit': 1,
@@ -1280,7 +1280,7 @@ class idex extends idex$1 {
1280
1280
  byteArray.push(encodedPrice);
1281
1281
  }
1282
1282
  if (type in stopLossTypeEnums) {
1283
- const encodedPrice = this.encode(stopPriceString || priceString);
1283
+ const encodedPrice = this.encode(triggerPriceString || priceString);
1284
1284
  byteArray.push(encodedPrice);
1285
1285
  }
1286
1286
  const clientOrderId = this.safeString(params, 'clientOrderId');
@@ -1314,7 +1314,7 @@ class idex extends idex$1 {
1314
1314
  request['parameters']['price'] = priceString;
1315
1315
  }
1316
1316
  if (type in stopLossTypeEnums) {
1317
- request['parameters']['stopPrice'] = stopPriceString || priceString;
1317
+ request['parameters']['stopPrice'] = triggerPriceString || priceString;
1318
1318
  }
1319
1319
  if (amountEnum === 0) {
1320
1320
  request['parameters']['quantity'] = amountString;
@@ -454,7 +454,6 @@ class independentreserve extends independentreserve$1 {
454
454
  'postOnly': undefined,
455
455
  'side': side,
456
456
  'price': this.safeString(order, 'Price'),
457
- 'stopPrice': undefined,
458
457
  'triggerPrice': undefined,
459
458
  'cost': this.safeString(order, 'Value'),
460
459
  'average': this.safeString(order, 'AvgPrice'),
@@ -716,7 +716,6 @@ class indodax extends indodax$1 {
716
716
  'postOnly': undefined,
717
717
  'side': side,
718
718
  'price': price,
719
- 'stopPrice': undefined,
720
719
  'triggerPrice': undefined,
721
720
  'cost': cost,
722
721
  'average': undefined,
@@ -427,6 +427,67 @@ class kraken extends kraken$1 {
427
427
  'Celestia': 'TIA',
428
428
  },
429
429
  },
430
+ 'features': {
431
+ 'spot': {
432
+ 'sandbox': false,
433
+ 'createOrder': {
434
+ 'marginMode': false,
435
+ 'triggerPrice': false,
436
+ 'triggerPriceType': undefined,
437
+ 'triggerDirection': false,
438
+ 'stopLossPrice': true,
439
+ 'takeProfitPrice': true,
440
+ 'attachedStopLossTakeProfit': undefined,
441
+ 'timeInForce': {
442
+ 'IOC': true,
443
+ 'FOK': true,
444
+ 'PO': true,
445
+ 'GTD': false,
446
+ },
447
+ 'hedged': false,
448
+ 'trailing': true,
449
+ },
450
+ 'createOrders': undefined,
451
+ 'fetchMyTrades': {
452
+ 'marginMode': false,
453
+ 'limit': undefined,
454
+ 'daysBack': undefined,
455
+ 'untilDays': undefined,
456
+ },
457
+ 'fetchOrder': {
458
+ 'marginMode': false,
459
+ 'trigger': false,
460
+ 'trailing': false,
461
+ },
462
+ 'fetchOpenOrders': {
463
+ 'marginMode': false,
464
+ 'limit': undefined,
465
+ 'trigger': false,
466
+ 'trailing': false,
467
+ },
468
+ 'fetchOrders': undefined,
469
+ 'fetchClosedOrders': {
470
+ 'marginMode': false,
471
+ 'limit': undefined,
472
+ 'daysBackClosed': undefined,
473
+ 'daysBackCanceled': undefined,
474
+ 'untilDays': 100000,
475
+ 'trigger': false,
476
+ 'trailing': false,
477
+ },
478
+ 'fetchOHLCV': {
479
+ 'limit': 720,
480
+ },
481
+ },
482
+ 'swap': {
483
+ 'linear': undefined,
484
+ 'inverse': undefined,
485
+ },
486
+ 'future': {
487
+ 'linear': undefined,
488
+ 'inverse': undefined,
489
+ },
490
+ },
430
491
  'precisionMode': number.TICK_SIZE,
431
492
  'exceptions': {
432
493
  'exact': {
@@ -1008,7 +1069,7 @@ class kraken extends kraken$1 {
1008
1069
  * @method
1009
1070
  * @name kraken#fetchOHLCV
1010
1071
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1011
- * @see https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getOHLCData
1072
+ * @see https://docs.kraken.com/api/docs/rest-api/get-ohlc-data
1012
1073
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1013
1074
  * @param {string} timeframe the length of time each candle represents
1014
1075
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1833,7 +1894,6 @@ class kraken extends kraken$1 {
1833
1894
  'postOnly': isPostOnly,
1834
1895
  'side': side,
1835
1896
  'price': price,
1836
- 'stopPrice': triggerPrice,
1837
1897
  'triggerPrice': triggerPrice,
1838
1898
  'takeProfitPrice': takeProfitPrice,
1839
1899
  'stopLossPrice': stopLossPrice,
@@ -2232,7 +2292,7 @@ class kraken extends kraken$1 {
2232
2292
  * @method
2233
2293
  * @name kraken#fetchMyTrades
2234
2294
  * @description fetch all trades made by the user
2235
- * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeHistory
2295
+ * @see https://docs.kraken.com/api/docs/rest-api/get-trade-history
2236
2296
  * @param {string} symbol unified market symbol
2237
2297
  * @param {int} [since] the earliest time in ms to fetch trades for
2238
2298
  * @param {int} [limit] the maximum number of trades structures to retrieve