ccxt 4.2.54 → 4.2.56

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.54/dist/ccxt.browser.js
213
- * unpkg: https://unpkg.com/ccxt@4.2.54/dist/ccxt.browser.js
212
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.56/dist/ccxt.browser.js
213
+ * unpkg: https://unpkg.com/ccxt@4.2.56/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.54/dist/ccxt.browser.js"></script>
218
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.56/dist/ccxt.browser.js"></script>
219
219
  ```
220
220
 
221
221
  Creates a global `ccxt` object:
package/build.sh CHANGED
@@ -77,7 +77,7 @@ build_and_test_all () {
77
77
  # if ! tox run-parallel; then
78
78
  # exit 1
79
79
  # fi
80
- # cd ..
80
+ # cd ..
81
81
  # fi
82
82
  fi
83
83
  npm run test-base
@@ -31991,7 +31991,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
31991
31991
  if (symbols !== undefined) {
31992
31992
  symbols = this.marketSymbols(symbols);
31993
31993
  const firstSymbol = this.safeString(symbols, 0);
31994
- market = this.market(firstSymbol);
31994
+ if (firstSymbol !== undefined) {
31995
+ market = this.market(firstSymbol);
31996
+ }
31995
31997
  }
31996
31998
  let type = undefined;
31997
31999
  [type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
@@ -82459,6 +82461,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82459
82461
  'fetchIsolatedBorrowRate': false,
82460
82462
  'fetchIsolatedBorrowRates': false,
82461
82463
  'fetchLedger': true,
82464
+ 'fetchLeverage': true,
82462
82465
  'fetchMarketLeverageTiers': true,
82463
82466
  'fetchMarkets': true,
82464
82467
  'fetchMarkOHLCV': true,
@@ -82489,7 +82492,6 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
82489
82492
  'fetchUnderlyingAssets': false,
82490
82493
  'fetchVolatilityHistory': true,
82491
82494
  'fetchWithdrawals': true,
82492
- 'fetchLeverage': true,
82493
82495
  'repayCrossMargin': true,
82494
82496
  'setLeverage': true,
82495
82497
  'setMarginMode': true,
@@ -132275,7 +132277,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132275
132277
  'spot': 'https://api.gateio.ws/api/v4',
132276
132278
  'options': 'https://api.gateio.ws/api/v4',
132277
132279
  'subAccounts': 'https://api.gateio.ws/api/v4',
132278
- 'portfolio': 'https://api.gateio.ws/api/v4',
132280
+ 'unified': 'https://api.gateio.ws/api/v4',
132279
132281
  'rebate': 'https://api.gateio.ws/api/v4',
132280
132282
  'earn': 'https://api.gateio.ws/api/v4',
132281
132283
  'account': 'https://api.gateio.ws/api/v4',
@@ -132498,11 +132500,14 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132498
132500
  'saved_address': 1,
132499
132501
  'fee': 1,
132500
132502
  'total_balance': 2.5,
132503
+ 'small_balance': 1,
132504
+ 'small_balance_history': 1,
132501
132505
  },
132502
132506
  'post': {
132503
132507
  'transfers': 2.5,
132504
132508
  'sub_account_transfers': 2.5,
132505
132509
  'sub_account_to_sub_account': 2.5,
132510
+ 'small_balance': 1,
132506
132511
  },
132507
132512
  },
132508
132513
  'subAccounts': {
@@ -132525,7 +132530,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132525
132530
  'sub_accounts/{user_id}/keys/{key}': 2.5,
132526
132531
  },
132527
132532
  },
132528
- 'portfolio': {
132533
+ 'unified': {
132529
132534
  'get': {
132530
132535
  'accounts': 20 / 15,
132531
132536
  'account_mode': 20 / 15,
@@ -132534,6 +132539,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
132534
132539
  'loans': 20 / 15,
132535
132540
  'loan_records': 20 / 15,
132536
132541
  'interest_records': 20 / 15,
132542
+ 'estimate_rate': 20 / 15,
132537
132543
  },
132538
132544
  'post': {
132539
132545
  'account_mode': 20 / 15,
@@ -198631,6 +198637,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
198631
198637
  '50027': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.PermissionDenied,
198632
198638
  '50028': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
198633
198639
  '50044': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
198640
+ '50062': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
198634
198641
  // API Class
198635
198642
  '50100': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
198636
198643
  '50101': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
@@ -198685,6 +198692,15 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
198685
198692
  '51072': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198686
198693
  '51073': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198687
198694
  '51074': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198695
+ '51090': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198696
+ '51091': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198697
+ '51092': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198698
+ '51093': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198699
+ '51094': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198700
+ '51095': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198701
+ '51096': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198702
+ '51098': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198703
+ '51099': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198688
198704
  '51100': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198689
198705
  '51101': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
198690
198706
  '51102': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
@@ -200812,7 +200828,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200812
200828
  }
200813
200829
  request['tpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
200814
200830
  const takeProfitLimitPrice = this.safeValueN(takeProfit, ['price', 'takeProfitPrice', 'tpOrdPx']);
200815
- const takeProfitOrderType = this.safeString(takeProfit, 'type');
200831
+ const takeProfitOrderType = this.safeString2(takeProfit, 'type', 'tpOrdKind');
200816
200832
  if (takeProfitOrderType !== undefined) {
200817
200833
  const takeProfitLimitOrderType = (takeProfitOrderType === 'limit');
200818
200834
  const takeProfitMarketOrderType = (takeProfitOrderType === 'market');
@@ -200824,6 +200840,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200824
200840
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires a limit price in params["takeProfit"]["price"] or params["takeProfit"]["tpOrdPx"] for a take profit limit order');
200825
200841
  }
200826
200842
  else {
200843
+ request['tpOrdKind'] = takeProfitOrderType;
200827
200844
  request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice);
200828
200845
  }
200829
200846
  }
@@ -200832,6 +200849,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200832
200849
  }
200833
200850
  }
200834
200851
  else if (takeProfitLimitPrice !== undefined) {
200852
+ request['tpOrdKind'] = 'limit';
200835
200853
  request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice); // limit tp order
200836
200854
  }
200837
200855
  else {
@@ -200856,6 +200874,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200856
200874
  const twoWayCondition = ((takeProfitPrice !== undefined) && (stopLossPrice !== undefined));
200857
200875
  // if TP and SL are sent together
200858
200876
  // as ordType 'conditional' only stop-loss order will be applied
200877
+ // tpOrdKind is 'condition' which is the default
200859
200878
  if (twoWayCondition) {
200860
200879
  request['ordType'] = 'oco';
200861
200880
  }
@@ -200909,6 +200928,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
200909
200928
  * @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
200910
200929
  * @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
200911
200930
  * @param {string} [params.trailingPercent] the percent to trail away from the current market price
200931
+ * @param {string} [params.tpOrdKind] 'condition' or 'limit', the default is 'condition'
200912
200932
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
200913
200933
  */
200914
200934
  await this.loadMarkets();
@@ -201074,6 +201094,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
201074
201094
  takeProfitTriggerPrice = this.safeValue(takeProfit, 'triggerPrice');
201075
201095
  takeProfitPrice = this.safeValue(takeProfit, 'price');
201076
201096
  const takeProfitType = this.safeString(takeProfit, 'type');
201097
+ request['newTpOrdKind'] = (takeProfitType === 'limit') ? takeProfitType : 'condition';
201077
201098
  request['newTpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
201078
201099
  request['newTpOrdPx'] = (takeProfitType === 'market') ? '-1' : this.priceToPrecision(symbol, takeProfitPrice);
201079
201100
  request['newTpTriggerPxType'] = takeProfitTriggerPriceType;
@@ -201119,6 +201140,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
201119
201140
  * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
201120
201141
  * @param {float} [params.takeProfit.price] used for take profit limit orders, not used for take profit market price orders
201121
201142
  * @param {string} [params.takeProfit.type] 'market' or 'limit' used to specify the take profit price type
201143
+ * @param {string} [params.newTpOrdKind] 'condition' or 'limit', the default is 'condition'
201122
201144
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
201123
201145
  */
201124
201146
  await this.loadMarkets();
@@ -226317,7 +226339,10 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
226317
226339
  }
226318
226340
  getInstType(market, params = {}) {
226319
226341
  let instType = undefined;
226320
- if ((market['swap']) || (market['future'])) {
226342
+ if (market === undefined) {
226343
+ [instType, params] = this.handleProductTypeAndParams(undefined, params);
226344
+ }
226345
+ else if ((market['swap']) || (market['future'])) {
226321
226346
  [instType, params] = this.handleProductTypeAndParams(market, params);
226322
226347
  }
226323
226348
  else {
@@ -226894,9 +226919,12 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
226894
226919
  stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_3__/* .ArrayCache */ .ZL(limit);
226895
226920
  this.trades[symbol] = stored;
226896
226921
  }
226897
- const data = this.safeValue(message, 'data', []);
226898
- for (let j = 0; j < data.length; j++) {
226899
- const rawTrade = data[j];
226922
+ const data = this.safeList(message, 'data', []);
226923
+ const length = data.length;
226924
+ const maxLength = Math.max(length - 1, 0);
226925
+ // fix chronological order by reversing
226926
+ for (let i = maxLength; i >= 0; i--) {
226927
+ const rawTrade = data[i];
226900
226928
  const parsed = this.parseWsTrade(rawTrade, market);
226901
226929
  stored.append(parsed);
226902
226930
  }
@@ -226913,22 +226941,71 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
226913
226941
  // "tradeId": "1116461060594286593"
226914
226942
  // }
226915
226943
  //
226916
- market = this.safeMarket(undefined, market);
226917
- const timestamp = this.safeInteger(trade, 'ts');
226944
+ // order with trade in it
226945
+ // {
226946
+ // accBaseVolume: '0.1',
226947
+ // baseVolume: '0.1',
226948
+ // cTime: '1709221342922',
226949
+ // clientOid: '1147122943507734528',
226950
+ // enterPointSource: 'API',
226951
+ // feeDetail: [Array],
226952
+ // fillFee: '-0.0049578',
226953
+ // fillFeeCoin: 'USDT',
226954
+ // fillNotionalUsd: '8.263',
226955
+ // fillPrice: '82.63',
226956
+ // fillTime: '1709221342986',
226957
+ // force: 'gtc',
226958
+ // instId: 'LTCUSDT',
226959
+ // leverage: '10',
226960
+ // marginCoin: 'USDT',
226961
+ // marginMode: 'crossed',
226962
+ // notionalUsd: '8.268',
226963
+ // orderId: '1147122943499345921',
226964
+ // orderType: 'market',
226965
+ // pnl: '0',
226966
+ // posMode: 'hedge_mode',
226967
+ // posSide: 'short',
226968
+ // price: '0',
226969
+ // priceAvg: '82.63',
226970
+ // reduceOnly: 'no',
226971
+ // side: 'sell',
226972
+ // size: '0.1',
226973
+ // status: 'filled',
226974
+ // tradeId: '1147122943772479563',
226975
+ // tradeScope: 'T',
226976
+ // tradeSide: 'open',
226977
+ // uTime: '1709221342986'
226978
+ // }
226979
+ //
226980
+ const instId = this.safeString(trade, 'instId');
226981
+ if (market === undefined) {
226982
+ market = this.safeMarket(instId, undefined, undefined, 'contract');
226983
+ }
226984
+ const timestamp = this.safeIntegerN(trade, ['uTime', 'cTime', 'ts']);
226985
+ const feeCost = this.safeString(trade, 'fillFee');
226986
+ let fee = undefined;
226987
+ if (feeCost !== undefined) {
226988
+ const feeCurrencyId = this.safeString(trade, 'fillFeeCoin');
226989
+ const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
226990
+ fee = {
226991
+ 'cost': _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringAbs(feeCost),
226992
+ 'currency': feeCurrencyCode,
226993
+ };
226994
+ }
226918
226995
  return this.safeTrade({
226919
226996
  'info': trade,
226920
226997
  'id': this.safeString(trade, 'tradeId'),
226921
- 'order': undefined,
226998
+ 'order': this.safeString(trade, 'orderId'),
226922
226999
  'timestamp': timestamp,
226923
227000
  'datetime': this.iso8601(timestamp),
226924
227001
  'symbol': market['symbol'],
226925
227002
  'type': undefined,
226926
227003
  'side': this.safeString(trade, 'side'),
226927
227004
  'takerOrMaker': undefined,
226928
- 'price': this.safeString(trade, 'price'),
227005
+ 'price': this.safeString2(trade, 'priceAvg', 'price'),
226929
227006
  'amount': this.safeString(trade, 'size'),
226930
- 'cost': undefined,
226931
- 'fee': undefined,
227007
+ 'cost': this.safeString(trade, 'fillNotionalUsd'),
227008
+ 'fee': fee,
226932
227009
  }, market);
226933
227010
  }
226934
227011
  async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
@@ -227333,6 +227410,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227333
227410
  const marketSymbols = {};
227334
227411
  for (let i = 0; i < data.length; i++) {
227335
227412
  const order = data[i];
227413
+ if ('tradeId' in order) {
227414
+ this.handleMyTrades(client, order);
227415
+ }
227336
227416
  const marketId = this.safeString(order, 'instId');
227337
227417
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
227338
227418
  const parsed = this.parseWsOrder(order, market);
@@ -227598,7 +227678,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227598
227678
  this.myTrades = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_3__/* .ArrayCache */ .ZL(limit);
227599
227679
  }
227600
227680
  const stored = this.myTrades;
227601
- const parsed = this.parseWsMyTrade(message);
227681
+ const parsed = this.parseWsTrade(message);
227602
227682
  stored.append(parsed);
227603
227683
  const symbol = parsed['symbol'];
227604
227684
  const messageHash = 'myTrades';
@@ -227606,68 +227686,6 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227606
227686
  const symbolSpecificMessageHash = 'myTrades:' + symbol;
227607
227687
  client.resolve(stored, symbolSpecificMessageHash);
227608
227688
  }
227609
- parseWsMyTrade(trade, market = undefined) {
227610
- //
227611
- // order and trade mixin (contract)
227612
- //
227613
- // {
227614
- // "accBaseVolume": "0",
227615
- // "cTime": "1701920553759",
227616
- // "clientOid": "1116501214318198793",
227617
- // "enterPointSource": "WEB",
227618
- // "feeDetail": [{
227619
- // "feeCoin": "USDT",
227620
- // "fee": "-0.162003"
227621
- // }],
227622
- // "force": "gtc",
227623
- // "instId": "BTCUSDT",
227624
- // "leverage": "20",
227625
- // "marginCoin": "USDT",
227626
- // "marginMode": "isolated",
227627
- // "notionalUsd": "105",
227628
- // "orderId": "1116501214293032964",
227629
- // "orderType": "limit",
227630
- // "posMode": "hedge_mode",
227631
- // "posSide": "long",
227632
- // "price": "35000",
227633
- // "reduceOnly": "no",
227634
- // "side": "buy",
227635
- // "size": "0.003",
227636
- // "status": "canceled",
227637
- // "tradeSide": "open",
227638
- // "uTime": "1701920595866"
227639
- // }
227640
- //
227641
- const marketId = this.safeString(trade, 'instId');
227642
- market = this.safeMarket(marketId, market, undefined, 'contract');
227643
- const timestamp = this.safeInteger2(trade, 'uTime', 'cTime');
227644
- const orderFee = this.safeValue(trade, 'feeDetail', []);
227645
- const fee = this.safeValue(orderFee, 0);
227646
- const feeAmount = this.safeString(fee, 'fee');
227647
- let feeObject = undefined;
227648
- if (feeAmount !== undefined) {
227649
- const feeCurrency = this.safeString(fee, 'feeCoin');
227650
- feeObject = {
227651
- 'cost': _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringAbs(feeAmount),
227652
- 'currency': this.safeCurrencyCode(feeCurrency),
227653
- };
227654
- }
227655
- return this.safeTrade({
227656
- 'info': trade,
227657
- 'id': undefined,
227658
- 'order': this.safeString(trade, 'orderId'),
227659
- 'timestamp': timestamp,
227660
- 'datetime': this.iso8601(timestamp),
227661
- 'symbol': market['symbol'],
227662
- 'type': this.safeString(trade, 'orderType'),
227663
- 'side': this.safeString(trade, 'side'),
227664
- 'takerOrMaker': undefined,
227665
- 'price': this.safeString(trade, 'price'),
227666
- 'amount': this.safeString(trade, 'size'),
227667
- 'cost': this.safeString(trade, 'notionalUsd'),
227668
- 'fee': feeObject,
227669
- }, market);
227670
- }
227671
227689
  async watchBalance(params = {}) {
227672
227690
  /**
227673
227691
  * @method
@@ -235215,15 +235233,29 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
235215
235233
  // "price24hPcnt": "-0.0388"
235216
235234
  // }
235217
235235
  // }
235236
+ // swap delta
235237
+ // {
235238
+ // "topic":"tickers.AAVEUSDT",
235239
+ // "type":"delta",
235240
+ // "data":{
235241
+ // "symbol":"AAVEUSDT",
235242
+ // "bid1Price":"112.89",
235243
+ // "bid1Size":"2.12",
235244
+ // "ask1Price":"112.90",
235245
+ // "ask1Size":"5.02"
235246
+ // },
235247
+ // "cs":78039939929,
235248
+ // "ts":1709210212704
235249
+ // }
235218
235250
  //
235219
235251
  const topic = this.safeString(message, 'topic', '');
235220
235252
  const updateType = this.safeString(message, 'type', '');
235221
- const data = this.safeValue(message, 'data', {});
235222
- const isSpot = this.safeString(data, 'fundingRate') === undefined;
235253
+ const data = this.safeDict(message, 'data', {});
235254
+ const isSpot = this.safeString(data, 'usdIndexPrice') !== undefined;
235223
235255
  const type = isSpot ? 'spot' : 'contract';
235224
235256
  let symbol = undefined;
235225
235257
  let parsed = undefined;
235226
- if ((updateType === 'snapshot') || isSpot) {
235258
+ if ((updateType === 'snapshot')) {
235227
235259
  parsed = this.parseTicker(data);
235228
235260
  symbol = parsed['symbol'];
235229
235261
  }
@@ -235234,8 +235266,8 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
235234
235266
  const market = this.safeMarket(marketId, undefined, undefined, type);
235235
235267
  symbol = market['symbol'];
235236
235268
  // update the info in place
235237
- const ticker = this.safeValue(this.tickers, symbol, {});
235238
- const rawTicker = this.safeValue(ticker, 'info', {});
235269
+ const ticker = this.safeDict(this.tickers, symbol, {});
235270
+ const rawTicker = this.safeDict(ticker, 'info', {});
235239
235271
  const merged = this.extend(rawTicker, data);
235240
235272
  parsed = this.parseTicker(merged);
235241
235273
  }
@@ -242669,7 +242701,7 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
242669
242701
  // "accountId": 5470310874305732,
242670
242702
  // "collateralCurrency": true,
242671
242703
  // "asset": "USD",
242672
- // "free": 47.82576735,
242704
+ // "free": 47.82576736,
242673
242705
  // "locked": 1.187925,
242674
242706
  // "default": true
242675
242707
  // },
@@ -243039,6 +243071,7 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
243039
243071
  orderbook = this.orderBook();
243040
243072
  }
243041
243073
  orderbook.reset({
243074
+ 'symbol': symbol,
243042
243075
  'timestamp': timestamp,
243043
243076
  'datetime': this.iso8601(timestamp),
243044
243077
  });
@@ -253281,7 +253314,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
253281
253314
  // [
253282
253315
  // 0, // channelID
253283
253316
  // [ // price volume time side type misc
253284
- // [ "5541.20000", "0.15850568", "1534614057.321597", "s", "l", "" ],
253317
+ // [ "5541.20000", "0.15850568", "1534614057.321596", "s", "l", "" ],
253285
253318
  // [ "6060.00000", "0.02455000", "1534614057.324998", "b", "l", "" ],
253286
253319
  // ],
253287
253320
  // "trade",
@@ -288018,7 +288051,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288018
288051
  // "trade_time": "104543",
288019
288052
  // "trade_date_kst": "20181122",
288020
288053
  // "trade_time_kst": "194543",
288021
- // "trade_timestamp": 1542883543097,
288054
+ // "trade_timestamp": 1542883543096,
288022
288055
  // "opening_price": 0.02976455,
288023
288056
  // "high_price": 0.02992577,
288024
288057
  // "low_price": 0.02934283,
@@ -295348,6 +295381,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
295348
295381
  'reduceMargin': false,
295349
295382
  'setLeverage': true,
295350
295383
  'setMargin': false,
295384
+ 'setPositionMode': true,
295351
295385
  'transfer': true,
295352
295386
  'withdraw': true, // exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://kronosresearch.github.io/wootrade-documents/#token-withdraw
295353
295387
  },
@@ -295422,10 +295456,16 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
295422
295456
  'client/trade/{tid}': 1,
295423
295457
  'order/{oid}/trades': 1,
295424
295458
  'client/trades': 1,
295459
+ 'client/hist_trades': 1,
295460
+ 'staking/yield_history': 1,
295461
+ 'client/holding': 1,
295425
295462
  'asset/deposit': 10,
295426
295463
  'asset/history': 60,
295427
295464
  'sub_account/all': 60,
295428
295465
  'sub_account/assets': 60,
295466
+ 'sub_account/asset_detail': 60,
295467
+ 'sub_account/ip_restriction': 10,
295468
+ 'asset/main_sub_transfer_history': 30,
295429
295469
  'token_interest': 60,
295430
295470
  'token_interest/{token}': 60,
295431
295471
  'interest/history': 60,
@@ -295438,9 +295478,12 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
295438
295478
  'post': {
295439
295479
  'order': 5,
295440
295480
  'asset/main_sub_transfer': 30,
295481
+ 'asset/ltv': 30,
295441
295482
  'asset/withdraw': 30,
295483
+ 'asset/internal_withdraw': 30,
295442
295484
  'interest/repay': 60,
295443
295485
  'client/account_mode': 120,
295486
+ 'client/position_mode': 5,
295444
295487
  'client/leverage': 120,
295445
295488
  },
295446
295489
  'delete': {
@@ -297862,6 +297905,37 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
297862
297905
  const sorted = this.sortBy(rates, 'timestamp');
297863
297906
  return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
297864
297907
  }
297908
+ async setPositionMode(hedged, symbol = undefined, params = {}) {
297909
+ /**
297910
+ * @method
297911
+ * @name woo#setPositionMode
297912
+ * @description set hedged to true or false for a market
297913
+ * @see https://docs.woo.org/#update-position-mode
297914
+ * @param {bool} hedged set to true to use HEDGE_MODE, false for ONE_WAY
297915
+ * @param {string} symbol not used by woo setPositionMode
297916
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
297917
+ * @returns {object} response from the exchange
297918
+ */
297919
+ let hedgeMode = undefined;
297920
+ if (hedged) {
297921
+ hedgeMode = 'HEDGE_MODE';
297922
+ }
297923
+ else {
297924
+ hedgeMode = 'ONE_WAY';
297925
+ }
297926
+ const request = {
297927
+ 'position_mode': hedgeMode,
297928
+ };
297929
+ const response = await this.v1PrivatePostClientPositionMode(this.extend(request, params));
297930
+ //
297931
+ // {
297932
+ // "success": true,
297933
+ // "data": {},
297934
+ // "timestamp": "1709195608551"
297935
+ // }
297936
+ //
297937
+ return response;
297938
+ }
297865
297939
  async fetchLeverage(symbol, params = {}) {
297866
297940
  await this.loadMarkets();
297867
297941
  const response = await this.v3PrivateGetAccountinfo(params);
@@ -307615,7 +307689,7 @@ SOFTWARE.
307615
307689
 
307616
307690
  //-----------------------------------------------------------------------------
307617
307691
  // this is updated by vss.js when building
307618
- const version = '4.2.54';
307692
+ const version = '4.2.56';
307619
307693
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
307620
307694
  //-----------------------------------------------------------------------------
307621
307695