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
@@ -359,6 +359,8 @@ interface Exchange {
359
359
  sapiPostPortfolioBnbTransfer(params?: {}): Promise<implicitReturnType>;
360
360
  sapiPostPortfolioRepayFuturesSwitch(params?: {}): Promise<implicitReturnType>;
361
361
  sapiPostPortfolioRepayFuturesNegativeBalance(params?: {}): Promise<implicitReturnType>;
362
+ sapiPostPortfolioMint(params?: {}): Promise<implicitReturnType>;
363
+ sapiPostPortfolioRedeem(params?: {}): Promise<implicitReturnType>;
362
364
  sapiPostLendingAutoInvestPlanAdd(params?: {}): Promise<implicitReturnType>;
363
365
  sapiPostLendingAutoInvestPlanEdit(params?: {}): Promise<implicitReturnType>;
364
366
  sapiPostLendingAutoInvestPlanEditStatus(params?: {}): Promise<implicitReturnType>;
@@ -598,6 +600,7 @@ interface Exchange {
598
600
  eapiPrivateGetBlockOrderOrders(params?: {}): Promise<implicitReturnType>;
599
601
  eapiPrivateGetBlockOrderExecute(params?: {}): Promise<implicitReturnType>;
600
602
  eapiPrivateGetBlockUserTrades(params?: {}): Promise<implicitReturnType>;
603
+ eapiPrivateGetBlockTrades(params?: {}): Promise<implicitReturnType>;
601
604
  eapiPrivatePostOrder(params?: {}): Promise<implicitReturnType>;
602
605
  eapiPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
603
606
  eapiPrivatePostListenKey(params?: {}): Promise<implicitReturnType>;
@@ -359,6 +359,8 @@ interface binance {
359
359
  sapiPostPortfolioBnbTransfer(params?: {}): Promise<implicitReturnType>;
360
360
  sapiPostPortfolioRepayFuturesSwitch(params?: {}): Promise<implicitReturnType>;
361
361
  sapiPostPortfolioRepayFuturesNegativeBalance(params?: {}): Promise<implicitReturnType>;
362
+ sapiPostPortfolioMint(params?: {}): Promise<implicitReturnType>;
363
+ sapiPostPortfolioRedeem(params?: {}): Promise<implicitReturnType>;
362
364
  sapiPostLendingAutoInvestPlanAdd(params?: {}): Promise<implicitReturnType>;
363
365
  sapiPostLendingAutoInvestPlanEdit(params?: {}): Promise<implicitReturnType>;
364
366
  sapiPostLendingAutoInvestPlanEditStatus(params?: {}): Promise<implicitReturnType>;
@@ -598,6 +600,7 @@ interface binance {
598
600
  eapiPrivateGetBlockOrderOrders(params?: {}): Promise<implicitReturnType>;
599
601
  eapiPrivateGetBlockOrderExecute(params?: {}): Promise<implicitReturnType>;
600
602
  eapiPrivateGetBlockUserTrades(params?: {}): Promise<implicitReturnType>;
603
+ eapiPrivateGetBlockTrades(params?: {}): Promise<implicitReturnType>;
601
604
  eapiPrivatePostOrder(params?: {}): Promise<implicitReturnType>;
602
605
  eapiPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
603
606
  eapiPrivatePostListenKey(params?: {}): Promise<implicitReturnType>;
@@ -390,6 +390,8 @@ interface binance {
390
390
  sapiPostPortfolioBnbTransfer(params?: {}): Promise<implicitReturnType>;
391
391
  sapiPostPortfolioRepayFuturesSwitch(params?: {}): Promise<implicitReturnType>;
392
392
  sapiPostPortfolioRepayFuturesNegativeBalance(params?: {}): Promise<implicitReturnType>;
393
+ sapiPostPortfolioMint(params?: {}): Promise<implicitReturnType>;
394
+ sapiPostPortfolioRedeem(params?: {}): Promise<implicitReturnType>;
393
395
  sapiPostLendingAutoInvestPlanAdd(params?: {}): Promise<implicitReturnType>;
394
396
  sapiPostLendingAutoInvestPlanEdit(params?: {}): Promise<implicitReturnType>;
395
397
  sapiPostLendingAutoInvestPlanEditStatus(params?: {}): Promise<implicitReturnType>;
@@ -650,6 +652,7 @@ interface binance {
650
652
  eapiPrivateGetBlockOrderOrders(params?: {}): Promise<implicitReturnType>;
651
653
  eapiPrivateGetBlockOrderExecute(params?: {}): Promise<implicitReturnType>;
652
654
  eapiPrivateGetBlockUserTrades(params?: {}): Promise<implicitReturnType>;
655
+ eapiPrivateGetBlockTrades(params?: {}): Promise<implicitReturnType>;
653
656
  eapiPrivatePostOrder(params?: {}): Promise<implicitReturnType>;
654
657
  eapiPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
655
658
  eapiPrivatePostListenKey(params?: {}): Promise<implicitReturnType>;
@@ -359,6 +359,8 @@ interface binance {
359
359
  sapiPostPortfolioBnbTransfer(params?: {}): Promise<implicitReturnType>;
360
360
  sapiPostPortfolioRepayFuturesSwitch(params?: {}): Promise<implicitReturnType>;
361
361
  sapiPostPortfolioRepayFuturesNegativeBalance(params?: {}): Promise<implicitReturnType>;
362
+ sapiPostPortfolioMint(params?: {}): Promise<implicitReturnType>;
363
+ sapiPostPortfolioRedeem(params?: {}): Promise<implicitReturnType>;
362
364
  sapiPostLendingAutoInvestPlanAdd(params?: {}): Promise<implicitReturnType>;
363
365
  sapiPostLendingAutoInvestPlanEdit(params?: {}): Promise<implicitReturnType>;
364
366
  sapiPostLendingAutoInvestPlanEditStatus(params?: {}): Promise<implicitReturnType>;
@@ -598,6 +600,7 @@ interface binance {
598
600
  eapiPrivateGetBlockOrderOrders(params?: {}): Promise<implicitReturnType>;
599
601
  eapiPrivateGetBlockOrderExecute(params?: {}): Promise<implicitReturnType>;
600
602
  eapiPrivateGetBlockUserTrades(params?: {}): Promise<implicitReturnType>;
603
+ eapiPrivateGetBlockTrades(params?: {}): Promise<implicitReturnType>;
601
604
  eapiPrivatePostOrder(params?: {}): Promise<implicitReturnType>;
602
605
  eapiPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
603
606
  eapiPrivatePostListenKey(params?: {}): Promise<implicitReturnType>;
package/js/src/ace.js CHANGED
@@ -592,7 +592,7 @@ export default class ace extends Exchange {
592
592
  'postOnly': undefined,
593
593
  'side': side,
594
594
  'price': price,
595
- 'stopPrice': undefined,
595
+ 'triggerPrice': undefined,
596
596
  'amount': amount,
597
597
  'cost': undefined,
598
598
  'average': average,
package/js/src/alpaca.js CHANGED
@@ -1214,7 +1214,6 @@ export default class alpaca extends Exchange {
1214
1214
  'postOnly': undefined,
1215
1215
  'side': this.safeString(order, 'side'),
1216
1216
  'price': this.safeNumber(order, 'limit_price'),
1217
- 'stopPrice': this.safeNumber(order, 'stop_price'),
1218
1217
  'triggerPrice': this.safeNumber(order, 'stop_price'),
1219
1218
  'cost': undefined,
1220
1219
  'average': this.safeNumber(order, 'filled_avg_price'),
@@ -1421,7 +1421,6 @@ export default class ascendex extends Exchange {
1421
1421
  'reduceOnly': reduceOnly,
1422
1422
  'side': side,
1423
1423
  'price': price,
1424
- 'stopPrice': triggerPrice,
1425
1424
  'triggerPrice': triggerPrice,
1426
1425
  'amount': amount,
1427
1426
  'cost': undefined,
@@ -1105,12 +1105,12 @@ export default class Exchange {
1105
1105
  createPostOnlyOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
1106
1106
  createReduceOnlyOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
1107
1107
  createReduceOnlyOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
1108
- createStopOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, stopPrice?: Num, params?: {}): Promise<Order>;
1109
- createStopOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, stopPrice?: Num, params?: {}): Promise<Order>;
1110
- createStopLimitOrder(symbol: string, side: OrderSide, amount: number, price: number, stopPrice: number, params?: {}): Promise<Order>;
1111
- createStopLimitOrderWs(symbol: string, side: OrderSide, amount: number, price: number, stopPrice: number, params?: {}): Promise<Order>;
1112
- createStopMarketOrder(symbol: string, side: OrderSide, amount: number, stopPrice: number, params?: {}): Promise<Order>;
1113
- createStopMarketOrderWs(symbol: string, side: OrderSide, amount: number, stopPrice: number, params?: {}): Promise<Order>;
1108
+ createStopOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, triggerPrice?: Num, params?: {}): Promise<Order>;
1109
+ createStopOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, triggerPrice?: Num, params?: {}): Promise<Order>;
1110
+ createStopLimitOrder(symbol: string, side: OrderSide, amount: number, price: number, triggerPrice: number, params?: {}): Promise<Order>;
1111
+ createStopLimitOrderWs(symbol: string, side: OrderSide, amount: number, price: number, triggerPrice: number, params?: {}): Promise<Order>;
1112
+ createStopMarketOrder(symbol: string, side: OrderSide, amount: number, triggerPrice: number, params?: {}): Promise<Order>;
1113
+ createStopMarketOrderWs(symbol: string, side: OrderSide, amount: number, triggerPrice: number, params?: {}): Promise<Order>;
1114
1114
  safeCurrencyCode(currencyId: Str, currency?: Currency): string;
1115
1115
  filterBySymbolSinceLimit(array: any, symbol?: Str, since?: Int, limit?: Int, tail?: boolean): any;
1116
1116
  filterByCurrencySinceLimit(array: any, code?: any, since?: Int, limit?: Int, tail?: boolean): any;
@@ -4449,10 +4449,15 @@ export default class Exchange {
4449
4449
  }
4450
4450
  handleOptionAndParams2(params, methodName1, optionName1, optionName2, defaultValue = undefined) {
4451
4451
  let value = undefined;
4452
- [value, params] = this.handleOptionAndParams(params, methodName1, optionName1, defaultValue);
4452
+ [value, params] = this.handleOptionAndParams(params, methodName1, optionName1);
4453
+ if (value !== undefined) {
4454
+ // omit optionName2 too from params
4455
+ params = this.omit(params, optionName2);
4456
+ return [value, params];
4457
+ }
4453
4458
  // if still undefined, try optionName2
4454
4459
  let value2 = undefined;
4455
- [value2, params] = this.handleOptionAndParams(params, methodName1, optionName2, value);
4460
+ [value2, params] = this.handleOptionAndParams(params, methodName1, optionName2, defaultValue);
4456
4461
  return [value2, params];
4457
4462
  }
4458
4463
  handleOption(methodName, optionName, defaultValue = undefined) {
@@ -5507,52 +5512,52 @@ export default class Exchange {
5507
5512
  const query = this.extend(params, { 'reduceOnly': true });
5508
5513
  return await this.createOrderWs(symbol, type, side, amount, price, query);
5509
5514
  }
5510
- async createStopOrder(symbol, type, side, amount, price = undefined, stopPrice = undefined, params = {}) {
5515
+ async createStopOrder(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
5511
5516
  if (!this.has['createStopOrder']) {
5512
5517
  throw new NotSupported(this.id + ' createStopOrder() is not supported yet');
5513
5518
  }
5514
- if (stopPrice === undefined) {
5519
+ if (triggerPrice === undefined) {
5515
5520
  throw new ArgumentsRequired(this.id + ' create_stop_order() requires a stopPrice argument');
5516
5521
  }
5517
- const query = this.extend(params, { 'stopPrice': stopPrice });
5522
+ const query = this.extend(params, { 'stopPrice': triggerPrice });
5518
5523
  return await this.createOrder(symbol, type, side, amount, price, query);
5519
5524
  }
5520
- async createStopOrderWs(symbol, type, side, amount, price = undefined, stopPrice = undefined, params = {}) {
5525
+ async createStopOrderWs(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
5521
5526
  if (!this.has['createStopOrderWs']) {
5522
5527
  throw new NotSupported(this.id + ' createStopOrderWs() is not supported yet');
5523
5528
  }
5524
- if (stopPrice === undefined) {
5529
+ if (triggerPrice === undefined) {
5525
5530
  throw new ArgumentsRequired(this.id + ' createStopOrderWs() requires a stopPrice argument');
5526
5531
  }
5527
- const query = this.extend(params, { 'stopPrice': stopPrice });
5532
+ const query = this.extend(params, { 'stopPrice': triggerPrice });
5528
5533
  return await this.createOrderWs(symbol, type, side, amount, price, query);
5529
5534
  }
5530
- async createStopLimitOrder(symbol, side, amount, price, stopPrice, params = {}) {
5535
+ async createStopLimitOrder(symbol, side, amount, price, triggerPrice, params = {}) {
5531
5536
  if (!this.has['createStopLimitOrder']) {
5532
5537
  throw new NotSupported(this.id + ' createStopLimitOrder() is not supported yet');
5533
5538
  }
5534
- const query = this.extend(params, { 'stopPrice': stopPrice });
5539
+ const query = this.extend(params, { 'stopPrice': triggerPrice });
5535
5540
  return await this.createOrder(symbol, 'limit', side, amount, price, query);
5536
5541
  }
5537
- async createStopLimitOrderWs(symbol, side, amount, price, stopPrice, params = {}) {
5542
+ async createStopLimitOrderWs(symbol, side, amount, price, triggerPrice, params = {}) {
5538
5543
  if (!this.has['createStopLimitOrderWs']) {
5539
5544
  throw new NotSupported(this.id + ' createStopLimitOrderWs() is not supported yet');
5540
5545
  }
5541
- const query = this.extend(params, { 'stopPrice': stopPrice });
5546
+ const query = this.extend(params, { 'stopPrice': triggerPrice });
5542
5547
  return await this.createOrderWs(symbol, 'limit', side, amount, price, query);
5543
5548
  }
5544
- async createStopMarketOrder(symbol, side, amount, stopPrice, params = {}) {
5549
+ async createStopMarketOrder(symbol, side, amount, triggerPrice, params = {}) {
5545
5550
  if (!this.has['createStopMarketOrder']) {
5546
5551
  throw new NotSupported(this.id + ' createStopMarketOrder() is not supported yet');
5547
5552
  }
5548
- const query = this.extend(params, { 'stopPrice': stopPrice });
5553
+ const query = this.extend(params, { 'stopPrice': triggerPrice });
5549
5554
  return await this.createOrder(symbol, 'market', side, amount, undefined, query);
5550
5555
  }
5551
- async createStopMarketOrderWs(symbol, side, amount, stopPrice, params = {}) {
5556
+ async createStopMarketOrderWs(symbol, side, amount, triggerPrice, params = {}) {
5552
5557
  if (!this.has['createStopMarketOrderWs']) {
5553
5558
  throw new NotSupported(this.id + ' createStopMarketOrderWs() is not supported yet');
5554
5559
  }
5555
- const query = this.extend(params, { 'stopPrice': stopPrice });
5560
+ const query = this.extend(params, { 'stopPrice': triggerPrice });
5556
5561
  return await this.createOrderWs(symbol, 'market', side, amount, undefined, query);
5557
5562
  }
5558
5563
  safeCurrencyCode(currencyId, currency = undefined) {
package/js/src/bigone.js CHANGED
@@ -1378,7 +1378,6 @@ export default class bigone extends Exchange {
1378
1378
  'postOnly': this.safeBool(order, 'post_only'),
1379
1379
  'side': side,
1380
1380
  'price': price,
1381
- 'stopPrice': triggerPrice,
1382
1381
  'triggerPrice': triggerPrice,
1383
1382
  'amount': amount,
1384
1383
  'cost': cost,
package/js/src/binance.js CHANGED
@@ -637,6 +637,8 @@ export default class binance extends Exchange {
637
637
  'portfolio/bnb-transfer': 150,
638
638
  'portfolio/repay-futures-switch': 150,
639
639
  'portfolio/repay-futures-negative-balance': 150,
640
+ 'portfolio/mint': 20,
641
+ 'portfolio/redeem': 20,
640
642
  'lending/auto-invest/plan/add': 0.1,
641
643
  'lending/auto-invest/plan/edit': 0.1,
642
644
  'lending/auto-invest/plan/edit-status': 0.1,
@@ -965,6 +967,7 @@ export default class binance extends Exchange {
965
967
  'block/order/orders': 5,
966
968
  'block/order/execute': 5,
967
969
  'block/user-trades': 5,
970
+ 'blockTrades': 5,
968
971
  },
969
972
  'post': {
970
973
  'order': 1,
package/js/src/bingx.js CHANGED
@@ -5601,6 +5601,9 @@ export default class bingx extends Exchange {
5601
5601
  request['endTs'] = now;
5602
5602
  }
5603
5603
  if (market['spot']) {
5604
+ if (limit !== undefined) {
5605
+ request['limit'] = limit; // default 500, maximum 1000
5606
+ }
5604
5607
  response = await this.spotV1PrivateGetTradeMyTrades(this.extend(request, params));
5605
5608
  const data = this.safeDict(response, 'data', {});
5606
5609
  fills = this.safeList(data, 'fills', []);
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitfinex.js';
2
- import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation, OrderRequest, Num, MarginModification, Currencies, TradingFees, Dict, LedgerEntry, FundingRate, FundingRates, DepositAddress } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderBook, Str, Transaction, Ticker, Balances, Tickers, Strings, Currency, Market, OpenInterest, Liquidation, OrderRequest, Num, MarginModification, Currencies, TradingFees, Dict, LedgerEntry, FundingRate, FundingRates, DepositAddress, OpenInterests } from './base/types.js';
3
3
  /**
4
4
  * @class bitfinex
5
5
  * @augments Exchange
@@ -416,6 +416,16 @@ export default class bitfinex extends Exchange {
416
416
  previousFundingTimestamp: any;
417
417
  previousFundingDatetime: any;
418
418
  };
419
+ /**
420
+ * @method
421
+ * @name bitfinex#fetchOpenInterests
422
+ * @description Retrieves the open interest for a list of symbols
423
+ * @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
424
+ * @param {string[]} [symbols] a list of unified CCXT market symbols
425
+ * @param {object} [params] exchange specific parameters
426
+ * @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
427
+ */
428
+ fetchOpenInterests(symbols?: Strings, params?: {}): Promise<OpenInterests>;
419
429
  /**
420
430
  * @method
421
431
  * @name bitfinex#fetchOpenInterest
@@ -85,6 +85,7 @@ export default class bitfinex extends Exchange {
85
85
  'fetchOHLCV': true,
86
86
  'fetchOpenInterest': true,
87
87
  'fetchOpenInterestHistory': true,
88
+ 'fetchOpenInterests': true,
88
89
  'fetchOpenOrder': true,
89
90
  'fetchOpenOrders': true,
90
91
  'fetchOrder': true,
@@ -404,6 +405,75 @@ export default class bitfinex extends Exchange {
404
405
  'TETHERUSE': 'ERC20',
405
406
  },
406
407
  },
408
+ 'features': {
409
+ 'default': {
410
+ 'sandbox': false,
411
+ 'createOrder': {
412
+ 'marginMode': true,
413
+ 'triggerPrice': true,
414
+ 'triggerPriceType': undefined,
415
+ 'triggerDirection': false,
416
+ 'stopLossPrice': true,
417
+ 'takeProfitPrice': true,
418
+ 'attachedStopLossTakeProfit': undefined,
419
+ 'timeInForce': {
420
+ 'IOC': true,
421
+ 'FOK': true,
422
+ 'PO': true,
423
+ 'GTD': false,
424
+ },
425
+ 'hedged': false,
426
+ 'trailing': true, // todo: unify
427
+ // todo: leverage unify
428
+ },
429
+ 'createOrders': {
430
+ 'max': 75,
431
+ },
432
+ 'fetchMyTrades': {
433
+ 'marginMode': false,
434
+ 'limit': 2500,
435
+ 'daysBack': undefined,
436
+ 'untilDays': 100000, // todo: implement
437
+ },
438
+ 'fetchOrder': {
439
+ 'marginMode': false,
440
+ 'trigger': false,
441
+ 'trailing': false,
442
+ },
443
+ 'fetchOpenOrders': {
444
+ 'marginMode': false,
445
+ 'limit': undefined,
446
+ 'trigger': false,
447
+ 'trailing': false,
448
+ },
449
+ 'fetchOrders': undefined,
450
+ 'fetchClosedOrders': {
451
+ 'marginMode': false,
452
+ 'limit': undefined,
453
+ 'daysBackClosed': undefined,
454
+ 'daysBackCanceled': undefined,
455
+ 'untilDays': 100000,
456
+ 'trigger': false,
457
+ 'trailing': false,
458
+ },
459
+ 'fetchOHLCV': {
460
+ 'limit': 10000,
461
+ },
462
+ },
463
+ 'spot': {
464
+ 'extends': 'default',
465
+ },
466
+ 'swap': {
467
+ 'linear': {
468
+ 'extends': 'default',
469
+ },
470
+ 'inverse': undefined,
471
+ },
472
+ 'future': {
473
+ 'linear': undefined,
474
+ 'inverse': undefined,
475
+ },
476
+ },
407
477
  'exceptions': {
408
478
  'exact': {
409
479
  '11010': RateLimitExceeded,
@@ -3248,6 +3318,59 @@ export default class bitfinex extends Exchange {
3248
3318
  'previousFundingDatetime': undefined,
3249
3319
  };
3250
3320
  }
3321
+ /**
3322
+ * @method
3323
+ * @name bitfinex#fetchOpenInterests
3324
+ * @description Retrieves the open interest for a list of symbols
3325
+ * @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
3326
+ * @param {string[]} [symbols] a list of unified CCXT market symbols
3327
+ * @param {object} [params] exchange specific parameters
3328
+ * @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
3329
+ */
3330
+ async fetchOpenInterests(symbols = undefined, params = {}) {
3331
+ await this.loadMarkets();
3332
+ symbols = this.marketSymbols(symbols);
3333
+ let marketIds = ['ALL'];
3334
+ if (symbols !== undefined) {
3335
+ marketIds = this.marketIds(symbols);
3336
+ }
3337
+ const request = {
3338
+ 'keys': marketIds.join(','),
3339
+ };
3340
+ const response = await this.publicGetStatusDeriv(this.extend(request, params));
3341
+ //
3342
+ // [
3343
+ // [
3344
+ // "tXRPF0:USTF0", // market id
3345
+ // 1706256986000, // millisecond timestamp
3346
+ // null,
3347
+ // 0.512705, // derivative mid price
3348
+ // 0.512395, // underlying spot mid price
3349
+ // null,
3350
+ // 37671483.04, // insurance fund balance
3351
+ // null,
3352
+ // 1706284800000, // timestamp of next funding
3353
+ // 0.00002353, // accrued funding for next period
3354
+ // 317, // next funding step
3355
+ // null,
3356
+ // 0, // current funding
3357
+ // null,
3358
+ // null,
3359
+ // 0.5123016, // mark price
3360
+ // null,
3361
+ // null,
3362
+ // 2233562.03115, // open interest in contracts
3363
+ // null,
3364
+ // null,
3365
+ // null,
3366
+ // 0.0005, // average spread without funding payment
3367
+ // 0.0025 // funding payment cap
3368
+ // ]
3369
+ // ]
3370
+ //
3371
+ const result = this.parseOpenInterests(response);
3372
+ return this.filterByArray(result, 'symbol', symbols);
3373
+ }
3251
3374
  /**
3252
3375
  * @method
3253
3376
  * @name bitfinex#fetchOpenInterest
@@ -113,7 +113,7 @@ export default class blofin extends Exchange {
113
113
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
114
114
  */
115
115
  fetchFundingRate(symbol: string, params?: {}): Promise<FundingRate>;
116
- parseBalanceByType(type: any, response: any): Balances;
116
+ parseBalanceByType(response: any): Balances;
117
117
  parseBalance(response: any): Balances;
118
118
  parseFundingBalance(response: any): Balances;
119
119
  parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
package/js/src/blofin.js CHANGED
@@ -161,7 +161,7 @@ export default class blofin extends Exchange {
161
161
  'rest': 'https://openapi.blofin.com',
162
162
  },
163
163
  'referral': {
164
- 'url': 'https://blofin.com/register?referral_code=jBd8U1',
164
+ 'url': 'https://blofin.com/register?referral_code=f79EsS',
165
165
  'discount': 0.05,
166
166
  },
167
167
  'www': 'https://www.blofin.com',
@@ -281,10 +281,18 @@ export default class blofin extends Exchange {
281
281
  'brokerId': 'ec6dd3a7dd982d0b',
282
282
  'accountsByType': {
283
283
  'swap': 'futures',
284
+ 'funding': 'funding',
284
285
  'future': 'futures',
286
+ 'copy_trading': 'copy_trading',
287
+ 'earn': 'earn',
288
+ 'spot': 'spot',
285
289
  },
286
290
  'accountsById': {
291
+ 'funding': 'funding',
287
292
  'futures': 'swap',
293
+ 'copy_trading': 'copy_trading',
294
+ 'earn': 'earn',
295
+ 'spot': 'spot',
288
296
  },
289
297
  'sandboxMode': false,
290
298
  'defaultNetwork': 'ERC20',
@@ -882,8 +890,9 @@ export default class blofin extends Exchange {
882
890
  const entry = this.safeDict(data, 0, {});
883
891
  return this.parseFundingRate(entry, market);
884
892
  }
885
- parseBalanceByType(type, response) {
886
- if (type) {
893
+ parseBalanceByType(response) {
894
+ const data = this.safeList(response, 'data');
895
+ if ((data !== undefined) && Array.isArray(data)) {
887
896
  return this.parseFundingBalance(response);
888
897
  }
889
898
  else {
@@ -1001,11 +1010,11 @@ export default class blofin extends Exchange {
1001
1010
  */
1002
1011
  async fetchBalance(params = {}) {
1003
1012
  await this.loadMarkets();
1004
- const accountType = this.safeString2(params, 'accountType', 'type');
1005
- params = this.omit(params, ['accountType', 'type']);
1013
+ let accountType = undefined;
1014
+ [accountType, params] = this.handleOptionAndParams2(params, 'fetchBalance', 'accountType', 'type');
1006
1015
  const request = {};
1007
1016
  let response = undefined;
1008
- if (accountType !== undefined) {
1017
+ if (accountType !== undefined && accountType !== 'swap') {
1009
1018
  const options = this.safeDict(this.options, 'accountsByType', {});
1010
1019
  const parsedAccountType = this.safeString(options, accountType, accountType);
1011
1020
  request['accountType'] = parsedAccountType;
@@ -1014,7 +1023,7 @@ export default class blofin extends Exchange {
1014
1023
  else {
1015
1024
  response = await this.privateGetAccountBalance(this.extend(request, params));
1016
1025
  }
1017
- return this.parseBalanceByType(accountType, response);
1026
+ return this.parseBalanceByType(response);
1018
1027
  }
1019
1028
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
1020
1029
  const market = this.market(symbol);
package/js/src/cex.js CHANGED
@@ -1090,7 +1090,7 @@ export default class cex extends Exchange {
1090
1090
  'postOnly': undefined,
1091
1091
  'side': this.safeStringLower(order, 'side'),
1092
1092
  'price': this.safeNumber(order, 'price'),
1093
- 'stopPrice': this.safeNumber(order, 'stopPrice'),
1093
+ 'triggerPrice': this.safeNumber(order, 'stopPrice'),
1094
1094
  'amount': requestedBase,
1095
1095
  'cost': executedQuote,
1096
1096
  'average': this.safeNumber(order, 'averagePrice'),
@@ -2893,10 +2893,10 @@ export default class coinbase extends Exchange {
2893
2893
  'product_id': market['id'],
2894
2894
  'side': side.toUpperCase(),
2895
2895
  };
2896
- const stopPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
2896
+ const triggerPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
2897
2897
  const stopLossPrice = this.safeNumber(params, 'stopLossPrice');
2898
2898
  const takeProfitPrice = this.safeNumber(params, 'takeProfitPrice');
2899
- const isStop = stopPrice !== undefined;
2899
+ const isStop = triggerPrice !== undefined;
2900
2900
  const isStopLoss = stopLossPrice !== undefined;
2901
2901
  const isTakeProfit = takeProfitPrice !== undefined;
2902
2902
  const timeInForce = this.safeString(params, 'timeInForce');
@@ -2916,7 +2916,7 @@ export default class coinbase extends Exchange {
2916
2916
  'stop_limit_stop_limit_gtd': {
2917
2917
  'base_size': this.amountToPrecision(symbol, amount),
2918
2918
  'limit_price': this.priceToPrecision(symbol, price),
2919
- 'stop_price': this.priceToPrecision(symbol, stopPrice),
2919
+ 'stop_price': this.priceToPrecision(symbol, triggerPrice),
2920
2920
  'stop_direction': stopDirection,
2921
2921
  'end_time': endTime,
2922
2922
  },
@@ -2927,31 +2927,31 @@ export default class coinbase extends Exchange {
2927
2927
  'stop_limit_stop_limit_gtc': {
2928
2928
  'base_size': this.amountToPrecision(symbol, amount),
2929
2929
  'limit_price': this.priceToPrecision(symbol, price),
2930
- 'stop_price': this.priceToPrecision(symbol, stopPrice),
2930
+ 'stop_price': this.priceToPrecision(symbol, triggerPrice),
2931
2931
  'stop_direction': stopDirection,
2932
2932
  },
2933
2933
  };
2934
2934
  }
2935
2935
  }
2936
2936
  else if (isStopLoss || isTakeProfit) {
2937
- let triggerPrice = undefined;
2937
+ let tpslPrice = undefined;
2938
2938
  if (isStopLoss) {
2939
2939
  if (stopDirection === undefined) {
2940
2940
  stopDirection = (side === 'buy') ? 'STOP_DIRECTION_STOP_UP' : 'STOP_DIRECTION_STOP_DOWN';
2941
2941
  }
2942
- triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
2942
+ tpslPrice = this.priceToPrecision(symbol, stopLossPrice);
2943
2943
  }
2944
2944
  else {
2945
2945
  if (stopDirection === undefined) {
2946
2946
  stopDirection = (side === 'buy') ? 'STOP_DIRECTION_STOP_DOWN' : 'STOP_DIRECTION_STOP_UP';
2947
2947
  }
2948
- triggerPrice = this.priceToPrecision(symbol, takeProfitPrice);
2948
+ tpslPrice = this.priceToPrecision(symbol, takeProfitPrice);
2949
2949
  }
2950
2950
  request['order_configuration'] = {
2951
2951
  'stop_limit_stop_limit_gtc': {
2952
2952
  'base_size': this.amountToPrecision(symbol, amount),
2953
2953
  'limit_price': this.priceToPrecision(symbol, price),
2954
- 'stop_price': triggerPrice,
2954
+ 'stop_price': tpslPrice,
2955
2955
  'stop_direction': stopDirection,
2956
2956
  },
2957
2957
  };
@@ -3234,7 +3234,6 @@ export default class coinbase extends Exchange {
3234
3234
  'postOnly': postOnly,
3235
3235
  'side': this.safeStringLower(order, 'side'),
3236
3236
  'price': price,
3237
- 'stopPrice': triggerPrice,
3238
3237
  'triggerPrice': triggerPrice,
3239
3238
  'amount': amount,
3240
3239
  'filled': this.safeString(order, 'filled_size'),
@@ -1064,7 +1064,7 @@ export default class coinbaseexchange extends Exchange {
1064
1064
  const side = this.safeString(order, 'side');
1065
1065
  const timeInForce = this.safeString(order, 'time_in_force');
1066
1066
  const postOnly = this.safeValue(order, 'post_only');
1067
- const stopPrice = this.safeNumber(order, 'stop_price');
1067
+ const triggerPrice = this.safeNumber(order, 'stop_price');
1068
1068
  const clientOrderId = this.safeString(order, 'client_oid');
1069
1069
  return this.safeOrder({
1070
1070
  'id': id,
@@ -1080,8 +1080,7 @@ export default class coinbaseexchange extends Exchange {
1080
1080
  'postOnly': postOnly,
1081
1081
  'side': side,
1082
1082
  'price': price,
1083
- 'stopPrice': stopPrice,
1084
- 'triggerPrice': stopPrice,
1083
+ 'triggerPrice': triggerPrice,
1085
1084
  'cost': cost,
1086
1085
  'amount': amount,
1087
1086
  'filled': filled,
@@ -1257,9 +1256,9 @@ export default class coinbaseexchange extends Exchange {
1257
1256
  if (clientOrderId !== undefined) {
1258
1257
  request['client_oid'] = clientOrderId;
1259
1258
  }
1260
- const stopPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
1261
- if (stopPrice !== undefined) {
1262
- request['stop_price'] = this.priceToPrecision(symbol, stopPrice);
1259
+ const triggerPrice = this.safeNumberN(params, ['stopPrice', 'stop_price', 'triggerPrice']);
1260
+ if (triggerPrice !== undefined) {
1261
+ request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
1263
1262
  }
1264
1263
  const timeInForce = this.safeString2(params, 'timeInForce', 'time_in_force');
1265
1264
  if (timeInForce !== undefined) {
@@ -311,7 +311,7 @@ export default class coinbaseinternational extends Exchange {
311
311
  * @param {float} amount how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
312
312
  * @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
313
313
  * @param {object} [params] extra parameters specific to the exchange API endpoint
314
- * @param {float} [params.stopPrice] price to trigger stop orders
314
+ * @param {float} [params.stopPrice] alias for triggerPrice
315
315
  * @param {float} [params.triggerPrice] price to trigger stop orders
316
316
  * @param {float} [params.stopLossPrice] price to trigger stop-loss orders
317
317
  * @param {bool} [params.postOnly] true or false