ccxt 4.2.49 → 4.2.51

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
@@ -210,13 +210,13 @@ console.log(version, Object.keys(exchanges));
210
210
 
211
211
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
212
212
 
213
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.49/dist/ccxt.browser.js
214
- * unpkg: https://unpkg.com/ccxt@4.2.49/dist/ccxt.browser.js
213
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.51/dist/ccxt.browser.js
214
+ * unpkg: https://unpkg.com/ccxt@4.2.51/dist/ccxt.browser.js
215
215
 
216
216
  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.
217
217
 
218
218
  ```HTML
219
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.49/dist/ccxt.browser.js"></script>
219
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.51/dist/ccxt.browser.js"></script>
220
220
  ```
221
221
 
222
222
  Creates a global `ccxt` object:
package/build.sh CHANGED
@@ -116,7 +116,7 @@ diff=$(echo "$diff" | sed -e "s/^ts\/src\/test\/static.*json//") #remove static
116
116
  # diff=$(echo "$diff" | sed -e "s/^\.travis\.yml//")
117
117
  # diff=$(echo "$diff" | sed -e "s/^package\-lock\.json//")
118
118
  # diff=$(echo "$diff" | sed -e "s/python\/qa\.py//")
119
- #echo $diff
119
+ #echo $diff
120
120
 
121
121
  critical_pattern='Client(Trait)?\.php|Exchange\.php|\/base|^build|static_dependencies|^run-tests|package(-lock)?\.json|composer\.json|ccxt\.ts|__init__.py|test' # add \/test|
122
122
  if [[ "$diff" =~ $critical_pattern ]]; then
@@ -9296,6 +9296,11 @@ class Exchange {
9296
9296
  this.codes = Object.keys(currenciesSortedByCode);
9297
9297
  return this.markets;
9298
9298
  }
9299
+ getDescribeForExtendedWsExchange(currentRestInstance, parentRestInstance, wsBaseDescribe) {
9300
+ const extendedRestDescribe = this.deepExtend(parentRestInstance.describe(), currentRestInstance.describe());
9301
+ const superWithRestDescribe = this.deepExtend(extendedRestDescribe, wsBaseDescribe);
9302
+ return superWithRestDescribe;
9303
+ }
9299
9304
  safeBalance(balance) {
9300
9305
  const balances = this.omit(balance, ['info', 'timestamp', 'datetime', 'free', 'used', 'total']);
9301
9306
  const codes = Object.keys(balances);
@@ -18105,6 +18110,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18105
18110
  'createMarketSellOrderWithCost': true,
18106
18111
  'createOrder': true,
18107
18112
  'createOrders': true,
18113
+ 'createOrderWithTakeProfitAndStopLoss': true,
18108
18114
  'createPostOnlyOrder': true,
18109
18115
  'createReduceOnlyOrder': true,
18110
18116
  'createStopLimitOrder': true,
@@ -18178,7 +18184,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18178
18184
  'fetchTradingFee': true,
18179
18185
  'fetchTradingFees': true,
18180
18186
  'fetchTradingLimits': undefined,
18181
- 'fetchTransactionFee': undefined,
18187
+ 'fetchTransactionFee': 'emulated',
18182
18188
  'fetchTransactionFees': true,
18183
18189
  'fetchTransactions': false,
18184
18190
  'fetchTransfers': true,
@@ -18530,6 +18536,10 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18530
18536
  'simple-earn/flexible/history/rewardsRecord': 15,
18531
18537
  'simple-earn/locked/history/rewardsRecord': 15,
18532
18538
  'simple-earn/flexible/history/collateralRecord': 0.1,
18539
+ // Convert
18540
+ 'dci/product/list': 0.1,
18541
+ 'dci/product/positions': 0.1,
18542
+ 'dci/product/accounts': 0.1,
18533
18543
  },
18534
18544
  'post': {
18535
18545
  'asset/dust': 0.06667,
@@ -18658,6 +18668,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18658
18668
  'simple-earn/locked/redeem': 0.1,
18659
18669
  'simple-earn/flexible/setAutoSubscribe': 15,
18660
18670
  'simple-earn/locked/setAutoSubscribe': 15,
18671
+ // convert
18672
+ 'dci/product/subscribe': 0.1,
18673
+ 'dci/product/auto_compound/edit': 0.1,
18661
18674
  },
18662
18675
  'put': {
18663
18676
  'userDataStream': 0.1,
@@ -75492,6 +75505,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
75492
75505
  'cancelOrder': true,
75493
75506
  'closeAllPositions': false,
75494
75507
  'closePosition': false,
75508
+ 'createDepositAddress': true,
75495
75509
  'createOrder': true,
75496
75510
  'createReduceOnlyOrder': false,
75497
75511
  'createStopLimitOrder': false,
@@ -75502,6 +75516,9 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
75502
75516
  'fetchBorrowRateHistory': false,
75503
75517
  'fetchCrossBorrowRate': false,
75504
75518
  'fetchCrossBorrowRates': false,
75519
+ 'fetchDepositAddress': false,
75520
+ 'fetchDepositAddresses': false,
75521
+ 'fetchDepositAddressesByNetwork': false,
75505
75522
  'fetchFundingHistory': false,
75506
75523
  'fetchFundingRate': false,
75507
75524
  'fetchFundingRateHistory': false,
@@ -75883,6 +75900,49 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
75883
75900
  };
75884
75901
  return await this.privatePostMarketMoneyOrderCancel(this.extend(request, params));
75885
75902
  }
75903
+ async createDepositAddress(code, params = {}) {
75904
+ /**
75905
+ * @method
75906
+ * @name bl3p#createDepositAddress
75907
+ * @description create a currency deposit address
75908
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#32---create-a-new-deposit-address
75909
+ * @param {string} code unified currency code of the currency for the deposit address
75910
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
75911
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
75912
+ */
75913
+ await this.loadMarkets();
75914
+ const currency = this.currency(code);
75915
+ const request = {
75916
+ 'currency': currency['id'],
75917
+ };
75918
+ const response = await this.privatePostGENMKTMoneyNewDepositAddress(this.extend(request, params));
75919
+ //
75920
+ // {
75921
+ // "result": "success",
75922
+ // "data": {
75923
+ // "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
75924
+ // }
75925
+ // }
75926
+ //
75927
+ const data = this.safeDict(response, 'data');
75928
+ return this.parseDepositAddress(data, currency);
75929
+ }
75930
+ parseDepositAddress(depositAddress, currency = undefined) {
75931
+ //
75932
+ // {
75933
+ // "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
75934
+ // }
75935
+ //
75936
+ const address = this.safeString(depositAddress, 'address');
75937
+ this.checkAddress(address);
75938
+ return {
75939
+ 'info': depositAddress,
75940
+ 'currency': this.safeString(currency, 'code'),
75941
+ 'address': address,
75942
+ 'tag': undefined,
75943
+ 'network': undefined,
75944
+ };
75945
+ }
75886
75946
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
75887
75947
  const request = this.implodeParams(path, params);
75888
75948
  let url = this.urls['api']['rest'] + '/' + this.version + '/' + request;
@@ -185698,6 +185758,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
185698
185758
  '700006': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
185699
185759
  '700007': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
185700
185760
  '700008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
185761
+ '700013': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
185701
185762
  '730001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
185702
185763
  '730002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
185703
185764
  '730000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
@@ -190230,7 +190291,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190230
190291
  'source': this.safeString(this.options, 'broker', 'CCXT'),
190231
190292
  };
190232
190293
  }
190233
- if (method === 'POST') {
190294
+ if ((method === 'POST') || (method === 'PUT')) {
190234
190295
  headers['Content-Type'] = 'application/json';
190235
190296
  }
190236
190297
  }
@@ -203935,7 +203996,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
203935
203996
  const liquidationPrice = this.safeNumber(position, 'liqPx');
203936
203997
  const percentageString = this.safeString(position, 'uplRatio');
203937
203998
  const percentage = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(percentageString, '100'));
203938
- const timestamp = this.safeInteger(position, 'uTime');
203999
+ const timestamp = this.safeInteger(position, 'cTime');
203939
204000
  const marginRatio = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(maintenanceMarginString, collateralString, 4));
203940
204001
  return this.safePosition({
203941
204002
  'info': position,
@@ -220401,18 +220462,18 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
220401
220462
  /* harmony export */ Z: () => (/* binding */ bequant)
220402
220463
  /* harmony export */ });
220403
220464
  /* harmony import */ var _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5189);
220465
+ /* harmony import */ var _hitbtc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4714);
220404
220466
  /* harmony import */ var _bequant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2049);
220405
220467
  // ---------------------------------------------------------------------------
220406
220468
 
220407
220469
 
220470
+
220408
220471
  // ---------------------------------------------------------------------------
220409
220472
  class bequant extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
220410
220473
  describe() {
220411
220474
  // eslint-disable-next-line new-cap
220412
- const restInstance = new _bequant_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
220413
- const restDescribe = restInstance.describe();
220414
- const extended = this.deepExtend(super.describe(), restDescribe);
220415
- return this.deepExtend(extended, {
220475
+ const describeExtended = this.getDescribeForExtendedWsExchange(new _bequant_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(), new _hitbtc_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z(), super.describe());
220476
+ return this.deepExtend(describeExtended, {
220416
220477
  'id': 'bequant',
220417
220478
  'name': 'Bequant',
220418
220479
  'countries': ['MT'],
@@ -220486,10 +220547,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
220486
220547
  'cancelOrderWs': true,
220487
220548
  'cancelOrdersWs': false,
220488
220549
  'cancelAllOrdersWs': true,
220489
- 'fetchOrderWs': true,
220490
- 'fetchOrdersWs': true,
220491
220550
  'fetchBalanceWs': true,
220551
+ 'fetchDepositsWs': false,
220552
+ 'fetchMarketsWs': false,
220492
220553
  'fetchMyTradesWs': true,
220554
+ 'fetchOpenOrdersWs': true,
220555
+ 'fetchOrderWs': true,
220556
+ 'fetchOrdersWs': true,
220557
+ 'fetchTradingFeesWs': false,
220558
+ 'fetchWithdrawalsWs': false,
220493
220559
  },
220494
220560
  'urls': {
220495
220561
  'test': {
@@ -222390,6 +222456,28 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222390
222456
  const orders = await this.watch(url, messageHash, message, messageHash, subscription);
222391
222457
  return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
222392
222458
  }
222459
+ async fetchClosedOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
222460
+ /**
222461
+ * @method
222462
+ * @name binance#fetchClosedOrdersWs
222463
+ * @see https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data
222464
+ * @description fetch closed orders
222465
+ * @param {string} symbol unified market symbol
222466
+ * @param {int} [since] the earliest time in ms to fetch open orders for
222467
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
222468
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
222469
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
222470
+ */
222471
+ const orders = await this.fetchOrdersWs(symbol, since, limit, params);
222472
+ const closedOrders = [];
222473
+ for (let i = 0; i < orders.length; i++) {
222474
+ const order = orders[i];
222475
+ if (order['status'] === 'closed') {
222476
+ closedOrders.push(order);
222477
+ }
222478
+ }
222479
+ return closedOrders;
222480
+ }
222393
222481
  async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
222394
222482
  /**
222395
222483
  * @method
@@ -224511,18 +224599,18 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
224511
224599
  /* harmony export */ Z: () => (/* binding */ bitcoincom)
224512
224600
  /* harmony export */ });
224513
224601
  /* harmony import */ var _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5189);
224514
- /* harmony import */ var _bequant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2049);
224602
+ /* harmony import */ var _hitbtc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4714);
224603
+ /* harmony import */ var _bitcoincom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1819);
224515
224604
  // ---------------------------------------------------------------------------
224516
224605
 
224517
224606
 
224607
+
224518
224608
  // ---------------------------------------------------------------------------
224519
224609
  class bitcoincom extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
224520
224610
  describe() {
224521
224611
  // eslint-disable-next-line new-cap
224522
- const restInstance = new _bequant_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z();
224523
- const restDescribe = restInstance.describe();
224524
- const extended = this.deepExtend(super.describe(), restDescribe);
224525
- return this.deepExtend(extended, {
224612
+ const describeExtended = this.getDescribeForExtendedWsExchange(new _bitcoincom_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(), new _hitbtc_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z(), super.describe());
224613
+ return this.deepExtend(describeExtended, {
224526
224614
  'id': 'bitcoincom',
224527
224615
  'name': 'bitcoin.com',
224528
224616
  'countries': ['KN'],
@@ -246239,6 +246327,7 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246239
246327
  'watchBalance': false,
246240
246328
  'watchTicker': false,
246241
246329
  'watchTickers': false,
246330
+ 'watchBidsAsks': true,
246242
246331
  'watchTrades': true,
246243
246332
  'watchTradesForSymbols': true,
246244
246333
  'watchMyTrades': false,
@@ -246638,6 +246727,79 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246638
246727
  const orderbook = await this.helperForWatchMultipleConstruct('orderbook', symbols, params);
246639
246728
  return orderbook.limit();
246640
246729
  }
246730
+ async watchBidsAsks(symbols, limit = undefined, params = {}) {
246731
+ /**
246732
+ * @method
246733
+ * @name gemini#watchBidsAsks
246734
+ * @description watches best bid & ask for symbols
246735
+ * @see https://docs.gemini.com/websocket-api/#multi-market-data
246736
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
246737
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
246738
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
246739
+ */
246740
+ return await this.helperForWatchMultipleConstruct('bidsasks', symbols, params);
246741
+ }
246742
+ handleBidsAsksForMultidata(client, rawBidAskChanges, timestamp, nonce) {
246743
+ //
246744
+ // {
246745
+ // eventId: '1683002916916153',
246746
+ // events: [
246747
+ // {
246748
+ // price: '50945.37',
246749
+ // reason: 'top-of-book',
246750
+ // remaining: '0.0',
246751
+ // side: 'bid',
246752
+ // symbol: 'BTCUSDT',
246753
+ // type: 'change'
246754
+ // },
246755
+ // {
246756
+ // price: '50947.75',
246757
+ // reason: 'top-of-book',
246758
+ // remaining: '0.11725',
246759
+ // side: 'bid',
246760
+ // symbol: 'BTCUSDT',
246761
+ // type: 'change'
246762
+ // }
246763
+ // ],
246764
+ // socket_sequence: 322,
246765
+ // timestamp: 1708674495,
246766
+ // timestampms: 1708674495174,
246767
+ // type: 'update'
246768
+ // }
246769
+ //
246770
+ const marketId = rawBidAskChanges[0]['symbol'];
246771
+ const market = this.safeMarket(marketId.toLowerCase());
246772
+ const symbol = market['symbol'];
246773
+ if (!(symbol in this.bidsasks)) {
246774
+ this.bidsasks[symbol] = this.parseTicker({});
246775
+ this.bidsasks[symbol]['symbol'] = symbol;
246776
+ }
246777
+ const currentBidAsk = this.bidsasks[symbol];
246778
+ const messageHash = 'bidsasks:' + symbol;
246779
+ // last update always overwrites the previous state and is the latest state
246780
+ for (let i = 0; i < rawBidAskChanges.length; i++) {
246781
+ const entry = rawBidAskChanges[i];
246782
+ const rawSide = this.safeString(entry, 'side');
246783
+ const price = this.safeNumber(entry, 'price');
246784
+ const size = this.safeNumber(entry, 'remaining');
246785
+ if (size === 0) {
246786
+ continue;
246787
+ }
246788
+ if (rawSide === 'bid') {
246789
+ currentBidAsk['bid'] = price;
246790
+ currentBidAsk['bidVolume'] = size;
246791
+ }
246792
+ else {
246793
+ currentBidAsk['ask'] = price;
246794
+ currentBidAsk['askVolume'] = size;
246795
+ }
246796
+ }
246797
+ currentBidAsk['timestamp'] = timestamp;
246798
+ currentBidAsk['datetime'] = this.iso8601(timestamp);
246799
+ currentBidAsk['info'] = rawBidAskChanges;
246800
+ this.bidsasks[symbol] = currentBidAsk;
246801
+ client.resolve(currentBidAsk, messageHash);
246802
+ }
246641
246803
  async helperForWatchMultipleConstruct(itemHashName, symbols, params = {}) {
246642
246804
  await this.loadMarkets();
246643
246805
  symbols = this.marketSymbols(symbols, undefined, false, true, true);
@@ -246659,6 +246821,9 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246659
246821
  if (itemHashName === 'orderbook') {
246660
246822
  url += 'trades=false&bids=true&offers=true';
246661
246823
  }
246824
+ else if (itemHashName === 'bidsasks') {
246825
+ url += 'trades=false&bids=true&offers=true&top_of_book=true';
246826
+ }
246662
246827
  else if (itemHashName === 'trades') {
246663
246828
  url += 'trades=true&bids=false&offers=false';
246664
246829
  }
@@ -247001,18 +247166,29 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247001
247166
  const eventId = this.safeInteger(message, 'eventId');
247002
247167
  const events = this.safeList(message, 'events');
247003
247168
  const orderBookItems = [];
247169
+ const bidaskItems = [];
247004
247170
  const collectedEventsOfTrades = [];
247171
+ const eventsLength = events.length;
247005
247172
  for (let i = 0; i < events.length; i++) {
247006
247173
  const event = events[i];
247007
247174
  const eventType = this.safeString(event, 'type');
247008
247175
  const isOrderBook = (eventType === 'change') && ('side' in event) && this.inArray(event['side'], ['ask', 'bid']);
247009
- if (isOrderBook) {
247176
+ const eventReason = this.safeString(event, 'reason');
247177
+ const isBidAsk = (eventReason === 'top-of-book') || (isOrderBook && (eventReason === 'initial') && eventsLength === 2);
247178
+ if (isBidAsk) {
247179
+ bidaskItems.push(event);
247180
+ }
247181
+ else if (isOrderBook) {
247010
247182
  orderBookItems.push(event);
247011
247183
  }
247012
247184
  else if (eventType === 'trade') {
247013
247185
  collectedEventsOfTrades.push(events[i]);
247014
247186
  }
247015
247187
  }
247188
+ const lengthBa = bidaskItems.length;
247189
+ if (lengthBa > 0) {
247190
+ this.handleBidsAsksForMultidata(client, bidaskItems, ts, eventId);
247191
+ }
247016
247192
  const lengthOb = orderBookItems.length;
247017
247193
  if (lengthOb > 0) {
247018
247194
  this.handleOrderBookForMultidata(client, orderBookItems, ts, eventId);
@@ -270775,6 +270951,7 @@ class whitebit extends _whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
270775
270951
  // "params":[
270776
270952
  // true,
270777
270953
  // {
270954
+ // "timestamp": 1708679568.940867,
270778
270955
  // "asks":[
270779
270956
  // [ "21252.45","0.01957"],
270780
270957
  // ["21252.55","0.126205"],
@@ -270811,14 +270988,14 @@ class whitebit extends _whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
270811
270988
  const market = this.safeMarket(marketId);
270812
270989
  const symbol = market['symbol'];
270813
270990
  const data = this.safeValue(params, 1);
270814
- let orderbook = undefined;
270815
- if (symbol in this.orderbooks) {
270816
- orderbook = this.orderbooks[symbol];
270817
- }
270818
- else {
270819
- orderbook = this.orderBook();
270820
- this.orderbooks[symbol] = orderbook;
270991
+ const timestamp = this.safeTimestamp(data, 'timestamp');
270992
+ if (!(symbol in this.orderbooks)) {
270993
+ const ob = this.orderBook();
270994
+ this.orderbooks[symbol] = ob;
270821
270995
  }
270996
+ const orderbook = this.orderbooks[symbol];
270997
+ orderbook['timestamp'] = timestamp;
270998
+ orderbook['datetime'] = this.iso8601(timestamp);
270822
270999
  if (isSnapshot) {
270823
271000
  const snapshot = this.parseOrderBook(data, symbol);
270824
271001
  orderbook.reset(snapshot);
@@ -283332,6 +283509,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283332
283509
  'fetchPremiumIndexOHLCV': false,
283333
283510
  'fetchTicker': true,
283334
283511
  'fetchTickers': true,
283512
+ 'fetchTime': true,
283335
283513
  'fetchTrades': true,
283336
283514
  'fetchTradingFee': true,
283337
283515
  'fetchWithdrawal': false,
@@ -283527,11 +283705,26 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283527
283705
  },
283528
283706
  });
283529
283707
  }
283708
+ async fetchTime(params = {}) {
283709
+ /**
283710
+ * @method
283711
+ * @name timex#fetchTime
283712
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
283713
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
283714
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
283715
+ */
283716
+ const response = await this.tradingviewGetTime(params);
283717
+ //
283718
+ // 1708682617
283719
+ //
283720
+ return this.parseToInt(response) * 1000;
283721
+ }
283530
283722
  async fetchMarkets(params = {}) {
283531
283723
  /**
283532
283724
  * @method
283533
283725
  * @name timex#fetchMarkets
283534
283726
  * @description retrieves data on all markets for timex
283727
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listMarkets
283535
283728
  * @param {object} [params] extra parameters specific to the exchange API endpoint
283536
283729
  * @returns {object[]} an array of objects representing market data
283537
283730
  */
@@ -283564,6 +283757,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283564
283757
  * @method
283565
283758
  * @name timex#fetchCurrencies
283566
283759
  * @description fetches all available currencies on an exchange
283760
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCurrencies
283567
283761
  * @param {object} [params] extra parameters specific to the exchange API endpoint
283568
283762
  * @returns {object} an associative dictionary of currencies
283569
283763
  */
@@ -283605,6 +283799,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283605
283799
  * @method
283606
283800
  * @name timex#fetchDeposits
283607
283801
  * @description fetch all deposits made to an account
283802
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getDeposits
283608
283803
  * @param {string} code unified currency code
283609
283804
  * @param {int} [since] the earliest time in ms to fetch deposits for
283610
283805
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -283640,6 +283835,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283640
283835
  * @method
283641
283836
  * @name timex#fetchWithdrawals
283642
283837
  * @description fetch all withdrawals made to an account
283838
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getWithdraws
283643
283839
  * @param {string} code unified currency code
283644
283840
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
283645
283841
  * @param {int} [limit] the maximum number of transaction structures to retrieve
@@ -283724,6 +283920,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283724
283920
  * @method
283725
283921
  * @name timex#fetchTickers
283726
283922
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
283923
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
283727
283924
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
283728
283925
  * @param {object} [params] extra parameters specific to the exchange API endpoint
283729
283926
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -283758,6 +283955,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283758
283955
  * @method
283759
283956
  * @name timex#fetchTicker
283760
283957
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
283958
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
283761
283959
  * @param {string} symbol unified symbol of the market to fetch the ticker for
283762
283960
  * @param {object} [params] extra parameters specific to the exchange API endpoint
283763
283961
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -283795,6 +283993,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283795
283993
  * @method
283796
283994
  * @name timex#fetchOrderBook
283797
283995
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
283996
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/orderbookV2
283798
283997
  * @param {string} symbol unified symbol of the market to fetch the order book for
283799
283998
  * @param {int} [limit] the maximum amount of order book entries to return
283800
283999
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -283841,6 +284040,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283841
284040
  * @method
283842
284041
  * @name timex#fetchTrades
283843
284042
  * @description get the list of most recent trades for a particular symbol
284043
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTrades
283844
284044
  * @param {string} symbol unified symbol of the market to fetch trades for
283845
284045
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
283846
284046
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -283888,6 +284088,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283888
284088
  * @method
283889
284089
  * @name timex#fetchOHLCV
283890
284090
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
284091
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCandles
283891
284092
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
283892
284093
  * @param {string} timeframe the length of time each candle represents
283893
284094
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -283953,6 +284154,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283953
284154
  * @method
283954
284155
  * @name timex#fetchBalance
283955
284156
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
284157
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getBalances
283956
284158
  * @param {object} [params] extra parameters specific to the exchange API endpoint
283957
284159
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
283958
284160
  */
@@ -283974,6 +284176,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
283974
284176
  * @method
283975
284177
  * @name timex#createOrder
283976
284178
  * @description create a trade order
284179
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/createOrder
283977
284180
  * @param {string} symbol unified symbol of the market to create an order in
283978
284181
  * @param {string} type 'market' or 'limit'
283979
284182
  * @param {string} side 'buy' or 'sell'
@@ -284102,6 +284305,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284102
284305
  * @method
284103
284306
  * @name timex#cancelOrder
284104
284307
  * @description cancels an open order
284308
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
284105
284309
  * @param {string} id order id
284106
284310
  * @param {string} symbol not used by timex cancelOrder ()
284107
284311
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -284115,6 +284319,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284115
284319
  * @method
284116
284320
  * @name timex#cancelOrders
284117
284321
  * @description cancel multiple orders
284322
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
284118
284323
  * @param {string[]} ids order ids
284119
284324
  * @param {string} symbol unified market symbol, default is undefined
284120
284325
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -284156,6 +284361,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284156
284361
  * @method
284157
284362
  * @name timex#fetchOrder
284158
284363
  * @description fetches information on an order made by the user
284364
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrderDetails
284159
284365
  * @param {string} symbol not used by timex fetchOrder
284160
284366
  * @param {object} [params] extra parameters specific to the exchange API endpoint
284161
284367
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -284207,6 +284413,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284207
284413
  * @method
284208
284414
  * @name timex#fetchOpenOrders
284209
284415
  * @description fetch all unfilled currently open orders
284416
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getOpenOrders
284210
284417
  * @param {string} symbol unified market symbol
284211
284418
  * @param {int} [since] the earliest time in ms to fetch open orders for
284212
284419
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -284261,6 +284468,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284261
284468
  * @method
284262
284469
  * @name timex#fetchClosedOrders
284263
284470
  * @description fetches information on multiple closed orders made by the user
284471
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrders
284264
284472
  * @param {string} symbol unified market symbol of the market orders were made in
284265
284473
  * @param {int} [since] the earliest time in ms to fetch orders for
284266
284474
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -284320,6 +284528,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284320
284528
  * @method
284321
284529
  * @name timex#fetchMyTrades
284322
284530
  * @description fetch all trades made by the user
284531
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getTrades_1
284323
284532
  * @param {string} symbol unified market symbol
284324
284533
  * @param {int} [since] the earliest time in ms to fetch trades for
284325
284534
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -284398,6 +284607,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284398
284607
  * @method
284399
284608
  * @name timex#fetchTradingFee
284400
284609
  * @description fetch the trading fees for a market
284610
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getFees
284401
284611
  * @param {string} symbol unified market symbol
284402
284612
  * @param {object} [params] extra parameters specific to the exchange API endpoint
284403
284613
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -284791,6 +285001,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284791
285001
  * @method
284792
285002
  * @name timex#fetchDepositAddress
284793
285003
  * @description fetch the deposit address for a currency associated with this account, does not accept params["network"]
285004
+ * @see https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Currency/selectCurrencyBySymbol
284794
285005
  * @param {string} code unified currency code
284795
285006
  * @param {object} [params] extra parameters specific to the exchange API endpoint
284796
285007
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -284853,7 +285064,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
284853
285064
  if (Object.keys(params).length) {
284854
285065
  url += '?' + this.urlencodeWithArrayRepeat(params);
284855
285066
  }
284856
- if (api !== 'public') {
285067
+ if (api !== 'public' && api !== 'tradingview') {
284857
285068
  this.checkRequiredCredentials();
284858
285069
  const auth = this.stringToBase64(this.apiKey + ':' + this.secret);
284859
285070
  const secret = 'Basic ' + auth;
@@ -307665,7 +307876,7 @@ SOFTWARE.
307665
307876
 
307666
307877
  //-----------------------------------------------------------------------------
307667
307878
  // this is updated by vss.js when building
307668
- const version = '4.2.49';
307879
+ const version = '4.2.51';
307669
307880
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
307670
307881
  //-----------------------------------------------------------------------------
307671
307882