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
@@ -500,6 +500,92 @@ class coinex extends coinex$1 {
500
500
  // CSC, AE, BASE, AIPG, AKASH, POLKADOTASSETHUB ?, ALEO, STX, ALGO, ALPH, BLAST, AR, ARCH, ARDR, ARK, ARRR, MANTA, NTRN, LUNA, AURORA, AVAIL, ASC20, AVA, AYA, AZERO, BAN, BAND, BB, RUNES, BEAM, BELLSCOIN, BITCI, NEAR, AGORIC, BLOCX, BNC, BOBA, BRISE, KRC20, CANTO, CAPS, CCD, CELO, CFX, CHI, CKB, CLORE, CLV, CORE, CSPR, CTXC, DAG, DCR, DERO, DESO, DEFI, DGB, DNX, DOCK, DOGECHAIN, DYDX, DYMENSION, EGLD, ELA, ELF, ENJIN, EOSIO, ERG, ETN_SC, EVMOS, EWC, SGB, FACT, FB, FET, FIO, FIRO, NEO3, FLOW, FLARE, FLUX, LINEA, FREN, FSN, FB_BRC20, GLMR, GRIN, GRS, HACASH, HBAR, HERB, HIVE, MAPO, HMND, HNS, ZKSYNC, HTR, HUAHUA, MERLIN, ICP, ICX, INJ, IOST, IOTA, IOTX, IRIS, IRON, ONE, JOYSTREAM, KAI, KAR, KAS, KAVA, KCN, KDA, KLAY, KLY, KMD, KSM, KUB, KUJIRA, LAT, LBC, LUNC, LUKSO, MARS, METIS, MINA, MANTLE, MOB, MODE, MONA, MOVR, MTL, NEOX, NEXA, NIBI, NIMIQ, NMC, ONOMY, NRG, WAVES, NULS, OAS, OCTA, OLT, ONT, OORT, ORAI, OSMO, P3D, COMPOSABLE, PIVX, RON, POKT, POLYMESH, PRE_MARKET, PYI, QKC, QTUM, QUBIC, RSK, ROSE, ROUTE, RTM, THORCHAIN, RVN, RADIANT, SAGA, SALVIUM, SATOX, SC, SCP, _NULL, SCRT, SDN, RGBPP, SELF, SMH, SPACE, STARGAZE, STC, STEEM, STRATISEVM, STRD, STARKNET, SXP, SYS, TAIKO, TAO, TARA, TENET, THETA, TT, VENOM, VECHAIN, TOMO, VITE, VLX, VSYS, VTC, WAN, WAXP, WEMIX, XCH, XDC, XEC, XELIS, NEM, XHV, XLM, XNA, NANO, XPLA, XPR, XPRT, XRD, XTZ, XVG, XYM, ZANO, ZEC, ZEN, ZEPH, ZETA
501
501
  },
502
502
  },
503
+ 'features': {
504
+ 'spot': {
505
+ 'sandbox': false,
506
+ 'createOrder': {
507
+ 'marginMode': true,
508
+ 'triggerPrice': true,
509
+ 'triggerPriceType': undefined,
510
+ 'triggerDirection': false,
511
+ 'stopLossPrice': false,
512
+ 'takeProfitPrice': false,
513
+ 'attachedStopLossTakeProfit': undefined,
514
+ 'timeInForce': {
515
+ 'IOC': true,
516
+ 'FOK': true,
517
+ 'PO': true,
518
+ 'GTD': false,
519
+ },
520
+ 'hedged': false,
521
+ 'trailing': false,
522
+ // exchange-supported features
523
+ // 'marketBuyRequiresPrice': true,
524
+ // 'marketBuyByCost': true,
525
+ // 'selfTradePrevention': true,
526
+ // 'iceberg': true,
527
+ },
528
+ 'createOrders': {
529
+ 'max': 5,
530
+ },
531
+ 'fetchMyTrades': {
532
+ 'marginMode': true,
533
+ 'limit': 1000,
534
+ 'daysBack': undefined,
535
+ 'untilDays': 100000,
536
+ },
537
+ 'fetchOrder': {
538
+ 'marginMode': false,
539
+ 'trigger': false,
540
+ 'trailing': false,
541
+ },
542
+ 'fetchOpenOrders': {
543
+ 'marginMode': true,
544
+ 'limit': 1000,
545
+ 'trigger': true,
546
+ 'trailing': false,
547
+ },
548
+ 'fetchOrders': undefined,
549
+ 'fetchClosedOrders': {
550
+ 'marginMode': true,
551
+ 'limit': 1000,
552
+ 'daysBackClosed': undefined,
553
+ 'daysBackCanceled': undefined,
554
+ 'untilDays': undefined,
555
+ 'trigger': true,
556
+ 'trailing': false,
557
+ },
558
+ 'fetchOHLCV': {
559
+ 'limit': 1000,
560
+ },
561
+ },
562
+ 'forDerivatives': {
563
+ 'extends': 'spot',
564
+ 'createOrder': {
565
+ 'marginMode': true,
566
+ 'stopLossPrice': true,
567
+ 'takeProfitPrice': true,
568
+ },
569
+ 'fetchOpenOrders': {
570
+ 'marginMode': false,
571
+ },
572
+ 'fetchClosedOrders': {
573
+ 'marginMode': false,
574
+ },
575
+ },
576
+ 'swap': {
577
+ 'linear': {
578
+ 'extends': 'forDerivatives',
579
+ },
580
+ 'inverse': {
581
+ 'extends': 'forDerivatives',
582
+ },
583
+ },
584
+ 'future': {
585
+ 'linear': undefined,
586
+ 'inverse': undefined,
587
+ },
588
+ },
503
589
  'commonCurrencies': {
504
590
  'ACM': 'Actinium',
505
591
  },
@@ -2004,7 +2090,6 @@ class coinex extends coinex$1 {
2004
2090
  'reduceOnly': undefined,
2005
2091
  'side': side,
2006
2092
  'price': this.safeString(order, 'price'),
2007
- 'stopPrice': this.safeString(order, 'trigger_price'),
2008
2093
  'triggerPrice': this.safeString(order, 'trigger_price'),
2009
2094
  'takeProfitPrice': this.safeNumber(order, 'take_profit_price'),
2010
2095
  'stopLossPrice': this.safeNumber(order, 'stop_loss_price'),
@@ -2045,7 +2130,7 @@ class coinex extends coinex$1 {
2045
2130
  const market = this.market(symbol);
2046
2131
  const swap = market['swap'];
2047
2132
  const clientOrderId = this.safeString2(params, 'client_id', 'clientOrderId');
2048
- const stopPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
2133
+ const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
2049
2134
  const stopLossPrice = this.safeString(params, 'stopLossPrice');
2050
2135
  const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
2051
2136
  const option = this.safeString(params, 'option');
@@ -2104,8 +2189,8 @@ class coinex extends coinex$1 {
2104
2189
  }
2105
2190
  else {
2106
2191
  request['amount'] = this.amountToPrecision(symbol, amount);
2107
- if (stopPrice !== undefined) {
2108
- request['trigger_price'] = this.priceToPrecision(symbol, stopPrice);
2192
+ if (triggerPrice !== undefined) {
2193
+ request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
2109
2194
  request['trigger_price_type'] = this.safeString(params, 'stop_type', 'latest_price');
2110
2195
  }
2111
2196
  }
@@ -2143,8 +2228,8 @@ class coinex extends coinex$1 {
2143
2228
  else {
2144
2229
  request['amount'] = this.amountToPrecision(symbol, amount);
2145
2230
  }
2146
- if (stopPrice !== undefined) {
2147
- request['trigger_price'] = this.priceToPrecision(symbol, stopPrice);
2231
+ if (triggerPrice !== undefined) {
2232
+ request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
2148
2233
  }
2149
2234
  }
2150
2235
  params = this.omit(params, ['reduceOnly', 'timeInForce', 'postOnly', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice']);
@@ -1528,7 +1528,7 @@ class coinlist extends coinlist$1 {
1528
1528
  }
1529
1529
  }
1530
1530
  else if ((type === 'stop_market') || (type === 'stop_limit') || (type === 'take_market') || (type === 'take_limit')) {
1531
- throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a stopPrice parameter for stop-loss and take-profit orders');
1531
+ throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders');
1532
1532
  }
1533
1533
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_id');
1534
1534
  if (clientOrderId !== undefined) {
@@ -1672,7 +1672,7 @@ class coinlist extends coinlist$1 {
1672
1672
  const type = this.parseOrderType(this.safeString(order, 'type'));
1673
1673
  const side = this.safeString(order, 'side');
1674
1674
  const price = this.safeString(order, 'price');
1675
- const stopPrice = this.safeString(order, 'stop_price');
1675
+ const triggerPrice = this.safeString(order, 'stop_price');
1676
1676
  const average = this.safeString(order, 'average_fill_price'); // from documentation
1677
1677
  const amount = this.safeString(order, 'size');
1678
1678
  const filled = this.safeString(order, 'size_filled');
@@ -1698,8 +1698,7 @@ class coinlist extends coinlist$1 {
1698
1698
  'timeInForce': 'GTC',
1699
1699
  'side': side,
1700
1700
  'price': price,
1701
- 'stopPrice': stopPrice,
1702
- 'triggerPrice': stopPrice,
1701
+ 'triggerPrice': triggerPrice,
1703
1702
  'average': average,
1704
1703
  'amount': amount,
1705
1704
  'cost': undefined,
@@ -945,7 +945,6 @@ class coinmate extends coinmate$1 {
945
945
  const marketId = this.safeString(order, 'currencyPair');
946
946
  const symbol = this.safeSymbol(marketId, market, '_');
947
947
  const clientOrderId = this.safeString(order, 'clientOrderId');
948
- const stopPrice = this.safeNumber(order, 'stopPrice');
949
948
  return this.safeOrder({
950
949
  'id': id,
951
950
  'clientOrderId': clientOrderId,
@@ -958,8 +957,7 @@ class coinmate extends coinmate$1 {
958
957
  'postOnly': undefined,
959
958
  'side': side,
960
959
  'price': priceString,
961
- 'stopPrice': stopPrice,
962
- 'triggerPrice': stopPrice,
960
+ 'triggerPrice': this.safeNumber(order, 'stopPrice'),
963
961
  'amount': amountString,
964
962
  'cost': undefined,
965
963
  'average': averageString,
@@ -1235,10 +1235,10 @@ class coinmetro extends coinmetro$1 {
1235
1235
  params = this.omit(params, 'timeInForce');
1236
1236
  request['timeInForce'] = this.encodeOrderTimeInForce(timeInForce);
1237
1237
  }
1238
- const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1239
- if (stopPrice !== undefined) {
1238
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1239
+ if (triggerPrice !== undefined) {
1240
1240
  params = this.omit(params, ['triggerPrice']);
1241
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
1241
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
1242
1242
  }
1243
1243
  const userData = this.safeValue(params, 'userData', {});
1244
1244
  const comment = this.safeString2(params, 'clientOrderId', 'comment');
@@ -1764,7 +1764,6 @@ class coinmetro extends coinmetro$1 {
1764
1764
  }
1765
1765
  const trades = this.safeValue(order, 'fills', []);
1766
1766
  const userData = this.safeValue(order, 'userData', {});
1767
- const triggerPrice = this.safeString(order, 'stopPrice');
1768
1767
  const clientOrderId = this.safeString(userData, 'comment');
1769
1768
  const takeProfitPrice = this.safeString(userData, 'takeProfit');
1770
1769
  const stopLossPrice = this.safeString(userData, 'stopLoss');
@@ -1780,7 +1779,7 @@ class coinmetro extends coinmetro$1 {
1780
1779
  'timeInForce': this.parseOrderTimeInForce(this.safeInteger(order, 'timeInForce')),
1781
1780
  'side': side,
1782
1781
  'price': price,
1783
- 'triggerPrice': triggerPrice,
1782
+ 'triggerPrice': this.safeString(order, 'stopPrice'),
1784
1783
  'takeProfitPrice': takeProfitPrice,
1785
1784
  'stopLossPrice': stopLossPrice,
1786
1785
  'average': undefined,
@@ -930,7 +930,6 @@ class coinone extends coinone$1 {
930
930
  'postOnly': undefined,
931
931
  'side': side,
932
932
  'price': this.safeString(order, 'price'),
933
- 'stopPrice': undefined,
934
933
  'triggerPrice': undefined,
935
934
  'cost': undefined,
936
935
  'average': this.safeString(order, 'averageExecutedPrice'),
@@ -1173,11 +1173,11 @@ class coinsph extends coinsph$1 {
1173
1173
  }
1174
1174
  }
1175
1175
  if (orderType === 'STOP_LOSS' || orderType === 'STOP_LOSS_LIMIT' || orderType === 'TAKE_PROFIT' || orderType === 'TAKE_PROFIT_LIMIT') {
1176
- const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1177
- if (stopPrice === undefined) {
1176
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1177
+ if (triggerPrice === undefined) {
1178
1178
  throw new errors.InvalidOrder(this.id + ' createOrder () requires a triggerPrice or stopPrice param for stop_loss, take_profit, stop_loss_limit, and take_profit_limit orders');
1179
1179
  }
1180
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
1180
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
1181
1181
  }
1182
1182
  request['newOrderRespType'] = newOrderRespType;
1183
1183
  params = this.omit(params, 'price', 'stopPrice', 'triggerPrice', 'quantity', 'quoteOrderQty');
@@ -1415,9 +1415,9 @@ class coinsph extends coinsph$1 {
1415
1415
  market = this.safeMarket(marketId, market);
1416
1416
  const timestamp = this.safeInteger2(order, 'time', 'transactTime');
1417
1417
  const trades = this.safeValue(order, 'fills', undefined);
1418
- let stopPrice = this.safeString(order, 'stopPrice');
1419
- if (Precise["default"].stringEq(stopPrice, '0')) {
1420
- stopPrice = undefined;
1418
+ let triggerPrice = this.safeString(order, 'stopPrice');
1419
+ if (Precise["default"].stringEq(triggerPrice, '0')) {
1420
+ triggerPrice = undefined;
1421
1421
  }
1422
1422
  return this.safeOrder({
1423
1423
  'id': id,
@@ -1431,8 +1431,7 @@ class coinsph extends coinsph$1 {
1431
1431
  'timeInForce': this.parseOrderTimeInForce(this.safeString(order, 'timeInForce')),
1432
1432
  'side': this.parseOrderSide(this.safeString(order, 'side')),
1433
1433
  'price': this.safeString(order, 'price'),
1434
- 'stopPrice': stopPrice,
1435
- 'triggerPrice': stopPrice,
1434
+ 'triggerPrice': triggerPrice,
1436
1435
  'average': undefined,
1437
1436
  'amount': this.safeString(order, 'origQty'),
1438
1437
  'cost': this.safeString(order, 'cummulativeQuoteQty'),
@@ -489,6 +489,9 @@ class cryptocom extends cryptocom$1 {
489
489
  '40801': errors.RequestTimeout,
490
490
  '42901': errors.RateLimitExceeded,
491
491
  '43005': errors.InvalidOrder,
492
+ '43003': errors.InvalidOrder,
493
+ '43004': errors.InvalidOrder,
494
+ '43012': errors.BadRequest,
492
495
  '50001': errors.ExchangeError,
493
496
  '9010001': errors.OnMaintenance, // {"code":9010001,"message":"SYSTEM_MAINTENANCE","details":"Crypto.com Exchange is currently under maintenance. Please refer to https://status.crypto.com for more details."}
494
497
  },
@@ -1206,7 +1206,6 @@ class currencycom extends currencycom$1 {
1206
1206
  'timeInForce': timeInForce,
1207
1207
  'side': side,
1208
1208
  'price': price,
1209
- 'stopPrice': undefined,
1210
1209
  'triggerPrice': undefined,
1211
1210
  'amount': amount,
1212
1211
  'cost': undefined,
@@ -1308,11 +1307,11 @@ class currencycom extends currencycom$1 {
1308
1307
  request['price'] = this.priceToPrecision(symbol, price);
1309
1308
  }
1310
1309
  else if (type === 'market') {
1311
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1310
+ const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1312
1311
  params = this.omit(params, ['triggerPrice', 'stopPrice']);
1313
- if (stopPrice !== undefined) {
1312
+ if (triggerPrice !== undefined) {
1314
1313
  request['type'] = 'STOP';
1315
- request['price'] = this.priceToPrecision(symbol, stopPrice);
1314
+ request['price'] = this.priceToPrecision(symbol, triggerPrice);
1316
1315
  }
1317
1316
  }
1318
1317
  }
@@ -1170,7 +1170,7 @@ class defx extends defx$1 {
1170
1170
  'type': orderType,
1171
1171
  };
1172
1172
  const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
1173
- const stopPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
1173
+ const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
1174
1174
  const isMarket = orderType === 'MARKET';
1175
1175
  const isLimit = orderType === 'LIMIT';
1176
1176
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
@@ -1190,7 +1190,7 @@ class defx extends defx$1 {
1190
1190
  if (clientOrderId !== undefined) {
1191
1191
  request['newClientOrderId'] = clientOrderId;
1192
1192
  }
1193
- if (stopPrice !== undefined || takeProfitPrice !== undefined) {
1193
+ if (triggerPrice !== undefined || takeProfitPrice !== undefined) {
1194
1194
  request['workingType'] = 'MARK_PRICE';
1195
1195
  if (takeProfitPrice !== undefined) {
1196
1196
  request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
@@ -1202,7 +1202,7 @@ class defx extends defx$1 {
1202
1202
  }
1203
1203
  }
1204
1204
  else {
1205
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
1205
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
1206
1206
  if (isMarket) {
1207
1207
  request['type'] = 'STOP_MARKET';
1208
1208
  }
@@ -1295,13 +1295,13 @@ class defx extends defx$1 {
1295
1295
  const average = this.omitZero(this.safeString(order, 'avgPrice'));
1296
1296
  const timeInForce = this.safeStringLower(order, 'timeInForce');
1297
1297
  let takeProfitPrice = undefined;
1298
- let stopPrice = undefined;
1298
+ let triggerPrice = undefined;
1299
1299
  if (orderType !== undefined) {
1300
1300
  if (orderType.indexOf('take_profit') >= 0) {
1301
1301
  takeProfitPrice = this.safeString(order, 'stopPrice');
1302
1302
  }
1303
1303
  else {
1304
- stopPrice = this.safeString(order, 'stopPrice');
1304
+ triggerPrice = this.safeString(order, 'stopPrice');
1305
1305
  }
1306
1306
  }
1307
1307
  const timestamp = this.parse8601(this.safeString(order, 'createdAt'));
@@ -1321,8 +1321,7 @@ class defx extends defx$1 {
1321
1321
  'reduceOnly': this.safeBool(order, 'reduceOnly'),
1322
1322
  'side': side,
1323
1323
  'price': price,
1324
- 'stopPrice': stopPrice,
1325
- 'triggerPrice': stopPrice,
1324
+ 'triggerPrice': triggerPrice,
1326
1325
  'takeProfitPrice': takeProfitPrice,
1327
1326
  'stopLossPrice': undefined,
1328
1327
  'average': average,
@@ -1812,7 +1812,6 @@ class deribit extends deribit$1 {
1812
1812
  // injected in createOrder
1813
1813
  const trades = this.safeValue(order, 'trades');
1814
1814
  const timeInForce = this.parseTimeInForce(this.safeString(order, 'time_in_force'));
1815
- const stopPrice = this.safeValue(order, 'stop_price');
1816
1815
  const postOnly = this.safeValue(order, 'post_only');
1817
1816
  return this.safeOrder({
1818
1817
  'info': order,
@@ -1827,8 +1826,7 @@ class deribit extends deribit$1 {
1827
1826
  'postOnly': postOnly,
1828
1827
  'side': side,
1829
1828
  'price': priceString,
1830
- 'stopPrice': stopPrice,
1831
- 'triggerPrice': stopPrice,
1829
+ 'triggerPrice': this.safeValue(order, 'stop_price'),
1832
1830
  'amount': amount,
1833
1831
  'cost': cost,
1834
1832
  'average': averageString,
@@ -2149,7 +2149,6 @@ class digifinex extends digifinex$1 {
2149
2149
  'postOnly': undefined,
2150
2150
  'side': side,
2151
2151
  'price': this.safeNumber(order, 'price'),
2152
- 'stopPrice': undefined,
2153
2152
  'triggerPrice': undefined,
2154
2153
  'amount': this.safeNumber2(order, 'amount', 'size'),
2155
2154
  'filled': this.safeNumber2(order, 'executed_amount', 'filled_qty'),
@@ -1296,7 +1296,6 @@ class ellipx extends ellipx$1 {
1296
1296
  'postOnly': postOnly,
1297
1297
  'side': side,
1298
1298
  'price': price,
1299
- 'stopPrice': undefined,
1300
1299
  'triggerPrice': undefined,
1301
1300
  'average': undefined,
1302
1301
  'cost': cost,
@@ -1356,7 +1355,6 @@ class ellipx extends ellipx$1 {
1356
1355
  'postOnly': undefined,
1357
1356
  'side': undefined,
1358
1357
  'price': undefined,
1359
- 'stopPrice': undefined,
1360
1358
  'triggerPrice': undefined,
1361
1359
  'average': undefined,
1362
1360
  'cost': undefined,
@@ -1468,7 +1468,7 @@ class exmo extends exmo$1 {
1468
1468
  * @param {float} amount how much of currency you want to trade in units of base currency
1469
1469
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1470
1470
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1471
- * @param {float} [params.stopPrice] the price at which a trigger order is triggered at
1471
+ * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
1472
1472
  * @param {string} [params.timeInForce] *spot only* 'fok', 'ioc' or 'post_only'
1473
1473
  * @param {boolean} [params.postOnly] *spot only* true for post only orders
1474
1474
  * @param {float} [params.cost] *spot only* *market orders only* the cost of the order in the quote currency for market orders
@@ -2005,7 +2005,6 @@ class exmo extends exmo$1 {
2005
2005
  'postOnly': undefined,
2006
2006
  'side': side,
2007
2007
  'price': price,
2008
- 'stopPrice': triggerPrice,
2009
2008
  'triggerPrice': triggerPrice,
2010
2009
  'cost': cost,
2011
2010
  'amount': amount,
@@ -4082,7 +4082,7 @@ class gate extends gate$1 {
4082
4082
  * @param {float} amount the amount of currency to trade
4083
4083
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
4084
4084
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4085
- * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
4085
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
4086
4086
  * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
4087
4087
  * @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
4088
4088
  * @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
@@ -4922,7 +4922,6 @@ class gate extends gate$1 {
4922
4922
  'reduceOnly': this.safeValue(order, 'is_reduce_only'),
4923
4923
  'side': side,
4924
4924
  'price': price,
4925
- 'stopPrice': triggerPrice,
4926
4925
  'triggerPrice': triggerPrice,
4927
4926
  'average': average,
4928
4927
  'amount': Precise["default"].stringAbs(amount),
@@ -1344,7 +1344,6 @@ class gemini extends gemini$1 {
1344
1344
  'postOnly': postOnly,
1345
1345
  'side': side,
1346
1346
  'price': price,
1347
- 'stopPrice': undefined,
1348
1347
  'triggerPrice': undefined,
1349
1348
  'average': average,
1350
1349
  'cost': undefined,
@@ -1478,13 +1477,13 @@ class gemini extends gemini$1 {
1478
1477
  };
1479
1478
  type = this.safeString(params, 'type', type);
1480
1479
  params = this.omit(params, 'type');
1481
- const rawStopPrice = this.safeString2(params, 'stop_price', 'stopPrice');
1480
+ const triggerPrice = this.safeStringN(params, ['stop_price', 'stopPrice']);
1482
1481
  params = this.omit(params, ['stop_price', 'stopPrice', 'type']);
1483
1482
  if (type === 'stopLimit') {
1484
- throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a stopPrice parameter or a stop_price parameter for ' + type + ' orders');
1483
+ throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice parameter or a stop_price parameter for ' + type + ' orders');
1485
1484
  }
1486
- if (rawStopPrice !== undefined) {
1487
- request['stop_price'] = this.priceToPrecision(symbol, rawStopPrice);
1485
+ if (triggerPrice !== undefined) {
1486
+ request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
1488
1487
  request['type'] = 'exchange stop limit';
1489
1488
  }
1490
1489
  else {