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
@@ -261,6 +261,78 @@ class krakenfutures extends krakenfutures$1 {
261
261
  'method': 'historyGetMarketSymbolExecutions', // historyGetMarketSymbolExecutions, publicGetHistory
262
262
  },
263
263
  },
264
+ 'features': {
265
+ 'default': {
266
+ 'sandbox': true,
267
+ 'createOrder': {
268
+ 'marginMode': false,
269
+ 'triggerPrice': true,
270
+ 'triggerPriceType': {
271
+ 'last': true,
272
+ 'mark': true,
273
+ 'index': true,
274
+ },
275
+ 'triggerDirection': false,
276
+ 'stopLossPrice': true,
277
+ 'takeProfitPrice': true,
278
+ 'attachedStopLossTakeProfit': undefined,
279
+ 'timeInForce': {
280
+ 'IOC': true,
281
+ 'FOK': true,
282
+ 'PO': true,
283
+ 'GTD': false,
284
+ },
285
+ 'hedged': false,
286
+ 'trailing': false,
287
+ },
288
+ 'createOrders': {
289
+ 'max': 100,
290
+ },
291
+ 'fetchMyTrades': {
292
+ 'marginMode': false,
293
+ 'limit': undefined,
294
+ 'daysBack': undefined,
295
+ 'untilDays': 100000,
296
+ },
297
+ 'fetchOrder': undefined,
298
+ 'fetchOpenOrders': {
299
+ 'marginMode': false,
300
+ 'limit': undefined,
301
+ 'trigger': false,
302
+ 'trailing': false,
303
+ },
304
+ 'fetchOrders': undefined,
305
+ 'fetchClosedOrders': {
306
+ 'marginMode': false,
307
+ 'limit': undefined,
308
+ 'daysBackClosed': undefined,
309
+ 'daysBackCanceled': undefined,
310
+ 'untilDays': undefined,
311
+ 'trigger': false,
312
+ 'trailing': false,
313
+ },
314
+ 'fetchOHLCV': {
315
+ 'limit': 5000,
316
+ },
317
+ },
318
+ 'spot': undefined,
319
+ 'swap': {
320
+ 'linear': {
321
+ 'extends': 'default',
322
+ },
323
+ 'inverse': {
324
+ 'extends': 'default',
325
+ },
326
+ },
327
+ 'future': {
328
+ 'linear': {
329
+ 'extends': 'default',
330
+ },
331
+ 'inverse': {
332
+ 'extends': 'default',
333
+ },
334
+ },
335
+ },
264
336
  'timeframes': {
265
337
  '1m': '1m',
266
338
  '5m': '5m',
@@ -1041,7 +1113,7 @@ class krakenfutures extends krakenfutures$1 {
1041
1113
  * @method
1042
1114
  * @name krakenfutures#createOrder
1043
1115
  * @description Create an order on the exchange
1044
- * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-send-order
1116
+ * @see https://docs.kraken.com/api/docs/futures-api/trading/send-order
1045
1117
  * @param {string} symbol unified market symbol
1046
1118
  * @param {string} type 'limit' or 'market'
1047
1119
  * @param {string} side 'buy' or 'sell'
@@ -1101,7 +1173,7 @@ class krakenfutures extends krakenfutures$1 {
1101
1173
  * @method
1102
1174
  * @name krakenfutures#createOrders
1103
1175
  * @description create a list of trade orders
1104
- * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
1176
+ * @see https://docs.kraken.com/api/docs/futures-api/trading/send-batch-order
1105
1177
  * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1106
1178
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1107
1179
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1888,7 +1960,6 @@ class krakenfutures extends krakenfutures$1 {
1888
1960
  'reduceOnly': this.safeBool2(details, 'reduceOnly', 'reduce_only'),
1889
1961
  'side': this.safeString(details, 'side'),
1890
1962
  'price': price,
1891
- 'stopPrice': this.safeString(details, 'triggerPrice'),
1892
1963
  'triggerPrice': this.safeString(details, 'triggerPrice'),
1893
1964
  'amount': amount,
1894
1965
  'cost': cost,
@@ -1919,6 +1990,7 @@ class krakenfutures extends krakenfutures$1 {
1919
1990
  if (symbol !== undefined) {
1920
1991
  market = this.market(symbol);
1921
1992
  }
1993
+ // todo: lastFillTime: this.iso8601(end)
1922
1994
  const response = await this.privateGetFills(params);
1923
1995
  //
1924
1996
  // {
@@ -3156,7 +3156,6 @@ class kucoin extends kucoin$1 {
3156
3156
  if (responseStatus === 'fail') {
3157
3157
  status = 'rejected';
3158
3158
  }
3159
- const stopPrice = this.safeNumber(order, 'stopPrice');
3160
3159
  return this.safeOrder({
3161
3160
  'info': order,
3162
3161
  'id': this.safeStringN(order, ['id', 'orderId', 'newOrderId', 'cancelledOrderId']),
@@ -3168,8 +3167,7 @@ class kucoin extends kucoin$1 {
3168
3167
  'side': this.safeString(order, 'side'),
3169
3168
  'amount': this.safeString(order, 'size'),
3170
3169
  'price': this.safeString(order, 'price'),
3171
- 'stopPrice': stopPrice,
3172
- 'triggerPrice': stopPrice,
3170
+ 'triggerPrice': this.safeNumber(order, 'stopPrice'),
3173
3171
  'cost': this.safeString(order, 'dealFunds'),
3174
3172
  'filled': this.safeString(order, 'dealSize'),
3175
3173
  'remaining': undefined,
@@ -1519,8 +1519,8 @@ class kucoinfutures extends kucoinfutures$1 {
1519
1519
  * @param {float} amount the amount of currency to trade
1520
1520
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1521
1521
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1522
- * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
1523
- * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
1522
+ * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered and the triggerPriceType
1523
+ * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered and the triggerPriceType
1524
1524
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
1525
1525
  * @param {float} [params.stopLossPrice] price to trigger stop-loss orders
1526
1526
  * @param {float} [params.takeProfitPrice] price to trigger take-profit orders
@@ -1532,8 +1532,9 @@ class kucoinfutures extends kucoinfutures$1 {
1532
1532
  * @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
1533
1533
  * @param {string} [params.clientOid] client order id, defaults to uuid if not passed
1534
1534
  * @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
1535
- * @param {string} [params.stop] 'up' or 'down', the direction the stopPrice is triggered from, requires stopPrice. down: Triggers when the price reaches or goes below the stopPrice. up: Triggers when the price reaches or goes above the stopPrice.
1536
- * @param {string} [params.stopPriceType] TP, IP or MP, defaults to MP: Mark Price
1535
+ * @param {string} [params.stop] 'up' or 'down', the direction the triggerPrice is triggered from, requires triggerPrice. down: Triggers when the price reaches or goes below the triggerPrice. up: Triggers when the price reaches or goes above the triggerPrice.
1536
+ * @param {string} [params.triggerPriceType] "last", "mark", "index" - defaults to "mark"
1537
+ * @param {string} [params.stopPriceType] exchange-specific alternative for triggerPriceType: TP, IP or MP
1537
1538
  * @param {bool} [params.closeOrder] set to true to close position
1538
1539
  * @param {bool} [params.test] set to true to use the test order endpoint (does not submit order, use to validate params)
1539
1540
  * @param {bool} [params.forceHold] A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default.
@@ -1663,12 +1664,14 @@ class kucoinfutures extends kucoinfutures$1 {
1663
1664
  if (stopLoss !== undefined) {
1664
1665
  const slPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice');
1665
1666
  request['triggerStopDownPrice'] = this.priceToPrecision(symbol, slPrice);
1666
- priceType = this.safeString(stopLoss, 'triggerPriceType', triggerPriceTypeValue);
1667
+ priceType = this.safeString(stopLoss, 'triggerPriceType', 'mark');
1668
+ priceType = this.safeString(triggerPriceTypes, priceType, priceType);
1667
1669
  }
1668
1670
  if (takeProfit !== undefined) {
1669
1671
  const tpPrice = this.safeString2(takeProfit, 'triggerPrice', 'takeProfitPrice');
1670
1672
  request['triggerStopUpPrice'] = this.priceToPrecision(symbol, tpPrice);
1671
- priceType = this.safeString(stopLoss, 'triggerPriceType', triggerPriceTypeValue);
1673
+ priceType = this.safeString(takeProfit, 'triggerPriceType', 'mark');
1674
+ priceType = this.safeString(triggerPriceTypes, priceType, priceType);
1672
1675
  }
1673
1676
  request['stopPriceType'] = priceType;
1674
1677
  }
@@ -2341,7 +2344,6 @@ class kucoinfutures extends kucoinfutures$1 {
2341
2344
  }
2342
2345
  const clientOrderId = this.safeString(order, 'clientOid');
2343
2346
  const timeInForce = this.safeString(order, 'timeInForce');
2344
- const stopPrice = this.safeNumber(order, 'stopPrice');
2345
2347
  const postOnly = this.safeValue(order, 'postOnly');
2346
2348
  const reduceOnly = this.safeValue(order, 'reduceOnly');
2347
2349
  const lastUpdateTimestamp = this.safeInteger(order, 'updatedAt');
@@ -2356,8 +2358,7 @@ class kucoinfutures extends kucoinfutures$1 {
2356
2358
  'side': side,
2357
2359
  'amount': amount,
2358
2360
  'price': price,
2359
- 'stopPrice': stopPrice,
2360
- 'triggerPrice': stopPrice,
2361
+ 'triggerPrice': this.safeNumber(order, 'stopPrice'),
2361
2362
  'cost': cost,
2362
2363
  'filled': filled,
2363
2364
  'remaining': undefined,
@@ -1103,7 +1103,6 @@ class kuna extends kuna$1 {
1103
1103
  //
1104
1104
  const marketId = this.safeString(order, 'pair');
1105
1105
  const datetime = this.safeString(order, 'createdAt');
1106
- const triggerPrice = this.safeString(order, 'stopPrice');
1107
1106
  let side = this.safeString(order, 'side');
1108
1107
  if (side === 'Bid') {
1109
1108
  side = 'buy';
@@ -1126,8 +1125,7 @@ class kuna extends kuna$1 {
1126
1125
  'postOnly': undefined,
1127
1126
  'side': side,
1128
1127
  'price': this.safeString(order, 'price'),
1129
- 'stopPrice': triggerPrice,
1130
- 'triggerPrice': triggerPrice,
1128
+ 'triggerPrice': this.safeString(order, 'stopPrice'),
1131
1129
  'amount': this.safeString(order, 'quantity'),
1132
1130
  'filled': this.safeString(order, 'executedQuantity'),
1133
1131
  'remaining': undefined,
@@ -1074,7 +1074,6 @@ class latoken extends latoken$1 {
1074
1074
  }
1075
1075
  const clientOrderId = this.safeString(order, 'clientOrderId');
1076
1076
  const timeInForce = this.parseTimeInForce(this.safeString(order, 'condition'));
1077
- const triggerPrice = this.safeString(order, 'stopPrice');
1078
1077
  return this.safeOrder({
1079
1078
  'id': id,
1080
1079
  'clientOrderId': clientOrderId,
@@ -1089,8 +1088,7 @@ class latoken extends latoken$1 {
1089
1088
  'postOnly': undefined,
1090
1089
  'side': side,
1091
1090
  'price': price,
1092
- 'stopPrice': triggerPrice,
1093
- 'triggerPrice': triggerPrice,
1091
+ 'triggerPrice': this.safeString(order, 'stopPrice'),
1094
1092
  'cost': cost,
1095
1093
  'amount': amount,
1096
1094
  'filled': filled,
@@ -1661,7 +1661,6 @@ class lbank extends lbank$1 {
1661
1661
  'postOnly': postOnly,
1662
1662
  'side': side,
1663
1663
  'price': price,
1664
- 'stopPrice': undefined,
1665
1664
  'triggerPrice': undefined,
1666
1665
  'cost': costString,
1667
1666
  'amount': amountString,
@@ -449,7 +449,6 @@ class luno extends luno$1 {
449
449
  'postOnly': undefined,
450
450
  'side': side,
451
451
  'price': price,
452
- 'stopPrice': undefined,
453
452
  'triggerPrice': undefined,
454
453
  'amount': amount,
455
454
  'filled': filled,
@@ -772,7 +772,6 @@ class lykke extends lykke$1 {
772
772
  'postOnly': undefined,
773
773
  'side': side,
774
774
  'price': price,
775
- 'stopPrice': undefined,
776
775
  'triggerPrice': undefined,
777
776
  'amount': amount,
778
777
  'cost': cost,
@@ -592,7 +592,6 @@ class mercado extends mercado$1 {
592
592
  'postOnly': undefined,
593
593
  'side': side,
594
594
  'price': price,
595
- 'stopPrice': undefined,
596
595
  'triggerPrice': undefined,
597
596
  'cost': undefined,
598
597
  'average': average,
@@ -2540,11 +2540,11 @@ class mexc extends mexc$1 {
2540
2540
  if (clientOrderId !== undefined) {
2541
2541
  request['externalOid'] = clientOrderId;
2542
2542
  }
2543
- const stopPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
2543
+ const triggerPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
2544
2544
  params = this.omit(params, ['clientOrderId', 'externalOid', 'postOnly', 'stopPrice', 'triggerPrice', 'hedged']);
2545
2545
  let response = undefined;
2546
- if (stopPrice) {
2547
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
2546
+ if (triggerPrice) {
2547
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
2548
2548
  request['triggerType'] = this.safeInteger(params, 'triggerType', 1);
2549
2549
  request['executeCycle'] = this.safeInteger(params, 'executeCycle', 1);
2550
2550
  request['trend'] = this.safeInteger(params, 'trend', 1);
@@ -3599,7 +3599,6 @@ class mexc extends mexc$1 {
3599
3599
  'timeInForce': this.parseOrderTimeInForce(this.safeString(order, 'timeInForce')),
3600
3600
  'side': this.parseOrderSide(this.safeString(order, 'side')),
3601
3601
  'price': this.safeNumber(order, 'price'),
3602
- 'stopPrice': this.safeNumber2(order, 'stopPrice', 'triggerPrice'),
3603
3602
  'triggerPrice': this.safeNumber2(order, 'stopPrice', 'triggerPrice'),
3604
3603
  'average': this.safeNumber(order, 'dealAvgPrice'),
3605
3604
  'amount': this.safeNumber2(order, 'origQty', 'vol'),
@@ -1354,7 +1354,7 @@ class ndax extends ndax$1 {
1354
1354
  'postOnly': undefined,
1355
1355
  'side': this.safeStringLower(order, 'Side'),
1356
1356
  'price': this.safeString(order, 'Price'),
1357
- 'stopPrice': this.parseNumber(this.omitZero(this.safeString(order, 'StopPrice'))),
1357
+ 'triggerPrice': this.parseNumber(this.omitZero(this.safeString(order, 'StopPrice'))),
1358
1358
  'cost': this.safeString(order, 'GrossValueExecuted'),
1359
1359
  'amount': this.safeString(order, 'OrigQuantity'),
1360
1360
  'filled': this.safeString(order, 'QuantityExecuted'),
@@ -756,8 +756,8 @@ class novadax extends novadax$1 {
756
756
  // "stopPrice": this.priceToPrecision (symbol, stopPrice),
757
757
  // "accountId": "...", // subaccount id, optional
758
758
  };
759
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
760
- if (stopPrice === undefined) {
759
+ const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
760
+ if (triggerPrice === undefined) {
761
761
  if ((uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'STOP_MARKET')) {
762
762
  throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a stopPrice parameter for ' + uppercaseType + ' orders');
763
763
  }
@@ -771,7 +771,7 @@ class novadax extends novadax$1 {
771
771
  }
772
772
  const defaultOperator = (uppercaseSide === 'BUY') ? 'LTE' : 'GTE';
773
773
  request['operator'] = this.safeString(params, 'operator', defaultOperator);
774
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
774
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
775
775
  params = this.omit(params, ['triggerPrice', 'stopPrice']);
776
776
  }
777
777
  if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT')) {
@@ -1104,7 +1104,6 @@ class novadax extends novadax$1 {
1104
1104
  }
1105
1105
  const marketId = this.safeString(order, 'symbol');
1106
1106
  const symbol = this.safeSymbol(marketId, market, '_');
1107
- const stopPrice = this.safeNumber(order, 'stopPrice');
1108
1107
  return this.safeOrder({
1109
1108
  'id': id,
1110
1109
  'clientOrderId': undefined,
@@ -1118,8 +1117,7 @@ class novadax extends novadax$1 {
1118
1117
  'postOnly': undefined,
1119
1118
  'side': side,
1120
1119
  'price': price,
1121
- 'stopPrice': stopPrice,
1122
- 'triggerPrice': stopPrice,
1120
+ 'triggerPrice': this.safeNumber(order, 'stopPrice'),
1123
1121
  'amount': amount,
1124
1122
  'cost': cost,
1125
1123
  'average': average,
@@ -851,7 +851,6 @@ class oceanex extends oceanex$1 {
851
851
  'postOnly': undefined,
852
852
  'side': this.safeValue(order, 'side'),
853
853
  'price': price,
854
- 'stopPrice': undefined,
855
854
  'triggerPrice': undefined,
856
855
  'average': average,
857
856
  'amount': amount,
@@ -1945,7 +1945,6 @@ class okcoin extends okcoin$1 {
1945
1945
  }
1946
1946
  const stopLossPrice = this.safeNumber2(order, 'slTriggerPx', 'slOrdPx');
1947
1947
  const takeProfitPrice = this.safeNumber2(order, 'tpTriggerPx', 'tpOrdPx');
1948
- const stopPrice = this.safeNumberN(order, ['triggerPx', 'moveTriggerPx']);
1949
1948
  const reduceOnlyRaw = this.safeString(order, 'reduceOnly');
1950
1949
  let reduceOnly = false;
1951
1950
  if (reduceOnly !== undefined) {
@@ -1967,8 +1966,7 @@ class okcoin extends okcoin$1 {
1967
1966
  'price': price,
1968
1967
  'stopLossPrice': stopLossPrice,
1969
1968
  'takeProfitPrice': takeProfitPrice,
1970
- 'stopPrice': stopPrice,
1971
- 'triggerPrice': stopPrice,
1969
+ 'triggerPrice': this.safeNumberN(order, ['triggerPx', 'moveTriggerPx']),
1972
1970
  'average': average,
1973
1971
  'cost': cost,
1974
1972
  'amount': amount,
@@ -3845,7 +3845,6 @@ class okx extends okx$1 {
3845
3845
  }
3846
3846
  const stopLossPrice = this.safeNumber2(order, 'slTriggerPx', 'slOrdPx');
3847
3847
  const takeProfitPrice = this.safeNumber2(order, 'tpTriggerPx', 'tpOrdPx');
3848
- const stopPrice = this.safeNumberN(order, ['triggerPx', 'moveTriggerPx']);
3849
3848
  const reduceOnlyRaw = this.safeString(order, 'reduceOnly');
3850
3849
  let reduceOnly = false;
3851
3850
  if (reduceOnly !== undefined) {
@@ -3867,8 +3866,7 @@ class okx extends okx$1 {
3867
3866
  'price': price,
3868
3867
  'stopLossPrice': stopLossPrice,
3869
3868
  'takeProfitPrice': takeProfitPrice,
3870
- 'stopPrice': stopPrice,
3871
- 'triggerPrice': stopPrice,
3869
+ 'triggerPrice': this.safeNumberN(order, ['triggerPx', 'moveTriggerPx']),
3872
3870
  'average': average,
3873
3871
  'cost': cost,
3874
3872
  'amount': amount,
@@ -1085,7 +1085,6 @@ class onetrading extends onetrading$1 {
1085
1085
  const side = this.safeStringLower(rawOrder, 'side');
1086
1086
  const type = this.safeStringLower(rawOrder, 'type');
1087
1087
  const timeInForce = this.parseTimeInForce(this.safeString(rawOrder, 'time_in_force'));
1088
- const stopPrice = this.safeNumber(rawOrder, 'trigger_price');
1089
1088
  const postOnly = this.safeValue(rawOrder, 'is_post_only');
1090
1089
  const rawTrades = this.safeValue(order, 'trades', []);
1091
1090
  return this.safeOrder({
@@ -1101,8 +1100,7 @@ class onetrading extends onetrading$1 {
1101
1100
  'postOnly': postOnly,
1102
1101
  'side': side,
1103
1102
  'price': price,
1104
- 'stopPrice': stopPrice,
1105
- 'triggerPrice': stopPrice,
1103
+ 'triggerPrice': this.safeNumber(rawOrder, 'trigger_price'),
1106
1104
  'amount': amount,
1107
1105
  'cost': undefined,
1108
1106
  'average': undefined,
@@ -1192,7 +1192,7 @@ class p2b extends p2b$1 {
1192
1192
  'postOnly': undefined,
1193
1193
  'side': this.safeString(order, 'side'),
1194
1194
  'price': this.safeString(order, 'price'),
1195
- 'stopPrice': undefined,
1195
+ 'triggerPrice': undefined,
1196
1196
  'amount': this.safeString(order, 'amount'),
1197
1197
  'cost': undefined,
1198
1198
  'average': undefined,
@@ -1106,7 +1106,6 @@ class paradex extends paradex$1 {
1106
1106
  const side = this.safeStringLower(order, 'side');
1107
1107
  const average = this.omitZero(this.safeString(order, 'avg_fill_price'));
1108
1108
  const remaining = this.omitZero(this.safeString(order, 'remaining_size'));
1109
- const stopPrice = this.safeString(order, 'trigger_price');
1110
1109
  const lastUpdateTimestamp = this.safeInteger(order, 'last_updated_at');
1111
1110
  return this.safeOrder({
1112
1111
  'id': orderId,
@@ -1123,8 +1122,7 @@ class paradex extends paradex$1 {
1123
1122
  'reduceOnly': undefined,
1124
1123
  'side': side,
1125
1124
  'price': price,
1126
- 'stopPrice': stopPrice,
1127
- 'triggerPrice': stopPrice,
1125
+ 'triggerPrice': this.safeString(order, 'trigger_price'),
1128
1126
  'takeProfitPrice': undefined,
1129
1127
  'stopLossPrice': undefined,
1130
1128
  'average': average,
@@ -1187,7 +1185,7 @@ class paradex extends paradex$1 {
1187
1185
  * @param {float} amount how much of currency you want to trade in units of base currency
1188
1186
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1189
1187
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1190
- * @param {float} [params.stopPrice] The price a trigger order is triggered at
1188
+ * @param {float} [params.stopPrice] alias for triggerPrice
1191
1189
  * @param {float} [params.triggerPrice] The price a trigger order is triggered at
1192
1190
  * @param {string} [params.timeInForce] "GTC", "IOC", or "POST_ONLY"
1193
1191
  * @param {bool} [params.postOnly] true or false
@@ -1208,7 +1206,7 @@ class paradex extends paradex$1 {
1208
1206
  'type': orderType,
1209
1207
  'size': this.amountToPrecision(symbol, amount),
1210
1208
  };
1211
- const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1209
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1212
1210
  const isMarket = orderType === 'MARKET';
1213
1211
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
1214
1212
  const postOnly = this.isPostOnly(isMarket, undefined, params);
@@ -1232,14 +1230,14 @@ class paradex extends paradex$1 {
1232
1230
  if (clientOrderId !== undefined) {
1233
1231
  request['client_id'] = clientOrderId;
1234
1232
  }
1235
- if (stopPrice !== undefined) {
1233
+ if (triggerPrice !== undefined) {
1236
1234
  if (isMarket) {
1237
1235
  request['type'] = 'STOP_MARKET';
1238
1236
  }
1239
1237
  else {
1240
1238
  request['type'] = 'STOP_LIMIT';
1241
1239
  }
1242
- request['trigger_price'] = this.priceToPrecision(symbol, stopPrice);
1240
+ request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
1243
1241
  }
1244
1242
  params = this.omit(params, ['reduceOnly', 'reduce_only', 'clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice']);
1245
1243
  const account = await this.retrieveAccount();
@@ -2267,7 +2267,7 @@ class phemex extends phemex$1 {
2267
2267
  };
2268
2268
  }
2269
2269
  const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
2270
- const stopPrice = this.parseNumber(this.omitZero(this.fromEp(this.safeString(order, 'stopPxEp'))));
2270
+ const triggerPrice = this.parseNumber(this.omitZero(this.fromEp(this.safeString(order, 'stopPxEp'))));
2271
2271
  const postOnly = (timeInForce === 'PO');
2272
2272
  return this.safeOrder({
2273
2273
  'info': order,
@@ -2282,8 +2282,7 @@ class phemex extends phemex$1 {
2282
2282
  'postOnly': postOnly,
2283
2283
  'side': side,
2284
2284
  'price': price,
2285
- 'stopPrice': stopPrice,
2286
- 'triggerPrice': stopPrice,
2285
+ 'triggerPrice': triggerPrice,
2287
2286
  'amount': amount,
2288
2287
  'cost': cost,
2289
2288
  'average': average,
@@ -2431,7 +2430,7 @@ class phemex extends phemex$1 {
2431
2430
  lastTradeTimestamp = undefined;
2432
2431
  }
2433
2432
  const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
2434
- const stopPrice = this.omitZero(this.safeString2(order, 'stopPx', 'stopPxRp'));
2433
+ const triggerPrice = this.omitZero(this.safeString2(order, 'stopPx', 'stopPxRp'));
2435
2434
  const postOnly = (timeInForce === 'PO');
2436
2435
  let reduceOnly = this.safeValue(order, 'reduceOnly');
2437
2436
  const execInst = this.safeString(order, 'execInst');
@@ -2469,8 +2468,7 @@ class phemex extends phemex$1 {
2469
2468
  'reduceOnly': reduceOnly,
2470
2469
  'side': side,
2471
2470
  'price': price,
2472
- 'stopPrice': stopPrice,
2473
- 'triggerPrice': stopPrice,
2471
+ 'triggerPrice': triggerPrice,
2474
2472
  'takeProfitPrice': takeProfit,
2475
2473
  'stopLossPrice': stopLoss,
2476
2474
  'amount': amount,
@@ -2875,13 +2873,13 @@ class phemex extends phemex$1 {
2875
2873
  request['baseQtyEV'] = this.toEv(amount, market);
2876
2874
  }
2877
2875
  }
2878
- const stopPrice = this.safeStringN(params, ['triggerPrice', 'stopPx', 'stopPrice']);
2879
- if (stopPrice !== undefined) {
2876
+ const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPx', 'stopPrice']);
2877
+ if (triggerPrice !== undefined) {
2880
2878
  if (isUSDTSettled) {
2881
- request['stopPxRp'] = this.priceToPrecision(symbol, stopPrice);
2879
+ request['stopPxRp'] = this.priceToPrecision(symbol, triggerPrice);
2882
2880
  }
2883
2881
  else {
2884
- request['stopPxEp'] = this.toEp(stopPrice, market);
2882
+ request['stopPxEp'] = this.toEp(triggerPrice, market);
2885
2883
  }
2886
2884
  }
2887
2885
  params = this.omit(params, ['triggerPrice', 'stopPx', 'stopPrice']);
@@ -1149,7 +1149,6 @@ class poloniex extends poloniex$1 {
1149
1149
  };
1150
1150
  }
1151
1151
  const clientOrderId = this.safeString(order, 'clientOrderId');
1152
- const triggerPrice = this.safeString2(order, 'triggerPrice', 'stopPrice');
1153
1152
  return this.safeOrder({
1154
1153
  'info': order,
1155
1154
  'id': id,
@@ -1164,8 +1163,7 @@ class poloniex extends poloniex$1 {
1164
1163
  'postOnly': undefined,
1165
1164
  'side': side,
1166
1165
  'price': price,
1167
- 'stopPrice': triggerPrice,
1168
- 'triggerPrice': triggerPrice,
1166
+ 'triggerPrice': this.safeString2(order, 'triggerPrice', 'stopPrice'),
1169
1167
  'cost': undefined,
1170
1168
  'average': this.safeString(order, 'avgPrice'),
1171
1169
  'amount': amount,
@@ -867,12 +867,12 @@ class poloniexfutures extends poloniexfutures$1 {
867
867
  'size': preciseAmount,
868
868
  'leverage': 1,
869
869
  };
870
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
871
- if (stopPrice) {
870
+ const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
871
+ if (triggerPrice) {
872
872
  request['stop'] = (side === 'buy') ? 'up' : 'down';
873
873
  const stopPriceType = this.safeString(params, 'stopPriceType', 'TP');
874
874
  request['stopPriceType'] = stopPriceType;
875
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
875
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
876
876
  }
877
877
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
878
878
  if (type === 'limit') {
@@ -929,7 +929,7 @@ class poloniexfutures extends poloniexfutures$1 {
929
929
  'trades': undefined,
930
930
  'timeInForce': undefined,
931
931
  'postOnly': undefined,
932
- 'stopPrice': undefined,
932
+ 'triggerPrice': undefined,
933
933
  'info': response,
934
934
  }, market);
935
935
  }
@@ -1260,7 +1260,7 @@ class poloniexfutures extends poloniexfutures$1 {
1260
1260
  'trades': undefined,
1261
1261
  'timeInForce': undefined,
1262
1262
  'postOnly': undefined,
1263
- 'stopPrice': undefined,
1263
+ 'triggerPrice': undefined,
1264
1264
  'info': response,
1265
1265
  }));
1266
1266
  }
@@ -1597,7 +1597,7 @@ class poloniexfutures extends poloniexfutures$1 {
1597
1597
  'side': this.safeString(order, 'side'),
1598
1598
  'amount': this.safeString(order, 'size'),
1599
1599
  'price': this.safeString(order, 'price'),
1600
- 'stopPrice': this.safeString(order, 'stopPrice'),
1600
+ 'triggerPrice': this.safeString(order, 'stopPrice'),
1601
1601
  'cost': this.safeString(order, 'dealValue'),
1602
1602
  'filled': filled,
1603
1603
  'remaining': undefined,
@@ -1164,7 +1164,6 @@ class probit extends probit$1 {
1164
1164
  'side': side,
1165
1165
  'status': status,
1166
1166
  'price': price,
1167
- 'stopPrice': undefined,
1168
1167
  'triggerPrice': undefined,
1169
1168
  'amount': amount,
1170
1169
  'filled': filled,
@@ -1562,7 +1562,6 @@ class timex extends timex$1 {
1562
1562
  'postOnly': undefined,
1563
1563
  'side': side,
1564
1564
  'price': price,
1565
- 'stopPrice': undefined,
1566
1565
  'triggerPrice': undefined,
1567
1566
  'amount': amount,
1568
1567
  'cost': undefined,