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
@@ -1549,8 +1549,6 @@ class tokocrypto extends tokocrypto$1 {
1549
1549
  timeInForce = 'PO';
1550
1550
  }
1551
1551
  const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');
1552
- const stopPriceString = this.safeString(order, 'stopPrice');
1553
- const stopPrice = this.parseNumber(this.omitZero(stopPriceString));
1554
1552
  return this.safeOrder({
1555
1553
  'info': order,
1556
1554
  'id': id,
@@ -1565,8 +1563,7 @@ class tokocrypto extends tokocrypto$1 {
1565
1563
  'reduceOnly': this.safeValue(order, 'reduceOnly'),
1566
1564
  'side': side,
1567
1565
  'price': price,
1568
- 'stopPrice': stopPrice,
1569
- 'triggerPrice': stopPrice,
1566
+ 'triggerPrice': this.parseNumber(this.omitZero(this.safeString(order, 'stopPrice'))),
1570
1567
  'amount': amount,
1571
1568
  'cost': cost,
1572
1569
  'average': average,
@@ -1614,8 +1611,8 @@ class tokocrypto extends tokocrypto$1 {
1614
1611
  params = this.omit(params, ['clientId', 'clientOrderId']);
1615
1612
  const initialUppercaseType = type.toUpperCase();
1616
1613
  let uppercaseType = initialUppercaseType;
1617
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1618
- if (stopPrice !== undefined) {
1614
+ const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1615
+ if (triggerPrice !== undefined) {
1619
1616
  params = this.omit(params, ['triggerPrice', 'stopPrice']);
1620
1617
  if (uppercaseType === 'MARKET') {
1621
1618
  uppercaseType = 'STOP_LOSS';
@@ -1627,7 +1624,7 @@ class tokocrypto extends tokocrypto$1 {
1627
1624
  const validOrderTypes = this.safeValue(market['info'], 'orderTypes');
1628
1625
  if (!this.inArray(uppercaseType, validOrderTypes)) {
1629
1626
  if (initialUppercaseType !== uppercaseType) {
1630
- throw new errors.InvalidOrder(this.id + ' stopPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders');
1627
+ throw new errors.InvalidOrder(this.id + ' triggerPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders');
1631
1628
  }
1632
1629
  else {
1633
1630
  throw new errors.InvalidOrder(this.id + ' ' + type + ' is not a valid order type for the ' + symbol + ' market');
@@ -1666,7 +1663,7 @@ class tokocrypto extends tokocrypto$1 {
1666
1663
  }
1667
1664
  // additional required fields depending on the order type
1668
1665
  let priceIsRequired = false;
1669
- let stopPriceIsRequired = false;
1666
+ let triggerPriceIsRequired = false;
1670
1667
  let quantityIsRequired = false;
1671
1668
  //
1672
1669
  // spot/margin
@@ -1714,7 +1711,7 @@ class tokocrypto extends tokocrypto$1 {
1714
1711
  quantityIsRequired = true;
1715
1712
  }
1716
1713
  else if ((uppercaseType === 'STOP_LOSS') || (uppercaseType === 'TAKE_PROFIT')) {
1717
- stopPriceIsRequired = true;
1714
+ triggerPriceIsRequired = true;
1718
1715
  quantityIsRequired = true;
1719
1716
  if (market['linear'] || market['inverse']) {
1720
1717
  priceIsRequired = true;
@@ -1722,7 +1719,7 @@ class tokocrypto extends tokocrypto$1 {
1722
1719
  }
1723
1720
  else if ((uppercaseType === 'STOP_LOSS_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
1724
1721
  quantityIsRequired = true;
1725
- stopPriceIsRequired = true;
1722
+ triggerPriceIsRequired = true;
1726
1723
  priceIsRequired = true;
1727
1724
  }
1728
1725
  else if (uppercaseType === 'LIMIT_MAKER') {
@@ -1738,12 +1735,12 @@ class tokocrypto extends tokocrypto$1 {
1738
1735
  }
1739
1736
  request['price'] = this.priceToPrecision(symbol, price);
1740
1737
  }
1741
- if (stopPriceIsRequired) {
1742
- if (stopPrice === undefined) {
1743
- throw new errors.InvalidOrder(this.id + ' createOrder() requires a stopPrice extra param for a ' + type + ' order');
1738
+ if (triggerPriceIsRequired) {
1739
+ if (triggerPrice === undefined) {
1740
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires a triggerPrice extra param for a ' + type + ' order');
1744
1741
  }
1745
1742
  else {
1746
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
1743
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
1747
1744
  }
1748
1745
  }
1749
1746
  const response = await this.privatePostOpenV1Orders(this.extend(request, params));
@@ -578,7 +578,7 @@ class tradeogre extends tradeogre$1 {
578
578
  'postOnly': undefined,
579
579
  'side': this.safeString(order, 'type'),
580
580
  'price': this.safeString(order, 'price'),
581
- 'stopPrice': undefined,
581
+ 'triggerPrice': undefined,
582
582
  'amount': this.safeString(order, 'quantity'),
583
583
  'cost': undefined,
584
584
  'average': undefined,
@@ -1560,7 +1560,6 @@ class upbit extends upbit$1 {
1560
1560
  'postOnly': undefined,
1561
1561
  'side': side,
1562
1562
  'price': price,
1563
- 'stopPrice': undefined,
1564
1563
  'triggerPrice': undefined,
1565
1564
  'cost': this.parseNumber(cost),
1566
1565
  'average': this.parseNumber(average),
@@ -1292,7 +1292,7 @@ class wavesexchange extends wavesexchange$1 {
1292
1292
  * @param {float} amount how much of currency you want to trade in units of base currency
1293
1293
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1294
1294
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1295
- * @param {float} [params.stopPrice] The price at which a stop order is triggered at
1295
+ * @param {float} [params.triggerPrice] The price at which a stop order is triggered at
1296
1296
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1297
1297
  */
1298
1298
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -1304,8 +1304,8 @@ class wavesexchange extends wavesexchange$1 {
1304
1304
  const amountAsset = this.getAssetId(market['baseId']);
1305
1305
  const priceAsset = this.getAssetId(market['quoteId']);
1306
1306
  const isMarketOrder = (type === 'market');
1307
- const stopPrice = this.safeFloat2(params, 'triggerPrice', 'stopPrice');
1308
- const isStopOrder = (stopPrice !== undefined);
1307
+ const triggerPrice = this.safeFloat2(params, 'triggerPrice', 'stopPrice');
1308
+ const isStopOrder = (triggerPrice !== undefined);
1309
1309
  if ((isMarketOrder) && (price === undefined)) {
1310
1310
  throw new errors.InvalidOrder(this.id + ' createOrder() requires a price argument for ' + type + ' orders to determine the max price for buy and the min price for sell');
1311
1311
  }
@@ -1412,7 +1412,7 @@ class wavesexchange extends wavesexchange$1 {
1412
1412
  'c': {
1413
1413
  't': 'sp',
1414
1414
  'v': {
1415
- 'p': this.toRealSymbolPrice(symbol, stopPrice),
1415
+ 'p': this.toRealSymbolPrice(symbol, triggerPrice),
1416
1416
  },
1417
1417
  },
1418
1418
  };
@@ -1810,7 +1810,6 @@ class wavesexchange extends wavesexchange$1 {
1810
1810
  'postOnly': undefined,
1811
1811
  'side': side,
1812
1812
  'price': price,
1813
- 'stopPrice': triggerPrice,
1814
1813
  'triggerPrice': triggerPrice,
1815
1814
  'amount': amount,
1816
1815
  'cost': undefined,
@@ -1294,8 +1294,8 @@ class whitebit extends whitebit$1 {
1294
1294
  const marketType = this.safeString(market, 'type');
1295
1295
  const isLimitOrder = type === 'limit';
1296
1296
  const isMarketOrder = type === 'market';
1297
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1298
- const isStopOrder = (stopPrice !== undefined);
1297
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1298
+ const isStopOrder = (triggerPrice !== undefined);
1299
1299
  const postOnly = this.isPostOnly(isMarketOrder, false, params);
1300
1300
  const [marginMode, query] = this.handleMarginModeAndParams('createOrder', params);
1301
1301
  if (postOnly) {
@@ -1308,7 +1308,7 @@ class whitebit extends whitebit$1 {
1308
1308
  const useCollateralEndpoint = marginMode !== undefined || marketType === 'swap';
1309
1309
  let response = undefined;
1310
1310
  if (isStopOrder) {
1311
- request['activation_price'] = this.priceToPrecision(symbol, stopPrice);
1311
+ request['activation_price'] = this.priceToPrecision(symbol, triggerPrice);
1312
1312
  if (isLimitOrder) {
1313
1313
  // stop limit order
1314
1314
  request['price'] = this.priceToPrecision(symbol, price);
@@ -1385,11 +1385,11 @@ class whitebit extends whitebit$1 {
1385
1385
  request['clientOrderId'] = clientOrderId;
1386
1386
  }
1387
1387
  const isLimitOrder = type === 'limit';
1388
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1389
- const isStopOrder = (stopPrice !== undefined);
1388
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1389
+ const isStopOrder = (triggerPrice !== undefined);
1390
1390
  params = this.omit(params, ['clOrdId', 'clientOrderId', 'triggerPrice', 'stopPrice']);
1391
1391
  if (isStopOrder) {
1392
- request['activation_price'] = this.priceToPrecision(symbol, stopPrice);
1392
+ request['activation_price'] = this.priceToPrecision(symbol, triggerPrice);
1393
1393
  if (isLimitOrder) {
1394
1394
  // stop limit order
1395
1395
  request['amount'] = this.amountToPrecision(symbol, amount);
@@ -1783,7 +1783,7 @@ class whitebit extends whitebit$1 {
1783
1783
  clientOrderId = undefined;
1784
1784
  }
1785
1785
  const price = this.safeString(order, 'price');
1786
- const stopPrice = this.safeNumber(order, 'activation_price');
1786
+ const triggerPrice = this.safeNumber(order, 'activation_price');
1787
1787
  const orderId = this.safeString2(order, 'orderId', 'id');
1788
1788
  const type = this.safeString(order, 'type');
1789
1789
  const orderType = this.parseOrderType(type);
@@ -1819,8 +1819,7 @@ class whitebit extends whitebit$1 {
1819
1819
  'side': side,
1820
1820
  'price': price,
1821
1821
  'type': orderType,
1822
- 'stopPrice': stopPrice,
1823
- 'triggerPrice': stopPrice,
1822
+ 'triggerPrice': triggerPrice,
1824
1823
  'amount': amount,
1825
1824
  'filled': filled,
1826
1825
  'remaining': remaining,
@@ -310,6 +310,92 @@ class woo extends woo$1 {
310
310
  },
311
311
  'brokerId': 'bc830de7-50f3-460b-9ee0-f430f83f9dad',
312
312
  },
313
+ 'features': {
314
+ 'default': {
315
+ 'sandbox': true,
316
+ 'createOrder': {
317
+ 'marginMode': true,
318
+ 'triggerPrice': true,
319
+ 'triggerPriceType': {
320
+ 'last': true,
321
+ 'mark': true,
322
+ 'index': false,
323
+ },
324
+ 'triggerDirection': false,
325
+ 'stopLossPrice': false,
326
+ 'takeProfitPrice': false,
327
+ 'attachedStopLossTakeProfit': undefined,
328
+ 'timeInForce': {
329
+ 'IOC': true,
330
+ 'FOK': true,
331
+ 'PO': true,
332
+ 'GTD': true,
333
+ },
334
+ 'hedged': false,
335
+ 'trailing': true,
336
+ // exchange specific params:
337
+ // 'iceberg': true,
338
+ // 'oco': true,
339
+ },
340
+ 'createOrders': undefined,
341
+ 'fetchMyTrades': {
342
+ 'marginMode': false,
343
+ 'limit': 500,
344
+ 'daysBack': 90,
345
+ 'untilDays': 10000,
346
+ },
347
+ 'fetchOrder': {
348
+ 'marginMode': false,
349
+ 'trigger': true,
350
+ 'trailing': false,
351
+ },
352
+ 'fetchOpenOrders': {
353
+ 'marginMode': false,
354
+ 'limit': 500,
355
+ 'trigger': true,
356
+ 'trailing': true,
357
+ },
358
+ 'fetchOrders': {
359
+ 'marginMode': false,
360
+ 'limit': 500,
361
+ 'daysBack': undefined,
362
+ 'untilDays': 100000,
363
+ 'trigger': true,
364
+ 'trailing': true,
365
+ },
366
+ 'fetchClosedOrders': {
367
+ 'marginMode': false,
368
+ 'limit': 500,
369
+ 'daysBackClosed': undefined,
370
+ 'daysBackCanceled': undefined,
371
+ 'untilDays': 100000,
372
+ 'trigger': true,
373
+ 'trailing': true,
374
+ },
375
+ 'fetchOHLCV': {
376
+ 'limit': 1000,
377
+ },
378
+ },
379
+ 'spot': {
380
+ 'extends': 'default',
381
+ },
382
+ 'forSwap': {
383
+ 'extends': 'default',
384
+ 'createOrder': {
385
+ 'hedged': true,
386
+ },
387
+ },
388
+ 'swap': {
389
+ 'linear': {
390
+ 'extends': 'forSwap',
391
+ },
392
+ 'inverse': undefined,
393
+ },
394
+ 'future': {
395
+ 'linear': undefined,
396
+ 'inverse': undefined,
397
+ },
398
+ },
313
399
  'commonCurrencies': {},
314
400
  'exceptions': {
315
401
  'exact': {
@@ -975,7 +1061,7 @@ class woo extends woo$1 {
975
1061
  if (marginMode !== undefined) {
976
1062
  request['margin_mode'] = this.encodeMarginMode(marginMode);
977
1063
  }
978
- const stopPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
1064
+ const triggerPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
979
1065
  const stopLoss = this.safeValue(params, 'stopLoss');
980
1066
  const takeProfit = this.safeValue(params, 'takeProfit');
981
1067
  const algoType = this.safeString(params, 'algoType');
@@ -985,7 +1071,7 @@ class woo extends woo$1 {
985
1071
  const isTrailingAmountOrder = trailingAmount !== undefined;
986
1072
  const isTrailingPercentOrder = trailingPercent !== undefined;
987
1073
  const isTrailing = isTrailingAmountOrder || isTrailingPercentOrder;
988
- const isConditional = isTrailing || stopPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
1074
+ const isConditional = isTrailing || triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
989
1075
  const isMarket = orderType === 'MARKET';
990
1076
  const timeInForce = this.safeStringLower(params, 'timeInForce');
991
1077
  const postOnly = this.isPostOnly(isMarket, undefined, params);
@@ -1055,9 +1141,9 @@ class woo extends woo$1 {
1055
1141
  request['callbackRate'] = convertedTrailingPercent;
1056
1142
  }
1057
1143
  }
1058
- else if (stopPrice !== undefined) {
1144
+ else if (triggerPrice !== undefined) {
1059
1145
  if (algoType !== 'TRAILING_STOP') {
1060
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
1146
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
1061
1147
  request['algoType'] = 'STOP';
1062
1148
  }
1063
1149
  }
@@ -1182,9 +1268,9 @@ class woo extends woo$1 {
1182
1268
  const clientOrderIdUnified = this.safeString2(params, 'clOrdID', 'clientOrderId');
1183
1269
  const clientOrderIdExchangeSpecific = this.safeString(params, 'client_order_id', clientOrderIdUnified);
1184
1270
  const isByClientOrder = clientOrderIdExchangeSpecific !== undefined;
1185
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice']);
1186
- if (stopPrice !== undefined) {
1187
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
1271
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice']);
1272
+ if (triggerPrice !== undefined) {
1273
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
1188
1274
  }
1189
1275
  const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
1190
1276
  const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
@@ -1205,7 +1291,7 @@ class woo extends woo$1 {
1205
1291
  }
1206
1292
  }
1207
1293
  params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent']);
1208
- const isConditional = isTrailing || (stopPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
1294
+ const isConditional = isTrailing || (triggerPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
1209
1295
  let response = undefined;
1210
1296
  if (isByClientOrder) {
1211
1297
  request['client_order_id'] = clientOrderIdExchangeSpecific;
@@ -1642,7 +1728,7 @@ class woo extends woo$1 {
1642
1728
  const fee = this.safeNumber2(order, 'total_fee', 'totalFee');
1643
1729
  const feeCurrency = this.safeString2(order, 'fee_asset', 'feeAsset');
1644
1730
  const transactions = this.safeValue(order, 'Transactions');
1645
- const stopPrice = this.safeNumber(order, 'triggerPrice');
1731
+ const triggerPrice = this.safeNumber(order, 'triggerPrice');
1646
1732
  let takeProfitPrice = undefined;
1647
1733
  let stopLossPrice = undefined;
1648
1734
  const childOrders = this.safeValue(order, 'childOrders');
@@ -1673,8 +1759,7 @@ class woo extends woo$1 {
1673
1759
  'reduceOnly': this.safeBool(order, 'reduce_only'),
1674
1760
  'side': side,
1675
1761
  'price': price,
1676
- 'stopPrice': stopPrice,
1677
- 'triggerPrice': stopPrice,
1762
+ 'triggerPrice': triggerPrice,
1678
1763
  'takeProfitPrice': takeProfitPrice,
1679
1764
  'stopLossPrice': stopLossPrice,
1680
1765
  'average': average,
@@ -1890,7 +1975,7 @@ class woo extends woo$1 {
1890
1975
  * @method
1891
1976
  * @name woo#fetchMyTrades
1892
1977
  * @description fetch all trades made by the user
1893
- * @see https://docs.woox.io/#get-trades
1978
+ * @see https://docs.woox.io/#get-trade-history
1894
1979
  * @param {string} symbol unified market symbol
1895
1980
  * @param {int} [since] the earliest time in ms to fetch trades for
1896
1981
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1905,7 +1990,7 @@ class woo extends woo$1 {
1905
1990
  if (paginate) {
1906
1991
  return await this.fetchPaginatedCallIncremental('fetchMyTrades', symbol, since, limit, params, 'page', 500);
1907
1992
  }
1908
- const request = {};
1993
+ let request = {};
1909
1994
  let market = undefined;
1910
1995
  if (symbol !== undefined) {
1911
1996
  market = this.market(symbol);
@@ -1914,6 +1999,7 @@ class woo extends woo$1 {
1914
1999
  if (since !== undefined) {
1915
2000
  request['start_t'] = since;
1916
2001
  }
2002
+ [request, params] = this.handleUntilOption('end_t', request, params);
1917
2003
  if (limit !== undefined) {
1918
2004
  request['size'] = limit;
1919
2005
  }
@@ -301,6 +301,88 @@ class woofipro extends woofipro$1 {
301
301
  'brokerId': 'CCXT',
302
302
  'verifyingContractAddress': '0x6F7a338F2aA472838dEFD3283eB360d4Dff5D203',
303
303
  },
304
+ 'features': {
305
+ 'default': {
306
+ 'sandbox': true,
307
+ 'createOrder': {
308
+ 'marginMode': false,
309
+ 'triggerPrice': true,
310
+ 'triggerPriceType': undefined,
311
+ 'triggerDirection': false,
312
+ 'stopLossPrice': false,
313
+ 'takeProfitPrice': false,
314
+ 'attachedStopLossTakeProfit': undefined,
315
+ 'timeInForce': {
316
+ 'IOC': true,
317
+ 'FOK': true,
318
+ 'PO': true,
319
+ 'GTD': false,
320
+ },
321
+ 'hedged': false,
322
+ 'trailing': true,
323
+ // exchange specific
324
+ // 'iceberg': true,
325
+ },
326
+ 'createOrders': {
327
+ 'max': 10,
328
+ },
329
+ 'fetchMyTrades': {
330
+ 'marginMode': false,
331
+ 'limit': 500,
332
+ 'daysBack': undefined,
333
+ 'untilDays': 100000,
334
+ },
335
+ 'fetchOrder': {
336
+ 'marginMode': false,
337
+ 'trigger': true,
338
+ 'trailing': false,
339
+ },
340
+ 'fetchOpenOrders': {
341
+ 'marginMode': false,
342
+ 'limit': 500,
343
+ 'trigger': true,
344
+ 'trailing': false,
345
+ },
346
+ 'fetchOrders': undefined,
347
+ 'fetchClosedOrders': {
348
+ 'marginMode': false,
349
+ 'limit': 500,
350
+ 'daysBackClosed': undefined,
351
+ 'daysBackCanceled': undefined,
352
+ 'untilDays': 100000,
353
+ 'trigger': true,
354
+ 'trailing': false,
355
+ },
356
+ 'fetchOHLCV': {
357
+ 'limit': 1000,
358
+ },
359
+ },
360
+ 'spot': {
361
+ 'extends': 'default',
362
+ },
363
+ 'forDerivatives': {
364
+ 'extends': 'default',
365
+ 'createOrder': {
366
+ // todo: implementation needs unification
367
+ 'triggerPriceType': undefined,
368
+ 'attachedStopLossTakeProfit': {
369
+ // todo: implementation needs unification
370
+ 'triggerPriceType': undefined,
371
+ 'limitPrice': false,
372
+ },
373
+ },
374
+ },
375
+ 'swap': {
376
+ 'linear': {
377
+ 'extends': 'forDerivatives',
378
+ },
379
+ 'inverse': undefined,
380
+ },
381
+ 'future': {
382
+ 'linear': undefined,
383
+ 'inverse': undefined,
384
+ },
385
+ },
304
386
  'commonCurrencies': {},
305
387
  'exceptions': {
306
388
  'exact': {
@@ -1172,7 +1254,7 @@ class woofipro extends woofipro$1 {
1172
1254
  const fee = this.safeValue2(order, 'total_fee', 'totalFee');
1173
1255
  const feeCurrency = this.safeString2(order, 'fee_asset', 'feeAsset');
1174
1256
  const transactions = this.safeValue(order, 'Transactions');
1175
- const stopPrice = this.safeNumber(order, 'triggerPrice');
1257
+ const triggerPrice = this.safeNumber(order, 'triggerPrice');
1176
1258
  let takeProfitPrice = undefined;
1177
1259
  let stopLossPrice = undefined;
1178
1260
  const childOrders = this.safeValue(order, 'childOrders');
@@ -1203,8 +1285,7 @@ class woofipro extends woofipro$1 {
1203
1285
  'reduceOnly': this.safeBool(order, 'reduce_only'),
1204
1286
  'side': side,
1205
1287
  'price': price,
1206
- 'stopPrice': stopPrice,
1207
- 'triggerPrice': stopPrice,
1288
+ 'triggerPrice': triggerPrice,
1208
1289
  'takeProfitPrice': takeProfitPrice,
1209
1290
  'stopLossPrice': stopLossPrice,
1210
1291
  'average': average,
@@ -1275,11 +1356,11 @@ class woofipro extends woofipro$1 {
1275
1356
  'symbol': market['id'],
1276
1357
  'side': orderSide,
1277
1358
  };
1278
- const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1359
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1279
1360
  const stopLoss = this.safeValue(params, 'stopLoss');
1280
1361
  const takeProfit = this.safeValue(params, 'takeProfit');
1281
1362
  const algoType = this.safeString(params, 'algoType');
1282
- const isConditional = stopPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
1363
+ const isConditional = triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
1283
1364
  const isMarket = orderType === 'MARKET';
1284
1365
  const timeInForce = this.safeStringLower(params, 'timeInForce');
1285
1366
  const postOnly = this.isPostOnly(isMarket, undefined, params);
@@ -1314,8 +1395,8 @@ class woofipro extends woofipro$1 {
1314
1395
  if (clientOrderId !== undefined) {
1315
1396
  request['client_order_id'] = clientOrderId;
1316
1397
  }
1317
- if (stopPrice !== undefined) {
1318
- request['trigger_price'] = this.priceToPrecision(symbol, stopPrice);
1398
+ if (triggerPrice !== undefined) {
1399
+ request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
1319
1400
  request['algo_type'] = 'STOP';
1320
1401
  }
1321
1402
  else if ((stopLoss !== undefined) || (takeProfit !== undefined)) {
@@ -1380,10 +1461,10 @@ class woofipro extends woofipro$1 {
1380
1461
  await this.loadMarkets();
1381
1462
  const market = this.market(symbol);
1382
1463
  const request = this.createOrderRequest(symbol, type, side, amount, price, params);
1383
- const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1464
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1384
1465
  const stopLoss = this.safeValue(params, 'stopLoss');
1385
1466
  const takeProfit = this.safeValue(params, 'takeProfit');
1386
- const isConditional = stopPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
1467
+ const isConditional = triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
1387
1468
  let response = undefined;
1388
1469
  if (isConditional) {
1389
1470
  response = await this.v1PrivatePostAlgoOrder(request);
@@ -1444,10 +1525,10 @@ class woofipro extends woofipro$1 {
1444
1525
  const amount = this.safeValue(rawOrder, 'amount');
1445
1526
  const price = this.safeValue(rawOrder, 'price');
1446
1527
  const orderParams = this.safeDict(rawOrder, 'params', {});
1447
- const stopPrice = this.safeString2(orderParams, 'triggerPrice', 'stopPrice');
1528
+ const triggerPrice = this.safeString2(orderParams, 'triggerPrice', 'stopPrice');
1448
1529
  const stopLoss = this.safeValue(orderParams, 'stopLoss');
1449
1530
  const takeProfit = this.safeValue(orderParams, 'takeProfit');
1450
- const isConditional = stopPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(orderParams, 'childOrders') !== undefined);
1531
+ const isConditional = triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(orderParams, 'childOrders') !== undefined);
1451
1532
  if (isConditional) {
1452
1533
  throw new errors.NotSupported(this.id + 'createOrders() only support non-stop order');
1453
1534
  }
@@ -1503,11 +1584,11 @@ class woofipro extends woofipro$1 {
1503
1584
  const request = {
1504
1585
  'order_id': id,
1505
1586
  };
1506
- const stopPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice']);
1507
- if (stopPrice !== undefined) {
1508
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
1587
+ const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice']);
1588
+ if (triggerPrice !== undefined) {
1589
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
1509
1590
  }
1510
- const isConditional = (stopPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
1591
+ const isConditional = (triggerPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
1511
1592
  const orderQtyKey = isConditional ? 'quantity' : 'order_quantity';
1512
1593
  const priceKey = isConditional ? 'price' : 'order_price';
1513
1594
  if (price !== undefined) {
@@ -2296,7 +2296,8 @@ class xt extends xt$1 {
2296
2296
  * @param {string} [params.timeInForce] 'GTC', 'IOC', 'FOK' or 'GTX'
2297
2297
  * @param {string} [params.entrustType] 'TAKE_PROFIT', 'STOP', 'TAKE_PROFIT_MARKET', 'STOP_MARKET', 'TRAILING_STOP_MARKET', required if stopPrice is defined, currently isn't functioning on xt's side
2298
2298
  * @param {string} [params.triggerPriceType] 'INDEX_PRICE', 'MARK_PRICE', 'LATEST_PRICE', required if stopPrice is defined
2299
- * @param {float} [params.stopPrice] price to trigger a stop order
2299
+ * @param {float} [params.triggerPrice] price to trigger a stop order
2300
+ * @param {float} [params.stopPrice] alias for triggerPrice
2300
2301
  * @param {float} [params.stopLoss] price to set a stop-loss on an open position
2301
2302
  * @param {float} [params.takeProfit] price to set a take-profit on an open position
2302
2303
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
@@ -3502,7 +3503,7 @@ class xt extends xt$1 {
3502
3503
  'postOnly': undefined,
3503
3504
  'side': this.safeStringLower2(order, 'side', 'orderSide'),
3504
3505
  'price': this.safeNumber(order, 'price'),
3505
- 'stopPrice': this.safeNumber(order, 'stopPrice'),
3506
+ 'triggerPrice': this.safeNumber(order, 'stopPrice'),
3506
3507
  'stopLoss': this.safeNumber(order, 'triggerStopPrice'),
3507
3508
  'takeProfit': this.safeNumber(order, 'triggerProfitPrice'),
3508
3509
  'amount': amount,
@@ -1022,7 +1022,6 @@ class yobit extends yobit$1 {
1022
1022
  'postOnly': undefined,
1023
1023
  'side': side,
1024
1024
  'price': price,
1025
- 'stopPrice': undefined,
1026
1025
  'triggerPrice': undefined,
1027
1026
  'cost': undefined,
1028
1027
  'amount': amount,
@@ -538,7 +538,6 @@ class zaif extends zaif$1 {
538
538
  'postOnly': undefined,
539
539
  'side': side,
540
540
  'price': price,
541
- 'stopPrice': undefined,
542
541
  'triggerPrice': undefined,
543
542
  'cost': undefined,
544
543
  'amount': amount,
@@ -492,7 +492,6 @@ class zonda extends zonda$1 {
492
492
  'postOnly': postOnly,
493
493
  'side': this.safeStringLower(order, 'offerType'),
494
494
  'price': this.safeString(order, 'rate'),
495
- 'stopPrice': undefined,
496
495
  'triggerPrice': undefined,
497
496
  'amount': amount,
498
497
  'cost': undefined,
@@ -1415,7 +1414,7 @@ class zonda extends zonda$1 {
1415
1414
  let response = undefined;
1416
1415
  if (isStopOrder) {
1417
1416
  if (!isStopLossPrice) {
1418
- throw new errors.ExchangeError(this.id + ' createOrder() zonda requires `triggerPrice` or `stopPrice` parameter for stop-limit or stop-market orders');
1417
+ throw new errors.ExchangeError(this.id + ' createOrder() zonda requires `triggerPrice` parameter for stop-limit or stop-market orders');
1419
1418
  }
1420
1419
  request['stopRate'] = this.priceToPrecision(symbol, stopLossPrice);
1421
1420
  response = await this.v1_01PrivatePostTradingStopOfferSymbol(this.extend(request, params));
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OpenInterests } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.4.40";
7
+ declare const version = "4.4.41";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.4.41';
41
+ const version = '4.4.42';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';