ccxt 4.4.38 → 4.4.40

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 (192) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +73 -2
  5. package/dist/cjs/src/ascendex.js +9 -9
  6. package/dist/cjs/src/base/Exchange.js +38 -27
  7. package/dist/cjs/src/binance.js +13 -19
  8. package/dist/cjs/src/bingx.js +1 -2
  9. package/dist/cjs/src/bit2c.js +0 -1
  10. package/dist/cjs/src/bitbank.js +0 -1
  11. package/dist/cjs/src/bitbns.js +0 -1
  12. package/dist/cjs/src/bitfinex.js +17 -18
  13. package/dist/cjs/src/bitfinex1.js +0 -1
  14. package/dist/cjs/src/bitflyer.js +0 -1
  15. package/dist/cjs/src/bitget.js +1 -2
  16. package/dist/cjs/src/bithumb.js +0 -1
  17. package/dist/cjs/src/bitmart.js +3 -4
  18. package/dist/cjs/src/bitmex.js +5 -6
  19. package/dist/cjs/src/bitopro.js +4 -5
  20. package/dist/cjs/src/bitrue.js +5 -7
  21. package/dist/cjs/src/bitso.js +1 -2
  22. package/dist/cjs/src/bitstamp.js +1 -2
  23. package/dist/cjs/src/bitteam.js +1 -3
  24. package/dist/cjs/src/bitvavo.js +2 -4
  25. package/dist/cjs/src/blockchaincom.js +5 -5
  26. package/dist/cjs/src/blofin.js +10 -10
  27. package/dist/cjs/src/btcalpha.js +0 -1
  28. package/dist/cjs/src/btcbox.js +0 -1
  29. package/dist/cjs/src/btcmarkets.js +1 -3
  30. package/dist/cjs/src/bybit.js +2 -3
  31. package/dist/cjs/src/cex.js +1 -1
  32. package/dist/cjs/src/coinbase.js +77 -1
  33. package/dist/cjs/src/coinbaseexchange.js +1 -1
  34. package/dist/cjs/src/coinbaseinternational.js +62 -0
  35. package/dist/cjs/src/coincatch.js +1 -1
  36. package/dist/cjs/src/coinex.js +9 -9
  37. package/dist/cjs/src/coinlist.js +1 -1
  38. package/dist/cjs/src/coinmetro.js +1 -1
  39. package/dist/cjs/src/cryptocom.js +91 -2
  40. package/dist/cjs/src/currencycom.js +1 -1
  41. package/dist/cjs/src/defx.js +1 -2
  42. package/dist/cjs/src/delta.js +1 -1
  43. package/dist/cjs/src/digifinex.js +59 -19
  44. package/dist/cjs/src/exmo.js +2 -2
  45. package/dist/cjs/src/gate.js +1 -1
  46. package/dist/cjs/src/hashkey.js +3 -5
  47. package/dist/cjs/src/htx.js +155 -33
  48. package/dist/cjs/src/hyperliquid.js +1 -1
  49. package/dist/cjs/src/kraken.js +1 -1
  50. package/dist/cjs/src/kucoin.js +25 -24
  51. package/dist/cjs/src/luno.js +1 -1
  52. package/dist/cjs/src/mexc.js +174 -27
  53. package/dist/cjs/src/ndax.js +1 -1
  54. package/dist/cjs/src/okcoin.js +18 -18
  55. package/dist/cjs/src/okx.js +22 -21
  56. package/dist/cjs/src/phemex.js +12 -8
  57. package/dist/cjs/src/poloniex.js +1 -1
  58. package/dist/cjs/src/poloniexfutures.js +6 -6
  59. package/dist/cjs/src/pro/bitget.js +1 -1
  60. package/dist/cjs/src/pro/bybit.js +13 -1
  61. package/dist/cjs/src/pro/coinex.js +2 -2
  62. package/dist/cjs/src/pro/gate.js +6 -6
  63. package/dist/cjs/src/pro/kucoin.js +3 -3
  64. package/dist/cjs/src/pro/okx.js +11 -11
  65. package/dist/cjs/src/pro/upbit.js +3 -3
  66. package/dist/cjs/src/pro/woo.js +1 -1
  67. package/dist/cjs/src/vertex.js +11 -11
  68. package/dist/cjs/src/woo.js +37 -37
  69. package/dist/cjs/src/woofipro.js +24 -24
  70. package/dist/cjs/src/xt.js +26 -26
  71. package/dist/cjs/src/zonda.js +1 -1
  72. package/js/ccxt.d.ts +1 -1
  73. package/js/ccxt.js +1 -1
  74. package/js/src/abstract/digifinex.d.ts +1 -0
  75. package/js/src/abstract/mexc.d.ts +1 -0
  76. package/js/src/alpaca.d.ts +11 -1
  77. package/js/src/alpaca.js +73 -2
  78. package/js/src/ascendex.d.ts +2 -2
  79. package/js/src/ascendex.js +9 -9
  80. package/js/src/base/Exchange.js +38 -27
  81. package/js/src/binance.d.ts +9 -9
  82. package/js/src/binance.js +13 -19
  83. package/js/src/bingx.d.ts +1 -1
  84. package/js/src/bingx.js +1 -2
  85. package/js/src/bit2c.js +0 -1
  86. package/js/src/bitbank.js +0 -1
  87. package/js/src/bitbns.js +0 -1
  88. package/js/src/bitfinex.d.ts +3 -3
  89. package/js/src/bitfinex.js +17 -18
  90. package/js/src/bitfinex1.js +0 -1
  91. package/js/src/bitflyer.js +0 -1
  92. package/js/src/bitget.d.ts +1 -1
  93. package/js/src/bitget.js +1 -2
  94. package/js/src/bithumb.js +0 -1
  95. package/js/src/bitmart.d.ts +1 -1
  96. package/js/src/bitmart.js +3 -4
  97. package/js/src/bitmex.d.ts +1 -1
  98. package/js/src/bitmex.js +5 -6
  99. package/js/src/bitopro.js +4 -5
  100. package/js/src/bitrue.js +5 -7
  101. package/js/src/bitso.d.ts +1 -1
  102. package/js/src/bitso.js +1 -2
  103. package/js/src/bitstamp.d.ts +1 -1
  104. package/js/src/bitstamp.js +1 -2
  105. package/js/src/bitteam.js +1 -3
  106. package/js/src/bitvavo.d.ts +1 -1
  107. package/js/src/bitvavo.js +2 -4
  108. package/js/src/blockchaincom.js +5 -5
  109. package/js/src/blofin.d.ts +3 -3
  110. package/js/src/blofin.js +10 -10
  111. package/js/src/btcalpha.js +0 -1
  112. package/js/src/btcbox.js +0 -1
  113. package/js/src/btcmarkets.js +1 -3
  114. package/js/src/bybit.d.ts +1 -1
  115. package/js/src/bybit.js +2 -3
  116. package/js/src/cex.d.ts +1 -1
  117. package/js/src/cex.js +1 -1
  118. package/js/src/coinbase.d.ts +1 -1
  119. package/js/src/coinbase.js +77 -1
  120. package/js/src/coinbaseexchange.d.ts +1 -1
  121. package/js/src/coinbaseexchange.js +1 -1
  122. package/js/src/coinbaseinternational.js +62 -0
  123. package/js/src/coincatch.d.ts +1 -1
  124. package/js/src/coincatch.js +1 -1
  125. package/js/src/coinex.js +9 -9
  126. package/js/src/coinlist.d.ts +1 -1
  127. package/js/src/coinlist.js +1 -1
  128. package/js/src/coinmetro.d.ts +1 -1
  129. package/js/src/coinmetro.js +1 -1
  130. package/js/src/cryptocom.d.ts +2 -2
  131. package/js/src/cryptocom.js +91 -2
  132. package/js/src/currencycom.d.ts +1 -1
  133. package/js/src/currencycom.js +1 -1
  134. package/js/src/defx.d.ts +1 -2
  135. package/js/src/defx.js +1 -2
  136. package/js/src/delta.d.ts +1 -1
  137. package/js/src/delta.js +1 -1
  138. package/js/src/digifinex.d.ts +5 -3
  139. package/js/src/digifinex.js +59 -19
  140. package/js/src/exmo.js +2 -2
  141. package/js/src/gate.d.ts +1 -1
  142. package/js/src/gate.js +1 -1
  143. package/js/src/hashkey.d.ts +1 -1
  144. package/js/src/hashkey.js +3 -5
  145. package/js/src/htx.d.ts +6 -6
  146. package/js/src/htx.js +155 -33
  147. package/js/src/hyperliquid.d.ts +1 -1
  148. package/js/src/hyperliquid.js +1 -1
  149. package/js/src/kraken.d.ts +1 -1
  150. package/js/src/kraken.js +1 -1
  151. package/js/src/kucoin.d.ts +13 -13
  152. package/js/src/kucoin.js +25 -24
  153. package/js/src/luno.d.ts +1 -1
  154. package/js/src/luno.js +1 -1
  155. package/js/src/mexc.d.ts +8 -9
  156. package/js/src/mexc.js +174 -27
  157. package/js/src/ndax.d.ts +1 -1
  158. package/js/src/ndax.js +1 -1
  159. package/js/src/okcoin.d.ts +4 -4
  160. package/js/src/okcoin.js +18 -18
  161. package/js/src/okx.d.ts +4 -3
  162. package/js/src/okx.js +22 -21
  163. package/js/src/phemex.js +12 -8
  164. package/js/src/poloniex.d.ts +1 -1
  165. package/js/src/poloniex.js +1 -1
  166. package/js/src/poloniexfutures.d.ts +1 -1
  167. package/js/src/poloniexfutures.js +6 -6
  168. package/js/src/pro/bitget.d.ts +1 -1
  169. package/js/src/pro/bitget.js +1 -1
  170. package/js/src/pro/bybit.d.ts +1 -1
  171. package/js/src/pro/bybit.js +13 -1
  172. package/js/src/pro/coinex.js +2 -2
  173. package/js/src/pro/gate.d.ts +2 -2
  174. package/js/src/pro/gate.js +6 -6
  175. package/js/src/pro/kucoin.d.ts +1 -1
  176. package/js/src/pro/kucoin.js +3 -3
  177. package/js/src/pro/okx.d.ts +2 -2
  178. package/js/src/pro/okx.js +11 -11
  179. package/js/src/pro/upbit.d.ts +3 -3
  180. package/js/src/pro/upbit.js +3 -3
  181. package/js/src/pro/woo.js +1 -1
  182. package/js/src/vertex.d.ts +3 -3
  183. package/js/src/vertex.js +11 -11
  184. package/js/src/woo.d.ts +7 -7
  185. package/js/src/woo.js +37 -37
  186. package/js/src/woofipro.d.ts +1 -1
  187. package/js/src/woofipro.js +24 -24
  188. package/js/src/xt.d.ts +7 -7
  189. package/js/src/xt.js +26 -26
  190. package/js/src/zonda.d.ts +1 -1
  191. package/js/src/zonda.js +1 -1
  192. package/package.json +1 -1
package/js/src/kucoin.js CHANGED
@@ -560,6 +560,7 @@ export default class kucoin extends Exchange {
560
560
  '400008': NotSupported,
561
561
  '400100': InsufficientFunds,
562
562
  '400200': InvalidOrder,
563
+ '400330': InvalidOrder,
563
564
  '400350': InvalidOrder,
564
565
  '400370': InvalidOrder,
565
566
  '400400': BadRequest,
@@ -2234,7 +2235,7 @@ export default class kucoin extends Exchange {
2234
2235
  * market orders --------------------------------------------------
2235
2236
  * @param {string} [params.funds] // Amount of quote currency to use
2236
2237
  * stop orders ----------------------------------------------------
2237
- * @param {string} [params.stop] Either loss or entry, the default is loss. Requires stopPrice to be defined
2238
+ * @param {string} [params.stop] Either loss or entry, the default is loss. Requires triggerPrice to be defined
2238
2239
  * margin orders --------------------------------------------------
2239
2240
  * @param {float} [params.leverage] Leverage size of the order
2240
2241
  * @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
@@ -2575,7 +2576,7 @@ export default class kucoin extends Exchange {
2575
2576
  * @param {string} id order id
2576
2577
  * @param {string} symbol unified symbol of the market the order was made in
2577
2578
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2578
- * @param {bool} [params.stop] True if cancelling a stop order
2579
+ * @param {bool} [params.trigger] True if cancelling a stop order
2579
2580
  * @param {bool} [params.hf] false, // true for hf order
2580
2581
  * @param {bool} [params.sync] false, // true to use the hf sync call
2581
2582
  * @returns Response from the exchange
@@ -2584,7 +2585,7 @@ export default class kucoin extends Exchange {
2584
2585
  await this.loadMarkets();
2585
2586
  const request = {};
2586
2587
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
2587
- const stop = this.safeBool2(params, 'stop', 'trigger', false);
2588
+ const trigger = this.safeBool2(params, 'stop', 'trigger', false);
2588
2589
  let hf = undefined;
2589
2590
  [hf, params] = this.handleHfAndParams(params);
2590
2591
  let useSync = false;
@@ -2600,7 +2601,7 @@ export default class kucoin extends Exchange {
2600
2601
  params = this.omit(params, ['clientOid', 'clientOrderId', 'stop', 'trigger']);
2601
2602
  if (clientOrderId !== undefined) {
2602
2603
  request['clientOid'] = clientOrderId;
2603
- if (stop) {
2604
+ if (trigger) {
2604
2605
  response = await this.privateDeleteStopOrderCancelOrderByClientOid(this.extend(request, params));
2605
2606
  //
2606
2607
  // {
@@ -2644,7 +2645,7 @@ export default class kucoin extends Exchange {
2644
2645
  }
2645
2646
  else {
2646
2647
  request['orderId'] = id;
2647
- if (stop) {
2648
+ if (trigger) {
2648
2649
  response = await this.privateDeleteStopOrderOrderId(this.extend(request, params));
2649
2650
  //
2650
2651
  // {
@@ -2696,7 +2697,7 @@ export default class kucoin extends Exchange {
2696
2697
  * @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
2697
2698
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2698
2699
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2699
- * @param {bool} [params.stop] *invalid for isolated margin* true if cancelling all stop orders
2700
+ * @param {bool} [params.trigger] *invalid for isolated margin* true if cancelling all stop orders
2700
2701
  * @param {string} [params.marginMode] 'cross' or 'isolated'
2701
2702
  * @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
2702
2703
  * @param {bool} [params.hf] false, // true for hf order
@@ -2705,7 +2706,7 @@ export default class kucoin extends Exchange {
2705
2706
  async cancelAllOrders(symbol = undefined, params = {}) {
2706
2707
  await this.loadMarkets();
2707
2708
  const request = {};
2708
- const stop = this.safeBool(params, 'stop', false);
2709
+ const trigger = this.safeBool(params, 'stop', false);
2709
2710
  let hf = undefined;
2710
2711
  [hf, params] = this.handleHfAndParams(params);
2711
2712
  params = this.omit(params, 'stop');
@@ -2715,12 +2716,12 @@ export default class kucoin extends Exchange {
2715
2716
  }
2716
2717
  if (marginMode !== undefined) {
2717
2718
  request['tradeType'] = this.options['marginModes'][marginMode];
2718
- if (marginMode === 'isolated' && stop) {
2719
+ if (marginMode === 'isolated' && trigger) {
2719
2720
  throw new BadRequest(this.id + ' cancelAllOrders does not support isolated margin for stop orders');
2720
2721
  }
2721
2722
  }
2722
2723
  let response = undefined;
2723
- if (stop) {
2724
+ if (trigger) {
2724
2725
  response = await this.privateDeleteStopOrderCancel(this.extend(request, query));
2725
2726
  }
2726
2727
  else if (hf) {
@@ -2753,9 +2754,9 @@ export default class kucoin extends Exchange {
2753
2754
  * @param {string} [params.side] buy or sell
2754
2755
  * @param {string} [params.type] limit, market, limit_stop or market_stop
2755
2756
  * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2756
- * @param {int} [params.currentPage] *stop orders only* current page
2757
- * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2758
- * @param {bool} [params.stop] True if fetching a stop order
2757
+ * @param {int} [params.currentPage] *trigger orders only* current page
2758
+ * @param {string} [params.orderIds] *trigger orders only* comma seperated order ID list
2759
+ * @param {bool} [params.trigger] True if fetching a trigger order
2759
2760
  * @param {bool} [params.hf] false, // true for hf order
2760
2761
  * @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2761
2762
  */
@@ -2877,7 +2878,7 @@ export default class kucoin extends Exchange {
2877
2878
  * @param {string} [params.side] buy or sell
2878
2879
  * @param {string} [params.type] limit, market, limit_stop or market_stop
2879
2880
  * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2880
- * @param {bool} [params.stop] True if fetching a stop order
2881
+ * @param {bool} [params.trigger] True if fetching a trigger order
2881
2882
  * @param {bool} [params.hf] false, // true for hf order
2882
2883
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2883
2884
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2904,12 +2905,12 @@ export default class kucoin extends Exchange {
2904
2905
  * @param {int} [limit] the maximum number of open orders structures to retrieve
2905
2906
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2906
2907
  * @param {int} [params.until] end time in ms
2907
- * @param {bool} [params.stop] true if fetching stop orders
2908
+ * @param {bool} [params.trigger] true if fetching trigger orders
2908
2909
  * @param {string} [params.side] buy or sell
2909
2910
  * @param {string} [params.type] limit, market, limit_stop or market_stop
2910
2911
  * @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
2911
- * @param {int} [params.currentPage] *stop orders only* current page
2912
- * @param {string} [params.orderIds] *stop orders only* comma seperated order ID list
2912
+ * @param {int} [params.currentPage] *trigger orders only* current page
2913
+ * @param {string} [params.orderIds] *trigger orders only* comma seperated order ID list
2913
2914
  * @param {bool} [params.hf] false, // true for hf order
2914
2915
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2915
2916
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2934,9 +2935,9 @@ export default class kucoin extends Exchange {
2934
2935
  * @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
2935
2936
  * @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
2936
2937
  * @param {string} id Order id
2937
- * @param {string} symbol not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
2938
+ * @param {string} symbol not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
2938
2939
  * @param {object} [params] exchange specific parameters
2939
- * @param {bool} [params.stop] true if fetching a stop order
2940
+ * @param {bool} [params.trigger] true if fetching a trigger order
2940
2941
  * @param {bool} [params.hf] false, // true for hf order
2941
2942
  * @param {bool} [params.clientOid] unique order id created by users to identify their orders
2942
2943
  * @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2945,7 +2946,7 @@ export default class kucoin extends Exchange {
2945
2946
  await this.loadMarkets();
2946
2947
  const request = {};
2947
2948
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
2948
- const stop = this.safeBool2(params, 'stop', 'trigger', false);
2949
+ const trigger = this.safeBool2(params, 'stop', 'trigger', false);
2949
2950
  let hf = undefined;
2950
2951
  [hf, params] = this.handleHfAndParams(params);
2951
2952
  let market = undefined;
@@ -2962,7 +2963,7 @@ export default class kucoin extends Exchange {
2962
2963
  let response = undefined;
2963
2964
  if (clientOrderId !== undefined) {
2964
2965
  request['clientOid'] = clientOrderId;
2965
- if (stop) {
2966
+ if (trigger) {
2966
2967
  if (symbol !== undefined) {
2967
2968
  request['symbol'] = market['id'];
2968
2969
  }
@@ -2983,7 +2984,7 @@ export default class kucoin extends Exchange {
2983
2984
  throw new InvalidOrder(this.id + ' fetchOrder() requires an order id');
2984
2985
  }
2985
2986
  request['orderId'] = id;
2986
- if (stop) {
2987
+ if (trigger) {
2987
2988
  response = await this.privateGetStopOrderOrderId(this.extend(request, params));
2988
2989
  }
2989
2990
  else if (hf) {
@@ -3126,7 +3127,7 @@ export default class kucoin extends Exchange {
3126
3127
  const feeCurrencyId = this.safeString(order, 'feeCurrency');
3127
3128
  const cancelExist = this.safeBool(order, 'cancelExist', false);
3128
3129
  const responseStop = this.safeString(order, 'stop');
3129
- const stop = responseStop !== undefined;
3130
+ const trigger = responseStop !== undefined;
3130
3131
  const stopTriggered = this.safeBool(order, 'stopTriggered', false);
3131
3132
  const isActive = this.safeBool2(order, 'isActive', 'active');
3132
3133
  const responseStatus = this.safeString(order, 'status');
@@ -3139,7 +3140,7 @@ export default class kucoin extends Exchange {
3139
3140
  status = 'closed';
3140
3141
  }
3141
3142
  }
3142
- if (stop) {
3143
+ if (trigger) {
3143
3144
  if (responseStatus === 'NEW') {
3144
3145
  status = 'open';
3145
3146
  }
@@ -4366,7 +4367,7 @@ export default class kucoin extends Exchange {
4366
4367
  * @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
4367
4368
  * @param {int} [params.until] the latest time in ms to fetch entries for
4368
4369
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4369
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4370
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
4370
4371
  */
4371
4372
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
4372
4373
  await this.loadMarkets();
package/js/src/luno.d.ts CHANGED
@@ -202,7 +202,7 @@ export default class luno extends Exchange {
202
202
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
203
203
  * @param {int} [limit] max number of ledger entries to return, default is undefined
204
204
  * @param {object} [params] extra parameters specific to the exchange API endpoint
205
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
205
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
206
206
  */
207
207
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
208
208
  parseLedgerComment(comment: any): {
package/js/src/luno.js CHANGED
@@ -999,7 +999,7 @@ export default class luno extends Exchange {
999
999
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
1000
1000
  * @param {int} [limit] max number of ledger entries to return, default is undefined
1001
1001
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1002
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
1002
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
1003
1003
  */
1004
1004
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1005
1005
  await this.loadMarkets();
package/js/src/mexc.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/mexc.js';
2
- import type { TransferEntry, IndexType, Int, OrderSide, Balances, OrderType, OHLCV, FundingRateHistory, Position, OrderBook, OrderRequest, FundingHistory, Order, Str, Trade, Transaction, Ticker, Tickers, Strings, Market, Currency, Leverage, Num, Account, MarginModification, Currencies, TradingFees, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress } from './base/types.js';
2
+ import type { TransferEntry, IndexType, Int, OrderSide, Balances, OrderType, OHLCV, FundingRateHistory, Position, OrderBook, OrderRequest, FundingHistory, Order, Str, Trade, Transaction, Ticker, Tickers, Strings, Market, Currency, Leverage, Num, Account, MarginModification, Currencies, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress, TradingFeeInterface } from './base/types.js';
3
3
  /**
4
4
  * @class mexc
5
5
  * @augments Exchange
@@ -215,7 +215,6 @@ export default class mexc extends Exchange {
215
215
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
216
216
  * @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
217
217
  * @param {object} [params] extra parameters specific to the exchange API endpoint
218
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
219
218
  * @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
220
219
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
221
220
  */
@@ -223,7 +222,7 @@ export default class mexc extends Exchange {
223
222
  /**
224
223
  * @ignore
225
224
  * @method
226
- * @name mexc#createOrder
225
+ * @name mexc#createSwapOrder
227
226
  * @description create a trade order
228
227
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
229
228
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
@@ -388,14 +387,14 @@ export default class mexc extends Exchange {
388
387
  fetchAccounts(params?: {}): Promise<Account[]>;
389
388
  /**
390
389
  * @method
391
- * @name mexc#fetchTradingFees
392
- * @description fetch the trading fees for multiple markets
393
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
394
- * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
390
+ * @name mexc#fetchTradingFee
391
+ * @description fetch the trading fees for a market
392
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
393
+ * @param {string} symbol unified market symbol
395
394
  * @param {object} [params] extra parameters specific to the exchange API endpoint
396
- * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
395
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
397
396
  */
398
- fetchTradingFees(params?: {}): Promise<TradingFees>;
397
+ fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
399
398
  customParseBalance(response: any, marketType: any): Balances;
400
399
  parseBalanceHelper(entry: any): import("./base/types.js").BalanceAccount;
401
400
  /**
package/js/src/mexc.js CHANGED
@@ -121,8 +121,8 @@ export default class mexc extends Exchange {
121
121
  'fetchTickers': true,
122
122
  'fetchTime': true,
123
123
  'fetchTrades': true,
124
- 'fetchTradingFee': undefined,
125
- 'fetchTradingFees': true,
124
+ 'fetchTradingFee': true,
125
+ 'fetchTradingFees': false,
126
126
  'fetchTradingLimits': undefined,
127
127
  'fetchTransactionFee': 'emulated',
128
128
  'fetchTransactionFees': true,
@@ -195,6 +195,7 @@ export default class mexc extends Exchange {
195
195
  'allOrders': 10,
196
196
  'account': 10,
197
197
  'myTrades': 10,
198
+ 'tradeFee': 10,
198
199
  'sub-account/list': 1,
199
200
  'sub-account/apiKey': 1,
200
201
  'capital/config/getall': 10,
@@ -676,6 +677,143 @@ export default class mexc extends Exchange {
676
677
  'maxTimeTillEnd': 90 * 86400 * 1000 - 1,
677
678
  'broker': 'CCXT',
678
679
  },
680
+ 'features': {
681
+ 'def': {
682
+ 'sandbox': false,
683
+ 'createOrder': {
684
+ 'marginMode': true,
685
+ 'triggerPrice': false,
686
+ 'triggerDirection': false,
687
+ 'triggerPriceType': {
688
+ 'last': false,
689
+ 'mark': false,
690
+ 'index': false,
691
+ },
692
+ 'stopLossPrice': false,
693
+ 'takeProfitPrice': false,
694
+ 'attachedStopLossTakeProfit': undefined,
695
+ 'timeInForce': {
696
+ 'IOC': true,
697
+ 'FOK': true,
698
+ 'PO': true,
699
+ 'GTD': false,
700
+ },
701
+ 'hedged': false,
702
+ // exchange-supported features
703
+ 'selfTradePrevention': false,
704
+ 'trailing': false,
705
+ 'iceberg': false,
706
+ },
707
+ 'createOrders': {
708
+ 'max': 20,
709
+ },
710
+ 'fetchMyTrades': {
711
+ 'marginMode': false,
712
+ 'limit': 100,
713
+ 'daysBack': 30,
714
+ 'untilDays': undefined,
715
+ },
716
+ 'fetchOrder': {
717
+ 'marginMode': false,
718
+ 'trigger': false,
719
+ 'trailing': false,
720
+ },
721
+ 'fetchOpenOrders': {
722
+ 'marginMode': true,
723
+ 'limit': undefined,
724
+ 'trigger': false,
725
+ 'trailing': false,
726
+ },
727
+ 'fetchOrders': {
728
+ 'marginMode': true,
729
+ 'limit': 1000,
730
+ 'daysBack': 7,
731
+ 'untilDays': 7,
732
+ 'trigger': false,
733
+ 'trailing': false,
734
+ },
735
+ 'fetchClosedOrders': {
736
+ 'marginMode': true,
737
+ 'limit': 1000,
738
+ 'daysBackClosed': 7,
739
+ 'daysBackCanceled': 7,
740
+ 'untilDays': 7,
741
+ 'trigger': false,
742
+ 'trailing': false,
743
+ },
744
+ 'fetchOHLCV': {
745
+ 'limit': 1000,
746
+ },
747
+ },
748
+ 'spot': {
749
+ 'extends': 'def',
750
+ },
751
+ 'forDerivs': {
752
+ 'extends': 'def',
753
+ 'createOrder': {
754
+ 'triggerPrice': true,
755
+ 'triggerPriceType': {
756
+ 'last': true,
757
+ 'mark': true,
758
+ 'index': true,
759
+ },
760
+ 'triggerDirection': true,
761
+ 'stopLossPrice': false,
762
+ 'takeProfitPrice': false,
763
+ 'hedged': true,
764
+ },
765
+ 'createOrders': {
766
+ 'max': 50,
767
+ },
768
+ 'fetchMyTrades': {
769
+ 'marginMode': false,
770
+ 'limit': 100,
771
+ 'daysBack': 90,
772
+ 'untilDays': 90,
773
+ },
774
+ 'fetchOrder': {
775
+ 'marginMode': false,
776
+ },
777
+ 'fetchOpenOrders': {
778
+ 'marginMode': false,
779
+ 'limit': 100,
780
+ 'trigger': true,
781
+ 'trailing': false,
782
+ },
783
+ 'fetchOrders': {
784
+ 'marginMode': false,
785
+ 'limit': 100,
786
+ 'daysBack': 90,
787
+ 'untilDays': 90,
788
+ 'trigger': true,
789
+ 'trailing': false,
790
+ },
791
+ 'fetchClosedOrders': {
792
+ 'marginMode': false,
793
+ 'limit': 100,
794
+ 'daysBackClosed': 90,
795
+ 'daysBackCanceled': undefined,
796
+ 'untilDays': 90,
797
+ 'trigger': true,
798
+ 'trailing': false,
799
+ },
800
+ 'fetchOHLCV': {
801
+ 'limit': 2000,
802
+ },
803
+ },
804
+ 'swap': {
805
+ 'linear': {
806
+ 'extends': 'forDerivs',
807
+ },
808
+ 'inverse': {
809
+ 'extends': 'forDerivs',
810
+ },
811
+ },
812
+ 'future': {
813
+ 'linear': undefined,
814
+ 'inverse': undefined,
815
+ },
816
+ },
679
817
  'commonCurrencies': {
680
818
  'BEYONDPROTOCOL': 'BEYOND',
681
819
  'BIFI': 'BIFIF',
@@ -2237,7 +2375,6 @@ export default class mexc extends Exchange {
2237
2375
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2238
2376
  * @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
2239
2377
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2240
- * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
2241
2378
  * @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
2242
2379
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2243
2380
  */
@@ -2286,7 +2423,7 @@ export default class mexc extends Exchange {
2286
2423
  /**
2287
2424
  * @ignore
2288
2425
  * @method
2289
- * @name mexc#createOrder
2426
+ * @name mexc#createSwapOrder
2290
2427
  * @description create a trade order
2291
2428
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
2292
2429
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
@@ -3607,33 +3744,43 @@ export default class mexc extends Exchange {
3607
3744
  }
3608
3745
  /**
3609
3746
  * @method
3610
- * @name mexc#fetchTradingFees
3611
- * @description fetch the trading fees for multiple markets
3612
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
3613
- * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
3747
+ * @name mexc#fetchTradingFee
3748
+ * @description fetch the trading fees for a market
3749
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
3750
+ * @param {string} symbol unified market symbol
3614
3751
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3615
- * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
3752
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
3616
3753
  */
3617
- async fetchTradingFees(params = {}) {
3754
+ async fetchTradingFee(symbol, params = {}) {
3618
3755
  await this.loadMarkets();
3619
- const response = await this.fetchAccountHelper('spot', params);
3620
- let makerFee = this.safeString(response, 'makerCommission');
3621
- let takerFee = this.safeString(response, 'takerCommission');
3622
- makerFee = Precise.stringDiv(makerFee, '1000');
3623
- takerFee = Precise.stringDiv(takerFee, '1000');
3624
- const result = {};
3625
- for (let i = 0; i < this.symbols.length; i++) {
3626
- const symbol = this.symbols[i];
3627
- result[symbol] = {
3628
- 'symbol': symbol,
3629
- 'maker': this.parseNumber(makerFee),
3630
- 'taker': this.parseNumber(takerFee),
3631
- 'percentage': true,
3632
- 'tierBased': false,
3633
- 'info': response,
3634
- };
3756
+ const market = this.market(symbol);
3757
+ if (!market['spot']) {
3758
+ throw new BadRequest(this.id + ' fetchTradingFee() supports spot markets only');
3635
3759
  }
3636
- return result;
3760
+ const request = {
3761
+ 'symbol': market['id'],
3762
+ };
3763
+ const response = await this.spotPrivateGetTradeFee(this.extend(request, params));
3764
+ //
3765
+ // {
3766
+ // "data":{
3767
+ // "makerCommission":0.003000000000000000,
3768
+ // "takerCommission":0.003000000000000000
3769
+ // },
3770
+ // "code":0,
3771
+ // "msg":"success",
3772
+ // "timestamp":1669109672717
3773
+ // }
3774
+ //
3775
+ const data = this.safeDict(response, 'data', {});
3776
+ return {
3777
+ 'info': data,
3778
+ 'symbol': symbol,
3779
+ 'maker': this.safeNumber(data, 'makerCommission'),
3780
+ 'taker': this.safeNumber(data, 'takerCommission'),
3781
+ 'percentage': undefined,
3782
+ 'tierBased': undefined,
3783
+ };
3637
3784
  }
3638
3785
  customParseBalance(response, marketType) {
3639
3786
  //
package/js/src/ndax.d.ts CHANGED
@@ -113,7 +113,7 @@ export default class ndax extends Exchange {
113
113
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
114
114
  * @param {int} [limit] max number of ledger entries to return, default is undefined
115
115
  * @param {object} [params] extra parameters specific to the exchange API endpoint
116
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
116
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
117
117
  */
118
118
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
119
119
  parseOrderStatus(status: Str): string;
package/js/src/ndax.js CHANGED
@@ -1221,7 +1221,7 @@ export default class ndax extends Exchange {
1221
1221
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
1222
1222
  * @param {int} [limit] max number of ledger entries to return, default is undefined
1223
1223
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1224
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
1224
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
1225
1225
  */
1226
1226
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
1227
1227
  const omsId = this.safeInteger(this.options, 'omsId', 1);
@@ -155,7 +155,7 @@ export default class okcoin extends Exchange {
155
155
  * @param {string} id order id
156
156
  * @param {string} symbol unified symbol of the market the order was made in
157
157
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158
- * @param {bool} [params.stop] True if cancel trigger or conditional orders
158
+ * @param {bool} [params.trigger] True if cancel trigger or conditional orders
159
159
  * @param {bool} [params.advanced] True if canceling advanced orders only
160
160
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
161
161
  */
@@ -198,7 +198,7 @@ export default class okcoin extends Exchange {
198
198
  * @param {int} [since] the earliest time in ms to fetch open orders for
199
199
  * @param {int} [limit] the maximum number of open orders structures to retrieve
200
200
  * @param {object} [params] extra parameters specific to the exchange API endpoint
201
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
201
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
202
202
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
203
203
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
204
204
  */
@@ -214,7 +214,7 @@ export default class okcoin extends Exchange {
214
214
  * @param {int} [since] the earliest time in ms to fetch orders for
215
215
  * @param {int} [limit] the maximum number of order structures to retrieve
216
216
  * @param {object} [params] extra parameters specific to the exchange API endpoint
217
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
217
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
218
218
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
219
219
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
220
220
  */
@@ -330,7 +330,7 @@ export default class okcoin extends Exchange {
330
330
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
331
331
  * @param {int} [limit] max number of ledger entries to return, default is undefined
332
332
  * @param {object} [params] extra parameters specific to the exchange API endpoint
333
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
333
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
334
334
  */
335
335
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
336
336
  parseLedgerEntryType(type: any): string;