ccxt 4.3.53 → 4.3.55

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 (231) 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 +1 -1
  6. package/dist/cjs/src/ascendex.js +6 -4
  7. package/dist/cjs/src/bigone.js +1 -1
  8. package/dist/cjs/src/binance.js +6 -6
  9. package/dist/cjs/src/bingx.js +4 -4
  10. package/dist/cjs/src/bit2c.js +1 -1
  11. package/dist/cjs/src/bitbank.js +1 -1
  12. package/dist/cjs/src/bitbns.js +1 -1
  13. package/dist/cjs/src/bitfinex.js +1 -1
  14. package/dist/cjs/src/bitfinex2.js +1 -1
  15. package/dist/cjs/src/bitflyer.js +1 -1
  16. package/dist/cjs/src/bitget.js +2 -2
  17. package/dist/cjs/src/bithumb.js +1 -1
  18. package/dist/cjs/src/bitmart.js +3 -3
  19. package/dist/cjs/src/bitmex.js +1 -1
  20. package/dist/cjs/src/bitopro.js +1 -1
  21. package/dist/cjs/src/bitrue.js +1 -1
  22. package/dist/cjs/src/bitso.js +1 -1
  23. package/dist/cjs/src/bitstamp.js +1 -1
  24. package/dist/cjs/src/bitteam.js +1 -1
  25. package/dist/cjs/src/bitvavo.js +2 -2
  26. package/dist/cjs/src/bl3p.js +1 -1
  27. package/dist/cjs/src/blockchaincom.js +28 -28
  28. package/dist/cjs/src/blofin.js +1 -1
  29. package/dist/cjs/src/btcalpha.js +4 -12
  30. package/dist/cjs/src/btcbox.js +1 -1
  31. package/dist/cjs/src/btcmarkets.js +1 -1
  32. package/dist/cjs/src/btcturk.js +1 -1
  33. package/dist/cjs/src/bybit.js +2 -2
  34. package/dist/cjs/src/cex.js +2 -2
  35. package/dist/cjs/src/coinbase.js +33 -33
  36. package/dist/cjs/src/coinbaseexchange.js +1 -1
  37. package/dist/cjs/src/coinbaseinternational.js +1 -1
  38. package/dist/cjs/src/coincheck.js +1 -1
  39. package/dist/cjs/src/coinex.js +2 -2
  40. package/dist/cjs/src/coinlist.js +2 -2
  41. package/dist/cjs/src/coinmate.js +1 -1
  42. package/dist/cjs/src/coinmetro.js +1 -1
  43. package/dist/cjs/src/coinone.js +1 -1
  44. package/dist/cjs/src/coinsph.js +1 -1
  45. package/dist/cjs/src/coinspot.js +1 -1
  46. package/dist/cjs/src/cryptocom.js +1 -1
  47. package/dist/cjs/src/currencycom.js +1 -1
  48. package/dist/cjs/src/delta.js +2 -2
  49. package/dist/cjs/src/deribit.js +4 -4
  50. package/dist/cjs/src/digifinex.js +2 -2
  51. package/dist/cjs/src/exmo.js +2 -2
  52. package/dist/cjs/src/gate.js +2 -2
  53. package/dist/cjs/src/gemini.js +1 -1
  54. package/dist/cjs/src/hitbtc.js +1 -1
  55. package/dist/cjs/src/hollaex.js +1 -1
  56. package/dist/cjs/src/htx.js +3 -3
  57. package/dist/cjs/src/huobijp.js +1 -1
  58. package/dist/cjs/src/hyperliquid.js +2 -2
  59. package/dist/cjs/src/idex.js +1 -1
  60. package/dist/cjs/src/independentreserve.js +1 -1
  61. package/dist/cjs/src/indodax.js +1 -1
  62. package/dist/cjs/src/kraken.js +2 -2
  63. package/dist/cjs/src/kucoin.js +136 -47
  64. package/dist/cjs/src/kucoinfutures.js +1 -1
  65. package/dist/cjs/src/kuna.js +1 -1
  66. package/dist/cjs/src/latoken.js +1 -1
  67. package/dist/cjs/src/lbank.js +1 -1
  68. package/dist/cjs/src/luno.js +1 -1
  69. package/dist/cjs/src/lykke.js +1 -1
  70. package/dist/cjs/src/mercado.js +1 -1
  71. package/dist/cjs/src/mexc.js +1 -1
  72. package/dist/cjs/src/ndax.js +1 -1
  73. package/dist/cjs/src/novadax.js +1 -1
  74. package/dist/cjs/src/oceanex.js +1 -1
  75. package/dist/cjs/src/okcoin.js +1 -1
  76. package/dist/cjs/src/okx.js +3 -3
  77. package/dist/cjs/src/onetrading.js +1 -1
  78. package/dist/cjs/src/oxfun.js +2 -2
  79. package/dist/cjs/src/p2b.js +1 -1
  80. package/dist/cjs/src/paymium.js +1 -1
  81. package/dist/cjs/src/phemex.js +30 -3
  82. package/dist/cjs/src/poloniex.js +6 -4
  83. package/dist/cjs/src/poloniexfutures.js +1 -1
  84. package/dist/cjs/src/pro/binance.js +3 -3
  85. package/dist/cjs/src/pro/bitvavo.js +2 -2
  86. package/dist/cjs/src/pro/bybit.js +22 -14
  87. package/dist/cjs/src/pro/cex.js +3 -3
  88. package/dist/cjs/src/pro/coinbase.js +23 -1
  89. package/dist/cjs/src/pro/cryptocom.js +1 -1
  90. package/dist/cjs/src/pro/gate.js +2 -2
  91. package/dist/cjs/src/pro/hitbtc.js +1 -1
  92. package/dist/cjs/src/pro/kraken.js +2 -2
  93. package/dist/cjs/src/pro/kucoin.js +66 -28
  94. package/dist/cjs/src/pro/okx.js +2 -2
  95. package/dist/cjs/src/pro/oxfun.js +2 -2
  96. package/dist/cjs/src/pro/poloniex.js +1 -1
  97. package/dist/cjs/src/pro/vertex.js +2 -2
  98. package/dist/cjs/src/probit.js +1 -1
  99. package/dist/cjs/src/timex.js +1 -1
  100. package/dist/cjs/src/tokocrypto.js +1 -1
  101. package/dist/cjs/src/tradeogre.js +1 -1
  102. package/dist/cjs/src/upbit.js +1 -1
  103. package/dist/cjs/src/vertex.js +2 -2
  104. package/dist/cjs/src/wavesexchange.js +1 -1
  105. package/dist/cjs/src/wazirx.js +1 -1
  106. package/dist/cjs/src/whitebit.js +2 -2
  107. package/dist/cjs/src/woo.js +34 -26
  108. package/dist/cjs/src/woofipro.js +3 -3
  109. package/dist/cjs/src/yobit.js +1 -1
  110. package/dist/cjs/src/zaif.js +1 -1
  111. package/dist/cjs/src/zonda.js +1 -1
  112. package/js/ccxt.d.ts +1 -1
  113. package/js/ccxt.js +1 -1
  114. package/js/src/abstract/kucoin.d.ts +3 -0
  115. package/js/src/abstract/kucoinfutures.d.ts +3 -0
  116. package/js/src/ace.js +1 -1
  117. package/js/src/alpaca.js +1 -1
  118. package/js/src/ascendex.d.ts +1 -1
  119. package/js/src/ascendex.js +6 -4
  120. package/js/src/base/types.d.ts +4 -0
  121. package/js/src/bigone.js +1 -1
  122. package/js/src/binance.js +6 -6
  123. package/js/src/bingx.js +4 -4
  124. package/js/src/bit2c.js +1 -1
  125. package/js/src/bitbank.js +1 -1
  126. package/js/src/bitbns.js +1 -1
  127. package/js/src/bitfinex.js +1 -1
  128. package/js/src/bitfinex2.js +1 -1
  129. package/js/src/bitflyer.js +1 -1
  130. package/js/src/bitget.js +2 -2
  131. package/js/src/bithumb.js +1 -1
  132. package/js/src/bitmart.js +3 -3
  133. package/js/src/bitmex.js +1 -1
  134. package/js/src/bitopro.js +1 -1
  135. package/js/src/bitrue.js +1 -1
  136. package/js/src/bitso.js +1 -1
  137. package/js/src/bitstamp.js +1 -1
  138. package/js/src/bitteam.js +1 -1
  139. package/js/src/bitvavo.js +2 -2
  140. package/js/src/bl3p.js +1 -1
  141. package/js/src/blockchaincom.js +28 -28
  142. package/js/src/blofin.js +1 -1
  143. package/js/src/btcalpha.js +5 -13
  144. package/js/src/btcbox.js +1 -1
  145. package/js/src/btcmarkets.js +1 -1
  146. package/js/src/btcturk.js +1 -1
  147. package/js/src/bybit.js +2 -2
  148. package/js/src/cex.js +2 -2
  149. package/js/src/coinbase.js +33 -33
  150. package/js/src/coinbaseexchange.js +1 -1
  151. package/js/src/coinbaseinternational.js +1 -1
  152. package/js/src/coincheck.js +1 -1
  153. package/js/src/coinex.js +2 -2
  154. package/js/src/coinlist.js +2 -2
  155. package/js/src/coinmate.js +1 -1
  156. package/js/src/coinmetro.js +1 -1
  157. package/js/src/coinone.js +1 -1
  158. package/js/src/coinsph.js +1 -1
  159. package/js/src/coinspot.js +1 -1
  160. package/js/src/cryptocom.js +1 -1
  161. package/js/src/currencycom.js +1 -1
  162. package/js/src/delta.js +2 -2
  163. package/js/src/deribit.js +4 -4
  164. package/js/src/digifinex.js +2 -2
  165. package/js/src/exmo.js +2 -2
  166. package/js/src/gate.js +2 -2
  167. package/js/src/gemini.js +1 -1
  168. package/js/src/hitbtc.js +1 -1
  169. package/js/src/hollaex.js +1 -1
  170. package/js/src/htx.js +3 -3
  171. package/js/src/huobijp.js +1 -1
  172. package/js/src/hyperliquid.js +2 -2
  173. package/js/src/idex.js +1 -1
  174. package/js/src/independentreserve.js +1 -1
  175. package/js/src/indodax.js +1 -1
  176. package/js/src/kraken.js +2 -2
  177. package/js/src/kucoin.d.ts +1 -0
  178. package/js/src/kucoin.js +136 -47
  179. package/js/src/kucoinfutures.js +1 -1
  180. package/js/src/kuna.js +1 -1
  181. package/js/src/latoken.js +1 -1
  182. package/js/src/lbank.js +1 -1
  183. package/js/src/luno.js +1 -1
  184. package/js/src/lykke.js +1 -1
  185. package/js/src/mercado.js +1 -1
  186. package/js/src/mexc.js +1 -1
  187. package/js/src/ndax.js +1 -1
  188. package/js/src/novadax.js +1 -1
  189. package/js/src/oceanex.js +1 -1
  190. package/js/src/okcoin.js +1 -1
  191. package/js/src/okx.js +3 -3
  192. package/js/src/onetrading.js +1 -1
  193. package/js/src/oxfun.js +2 -2
  194. package/js/src/p2b.js +1 -1
  195. package/js/src/paymium.js +1 -1
  196. package/js/src/phemex.d.ts +1 -1
  197. package/js/src/phemex.js +30 -3
  198. package/js/src/poloniex.js +6 -4
  199. package/js/src/poloniexfutures.js +1 -1
  200. package/js/src/pro/binance.js +3 -3
  201. package/js/src/pro/bitvavo.js +2 -2
  202. package/js/src/pro/bybit.d.ts +1 -1
  203. package/js/src/pro/bybit.js +22 -14
  204. package/js/src/pro/cex.js +3 -3
  205. package/js/src/pro/coinbase.d.ts +1 -0
  206. package/js/src/pro/coinbase.js +23 -1
  207. package/js/src/pro/cryptocom.js +1 -1
  208. package/js/src/pro/gate.js +2 -2
  209. package/js/src/pro/hitbtc.js +1 -1
  210. package/js/src/pro/kraken.js +2 -2
  211. package/js/src/pro/kucoin.js +66 -28
  212. package/js/src/pro/okx.js +2 -2
  213. package/js/src/pro/oxfun.js +2 -2
  214. package/js/src/pro/poloniex.js +1 -1
  215. package/js/src/pro/vertex.js +2 -2
  216. package/js/src/probit.js +1 -1
  217. package/js/src/timex.js +1 -1
  218. package/js/src/tokocrypto.js +1 -1
  219. package/js/src/tradeogre.js +1 -1
  220. package/js/src/upbit.js +1 -1
  221. package/js/src/vertex.js +2 -2
  222. package/js/src/wavesexchange.js +1 -1
  223. package/js/src/wazirx.js +1 -1
  224. package/js/src/whitebit.js +2 -2
  225. package/js/src/woo.d.ts +1 -0
  226. package/js/src/woo.js +34 -26
  227. package/js/src/woofipro.js +3 -3
  228. package/js/src/yobit.js +1 -1
  229. package/js/src/zaif.js +1 -1
  230. package/js/src/zonda.js +1 -1
  231. package/package.json +54 -52
@@ -455,7 +455,7 @@ export default class tradeogre extends Exchange {
455
455
  * @param {string} type must be 'limit'
456
456
  * @param {string} side 'buy' or 'sell'
457
457
  * @param {float} amount how much of currency you want to trade in units of base currency
458
- * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
458
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency
459
459
  * @param {object} [params] extra parameters specific to the exchange API endpoint
460
460
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
461
461
  */
package/js/src/upbit.js CHANGED
@@ -1037,7 +1037,7 @@ export default class upbit extends Exchange {
1037
1037
  * @param {string} type 'market' or 'limit'
1038
1038
  * @param {string} side 'buy' or 'sell'
1039
1039
  * @param {float} amount how much you want to trade in units of the base currency
1040
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1040
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1041
1041
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1042
1042
  * @param {float} [params.cost] for market buy orders, the quote quantity that can be used as an alternative for the amount
1043
1043
  * @param {string} [params.timeInForce] 'IOC' or 'FOK'
package/js/src/vertex.js CHANGED
@@ -1625,7 +1625,7 @@ export default class vertex extends Exchange {
1625
1625
  * @param {string} type 'market' or 'limit'
1626
1626
  * @param {string} side 'buy' or 'sell'
1627
1627
  * @param {float} amount how much of currency you want to trade in units of base currency
1628
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1628
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1629
1629
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1630
1630
  * @param {string} [params.timeInForce] ioc, fok
1631
1631
  * @param {bool} [params.postOnly] true or false whether the order is post-only
@@ -1729,7 +1729,7 @@ export default class vertex extends Exchange {
1729
1729
  * @param {string} type 'market' or 'limit'
1730
1730
  * @param {string} side 'buy' or 'sell'
1731
1731
  * @param {float} amount how much of currency you want to trade in units of base currency
1732
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
1732
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1733
1733
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1734
1734
  * @param {string} [params.timeInForce] ioc, fok
1735
1735
  * @param {bool} [params.postOnly] true or false whether the order is post-only
@@ -1283,7 +1283,7 @@ export default class wavesexchange extends Exchange {
1283
1283
  * @param {string} type 'market' or 'limit'
1284
1284
  * @param {string} side 'buy' or 'sell'
1285
1285
  * @param {float} amount how much of currency you want to trade in units of base currency
1286
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1286
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1287
1287
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1288
1288
  * @param {float} [params.stopPrice] The price at which a stop order is triggered at
1289
1289
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
package/js/src/wazirx.js CHANGED
@@ -849,7 +849,7 @@ export default class wazirx extends Exchange {
849
849
  * @param {string} type 'market' or 'limit'
850
850
  * @param {string} side 'buy' or 'sell'
851
851
  * @param {float} amount how much of currency you want to trade in units of base currency
852
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
852
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
853
853
  * @param {object} [params] extra parameters specific to the exchange API endpoint
854
854
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
855
855
  */
@@ -1244,7 +1244,7 @@ export default class whitebit extends Exchange {
1244
1244
  * @param {string} type 'market' or 'limit'
1245
1245
  * @param {string} side 'buy' or 'sell'
1246
1246
  * @param {float} amount how much of currency you want to trade in units of base currency
1247
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1247
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1248
1248
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1249
1249
  * @param {float} [params.cost] *market orders only* the cost of the order in units of the base currency
1250
1250
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1349,7 +1349,7 @@ export default class whitebit extends Exchange {
1349
1349
  * @param {string} type 'market' or 'limit'
1350
1350
  * @param {string} side 'buy' or 'sell'
1351
1351
  * @param {float} amount how much of currency you want to trade in units of base currency
1352
- * @param {float} price the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
1352
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1353
1353
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1354
1354
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1355
1355
  */
package/js/src/woo.d.ts CHANGED
@@ -22,6 +22,7 @@ export default class woo extends Exchange {
22
22
  fetchTradingFees(params?: {}): Promise<TradingFees>;
23
23
  fetchCurrencies(params?: {}): Promise<Currencies>;
24
24
  createMarketBuyOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
25
+ createMarketSellOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>;
25
26
  createTrailingAmountOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, trailingAmount?: any, trailingTriggerPrice?: any, params?: {}): Promise<Order>;
26
27
  createTrailingPercentOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, trailingPercent?: any, trailingTriggerPrice?: any, params?: {}): Promise<Order>;
27
28
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
package/js/src/woo.js CHANGED
@@ -45,7 +45,7 @@ export default class woo extends Exchange {
45
45
  'createMarketBuyOrderWithCost': true,
46
46
  'createMarketOrder': false,
47
47
  'createMarketOrderWithCost': false,
48
- 'createMarketSellOrderWithCost': false,
48
+ 'createMarketSellOrderWithCost': true,
49
49
  'createOrder': true,
50
50
  'createOrderWithTakeProfitAndStopLoss': true,
51
51
  'createReduceOnlyOrder': true,
@@ -853,8 +853,25 @@ export default class woo extends Exchange {
853
853
  if (!market['spot']) {
854
854
  throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
855
855
  }
856
- params['createMarketBuyOrderRequiresPrice'] = false;
857
- return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
856
+ return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
857
+ }
858
+ async createMarketSellOrderWithCost(symbol, cost, params = {}) {
859
+ /**
860
+ * @method
861
+ * @name woo#createMarketSellOrderWithCost
862
+ * @description create a market sell order by providing the symbol and cost
863
+ * @see https://docs.woo.org/#send-order
864
+ * @param {string} symbol unified symbol of the market to create an order in
865
+ * @param {float} cost how much you want to trade in units of the quote currency
866
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
867
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
868
+ */
869
+ await this.loadMarkets();
870
+ const market = this.market(symbol);
871
+ if (!market['spot']) {
872
+ throw new NotSupported(this.id + ' createMarketSellOrderWithCost() supports spot orders only');
873
+ }
874
+ return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
858
875
  }
859
876
  async createTrailingAmountOrder(symbol, type, side, amount, price = undefined, trailingAmount = undefined, trailingTriggerPrice = undefined, params = {}) {
860
877
  /**
@@ -919,7 +936,7 @@ export default class woo extends Exchange {
919
936
  * @param {string} type 'market' or 'limit'
920
937
  * @param {string} side 'buy' or 'sell'
921
938
  * @param {float} amount how much of currency you want to trade in units of base currency
922
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
939
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
923
940
  * @param {object} [params] extra parameters specific to the exchange API endpoint
924
941
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
925
942
  * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only)
@@ -977,33 +994,24 @@ export default class woo extends Exchange {
977
994
  if (reduceOnly) {
978
995
  request[reduceOnlyKey] = reduceOnly;
979
996
  }
980
- if (price !== undefined) {
997
+ if (!isMarket && price !== undefined) {
981
998
  request[priceKey] = this.priceToPrecision(symbol, price);
982
999
  }
983
1000
  if (isMarket && !isStop) {
984
1001
  // for market buy it requires the amount of quote currency to spend
985
- if (market['spot'] && orderSide === 'BUY') {
1002
+ const cost = this.safeString2(params, 'cost', 'order_amount');
1003
+ params = this.omit(params, ['cost', 'order_amount']);
1004
+ const isPriceProvided = price !== undefined;
1005
+ if (market['spot'] && (isPriceProvided || (cost !== undefined))) {
986
1006
  let quoteAmount = undefined;
987
- let createMarketBuyOrderRequiresPrice = true;
988
- [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
989
- const cost = this.safeNumber2(params, 'cost', 'order_amount');
990
- params = this.omit(params, ['cost', 'order_amount']);
991
1007
  if (cost !== undefined) {
992
1008
  quoteAmount = this.costToPrecision(symbol, cost);
993
1009
  }
994
- else if (createMarketBuyOrderRequiresPrice) {
995
- if (price === undefined) {
996
- throw new InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend (quote quantity) in the amount argument');
997
- }
998
- else {
999
- const amountString = this.numberToString(amount);
1000
- const priceString = this.numberToString(price);
1001
- const costRequest = Precise.stringMul(amountString, priceString);
1002
- quoteAmount = this.costToPrecision(symbol, costRequest);
1003
- }
1004
- }
1005
1010
  else {
1006
- quoteAmount = this.costToPrecision(symbol, amount);
1011
+ const amountString = this.numberToString(amount);
1012
+ const priceString = this.numberToString(price);
1013
+ const costRequest = Precise.stringMul(amountString, priceString);
1014
+ quoteAmount = this.costToPrecision(symbol, costRequest);
1007
1015
  }
1008
1016
  request['order_amount'] = quoteAmount;
1009
1017
  }
@@ -1127,7 +1135,7 @@ export default class woo extends Exchange {
1127
1135
  * @param {string} type 'market' or 'limit'
1128
1136
  * @param {string} side 'buy' or 'sell'
1129
1137
  * @param {float} amount how much of currency you want to trade in units of base currency
1130
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1138
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1131
1139
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1132
1140
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
1133
1141
  * @param {float} [params.stopLossPrice] price to trigger stop-loss orders
@@ -1608,8 +1616,8 @@ export default class woo extends Exchange {
1608
1616
  const side = this.safeStringLower(order, 'side');
1609
1617
  const filled = this.omitZero(this.safeValue2(order, 'executed', 'totalExecutedQuantity'));
1610
1618
  const average = this.omitZero(this.safeString2(order, 'average_executed_price', 'averageExecutedPrice'));
1611
- const remaining = Precise.stringSub(cost, filled);
1612
- const fee = this.safeValue2(order, 'total_fee', 'totalFee');
1619
+ // const remaining = Precise.stringSub (cost, filled);
1620
+ const fee = this.safeNumber2(order, 'total_fee', 'totalFee');
1613
1621
  const feeCurrency = this.safeString2(order, 'fee_asset', 'feeAsset');
1614
1622
  const transactions = this.safeValue(order, 'Transactions');
1615
1623
  const stopPrice = this.safeNumber(order, 'triggerPrice');
@@ -1650,7 +1658,7 @@ export default class woo extends Exchange {
1650
1658
  'average': average,
1651
1659
  'amount': amount,
1652
1660
  'filled': filled,
1653
- 'remaining': remaining,
1661
+ 'remaining': undefined,
1654
1662
  'cost': cost,
1655
1663
  'trades': transactions,
1656
1664
  'fee': {
@@ -1235,7 +1235,7 @@ export default class woofipro extends Exchange {
1235
1235
  * @param {string} type 'market' or 'limit'
1236
1236
  * @param {string} side 'buy' or 'sell'
1237
1237
  * @param {float} amount how much you want to trade in units of the base currency
1238
- * @param {float} [price] the price that the order is to be fullfilled, in units of the quote currency, ignored in market orders
1238
+ * @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
1239
1239
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1240
1240
  * @returns {object} request to be sent to the exchange
1241
1241
  */
@@ -1337,7 +1337,7 @@ export default class woofipro extends Exchange {
1337
1337
  * @param {string} type 'market' or 'limit'
1338
1338
  * @param {string} side 'buy' or 'sell'
1339
1339
  * @param {float} amount how much of currency you want to trade in units of base currency
1340
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1340
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1341
1341
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1342
1342
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
1343
1343
  * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only)
@@ -1462,7 +1462,7 @@ export default class woofipro extends Exchange {
1462
1462
  * @param {string} type 'market' or 'limit'
1463
1463
  * @param {string} side 'buy' or 'sell'
1464
1464
  * @param {float} amount how much of currency you want to trade in units of base currency
1465
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1465
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1466
1466
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1467
1467
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
1468
1468
  * @param {float} [params.stopLossPrice] price to trigger stop-loss orders
package/js/src/yobit.js CHANGED
@@ -793,7 +793,7 @@ export default class yobit extends Exchange {
793
793
  * @param {string} type must be 'limit'
794
794
  * @param {string} side 'buy' or 'sell'
795
795
  * @param {float} amount how much of currency you want to trade in units of base currency
796
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
796
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
797
797
  * @param {object} [params] extra parameters specific to the exchange API endpoint
798
798
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
799
799
  */
package/js/src/zaif.js CHANGED
@@ -444,7 +444,7 @@ export default class zaif extends Exchange {
444
444
  * @param {string} type must be 'limit'
445
445
  * @param {string} side 'buy' or 'sell'
446
446
  * @param {float} amount how much of currency you want to trade in units of base currency
447
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
447
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
448
448
  * @param {object} [params] extra parameters specific to the exchange API endpoint
449
449
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
450
450
  */
package/js/src/zonda.js CHANGED
@@ -1358,7 +1358,7 @@ export default class zonda extends Exchange {
1358
1358
  * @param {string} type 'market' or 'limit'
1359
1359
  * @param {string} side 'buy' or 'sell'
1360
1360
  * @param {float} amount how much of currency you want to trade in units of base currency
1361
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1361
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1362
1362
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1363
1363
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1364
1364
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.3.53",
3
+ "version": "4.3.55",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "readme": "README.md",
27
27
  "scripts": {
28
28
  "instrument": "nyc instrument js/ jsInstrumented/",
29
- "nyc-coverage": "nyc --reporter=html --reporter=lcov --exclude='js/src/pro/**' --exclude='js/src/base/**' --exclude='js/src/test/**' --exclude='js/src/abstract/**' --exclude='js/src/static_dependencies' node jsInstrumented/src/test/test.js --requestTests --responseTests",
29
+ "nyc-coverage": "nyc --reporter=html --reporter=lcov --exclude='js/src/pro/**' --exclude='js/src/base/**' --exclude='js/src/test/**' --exclude='js/src/abstract/**' --exclude='js/src/static_dependencies' node jsInstrumented/src/test/tests.init.js --requestTests --responseTests",
30
30
  "coverage-js": "npm run instrument && npm run nyc-coverage && rm -rf jsInstrumented",
31
31
  "docker": "docker-compose run --rm ccxt",
32
32
  "fixTSBug": "node build/fixTSBug",
@@ -48,31 +48,6 @@
48
48
  "pre-transpile": "npm run export-exchanges && npm run vss && npm run tsBuild && npm run emitAPI && npm run validate-types && npm run tsBuildExamples && npm run copy-python-files && npm run check-js-syntax && npm run bundle",
49
49
  "pre-transpile-pr": "npm run export-exchanges && npm run tsBuild && npm run emitAPI && npm run check-js-syntax",
50
50
  "post-transpile": "npm run check-python-syntax && npm run check-php-syntax",
51
- "test-ws": "npm run build && node run-tests --ws --useProxy",
52
- "test": "npm run build && npm run commonjs-test && npm run static-tests && node run-tests --useProxy",
53
- "fast-test": "npm run commonjs-test && node run-tests --js --useProxy",
54
- "commonjs-test": "node ./utils/test-commonjs.cjs",
55
- "package-test": "./utils/package-test.sh",
56
- "fast-test-ws": "node run-tests --ws --js",
57
- "test-base": "npm run test-js-base && npm run test-python-base && npm run test-php-base && npm run test-cs-base && npm run id-tests && npm run static-tests",
58
- "test-base-ws": "npm run test-js-base-ws && npm run test-python-base-ws && npm run test-php-base-ws && npm run test-cs-base-ws",
59
- "test-js": "npm run commonjs-test && node run-tests --js --useProxy",
60
- "test-js-ws": "node run-tests --ws --js --useProxy",
61
- "test-py": "node run-tests --python --useProxy",
62
- "test-py-ws": "node run-tests --ws --python --useProxy",
63
- "test-php": "node run-tests --php --useProxy",
64
- "test-php-ws": "node run-tests --ws --php --useProxy",
65
- "test-csharp": "npm run commonjs-test && node run-tests --csharp --useProxy",
66
- "test-csharp-ws": "node run-tests --ws --csharp --useProxy",
67
- "test-js-base": "node ./js/src/test/base/test.base.js",
68
- "test-js-base-ws": "npm run test-js-cache && npm run test-js-orderbook",
69
- "test-python-base": "python3 python/ccxt/test/base/test_number.py && python3 python/ccxt/test/base/test_crypto.py",
70
- "test-python-base-ws": "npm run test-python-cache && npm run test-python-orderbook",
71
- "test-php-base": "php -f php/test/base/test_number.php && php -f php/test/base/test_crypto.php",
72
- "test-php-base-ws": "npm run test-php-cache && npm run test-php-orderbook",
73
- "test-cs-base": "dotnet run --project cs/tests/tests.csproj --base",
74
- "test-cs-base-ws": "dotnet run --project cs/tests/tests.csproj --cache && dotnet run --project cs/tests/tests.csproj --orderbook",
75
- "test-freshness": "tsx ./utils/test-freshness.ts",
76
51
  "cli.js": "node ./examples/js/cli.js",
77
52
  "cli.py": "python3 ./examples/py/cli.py",
78
53
  "cli.php": "php ./examples/php/cli.php",
@@ -94,18 +69,6 @@
94
69
  "fast-force-transpileRest": "node build/transpile.js --multiprocess --force",
95
70
  "force-transpileWs": "node build/transpileWS --force",
96
71
  "fast-force-transpileWs": "node build/transpileWS.js --multiprocess --force",
97
- "test-js-cache": "node js/src/pro/test/base/test.Cache.js",
98
- "test-js-orderbook": "node js/src/pro/test/base/test.OrderBook.js",
99
- "test-python-future": "python python/ccxt/pro/test/base/test_future.py",
100
- "test-python-close": "python python/ccxt/pro/test/base/test_close.py",
101
- "test-python-cache": "python python/ccxt/pro/test/base/test_cache.py",
102
- "test-python-orderbook": "python python/ccxt/pro/test/base/test_order_book.py",
103
- "test-cs-cache": "dotnet run --project cs/tests/tests.csproj --cache",
104
- "test-ws-php-base": "npm run test-php-cache && npm run test-php-orderbook",
105
- "test-php-cache": "php -f php/pro/test/base/test_cache.php",
106
- "test-php-orderbook": "php -f php/pro/test/base/test_order_book.php",
107
- "test-cs-orderbook": "dotnet run --project cs/tests/tests.csproj --orderbook",
108
- "test-ws-cs-base": "npm run test-cs-cache && npm run test-cs-orderbook",
109
72
  "vss": "node build/vss",
110
73
  "lint": "eslint \"ts/src/*.ts\" \"ts/src/base/Exchange.ts\" \"ts/src/pro/*.ts\" --cache --cache-location .cache/eslintcache --cache-strategy metadata",
111
74
  "check-syntax": "npm run transpile && npm run check-js-syntax && npm run check-python-syntax && npm run check-php-syntax",
@@ -126,22 +89,61 @@
126
89
  "copy-python-readme": "node build/copy README.md python/README.md",
127
90
  "postinstall": "node postinstall.js",
128
91
  "validate-types": "tsx build/validate-types.ts",
129
- "response-js": "node js/src/test/test.js --responseTests",
130
- "request-js": "node js/src/test/test.js --requestTests",
131
- "request-py": "python3 python/ccxt/test/test_async.py --requestTests",
132
- "response-py": "python3 python/ccxt/test/test_async.py --responseTests",
133
- "request-cs": "dotnet run --project cs/tests/tests.csproj --requestTests",
134
- "response-cs": "dotnet run --project cs/tests/tests.csproj --responseTests",
135
- "request-php": "php php/test/test_async.php --requestTests",
136
- "response-php": "php php/test/test_async.php --responseTests",
92
+ "live-tests": "node run-tests --useProxy",
93
+ "live-tests-rest": "npm run live-tests",
94
+ "live-tests-ws": "npm run live-tests -- --ws",
95
+ "live-tests-rest-ts": "npm run live-tests -- --ts",
96
+ "live-tests-ws-ts": "npm run live-tests -- --ts --ws",
97
+ "live-tests-rest-js": "npm run live-tests -- --js",
98
+ "live-tests-ws-js": "npm run live-tests -- --js --ws",
99
+ "live-tests-rest-py": "npm run live-tests -- --python",
100
+ "live-tests-ws-py": "npm run live-tests -- --python --ws",
101
+ "live-tests-rest-php": "npm run live-tests -- --php",
102
+ "live-tests-ws-php": "npm run live-tests -- --php --ws",
103
+ "live-tests-rest-csharp": "npm run live-tests -- --csharp",
104
+ "live-tests-ws-csharp": "npm run live-tests -- --csharp --ws",
105
+ "ti-ts": "tsx ts/src/test/tests.init.ts",
106
+ "ti-js": "node js/src/test/tests.init.js",
107
+ "ti-py": "python3 python/ccxt/test/tests_init.py",
108
+ "ti-php": "php php/test/tests_init.php",
109
+ "ti-cs": "dotnet run --project cs/tests/tests.csproj",
110
+ "request-ts": "npm run ti-ts -- --requestTests",
111
+ "request-js": "npm run ti-js -- --requestTests",
112
+ "request-py-async": "npm run ti-py -- --requestTests",
113
+ "request-py-sync": "npm run ti-py -- --requestTests --sync",
114
+ "request-py": "npm run request-py-sync && npm run request-py-async",
115
+ "request-php-async": "npm run ti-php -- --requestTests",
116
+ "request-php-sync": "npm run ti-php -- --requestTests --sync",
117
+ "request-php": "npm run request-php-sync && npm run request-php-async",
118
+ "request-cs": "npm run ti-cs -- --requestTests",
137
119
  "request-tests": "npm run request-js && npm run request-py && npm run request-php && npm run request-cs",
120
+ "response-ts": "npm run ti-ts -- --responseTests",
121
+ "response-js": "npm run ti-js -- --responseTests",
122
+ "response-py": "npm run ti-py -- --responseTests",
123
+ "response-cs": "npm run ti-cs -- --responseTests",
124
+ "response-php": "npm run ti-php -- --responseTests",
138
125
  "response-tests": "npm run response-js && npm run response-py && npm run response-php && npm run response-cs",
139
- "static-tests": "npm run request-tests && npm run response-tests",
140
- "id-tests-js": "node js/src/test/test.js --idTests",
141
- "id-tests-py": "python python/ccxt/test/test_async.py --idTests",
142
- "id-tests-php": "php php/test/test_async.php --idTests",
143
- "id-tests-cs": "dotnet run --project cs/tests/tests.csproj --idTests",
126
+ "id-tests-js": "npm run ti-js -- --idTests",
127
+ "id-tests-py": "npm run ti-py -- --idTests",
128
+ "id-tests-php": "npm run ti-php -- --idTests",
129
+ "id-tests-cs": "npm run ti-cs -- --idTests",
144
130
  "id-tests": "npm run id-tests-js && npm run id-tests-py && npm run id-tests-php && npm run id-tests-cs",
131
+ "test-base-rest-ts": "npm run ti-ts -- --baseTests",
132
+ "test-base-rest-js": "npm run ti-js -- --baseTests",
133
+ "test-base-rest-py": "npm run ti-py -- --baseTests",
134
+ "test-base-rest-php": "npm run ti-php -- --baseTests",
135
+ "test-base-rest-cs": "npm run ti-cs -- --baseTests",
136
+ "test-base-ws-ts": "npm run ti-ts -- --baseTests --ws",
137
+ "test-base-ws-js": "npm run ti-js -- --baseTests --ws",
138
+ "test-base-ws-py": "npm run ti-py -- --baseTests --ws",
139
+ "test-base-ws-php": "npm run ti-php -- --baseTests --ws",
140
+ "test-base-ws-cs": "npm run ti-cs -- --baseTests --ws",
141
+ "test-base-rest": "npm run test-base-rest-js && npm run test-base-rest-py && npm run test-base-rest-php && npm run test-base-rest-cs",
142
+ "test-base-ws": "npm run test-base-ws-js && npm run test-base-ws-py && npm run test-base-ws-php && npm run test-base-ws-cs",
143
+ "test": "npm run build && npm run commonjs-test && npm run id-tests && npm run request-tests && npm run response-tests && npm run live-tests",
144
+ "commonjs-test": "node ./utils/test-commonjs.cjs",
145
+ "package-test": "./utils/package-test.sh",
146
+ "test-freshness": "tsx ./utils/test-freshness.ts",
145
147
  "benchmark": "tsx examples/ts/benchmark.ts"
146
148
  },
147
149
  "types": "./js/ccxt.d.ts",