ccxt 4.4.37 → 4.4.39

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 (52) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +73 -2
  5. package/dist/cjs/src/base/Exchange.js +31 -10
  6. package/dist/cjs/src/binance.js +0 -2
  7. package/dist/cjs/src/bingx.js +93 -8
  8. package/dist/cjs/src/bitget.js +0 -2
  9. package/dist/cjs/src/bithumb.js +1 -1
  10. package/dist/cjs/src/bitmart.js +163 -15
  11. package/dist/cjs/src/bybit.js +3 -2
  12. package/dist/cjs/src/digifinex.js +58 -18
  13. package/dist/cjs/src/htx.js +154 -32
  14. package/dist/cjs/src/kucoin.js +77 -2
  15. package/dist/cjs/src/kucoinfutures.js +93 -5
  16. package/dist/cjs/src/mexc.js +36 -25
  17. package/dist/cjs/src/ndax.js +7 -2
  18. package/dist/cjs/src/okx.js +1 -1
  19. package/dist/cjs/src/pro/woo.js +1 -1
  20. package/dist/cjs/src/probit.js +3 -1
  21. package/dist/cjs/src/woo.js +4 -4
  22. package/js/ccxt.d.ts +1 -1
  23. package/js/ccxt.js +1 -1
  24. package/js/src/abstract/bingx.d.ts +0 -1
  25. package/js/src/abstract/digifinex.d.ts +1 -0
  26. package/js/src/abstract/mexc.d.ts +1 -0
  27. package/js/src/alpaca.d.ts +11 -1
  28. package/js/src/alpaca.js +73 -2
  29. package/js/src/base/Exchange.js +31 -10
  30. package/js/src/binance.js +0 -2
  31. package/js/src/bingx.d.ts +14 -1
  32. package/js/src/bingx.js +93 -8
  33. package/js/src/bitget.js +0 -2
  34. package/js/src/bithumb.js +1 -1
  35. package/js/src/bitmart.js +163 -15
  36. package/js/src/bybit.js +3 -2
  37. package/js/src/digifinex.d.ts +4 -2
  38. package/js/src/digifinex.js +58 -18
  39. package/js/src/htx.d.ts +5 -5
  40. package/js/src/htx.js +154 -32
  41. package/js/src/kucoin.js +77 -2
  42. package/js/src/kucoinfutures.js +93 -5
  43. package/js/src/mexc.d.ts +7 -7
  44. package/js/src/mexc.js +36 -25
  45. package/js/src/ndax.d.ts +2 -0
  46. package/js/src/ndax.js +7 -2
  47. package/js/src/okx.d.ts +1 -0
  48. package/js/src/okx.js +1 -1
  49. package/js/src/pro/woo.js +1 -1
  50. package/js/src/probit.js +3 -1
  51. package/js/src/woo.js +4 -4
  52. package/package.json +1 -1
@@ -659,6 +659,9 @@ class bybit extends bybit$1 {
659
659
  '110071': errors.ExchangeError,
660
660
  '110072': errors.InvalidOrder,
661
661
  '110073': errors.ExchangeError,
662
+ '110092': errors.InvalidOrder,
663
+ '110093': errors.InvalidOrder,
664
+ '110094': errors.InvalidOrder,
662
665
  '130006': errors.InvalidOrder,
663
666
  '130021': errors.InsufficientFunds,
664
667
  '130074': errors.InvalidOrder,
@@ -1098,7 +1101,6 @@ class bybit extends bybit$1 {
1098
1101
  'limitPrice': true,
1099
1102
  },
1100
1103
  'timeInForce': {
1101
- 'GTC': true,
1102
1104
  'IOC': true,
1103
1105
  'FOK': true,
1104
1106
  'PO': true,
@@ -1160,7 +1162,6 @@ class bybit extends bybit$1 {
1160
1162
  'limitPrice': true,
1161
1163
  },
1162
1164
  'timeInForce': {
1163
- 'GTC': true,
1164
1165
  'IOC': true,
1165
1166
  'FOK': true,
1166
1167
  'PO': true,
@@ -211,6 +211,7 @@ class digifinex extends digifinex$1 {
211
211
  'trade/order_info',
212
212
  ],
213
213
  'post': [
214
+ 'account/transfer',
214
215
  'account/leverage',
215
216
  'account/position_mode',
216
217
  'account/position_margin',
@@ -2939,12 +2940,23 @@ class digifinex extends digifinex$1 {
2939
2940
  }
2940
2941
  parseTransfer(transfer, currency = undefined) {
2941
2942
  //
2942
- // transfer
2943
+ // transfer between spot, margin and OTC
2943
2944
  //
2944
2945
  // {
2945
2946
  // "code": 0
2946
2947
  // }
2947
2948
  //
2949
+ // transfer between spot and swap
2950
+ //
2951
+ // {
2952
+ // "code": 0,
2953
+ // "data": {
2954
+ // "type": 2,
2955
+ // "currency": "USDT",
2956
+ // "transfer_amount": "5"
2957
+ // }
2958
+ // }
2959
+ //
2948
2960
  // fetchTransfers
2949
2961
  //
2950
2962
  // {
@@ -2957,7 +2969,8 @@ class digifinex extends digifinex$1 {
2957
2969
  //
2958
2970
  let fromAccount = undefined;
2959
2971
  let toAccount = undefined;
2960
- const type = this.safeInteger(transfer, 'type');
2972
+ const data = this.safeDict(transfer, 'data', transfer);
2973
+ const type = this.safeInteger(data, 'type');
2961
2974
  if (type === 1) {
2962
2975
  fromAccount = 'spot';
2963
2976
  toAccount = 'swap';
@@ -2972,8 +2985,8 @@ class digifinex extends digifinex$1 {
2972
2985
  'id': this.safeString(transfer, 'transfer_id'),
2973
2986
  'timestamp': timestamp,
2974
2987
  'datetime': this.iso8601(timestamp),
2975
- 'currency': this.safeCurrencyCode(this.safeString(transfer, 'currency'), currency),
2976
- 'amount': this.safeNumber(transfer, 'amount'),
2988
+ 'currency': this.safeCurrencyCode(this.safeString(data, 'currency'), currency),
2989
+ 'amount': this.safeNumber2(data, 'amount', 'transfer_amount'),
2977
2990
  'fromAccount': fromAccount,
2978
2991
  'toAccount': toAccount,
2979
2992
  'status': this.parseTransferStatus(this.safeString(transfer, 'code')),
@@ -2983,31 +2996,58 @@ class digifinex extends digifinex$1 {
2983
2996
  * @method
2984
2997
  * @name digifinex#transfer
2985
2998
  * @description transfer currency internally between wallets on the same account
2999
+ * @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#transfer-assets-among-accounts
3000
+ * @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#accounttransfer
2986
3001
  * @param {string} code unified currency code
2987
3002
  * @param {float} amount amount to transfer
2988
- * @param {string} fromAccount account to transfer from
2989
- * @param {string} toAccount account to transfer to
3003
+ * @param {string} fromAccount 'spot', 'swap', 'margin', 'OTC' - account to transfer from
3004
+ * @param {string} toAccount 'spot', 'swap', 'margin', 'OTC' - account to transfer to
2990
3005
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2991
3006
  * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
2992
3007
  */
2993
3008
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
2994
3009
  await this.loadMarkets();
2995
3010
  const currency = this.currency(code);
3011
+ const currencyId = currency['id'];
2996
3012
  const accountsByType = this.safeValue(this.options, 'accountsByType', {});
2997
3013
  const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
2998
3014
  const toId = this.safeString(accountsByType, toAccount, toAccount);
2999
- const request = {
3000
- 'currency_mark': currency['id'],
3001
- 'num': this.currencyToPrecision(code, amount),
3002
- 'from': fromId,
3003
- 'to': toId, // 1 = SPOT, 2 = MARGIN, 3 = OTC
3004
- };
3005
- const response = await this.privateSpotPostTransfer(this.extend(request, params));
3006
- //
3007
- // {
3008
- // "code": 0
3009
- // }
3010
- //
3015
+ const request = {};
3016
+ const fromSwap = (fromAccount === 'swap');
3017
+ const toSwap = (toAccount === 'swap');
3018
+ let response = undefined;
3019
+ const amountString = this.currencyToPrecision(code, amount);
3020
+ if (fromSwap || toSwap) {
3021
+ if ((fromId !== '1') && (toId !== '1')) {
3022
+ throw new errors.ExchangeError(this.id + ' transfer() supports transferring between spot and swap, spot and margin, spot and OTC only');
3023
+ }
3024
+ request['type'] = toSwap ? 1 : 2; // 1 = spot to swap, 2 = swap to spot
3025
+ request['currency'] = currencyId;
3026
+ request['transfer_amount'] = amountString;
3027
+ //
3028
+ // {
3029
+ // "code": 0,
3030
+ // "data": {
3031
+ // "type": 2,
3032
+ // "currency": "USDT",
3033
+ // "transfer_amount": "5"
3034
+ // }
3035
+ // }
3036
+ //
3037
+ response = await this.privateSwapPostAccountTransfer(this.extend(request, params));
3038
+ }
3039
+ else {
3040
+ request['currency_mark'] = currencyId;
3041
+ request['num'] = amountString;
3042
+ request['from'] = fromId; // 1 = SPOT, 2 = MARGIN, 3 = OTC
3043
+ request['to'] = toId; // 1 = SPOT, 2 = MARGIN, 3 = OTC
3044
+ //
3045
+ // {
3046
+ // "code": 0
3047
+ // }
3048
+ //
3049
+ response = await this.privateSpotPostTransfer(this.extend(request, params));
3050
+ }
3011
3051
  return this.parseTransfer(response, currency);
3012
3052
  }
3013
3053
  /**
@@ -1232,6 +1232,128 @@ class htx extends htx$1 {
1232
1232
  'BIFI': 'BITCOINFILE',
1233
1233
  'FUD': 'FTX Users Debt',
1234
1234
  },
1235
+ 'features': {
1236
+ 'spot': {
1237
+ 'sandbox': true,
1238
+ 'createOrder': {
1239
+ 'marginMode': true,
1240
+ 'triggerPrice': true,
1241
+ 'triggerDirection': true,
1242
+ 'triggerPriceType': undefined,
1243
+ 'stopLossPrice': false,
1244
+ 'takeProfitPrice': false,
1245
+ 'attachedStopLossTakeProfit': undefined,
1246
+ 'timeInForce': {
1247
+ 'IOC': true,
1248
+ 'FOK': true,
1249
+ 'PO': true,
1250
+ 'GTD': false,
1251
+ },
1252
+ 'hedged': false,
1253
+ 'trailing': false,
1254
+ // exchange-specific features
1255
+ 'iceberg': false,
1256
+ 'selfTradePrevention': true,
1257
+ },
1258
+ 'createOrders': {
1259
+ 'max': 10,
1260
+ },
1261
+ 'fetchMyTrades': {
1262
+ 'marginMode': false,
1263
+ 'limit': 500,
1264
+ 'daysBack': 120,
1265
+ 'untilDays': 2,
1266
+ },
1267
+ 'fetchOrder': {
1268
+ 'marginMode': false,
1269
+ 'trigger': false,
1270
+ 'trailing': false,
1271
+ },
1272
+ 'fetchOpenOrders': {
1273
+ 'marginMode': false,
1274
+ 'trigger': true,
1275
+ 'trailing': false,
1276
+ 'limit': 500,
1277
+ },
1278
+ 'fetchOrders': {
1279
+ 'marginMode': false,
1280
+ 'trigger': true,
1281
+ 'trailing': false,
1282
+ 'limit': 500,
1283
+ 'untilDays': 2,
1284
+ 'daysBack': 180,
1285
+ },
1286
+ 'fetchClosedOrders': {
1287
+ 'marginMode': false,
1288
+ 'trigger': true,
1289
+ 'trailing': false,
1290
+ 'untilDays': 2,
1291
+ 'limit': 500,
1292
+ 'daysBackClosed': 180,
1293
+ 'daysBackCanceled': 1 / 12,
1294
+ },
1295
+ 'fetchOHLCV': {
1296
+ 'limit': 1000, // 2000 for non-historical
1297
+ },
1298
+ },
1299
+ 'forDerivatives': {
1300
+ 'extends': 'spot',
1301
+ 'createOrder': {
1302
+ 'stopLossPrice': true,
1303
+ 'takeProfitPrice': true,
1304
+ 'trailing': true,
1305
+ 'hedged': true,
1306
+ // 'leverage': true, // todo
1307
+ },
1308
+ 'createOrders': {
1309
+ 'max': 25,
1310
+ },
1311
+ 'fetchOrder': {
1312
+ 'marginMode': true,
1313
+ },
1314
+ 'fetchOpenOrders': {
1315
+ 'marginMode': true,
1316
+ 'trigger': false,
1317
+ 'trailing': false,
1318
+ 'limit': 50,
1319
+ },
1320
+ 'fetchOrders': {
1321
+ 'marginMode': true,
1322
+ 'trigger': false,
1323
+ 'trailing': false,
1324
+ 'limit': 50,
1325
+ 'daysBack': 90,
1326
+ },
1327
+ 'fetchClosedOrders': {
1328
+ 'marginMode': true,
1329
+ 'trigger': false,
1330
+ 'trailing': false,
1331
+ 'untilDays': 2,
1332
+ 'limit': 50,
1333
+ 'daysBackClosed': 90,
1334
+ 'daysBackCanceled': 1 / 12,
1335
+ },
1336
+ 'fetchOHLCV': {
1337
+ 'limit': 2000,
1338
+ },
1339
+ },
1340
+ 'swap': {
1341
+ 'linear': {
1342
+ 'extends': 'forDerivatives',
1343
+ },
1344
+ 'inverse': {
1345
+ 'extends': 'forDerivatives',
1346
+ },
1347
+ },
1348
+ 'future': {
1349
+ 'linear': {
1350
+ 'extends': 'forDerivatives',
1351
+ },
1352
+ 'inverse': {
1353
+ 'extends': 'forDerivatives',
1354
+ },
1355
+ },
1356
+ },
1235
1357
  });
1236
1358
  }
1237
1359
  /**
@@ -4081,11 +4203,11 @@ class htx extends htx$1 {
4081
4203
  'status': '0', // support multiple query seperated by ',',such as '3,4,5', 0: all. 3. Have sumbmitted the orders; 4. Orders partially matched; 5. Orders cancelled with partially matched; 6. Orders fully matched; 7. Orders cancelled;
4082
4204
  };
4083
4205
  let response = undefined;
4084
- const stop = this.safeBool2(params, 'stop', 'trigger');
4206
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
4085
4207
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
4086
4208
  const trailing = this.safeBool(params, 'trailing', false);
4087
4209
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
4088
- if (stop || stopLossTakeProfit || trailing) {
4210
+ if (trigger || stopLossTakeProfit || trailing) {
4089
4211
  if (limit !== undefined) {
4090
4212
  request['page_size'] = limit;
4091
4213
  }
@@ -4106,7 +4228,7 @@ class htx extends htx$1 {
4106
4228
  [marginMode, params] = this.handleMarginModeAndParams('fetchContractOrders', params);
4107
4229
  marginMode = (marginMode === undefined) ? 'cross' : marginMode;
4108
4230
  if (marginMode === 'isolated') {
4109
- if (stop) {
4231
+ if (trigger) {
4110
4232
  response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerHisorders(this.extend(request, params));
4111
4233
  }
4112
4234
  else if (stopLossTakeProfit) {
@@ -4120,7 +4242,7 @@ class htx extends htx$1 {
4120
4242
  }
4121
4243
  }
4122
4244
  else if (marginMode === 'cross') {
4123
- if (stop) {
4245
+ if (trigger) {
4124
4246
  response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerHisorders(this.extend(request, params));
4125
4247
  }
4126
4248
  else if (stopLossTakeProfit) {
@@ -4136,7 +4258,7 @@ class htx extends htx$1 {
4136
4258
  }
4137
4259
  else if (market['inverse']) {
4138
4260
  if (market['swap']) {
4139
- if (stop) {
4261
+ if (trigger) {
4140
4262
  response = await this.contractPrivatePostSwapApiV1SwapTriggerHisorders(this.extend(request, params));
4141
4263
  }
4142
4264
  else if (stopLossTakeProfit) {
@@ -4151,7 +4273,7 @@ class htx extends htx$1 {
4151
4273
  }
4152
4274
  else if (market['future']) {
4153
4275
  request['symbol'] = market['settleId'];
4154
- if (stop) {
4276
+ if (trigger) {
4155
4277
  response = await this.contractPrivatePostApiV1ContractTriggerHisorders(this.extend(request, params));
4156
4278
  }
4157
4279
  else if (stopLossTakeProfit) {
@@ -4333,7 +4455,7 @@ class htx extends htx$1 {
4333
4455
  * @param {int} [since] the earliest time in ms to fetch orders for
4334
4456
  * @param {int} [limit] the maximum number of order structures to retrieve
4335
4457
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4336
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4458
+ * @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
4337
4459
  * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4338
4460
  * @param {int} [params.until] the latest time in ms to fetch entries for
4339
4461
  * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
@@ -4407,7 +4529,7 @@ class htx extends htx$1 {
4407
4529
  * @param {int} [since] the earliest time in ms to fetch open orders for
4408
4530
  * @param {int} [limit] the maximum number of open order structures to retrieve
4409
4531
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4410
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
4532
+ * @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
4411
4533
  * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
4412
4534
  * @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
4413
4535
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -4456,7 +4578,7 @@ class htx extends htx$1 {
4456
4578
  request['page_size'] = limit;
4457
4579
  }
4458
4580
  request['contract_code'] = market['id'];
4459
- const stop = this.safeBool2(params, 'stop', 'trigger');
4581
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
4460
4582
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
4461
4583
  const trailing = this.safeBool(params, 'trailing', false);
4462
4584
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
@@ -4465,7 +4587,7 @@ class htx extends htx$1 {
4465
4587
  [marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
4466
4588
  marginMode = (marginMode === undefined) ? 'cross' : marginMode;
4467
4589
  if (marginMode === 'isolated') {
4468
- if (stop) {
4590
+ if (trigger) {
4469
4591
  response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
4470
4592
  }
4471
4593
  else if (stopLossTakeProfit) {
@@ -4479,7 +4601,7 @@ class htx extends htx$1 {
4479
4601
  }
4480
4602
  }
4481
4603
  else if (marginMode === 'cross') {
4482
- if (stop) {
4604
+ if (trigger) {
4483
4605
  response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerOpenorders(this.extend(request, params));
4484
4606
  }
4485
4607
  else if (stopLossTakeProfit) {
@@ -4495,7 +4617,7 @@ class htx extends htx$1 {
4495
4617
  }
4496
4618
  else if (market['inverse']) {
4497
4619
  if (market['swap']) {
4498
- if (stop) {
4620
+ if (trigger) {
4499
4621
  response = await this.contractPrivatePostSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
4500
4622
  }
4501
4623
  else if (stopLossTakeProfit) {
@@ -4510,7 +4632,7 @@ class htx extends htx$1 {
4510
4632
  }
4511
4633
  else if (market['future']) {
4512
4634
  request['symbol'] = market['settleId'];
4513
- if (stop) {
4635
+ if (trigger) {
4514
4636
  response = await this.contractPrivatePostApiV1ContractTriggerOpenorders(this.extend(request, params));
4515
4637
  }
4516
4638
  else if (stopLossTakeProfit) {
@@ -5259,7 +5381,7 @@ class htx extends htx$1 {
5259
5381
  if (triggerPrice === undefined) {
5260
5382
  const stopOrderTypes = this.safeValue(options, 'stopOrderTypes', {});
5261
5383
  if (orderType in stopOrderTypes) {
5262
- throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a stop order');
5384
+ throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a trigger order');
5263
5385
  }
5264
5386
  }
5265
5387
  else {
@@ -5789,7 +5911,7 @@ class htx extends htx$1 {
5789
5911
  * @param {string} id order id
5790
5912
  * @param {string} symbol unified symbol of the market the order was made in
5791
5913
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5792
- * @param {boolean} [params.stop] *contract only* if the order is a stop trigger order or not
5914
+ * @param {boolean} [params.trigger] *contract only* if the order is a trigger trigger order or not
5793
5915
  * @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
5794
5916
  * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
5795
5917
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -5845,7 +5967,7 @@ class htx extends htx$1 {
5845
5967
  else {
5846
5968
  request['contract_code'] = market['id'];
5847
5969
  }
5848
- const stop = this.safeBool2(params, 'stop', 'trigger');
5970
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
5849
5971
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
5850
5972
  const trailing = this.safeBool(params, 'trailing', false);
5851
5973
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
@@ -5854,7 +5976,7 @@ class htx extends htx$1 {
5854
5976
  [marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
5855
5977
  marginMode = (marginMode === undefined) ? 'cross' : marginMode;
5856
5978
  if (marginMode === 'isolated') {
5857
- if (stop) {
5979
+ if (trigger) {
5858
5980
  response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancel(this.extend(request, params));
5859
5981
  }
5860
5982
  else if (stopLossTakeProfit) {
@@ -5868,7 +5990,7 @@ class htx extends htx$1 {
5868
5990
  }
5869
5991
  }
5870
5992
  else if (marginMode === 'cross') {
5871
- if (stop) {
5993
+ if (trigger) {
5872
5994
  response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancel(this.extend(request, params));
5873
5995
  }
5874
5996
  else if (stopLossTakeProfit) {
@@ -5884,7 +6006,7 @@ class htx extends htx$1 {
5884
6006
  }
5885
6007
  else if (market['inverse']) {
5886
6008
  if (market['swap']) {
5887
- if (stop) {
6009
+ if (trigger) {
5888
6010
  response = await this.contractPrivatePostSwapApiV1SwapTriggerCancel(this.extend(request, params));
5889
6011
  }
5890
6012
  else if (stopLossTakeProfit) {
@@ -5898,7 +6020,7 @@ class htx extends htx$1 {
5898
6020
  }
5899
6021
  }
5900
6022
  else if (market['future']) {
5901
- if (stop) {
6023
+ if (trigger) {
5902
6024
  response = await this.contractPrivatePostApiV1ContractTriggerCancel(this.extend(request, params));
5903
6025
  }
5904
6026
  else if (stopLossTakeProfit) {
@@ -5947,7 +6069,7 @@ class htx extends htx$1 {
5947
6069
  * @param {string[]} ids order ids
5948
6070
  * @param {string} symbol unified market symbol, default is undefined
5949
6071
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5950
- * @param {bool} [params.stop] *contract only* if the orders are stop trigger orders or not
6072
+ * @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
5951
6073
  * @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
5952
6074
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5953
6075
  */
@@ -6011,7 +6133,7 @@ class htx extends htx$1 {
6011
6133
  else {
6012
6134
  request['contract_code'] = market['id'];
6013
6135
  }
6014
- const stop = this.safeBool2(params, 'stop', 'trigger');
6136
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
6015
6137
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
6016
6138
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trigger']);
6017
6139
  if (market['linear']) {
@@ -6019,7 +6141,7 @@ class htx extends htx$1 {
6019
6141
  [marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
6020
6142
  marginMode = (marginMode === undefined) ? 'cross' : marginMode;
6021
6143
  if (marginMode === 'isolated') {
6022
- if (stop) {
6144
+ if (trigger) {
6023
6145
  response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancel(this.extend(request, params));
6024
6146
  }
6025
6147
  else if (stopLossTakeProfit) {
@@ -6030,7 +6152,7 @@ class htx extends htx$1 {
6030
6152
  }
6031
6153
  }
6032
6154
  else if (marginMode === 'cross') {
6033
- if (stop) {
6155
+ if (trigger) {
6034
6156
  response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancel(this.extend(request, params));
6035
6157
  }
6036
6158
  else if (stopLossTakeProfit) {
@@ -6043,7 +6165,7 @@ class htx extends htx$1 {
6043
6165
  }
6044
6166
  else if (market['inverse']) {
6045
6167
  if (market['swap']) {
6046
- if (stop) {
6168
+ if (trigger) {
6047
6169
  response = await this.contractPrivatePostSwapApiV1SwapTriggerCancel(this.extend(request, params));
6048
6170
  }
6049
6171
  else if (stopLossTakeProfit) {
@@ -6054,7 +6176,7 @@ class htx extends htx$1 {
6054
6176
  }
6055
6177
  }
6056
6178
  else if (market['future']) {
6057
- if (stop) {
6179
+ if (trigger) {
6058
6180
  response = await this.contractPrivatePostApiV1ContractTriggerCancel(this.extend(request, params));
6059
6181
  }
6060
6182
  else if (stopLossTakeProfit) {
@@ -6187,7 +6309,7 @@ class htx extends htx$1 {
6187
6309
  * @description cancel all open orders
6188
6310
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
6189
6311
  * @param {object} [params] extra parameters specific to the exchange API endpoint
6190
- * @param {boolean} [params.stop] *contract only* if the orders are stop trigger orders or not
6312
+ * @param {boolean} [params.trigger] *contract only* if the orders are trigger trigger orders or not
6191
6313
  * @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
6192
6314
  * @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
6193
6315
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -6245,7 +6367,7 @@ class htx extends htx$1 {
6245
6367
  request['symbol'] = market['settleId'];
6246
6368
  }
6247
6369
  request['contract_code'] = market['id'];
6248
- const stop = this.safeBool2(params, 'stop', 'trigger');
6370
+ const trigger = this.safeBool2(params, 'stop', 'trigger');
6249
6371
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
6250
6372
  const trailing = this.safeBool(params, 'trailing', false);
6251
6373
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
@@ -6254,7 +6376,7 @@ class htx extends htx$1 {
6254
6376
  [marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
6255
6377
  marginMode = (marginMode === undefined) ? 'cross' : marginMode;
6256
6378
  if (marginMode === 'isolated') {
6257
- if (stop) {
6379
+ if (trigger) {
6258
6380
  response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancelall(this.extend(request, params));
6259
6381
  }
6260
6382
  else if (stopLossTakeProfit) {
@@ -6268,7 +6390,7 @@ class htx extends htx$1 {
6268
6390
  }
6269
6391
  }
6270
6392
  else if (marginMode === 'cross') {
6271
- if (stop) {
6393
+ if (trigger) {
6272
6394
  response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancelall(this.extend(request, params));
6273
6395
  }
6274
6396
  else if (stopLossTakeProfit) {
@@ -6284,7 +6406,7 @@ class htx extends htx$1 {
6284
6406
  }
6285
6407
  else if (market['inverse']) {
6286
6408
  if (market['swap']) {
6287
- if (stop) {
6409
+ if (trigger) {
6288
6410
  response = await this.contractPrivatePostSwapApiV1SwapTriggerCancelall(this.extend(request, params));
6289
6411
  }
6290
6412
  else if (stopLossTakeProfit) {
@@ -6298,7 +6420,7 @@ class htx extends htx$1 {
6298
6420
  }
6299
6421
  }
6300
6422
  else if (market['future']) {
6301
- if (stop) {
6423
+ if (trigger) {
6302
6424
  response = await this.contractPrivatePostApiV1ContractTriggerCancelall(this.extend(request, params));
6303
6425
  }
6304
6426
  else if (stopLossTakeProfit) {