ccxt 4.2.2 → 4.2.3

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.
package/README.md CHANGED
@@ -209,13 +209,13 @@ console.log(version, Object.keys(exchanges));
209
209
 
210
210
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
211
211
 
212
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.2/dist/ccxt.browser.js
213
- * unpkg: https://unpkg.com/ccxt@4.2.2/dist/ccxt.browser.js
212
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.3/dist/ccxt.browser.js
213
+ * unpkg: https://unpkg.com/ccxt@4.2.3/dist/ccxt.browser.js
214
214
 
215
215
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
216
216
 
217
217
  ```HTML
218
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.2/dist/ccxt.browser.js"></script>
218
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.3/dist/ccxt.browser.js"></script>
219
219
  ```
220
220
 
221
221
  Creates a global `ccxt` object:
@@ -2536,7 +2536,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
2536
2536
  'closeAllPositions': false,
2537
2537
  'closePosition': false,
2538
2538
  'createOrder': true,
2539
- 'fetchBalance': true,
2539
+ 'fetchBalance': false,
2540
2540
  'fetchBidsAsks': false,
2541
2541
  'fetchClosedOrders': true,
2542
2542
  'fetchCurrencies': false,
@@ -27332,6 +27332,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27332
27332
  'post': {
27333
27333
  'userDataStream': 1,
27334
27334
  },
27335
+ 'put': {
27336
+ 'userDataStream': 1,
27337
+ },
27335
27338
  },
27336
27339
  },
27337
27340
  },
@@ -28773,6 +28776,10 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28773
28776
  const isTrailingAmountOrder = trailingAmount !== undefined;
28774
28777
  const isTrailingPercentOrder = trailingPercent !== undefined;
28775
28778
  const isTrailing = isTrailingAmountOrder || isTrailingPercentOrder;
28779
+ const stopLoss = this.safeValue(params, 'stopLoss');
28780
+ const takeProfit = this.safeValue(params, 'takeProfit');
28781
+ const isStopLoss = stopLoss !== undefined;
28782
+ const isTakeProfit = takeProfit !== undefined;
28776
28783
  if (((type === 'LIMIT') || (type === 'TRIGGER_LIMIT') || (type === 'STOP') || (type === 'TAKE_PROFIT')) && !isTrailing) {
28777
28784
  request['price'] = this.parseToNumeric(this.priceToPrecision(symbol, price));
28778
28785
  }
@@ -28818,6 +28825,42 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28818
28825
  request['priceRate'] = this.parseToNumeric(requestTrailingPercent);
28819
28826
  }
28820
28827
  }
28828
+ if (isStopLoss || isTakeProfit) {
28829
+ if (isStopLoss) {
28830
+ const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
28831
+ const slWorkingType = this.safeString(stopLoss, 'workingType', 'MARK_PRICE');
28832
+ const slType = this.safeString(stopLoss, 'type', 'STOP_MARKET');
28833
+ const slRequest = {
28834
+ 'stopPrice': this.parseToNumeric(this.priceToPrecision(symbol, slTriggerPrice)),
28835
+ 'workingType': slWorkingType,
28836
+ 'type': slType,
28837
+ };
28838
+ const slPrice = this.safeString(stopLoss, 'price');
28839
+ if (slPrice !== undefined) {
28840
+ slRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
28841
+ }
28842
+ const slQuantity = this.safeString(stopLoss, 'quantity', amount);
28843
+ slRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, slQuantity));
28844
+ request['stopLoss'] = this.json(slRequest);
28845
+ }
28846
+ if (isTakeProfit) {
28847
+ const tkTriggerPrice = this.safeString2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit);
28848
+ const tkWorkingType = this.safeString(takeProfit, 'workingType', 'MARK_PRICE');
28849
+ const tpType = this.safeString(takeProfit, 'type', 'TAKE_PROFIT_MARKET');
28850
+ const tpRequest = {
28851
+ 'stopPrice': this.parseToNumeric(this.priceToPrecision(symbol, tkTriggerPrice)),
28852
+ 'workingType': tkWorkingType,
28853
+ 'type': tpType,
28854
+ };
28855
+ const slPrice = this.safeString(takeProfit, 'price');
28856
+ if (slPrice !== undefined) {
28857
+ tpRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
28858
+ }
28859
+ const tkQuantity = this.safeString(takeProfit, 'quantity', amount);
28860
+ tpRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, tkQuantity));
28861
+ request['takeProfit'] = this.json(tpRequest);
28862
+ }
28863
+ }
28821
28864
  let positionSide = undefined;
28822
28865
  if (reduceOnly) {
28823
28866
  positionSide = (side === 'buy') ? 'SHORT' : 'LONG';
@@ -28827,7 +28870,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28827
28870
  }
28828
28871
  request['positionSide'] = positionSide;
28829
28872
  request['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, amount));
28830
- params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent']);
28873
+ params = this.omit(params, ['reduceOnly', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'takeProfit', 'stopLoss']);
28831
28874
  }
28832
28875
  return this.extend(request, params);
28833
28876
  }
@@ -28837,6 +28880,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28837
28880
  * @name bingx#createOrder
28838
28881
  * @description create a trade order
28839
28882
  * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Trade%20order
28883
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Create%20an%20Order
28840
28884
  * @param {string} symbol unified symbol of the market to create an order in
28841
28885
  * @param {string} type 'market' or 'limit'
28842
28886
  * @param {string} side 'buy' or 'sell'
@@ -28852,6 +28896,10 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28852
28896
  * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount
28853
28897
  * @param {float} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
28854
28898
  * @param {float} [params.trailingPercent] *swap only* the percent to trail away from the current market price
28899
+ * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
28900
+ * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
28901
+ * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
28902
+ * @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
28855
28903
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
28856
28904
  */
28857
28905
  await this.loadMarkets();
@@ -28902,6 +28950,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28902
28950
  // }
28903
28951
  // }
28904
28952
  //
28953
+ if (typeof response === 'string') {
28954
+ response = JSON.parse(response);
28955
+ }
28905
28956
  const data = this.safeValue(response, 'data', {});
28906
28957
  const order = this.safeValue(data, 'order', data);
28907
28958
  return this.parseOrder(order, market);
@@ -29106,6 +29157,24 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
29106
29157
  // "orderType": "",
29107
29158
  // "workingType": "MARK_PRICE"
29108
29159
  // }
29160
+ // with tp and sl
29161
+ // {
29162
+ // orderId: 1741440894764281900,
29163
+ // symbol: 'LTC-USDT',
29164
+ // positionSide: 'LONG',
29165
+ // side: 'BUY',
29166
+ // type: 'MARKET',
29167
+ // price: 0,
29168
+ // quantity: 1,
29169
+ // stopPrice: 0,
29170
+ // workingType: 'MARK_PRICE',
29171
+ // clientOrderID: '',
29172
+ // timeInForce: 'GTC',
29173
+ // priceRate: 0,
29174
+ // stopLoss: '{"stopPrice":50,"workingType":"MARK_PRICE","type":"STOP_MARKET","quantity":1}',
29175
+ // takeProfit: '{"stopPrice":150,"workingType":"MARK_PRICE","type":"TAKE_PROFIT_MARKET","quantity":1}',
29176
+ // reduceOnly: false
29177
+ // }
29109
29178
  //
29110
29179
  const positionSide = this.safeString2(order, 'positionSide', 'ps');
29111
29180
  const marketType = (positionSide === undefined) ? 'spot' : 'swap';
@@ -29144,6 +29213,30 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
29144
29213
  'cost': _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(feeCost),
29145
29214
  };
29146
29215
  const clientOrderId = this.safeString2(order, 'clientOrderId', 'c');
29216
+ let stopLoss = this.safeValue(order, 'stopLoss');
29217
+ let stopLossPrice = undefined;
29218
+ if (stopLoss !== undefined) {
29219
+ stopLossPrice = this.safeNumber(stopLoss, 'stopLoss');
29220
+ }
29221
+ if ((stopLoss !== undefined) && (typeof stopLoss !== 'number')) {
29222
+ // stopLoss: '{"stopPrice":50,"workingType":"MARK_PRICE","type":"STOP_MARKET","quantity":1}',
29223
+ if (typeof stopLoss === 'string') {
29224
+ stopLoss = JSON.parse(stopLoss);
29225
+ }
29226
+ stopLossPrice = this.safeNumber(stopLoss, 'stopPrice');
29227
+ }
29228
+ let takeProfit = this.safeValue(order, 'takeProfit');
29229
+ let takeProfitPrice = undefined;
29230
+ if (takeProfit !== undefined) {
29231
+ takeProfitPrice = this.safeNumber(takeProfit, 'takeProfit');
29232
+ }
29233
+ if ((takeProfit !== undefined) && (typeof takeProfit !== 'number')) {
29234
+ // takeProfit: '{"stopPrice":150,"workingType":"MARK_PRICE","type":"TAKE_PROFIT_MARKET","quantity":1}',
29235
+ if (typeof takeProfit === 'string') {
29236
+ takeProfit = JSON.parse(takeProfit);
29237
+ }
29238
+ takeProfitPrice = this.safeNumber(takeProfit, 'stopPrice');
29239
+ }
29147
29240
  return this.safeOrder({
29148
29241
  'info': order,
29149
29242
  'id': orderId,
@@ -29160,8 +29253,8 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
29160
29253
  'price': price,
29161
29254
  'stopPrice': this.safeNumber(order, 'stopPrice'),
29162
29255
  'triggerPrice': this.safeNumber(order, 'stopPrice'),
29163
- 'stopLossPrice': this.safeNumber(order, 'stopLoss'),
29164
- 'takeProfitPrice': this.safeNumber(order, 'takeProfit'),
29256
+ 'stopLossPrice': stopLossPrice,
29257
+ 'takeProfitPrice': takeProfitPrice,
29165
29258
  'average': average,
29166
29259
  'cost': undefined,
29167
29260
  'amount': amount,
@@ -29355,6 +29448,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
29355
29448
  * @param {string[]} ids order ids
29356
29449
  * @param {string} symbol unified market symbol, default is undefined
29357
29450
  * @param {object} [params] extra parameters specific to the exchange API endpoint
29451
+ * @param {string[]} [params.clientOrderIds] client order ids
29358
29452
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
29359
29453
  */
29360
29454
  if (symbol === undefined) {
@@ -29365,19 +29459,27 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
29365
29459
  const request = {
29366
29460
  'symbol': market['id'],
29367
29461
  };
29462
+ const clientOrderIds = this.safeValue(params, 'clientOrderIds');
29463
+ let idsToParse = ids;
29464
+ const areClientOrderIds = (clientOrderIds !== undefined);
29465
+ if (areClientOrderIds) {
29466
+ idsToParse = clientOrderIds;
29467
+ }
29368
29468
  const parsedIds = [];
29369
- for (let i = 0; i < ids.length; i++) {
29370
- const id = ids[i];
29469
+ for (let i = 0; i < idsToParse.length; i++) {
29470
+ const id = idsToParse[i];
29371
29471
  const stringId = id.toString();
29372
29472
  parsedIds.push(stringId);
29373
29473
  }
29374
29474
  let response = undefined;
29375
29475
  if (market['spot']) {
29376
- request['orderIds'] = parsedIds.join(',');
29476
+ const spotReqKey = areClientOrderIds ? 'clientOrderIds' : 'orderIds';
29477
+ request[spotReqKey] = parsedIds.join(',');
29377
29478
  response = await this.spotV1PrivatePostTradeCancelOrders(this.extend(request, params));
29378
29479
  }
29379
29480
  else {
29380
- request['orderIdList'] = parsedIds;
29481
+ const swapReqKey = areClientOrderIds ? 'ClientOrderIDList' : 'orderIdList';
29482
+ request[swapReqKey] = parsedIds;
29381
29483
  response = await this.swapV2PrivateDeleteTradeBatchOrders(this.extend(request, params));
29382
29484
  }
29383
29485
  //
@@ -45231,8 +45333,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
45231
45333
  }
45232
45334
  let marginMode = undefined;
45233
45335
  [marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
45234
- const stop = this.safeValue(params, 'stop');
45235
- params = this.omit(params, 'stop');
45336
+ const stop = this.safeValue2(params, 'stop', 'trigger');
45337
+ params = this.omit(params, ['stop', 'trigger']);
45236
45338
  const orderIdList = [];
45237
45339
  for (let i = 0; i < ids.length; i++) {
45238
45340
  const individualId = ids[i];
@@ -45328,8 +45430,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
45328
45430
  const request = {
45329
45431
  'symbol': market['id'],
45330
45432
  };
45331
- const stop = this.safeValue(params, 'stop');
45332
- params = this.omit(params, 'stop');
45433
+ const stop = this.safeValue2(params, 'stop', 'trigger');
45434
+ params = this.omit(params, ['stop', 'trigger']);
45333
45435
  let response = undefined;
45334
45436
  if (market['spot']) {
45335
45437
  if (marginMode !== undefined) {
@@ -52368,8 +52470,8 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
52368
52470
  response = await this.privatePostSpotV3CancelOrder(this.extend(request, params));
52369
52471
  }
52370
52472
  else {
52371
- const stop = this.safeValue(params, 'stop');
52372
- params = this.omit(params, ['stop']);
52473
+ const stop = this.safeValue2(params, 'stop', 'trigger');
52474
+ params = this.omit(params, ['stop', 'trigger']);
52373
52475
  if (!stop) {
52374
52476
  response = await this.privatePostContractPrivateCancelOrder(this.extend(request, params));
52375
52477
  }
@@ -163999,7 +164101,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
163999
164101
  * @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-multiple-futures-stop-orders
164000
164102
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
164001
164103
  * @param {object} [params] extra parameters specific to the exchange API endpoint
164002
- * @param {object} [params.stop] When true, all the trigger orders will be cancelled
164104
+ * @param {object} [params.trigger] When true, all the trigger orders will be cancelled
164003
164105
  * @returns Response from the exchange
164004
164106
  */
164005
164107
  await this.loadMarkets();
@@ -164007,8 +164109,8 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
164007
164109
  if (symbol !== undefined) {
164008
164110
  request['symbol'] = this.marketId(symbol);
164009
164111
  }
164010
- const stop = this.safeValue(params, 'stop');
164011
- params = this.omit(params, 'stop');
164112
+ const stop = this.safeValue2(params, 'stop', 'trigger');
164113
+ params = this.omit(params, ['stop', 'trigger']);
164012
164114
  let response = undefined;
164013
164115
  if (stop) {
164014
164116
  response = await this.futuresPrivateDeleteStopOrders(this.extend(request, params));
@@ -164177,7 +164279,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
164177
164279
  * @param {int} [since] timestamp in ms of the earliest order to retrieve
164178
164280
  * @param {int} [limit] The maximum number of orders to retrieve
164179
164281
  * @param {object} [params] exchange specific parameters
164180
- * @param {bool} [params.stop] set to true to retrieve untriggered stop orders
164282
+ * @param {bool} [params.trigger] set to true to retrieve untriggered stop orders
164181
164283
  * @param {int} [params.until] End time in ms
164182
164284
  * @param {string} [params.side] buy or sell
164183
164285
  * @param {string} [params.type] limit or market
@@ -164190,9 +164292,9 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
164190
164292
  if (paginate) {
164191
164293
  return await this.fetchPaginatedCallDynamic('fetchOrdersByStatus', symbol, since, limit, params);
164192
164294
  }
164193
- const stop = this.safeValue(params, 'stop');
164295
+ const stop = this.safeValue2(params, 'stop', 'trigger');
164194
164296
  const until = this.safeInteger2(params, 'until', 'till');
164195
- params = this.omit(params, ['stop', 'until', 'till']);
164297
+ params = this.omit(params, ['stop', 'until', 'till', 'trigger']);
164196
164298
  if (status === 'closed') {
164197
164299
  status = 'done';
164198
164300
  }
@@ -187402,7 +187504,7 @@ class okcoin extends _abstract_okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
187402
187504
  // 'ordId': id,
187403
187505
  };
187404
187506
  const clientOrderId = this.safeString2(params, 'clOrdId', 'clientOrderId');
187405
- const stop = this.safeValue(params, 'stop');
187507
+ const stop = this.safeValue2(params, 'stop', 'trigger');
187406
187508
  if (stop) {
187407
187509
  if (clientOrderId !== undefined) {
187408
187510
  request['algoClOrdId'] = clientOrderId;
@@ -187419,7 +187521,7 @@ class okcoin extends _abstract_okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
187419
187521
  request['ordId'] = id;
187420
187522
  }
187421
187523
  }
187422
- const query = this.omit(params, ['clientOrderId', 'stop']);
187524
+ const query = this.omit(params, ['clientOrderId', 'stop', 'trigger']);
187423
187525
  let response = undefined;
187424
187526
  if (stop) {
187425
187527
  response = await this.privateGetTradeOrderAlgo(this.extend(request, query));
@@ -191585,12 +191687,13 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
191585
191687
  * @param {string} id order id
191586
191688
  * @param {string} symbol unified symbol of the market the order was made in
191587
191689
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191690
+ * @param {boolean} [params.trigger] true if trigger orders
191588
191691
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
191589
191692
  */
191590
191693
  if (symbol === undefined) {
191591
191694
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
191592
191695
  }
191593
- const stop = this.safeValue(params, 'stop');
191696
+ const stop = this.safeValue2(params, 'stop', 'trigger');
191594
191697
  if (stop) {
191595
191698
  const orderInner = await this.cancelOrders([id], symbol, params);
191596
191699
  return this.safeValue(orderInner, 0);
@@ -191962,6 +192065,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
191962
192065
  * @param {string} id the order id
191963
192066
  * @param {string} symbol unified market symbol
191964
192067
  * @param {object} [params] extra and exchange specific parameters
192068
+ * @param {boolean} [params.trigger] true if fetching trigger orders
191965
192069
  * @returns [an order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
191966
192070
  */
191967
192071
  if (symbol === undefined) {
@@ -191979,7 +192083,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
191979
192083
  const options = this.safeValue(this.options, 'fetchOrder', {});
191980
192084
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrder');
191981
192085
  let method = this.safeString(params, 'method', defaultMethod);
191982
- const stop = this.safeValue(params, 'stop');
192086
+ const stop = this.safeValue2(params, 'stop', 'trigger');
191983
192087
  if (stop) {
191984
192088
  method = 'privateGetTradeOrderAlgo';
191985
192089
  if (clientOrderId !== undefined) {
@@ -191997,7 +192101,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
191997
192101
  request['ordId'] = id;
191998
192102
  }
191999
192103
  }
192000
- const query = this.omit(params, ['method', 'clOrdId', 'clientOrderId', 'stop']);
192104
+ const query = this.omit(params, ['method', 'clOrdId', 'clientOrderId', 'stop', 'trigger']);
192001
192105
  let response = undefined;
192002
192106
  if (method === 'privateGetTradeOrderAlgo') {
192003
192107
  response = await this.privateGetTradeOrderAlgo(this.extend(request, query));
@@ -192153,7 +192257,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
192153
192257
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersPending');
192154
192258
  let method = this.safeString(params, 'method', defaultMethod);
192155
192259
  const ordType = this.safeString(params, 'ordType');
192156
- const stop = this.safeValue(params, 'stop');
192260
+ const stop = this.safeValue2(params, 'stop', 'trigger');
192157
192261
  if (stop || (ordType in algoOrderTypes)) {
192158
192262
  method = 'privateGetTradeOrdersAlgoPending';
192159
192263
  if (stop) {
@@ -192162,7 +192266,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
192162
192266
  }
192163
192267
  }
192164
192268
  }
192165
- const query = this.omit(params, ['method', 'stop']);
192269
+ const query = this.omit(params, ['method', 'stop', 'trigger']);
192166
192270
  let response = undefined;
192167
192271
  if (method === 'privateGetTradeOrdersAlgoPending') {
192168
192272
  response = await this.privateGetTradeOrdersAlgoPending(this.extend(request, query));
@@ -192315,7 +192419,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
192315
192419
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
192316
192420
  let method = this.safeString(params, 'method', defaultMethod);
192317
192421
  const ordType = this.safeString(params, 'ordType');
192318
- const stop = this.safeValue(params, 'stop');
192422
+ const stop = this.safeValue2(params, 'stop', 'trigger');
192319
192423
  if (stop || (ordType in algoOrderTypes)) {
192320
192424
  method = 'privateGetTradeOrdersAlgoHistory';
192321
192425
  const algoId = this.safeString(params, 'algoId');
@@ -192340,7 +192444,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
192340
192444
  query = this.omit(query, ['until', 'till']);
192341
192445
  }
192342
192446
  }
192343
- const send = this.omit(query, ['method', 'stop', 'ordType']);
192447
+ const send = this.omit(query, ['method', 'stop', 'ordType', 'trigger']);
192344
192448
  let response = undefined;
192345
192449
  if (method === 'privateGetTradeOrdersAlgoHistory') {
192346
192450
  response = await this.privateGetTradeOrdersAlgoHistory(this.extend(request, send));
@@ -192502,7 +192606,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
192502
192606
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
192503
192607
  let method = this.safeString(params, 'method', defaultMethod);
192504
192608
  const ordType = this.safeString(params, 'ordType');
192505
- const stop = this.safeValue(params, 'stop');
192609
+ const stop = this.safeValue2(params, 'stop', 'trigger');
192506
192610
  if (stop || (ordType in algoOrderTypes)) {
192507
192611
  method = 'privateGetTradeOrdersAlgoHistory';
192508
192612
  if (stop) {
@@ -192523,7 +192627,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
192523
192627
  }
192524
192628
  request['state'] = 'filled';
192525
192629
  }
192526
- const send = this.omit(query, ['method', 'stop']);
192630
+ const send = this.omit(query, ['method', 'stop', 'trigger']);
192527
192631
  let response = undefined;
192528
192632
  if (method === 'privateGetTradeOrdersAlgoHistory') {
192529
192633
  response = await this.privateGetTradeOrdersAlgoHistory(this.extend(request, send));
@@ -211238,6 +211342,7 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
211238
211342
  },
211239
211343
  },
211240
211344
  'options': {
211345
+ 'listenKeyRefreshRate': 3540000,
211241
211346
  'ws': {
211242
211347
  'gunzip': true,
211243
211348
  },
@@ -211835,7 +211940,7 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
211835
211940
  const lastAuthenticatedTime = this.safeInteger(this.options, 'lastAuthenticatedTime', 0);
211836
211941
  const listenKeyRefreshRate = this.safeInteger(this.options, 'listenKeyRefreshRate', 3600000); // 1 hour
211837
211942
  if (time - lastAuthenticatedTime > listenKeyRefreshRate) {
211838
- const response = await this.userAuthPrivatePostUserDataStream({ 'listenKey': listenKey }); // extend the expiry
211943
+ const response = await this.userAuthPrivatePutUserDataStream({ 'listenKey': listenKey }); // extend the expiry
211839
211944
  this.options['listenKey'] = this.safeString(response, 'listenKey');
211840
211945
  this.options['lastAuthenticatedTime'] = time;
211841
211946
  }
@@ -223289,7 +223394,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
223289
223394
  */
223290
223395
  await this.loadMarkets();
223291
223396
  symbols = this.marketSymbols(symbols, undefined, false);
223292
- const messageHash = 'tickers::' + symbols.join(',');
223397
+ const messageHashes = [];
223293
223398
  const url = this.getUrlByMarketType(symbols[0], false, params);
223294
223399
  params = this.cleanParams(params);
223295
223400
  const options = this.safeValue(this.options, 'watchTickers', {});
@@ -223299,8 +223404,9 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
223299
223404
  for (let i = 0; i < marketIds.length; i++) {
223300
223405
  const marketId = marketIds[i];
223301
223406
  topics.push(topic + '.' + marketId);
223407
+ messageHashes.push('ticker:' + symbols[i]);
223302
223408
  }
223303
- const ticker = await this.watchTopics(url, messageHash, topics, params);
223409
+ const ticker = await this.watchTopics(url, messageHashes, topics, params);
223304
223410
  if (this.newUpdates) {
223305
223411
  return ticker;
223306
223412
  }
@@ -223436,17 +223542,6 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
223436
223542
  this.tickers[symbol] = parsed;
223437
223543
  const messageHash = 'ticker:' + symbol;
223438
223544
  client.resolve(this.tickers[symbol], messageHash);
223439
- // watchTickers part
223440
- const messageHashes = this.findMessageHashes(client, 'tickers::');
223441
- for (let i = 0; i < messageHashes.length; i++) {
223442
- const messageHashTicker = messageHashes[i];
223443
- const parts = messageHashTicker.split('::');
223444
- const symbolsString = parts[1];
223445
- const symbols = symbolsString.split(',');
223446
- if (this.inArray(parsed['symbol'], symbols)) {
223447
- client.resolve(parsed, messageHashTicker);
223448
- }
223449
- }
223450
223545
  }
223451
223546
  async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
223452
223547
  /**
@@ -291423,7 +291518,7 @@ SOFTWARE.
291423
291518
 
291424
291519
  //-----------------------------------------------------------------------------
291425
291520
  // this is updated by vss.js when building
291426
- const version = '4.2.2';
291521
+ const version = '4.2.3';
291427
291522
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
291428
291523
  //-----------------------------------------------------------------------------
291429
291524