ccxt 4.2.48 → 4.2.49

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 (47) hide show
  1. package/README.md +3 -3
  2. package/build.sh +7 -0
  3. package/dist/ccxt.browser.js +379 -32
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/binance.js +7 -3
  7. package/dist/cjs/src/bitmart.js +30 -4
  8. package/dist/cjs/src/bitstamp.js +8 -0
  9. package/dist/cjs/src/btcalpha.js +4 -0
  10. package/dist/cjs/src/btcmarkets.js +4 -0
  11. package/dist/cjs/src/btcturk.js +4 -0
  12. package/dist/cjs/src/bybit.js +138 -6
  13. package/dist/cjs/src/independentreserve.js +48 -0
  14. package/dist/cjs/src/latoken.js +16 -0
  15. package/dist/cjs/src/luno.js +18 -0
  16. package/dist/cjs/src/lykke.js +19 -0
  17. package/dist/cjs/src/ndax.js +18 -0
  18. package/dist/cjs/src/pro/ascendex.js +22 -7
  19. package/dist/cjs/src/pro/bitget.js +28 -7
  20. package/dist/cjs/src/pro/bitstamp.js +1 -1
  21. package/dist/cjs/src/pro/mexc.js +2 -1
  22. package/dist/cjs/src/upbit.js +11 -2
  23. package/js/ccxt.d.ts +1 -1
  24. package/js/ccxt.js +1 -1
  25. package/js/src/abstract/bitstamp.d.ts +8 -0
  26. package/js/src/binance.js +7 -3
  27. package/js/src/bitmart.js +30 -4
  28. package/js/src/bitstamp.js +8 -0
  29. package/js/src/btcalpha.js +4 -0
  30. package/js/src/btcmarkets.js +4 -0
  31. package/js/src/btcturk.js +4 -0
  32. package/js/src/bybit.d.ts +3 -1
  33. package/js/src/bybit.js +138 -6
  34. package/js/src/independentreserve.d.ts +15 -1
  35. package/js/src/independentreserve.js +48 -0
  36. package/js/src/latoken.js +16 -0
  37. package/js/src/luno.js +18 -0
  38. package/js/src/lykke.js +19 -0
  39. package/js/src/ndax.js +18 -0
  40. package/js/src/pro/ascendex.d.ts +1 -0
  41. package/js/src/pro/ascendex.js +22 -7
  42. package/js/src/pro/bitget.js +28 -7
  43. package/js/src/pro/bitstamp.js +1 -1
  44. package/js/src/pro/mexc.js +2 -1
  45. package/js/src/upbit.js +11 -2
  46. package/package.json +3 -1
  47. package/skip-tests.json +4 -2
@@ -21076,7 +21076,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21076
21076
  let fees = this.fees;
21077
21077
  let linear = undefined;
21078
21078
  let inverse = undefined;
21079
- const strike = this.safeInteger(market, 'strikePrice');
21079
+ const strike = this.safeString(market, 'strikePrice');
21080
21080
  let symbol = base + '/' + quote;
21081
21081
  if (contract) {
21082
21082
  if (swap) {
@@ -21086,7 +21086,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21086
21086
  symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry);
21087
21087
  }
21088
21088
  else if (option) {
21089
- symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry) + '-' + this.numberToString(strike) + '-' + this.safeString(optionParts, 3);
21089
+ symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry) + '-' + strike + '-' + this.safeString(optionParts, 3);
21090
21090
  }
21091
21091
  contractSize = this.safeNumber2(market, 'contractSize', 'unit', this.parseNumber('1'));
21092
21092
  linear = settle === quote;
@@ -21119,6 +21119,10 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21119
21119
  unifiedType = 'option';
21120
21120
  active = undefined;
21121
21121
  }
21122
+ let parsedStrike = undefined;
21123
+ if (strike !== undefined) {
21124
+ parsedStrike = this.parseToNumeric(strike);
21125
+ }
21122
21126
  const entry = {
21123
21127
  'id': id,
21124
21128
  'lowercaseId': lowercaseId,
@@ -21144,7 +21148,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21144
21148
  'contractSize': contractSize,
21145
21149
  'expiry': expiry,
21146
21150
  'expiryDatetime': this.iso8601(expiry),
21147
- 'strike': strike,
21151
+ 'strike': parsedStrike,
21148
21152
  'optionType': this.safeStringLower(market, 'side'),
21149
21153
  'precision': {
21150
21154
  'amount': this.safeInteger2(market, 'quantityPrecision', 'quantityScale'),
@@ -55755,7 +55759,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55755
55759
  }
55756
55760
  parseTicker(ticker, market = undefined) {
55757
55761
  //
55758
- // spot
55762
+ // spot (REST)
55759
55763
  //
55760
55764
  // {
55761
55765
  // "symbol": "SOLAR_USDT",
@@ -55775,6 +55779,17 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55775
55779
  // "timestamp": 1667403439367
55776
55780
  // }
55777
55781
  //
55782
+ // spot (WS)
55783
+ // {
55784
+ // "symbol":"BTC_USDT",
55785
+ // "last_price":"146.24",
55786
+ // "open_24h":"147.17",
55787
+ // "high_24h":"147.48",
55788
+ // "low_24h":"143.88",
55789
+ // "base_volume_24h":"117387.58", // NOT base, but quote currency!!!
55790
+ // "s_t": 1610936002
55791
+ // }
55792
+ //
55778
55793
  // swap
55779
55794
  //
55780
55795
  // {
@@ -55790,7 +55805,11 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55790
55805
  // "legal_coin_price":"0.1302699"
55791
55806
  // }
55792
55807
  //
55793
- const timestamp = this.safeInteger(ticker, 'timestamp');
55808
+ let timestamp = this.safeInteger(ticker, 'timestamp');
55809
+ if (timestamp === undefined) {
55810
+ // ticker from WS has a different field (in seconds)
55811
+ timestamp = this.safeIntegerProduct(ticker, 's_t', 1000);
55812
+ }
55794
55813
  const marketId = this.safeString2(ticker, 'symbol', 'contract_symbol');
55795
55814
  market = this.safeMarket(marketId, market);
55796
55815
  const symbol = market['symbol'];
@@ -55806,9 +55825,20 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55806
55825
  percentage = '0';
55807
55826
  }
55808
55827
  }
55809
- const baseVolume = this.safeString(ticker, 'base_volume_24h');
55828
+ let baseVolume = this.safeString(ticker, 'base_volume_24h');
55810
55829
  let quoteVolume = this.safeString(ticker, 'quote_volume_24h');
55811
- quoteVolume = this.safeString(ticker, 'volume_24h', quoteVolume);
55830
+ if (quoteVolume === undefined) {
55831
+ if (baseVolume === undefined) {
55832
+ // this is swap
55833
+ quoteVolume = this.safeString(ticker, 'volume_24h', quoteVolume);
55834
+ }
55835
+ else {
55836
+ // this is a ticker from websockets
55837
+ // contrary to name and documentation, base_volume_24h is actually the quote volume
55838
+ quoteVolume = baseVolume;
55839
+ baseVolume = undefined;
55840
+ }
55841
+ }
55812
55842
  const average = this.safeString2(ticker, 'avg_price', 'index_price');
55813
55843
  const high = this.safeString2(ticker, 'high_24h', 'high_price');
55814
55844
  const low = this.safeString2(ticker, 'low_24h', 'low_price');
@@ -69148,6 +69178,14 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69148
69178
  'eurcv_address/': 1,
69149
69179
  'pyusd_withdrawal/': 1,
69150
69180
  'pyusd_address/': 1,
69181
+ 'lmwr_withdrawal/': 1,
69182
+ 'lmwr_address/': 1,
69183
+ 'pepe_withdrawal/': 1,
69184
+ 'pepe_address/': 1,
69185
+ 'blur_withdrawal/': 1,
69186
+ 'blur_address/': 1,
69187
+ 'vext_withdrawal/': 1,
69188
+ 'vext_address/': 1,
69151
69189
  },
69152
69190
  },
69153
69191
  },
@@ -79221,6 +79259,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
79221
79259
  'cancelOrder': true,
79222
79260
  'closeAllPositions': false,
79223
79261
  'closePosition': false,
79262
+ 'createDepositAddress': false,
79224
79263
  'createOrder': true,
79225
79264
  'createReduceOnlyOrder': false,
79226
79265
  'createStopLimitOrder': false,
@@ -79233,6 +79272,9 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
79233
79272
  'fetchCrossBorrowRate': false,
79234
79273
  'fetchCrossBorrowRates': false,
79235
79274
  'fetchDeposit': false,
79275
+ 'fetchDepositAddress': false,
79276
+ 'fetchDepositAddresses': false,
79277
+ 'fetchDepositAddressesByNetwork': false,
79236
79278
  'fetchDeposits': true,
79237
79279
  'fetchFundingHistory': false,
79238
79280
  'fetchFundingRate': false,
@@ -80755,6 +80797,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80755
80797
  'cancelOrders': true,
80756
80798
  'closeAllPositions': false,
80757
80799
  'closePosition': false,
80800
+ 'createDepositAddress': false,
80758
80801
  'createOrder': true,
80759
80802
  'createReduceOnlyOrder': false,
80760
80803
  'fetchBalance': true,
@@ -80763,6 +80806,9 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80763
80806
  'fetchClosedOrders': 'emulated',
80764
80807
  'fetchCrossBorrowRate': false,
80765
80808
  'fetchCrossBorrowRates': false,
80809
+ 'fetchDepositAddress': false,
80810
+ 'fetchDepositAddresses': false,
80811
+ 'fetchDepositAddressesByNetwork': false,
80766
80812
  'fetchDeposits': true,
80767
80813
  'fetchDepositsWithdrawals': true,
80768
80814
  'fetchFundingHistory': false,
@@ -82020,6 +82066,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82020
82066
  'cancelOrder': true,
82021
82067
  'closeAllPositions': false,
82022
82068
  'closePosition': false,
82069
+ 'createDepositAddress': false,
82023
82070
  'createOrder': true,
82024
82071
  'createReduceOnlyOrder': false,
82025
82072
  'fetchBalance': true,
@@ -82027,6 +82074,9 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82027
82074
  'fetchBorrowRateHistory': false,
82028
82075
  'fetchCrossBorrowRate': false,
82029
82076
  'fetchCrossBorrowRates': false,
82077
+ 'fetchDepositAddress': false,
82078
+ 'fetchDepositAddresses': false,
82079
+ 'fetchDepositAddressesByNetwork': false,
82030
82080
  'fetchFundingHistory': false,
82031
82081
  'fetchFundingRate': false,
82032
82082
  'fetchFundingRateHistory': false,
@@ -83021,6 +83071,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
83021
83071
  'fetchMarketLeverageTiers': true,
83022
83072
  'fetchMarkets': true,
83023
83073
  'fetchMarkOHLCV': true,
83074
+ 'fetchMyLiquidations': true,
83024
83075
  'fetchMySettlementHistory': true,
83025
83076
  'fetchMyTrades': true,
83026
83077
  'fetchOHLCV': true,
@@ -87516,7 +87567,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
87516
87567
  let paginate = false;
87517
87568
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
87518
87569
  if (paginate) {
87519
- return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
87570
+ return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
87520
87571
  }
87521
87572
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
87522
87573
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -87694,7 +87745,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
87694
87745
  let paginate = false;
87695
87746
  [paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
87696
87747
  if (paginate) {
87697
- return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
87748
+ return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
87698
87749
  }
87699
87750
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
87700
87751
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -88066,7 +88117,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
88066
88117
  let paginate = false;
88067
88118
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
88068
88119
  if (paginate) {
88069
- return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 100);
88120
+ return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
88070
88121
  }
88071
88122
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
88072
88123
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -88268,7 +88319,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
88268
88319
  let paginate = false;
88269
88320
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
88270
88321
  if (paginate) {
88271
- return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
88322
+ return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
88272
88323
  }
88273
88324
  let request = {
88274
88325
  // 'coin': currency['id'],
@@ -88336,7 +88387,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
88336
88387
  let paginate = false;
88337
88388
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
88338
88389
  if (paginate) {
88339
- return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
88390
+ return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
88340
88391
  }
88341
88392
  let request = {
88342
88393
  // 'coin': currency['id'],
@@ -89856,7 +89907,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
89856
89907
  let paginate = false;
89857
89908
  [paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
89858
89909
  if (paginate) {
89859
- return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
89910
+ return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
89860
89911
  }
89861
89912
  let currency = undefined;
89862
89913
  let request = {};
@@ -90691,6 +90742,137 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
90691
90742
  'info': greeks,
90692
90743
  };
90693
90744
  }
90745
+ async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
90746
+ /**
90747
+ * @method
90748
+ * @name bybit#fetchMyLiquidations
90749
+ * @description retrieves the users liquidated positions
90750
+ * @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
90751
+ * @param {string} [symbol] unified CCXT market symbol
90752
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
90753
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
90754
+ * @param {object} [params] exchange specific parameters for the exchange API endpoint
90755
+ * @param {string} [params.type] market type, ['swap', 'option', 'spot']
90756
+ * @param {string} [params.subType] market subType, ['linear', 'inverse']
90757
+ * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
90758
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
90759
+ */
90760
+ await this.loadMarkets();
90761
+ let paginate = false;
90762
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
90763
+ if (paginate) {
90764
+ return await this.fetchPaginatedCallCursor('fetchMyLiquidations', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
90765
+ }
90766
+ let request = {
90767
+ 'execType': 'BustTrade',
90768
+ };
90769
+ let market = undefined;
90770
+ if (symbol !== undefined) {
90771
+ market = this.market(symbol);
90772
+ request['symbol'] = market['id'];
90773
+ }
90774
+ let type = undefined;
90775
+ [type, params] = this.getBybitType('fetchMyLiquidations', market, params);
90776
+ request['category'] = type;
90777
+ if (limit !== undefined) {
90778
+ request['limit'] = limit;
90779
+ }
90780
+ if (since !== undefined) {
90781
+ request['startTime'] = since;
90782
+ }
90783
+ [request, params] = this.handleUntilOption('endTime', request, params);
90784
+ const response = await this.privateGetV5ExecutionList(this.extend(request, params));
90785
+ //
90786
+ // {
90787
+ // "retCode": 0,
90788
+ // "retMsg": "OK",
90789
+ // "result": {
90790
+ // "nextPageCursor": "132766%3A2%2C132766%3A2",
90791
+ // "category": "linear",
90792
+ // "list": [
90793
+ // {
90794
+ // "symbol": "ETHPERP",
90795
+ // "orderType": "Market",
90796
+ // "underlyingPrice": "",
90797
+ // "orderLinkId": "",
90798
+ // "side": "Buy",
90799
+ // "indexPrice": "",
90800
+ // "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
90801
+ // "stopOrderType": "UNKNOWN",
90802
+ // "leavesQty": "0",
90803
+ // "execTime": "1672282722429",
90804
+ // "isMaker": false,
90805
+ // "execFee": "0.071409",
90806
+ // "feeRate": "0.0006",
90807
+ // "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
90808
+ // "tradeIv": "",
90809
+ // "blockTradeId": "",
90810
+ // "markPrice": "1183.54",
90811
+ // "execPrice": "1190.15",
90812
+ // "markIv": "",
90813
+ // "orderQty": "0.1",
90814
+ // "orderPrice": "1236.9",
90815
+ // "execValue": "119.015",
90816
+ // "execType": "Trade",
90817
+ // "execQty": "0.1"
90818
+ // }
90819
+ // ]
90820
+ // },
90821
+ // "retExtInfo": {},
90822
+ // "time": 1672283754510
90823
+ // }
90824
+ //
90825
+ const liquidations = this.addPaginationCursorToResult(response);
90826
+ return this.parseLiquidations(liquidations, market, since, limit);
90827
+ }
90828
+ parseLiquidation(liquidation, market = undefined) {
90829
+ //
90830
+ // {
90831
+ // "symbol": "ETHPERP",
90832
+ // "orderType": "Market",
90833
+ // "underlyingPrice": "",
90834
+ // "orderLinkId": "",
90835
+ // "side": "Buy",
90836
+ // "indexPrice": "",
90837
+ // "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
90838
+ // "stopOrderType": "UNKNOWN",
90839
+ // "leavesQty": "0",
90840
+ // "execTime": "1672282722429",
90841
+ // "isMaker": false,
90842
+ // "execFee": "0.071409",
90843
+ // "feeRate": "0.0006",
90844
+ // "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
90845
+ // "tradeIv": "",
90846
+ // "blockTradeId": "",
90847
+ // "markPrice": "1183.54",
90848
+ // "execPrice": "1190.15",
90849
+ // "markIv": "",
90850
+ // "orderQty": "0.1",
90851
+ // "orderPrice": "1236.9",
90852
+ // "execValue": "119.015",
90853
+ // "execType": "Trade",
90854
+ // "execQty": "0.1"
90855
+ // }
90856
+ //
90857
+ const marketId = this.safeString(liquidation, 'symbol');
90858
+ const timestamp = this.safeInteger(liquidation, 'execTime');
90859
+ const contractsString = this.safeString(liquidation, 'execQty');
90860
+ const contractSizeString = this.safeString(market, 'contractSize');
90861
+ const priceString = this.safeString(liquidation, 'execPrice');
90862
+ const baseValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(contractsString, contractSizeString);
90863
+ const quoteValueString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(baseValueString, priceString);
90864
+ return this.safeLiquidation({
90865
+ 'info': liquidation,
90866
+ 'symbol': this.safeSymbol(marketId, market),
90867
+ 'contracts': this.parseNumber(contractsString),
90868
+ 'contractSize': this.parseNumber(contractSizeString),
90869
+ 'price': this.parseNumber(priceString),
90870
+ 'baseValue': this.parseNumber(baseValueString),
90871
+ 'quoteValue': this.parseNumber(quoteValueString),
90872
+ 'timestamp': timestamp,
90873
+ 'datetime': this.iso8601(timestamp),
90874
+ });
90875
+ }
90694
90876
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
90695
90877
  let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
90696
90878
  if (api === 'public') {
@@ -160035,6 +160217,9 @@ class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORT
160035
160217
  'fetchClosedOrders': true,
160036
160218
  'fetchCrossBorrowRate': false,
160037
160219
  'fetchCrossBorrowRates': false,
160220
+ 'fetchDepositAddress': true,
160221
+ 'fetchDepositAddresses': false,
160222
+ 'fetchDepositAddressesByNetwork': false,
160038
160223
  'fetchFundingHistory': false,
160039
160224
  'fetchFundingRate': false,
160040
160225
  'fetchFundingRateHistory': false,
@@ -160714,6 +160899,51 @@ class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORT
160714
160899
  };
160715
160900
  return await this.privatePostCancelOrder(this.extend(request, params));
160716
160901
  }
160902
+ async fetchDepositAddress(code, params = {}) {
160903
+ /**
160904
+ * @method
160905
+ * @name independentreserve#fetchDepositAddress
160906
+ * @description fetch the deposit address for a currency associated with this account
160907
+ * @see https://www.independentreserve.com/features/api#GetDigitalCurrencyDepositAddress
160908
+ * @param {string} code unified currency code
160909
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
160910
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
160911
+ */
160912
+ await this.loadMarkets();
160913
+ const currency = this.currency(code);
160914
+ const request = {
160915
+ 'primaryCurrencyCode': currency['id'],
160916
+ };
160917
+ const response = await this.privatePostGetDigitalCurrencyDepositAddress(this.extend(request, params));
160918
+ //
160919
+ // {
160920
+ // Tag: '3307446684',
160921
+ // DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
160922
+ // LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
160923
+ // NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
160924
+ // }
160925
+ //
160926
+ return this.parseDepositAddress(response);
160927
+ }
160928
+ parseDepositAddress(depositAddress, currency = undefined) {
160929
+ //
160930
+ // {
160931
+ // Tag: '3307446684',
160932
+ // DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
160933
+ // LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
160934
+ // NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
160935
+ // }
160936
+ //
160937
+ const address = this.safeString(depositAddress, 'DepositAddress');
160938
+ this.checkAddress(address);
160939
+ return {
160940
+ 'info': depositAddress,
160941
+ 'currency': this.safeString(currency, 'code'),
160942
+ 'address': address,
160943
+ 'tag': this.safeString(depositAddress, 'Tag'),
160944
+ 'network': undefined,
160945
+ };
160946
+ }
160717
160947
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
160718
160948
  let url = this.urls['api'][api] + '/' + path;
160719
160949
  if (api === 'public') {
@@ -176795,6 +177025,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
176795
177025
  * @method
176796
177026
  * @name latoken#fetchTime
176797
177027
  * @description fetches the current integer timestamp in milliseconds from the exchange server
177028
+ * @see https://api.latoken.com/doc/v2/#tag/Time/operation/currentTime
176798
177029
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176799
177030
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
176800
177031
  */
@@ -176811,6 +177042,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
176811
177042
  * @method
176812
177043
  * @name latoken#fetchMarkets
176813
177044
  * @description retrieves data on all markets for latoken
177045
+ * @see https://api.latoken.com/doc/v2/#tag/Pair/operation/getActivePairs
176814
177046
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176815
177047
  * @returns {object[]} an array of objects representing market data
176816
177048
  */
@@ -177047,6 +177279,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177047
177279
  * @method
177048
177280
  * @name latoken#fetchBalance
177049
177281
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
177282
+ * @see https://api.latoken.com/doc/v2/#tag/Account/operation/getBalancesByUser
177050
177283
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177051
177284
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
177052
177285
  */
@@ -177113,6 +177346,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177113
177346
  * @method
177114
177347
  * @name latoken#fetchOrderBook
177115
177348
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
177349
+ * @see https://api.latoken.com/doc/v2/#tag/Order-Book/operation/getOrderBook
177116
177350
  * @param {string} symbol unified symbol of the market to fetch the order book for
177117
177351
  * @param {int} [limit] the maximum amount of order book entries to return
177118
177352
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -177198,6 +177432,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177198
177432
  * @method
177199
177433
  * @name latoken#fetchTicker
177200
177434
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
177435
+ * @see https://api.latoken.com/doc/v2/#tag/Ticker/operation/getTicker
177201
177436
  * @param {string} symbol unified symbol of the market to fetch the ticker for
177202
177437
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177203
177438
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -177236,6 +177471,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177236
177471
  * @method
177237
177472
  * @name latoken#fetchTickers
177238
177473
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
177474
+ * @see https://api.latoken.com/doc/v2/#tag/Ticker/operation/getAllTickers
177239
177475
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
177240
177476
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177241
177477
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -177358,6 +177594,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177358
177594
  * @method
177359
177595
  * @name latoken#fetchTrades
177360
177596
  * @description get the list of most recent trades for a particular symbol
177597
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByPair
177361
177598
  * @param {string} symbol unified symbol of the market to fetch trades for
177362
177599
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
177363
177600
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -177390,6 +177627,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177390
177627
  * @method
177391
177628
  * @name latoken#fetchTradingFee
177392
177629
  * @description fetch the trading fees for a market
177630
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getFeeByPair
177631
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getAuthFeeByPair
177393
177632
  * @param {string} symbol unified market symbol
177394
177633
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177395
177634
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -177459,6 +177698,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177459
177698
  * @method
177460
177699
  * @name latoken#fetchMyTrades
177461
177700
  * @description fetch all trades made by the user
177701
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByTrader
177702
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByAssetAndTrader
177462
177703
  * @param {string} symbol unified market symbol
177463
177704
  * @param {int} [since] the earliest time in ms to fetch trades for
177464
177705
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -177966,6 +178207,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177966
178207
  * @name latoken#fetchTransactions
177967
178208
  * @deprecated
177968
178209
  * @description use fetchDepositsWithdrawals instead
178210
+ * @see https://api.latoken.com/doc/v2/#tag/Transaction/operation/getUserTransactions
177969
178211
  * @param {string} code unified currency code for the currency of the transactions, default is undefined
177970
178212
  * @param {int} [since] timestamp in ms of the earliest transaction, default is undefined
177971
178213
  * @param {int} [limit] max number of transactions to return, default is undefined
@@ -178094,6 +178336,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
178094
178336
  * @method
178095
178337
  * @name latoken#fetchTransfers
178096
178338
  * @description fetch a history of internal transfers made on an account
178339
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
178097
178340
  * @param {string} code unified currency code of the currency transferred
178098
178341
  * @param {int} [since] the earliest time in ms to fetch transfers for
178099
178342
  * @param {int} [limit] the maximum number of transfers structures to retrieve
@@ -178142,6 +178385,9 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
178142
178385
  * @method
178143
178386
  * @name latoken#transfer
178144
178387
  * @description transfer currency internally between wallets on the same account
178388
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByEmail
178389
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferById
178390
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByPhone
178145
178391
  * @param {string} code unified currency code
178146
178392
  * @param {float} amount amount to transfer
178147
178393
  * @param {string} fromAccount account to transfer from
@@ -181351,6 +181597,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181351
181597
  * @method
181352
181598
  * @name luno#fetchMarkets
181353
181599
  * @description retrieves data on all markets for luno
181600
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/Markets
181354
181601
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181355
181602
  * @returns {object[]} an array of objects representing market data
181356
181603
  */
@@ -181441,6 +181688,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181441
181688
  * @method
181442
181689
  * @name luno#fetchAccounts
181443
181690
  * @description fetch all the accounts associated with a profile
181691
+ * @see https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
181444
181692
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181445
181693
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
181446
181694
  */
@@ -181495,6 +181743,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181495
181743
  * @method
181496
181744
  * @name luno#fetchBalance
181497
181745
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
181746
+ * @see https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
181498
181747
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181499
181748
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
181500
181749
  */
@@ -181517,6 +181766,8 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181517
181766
  * @method
181518
181767
  * @name luno#fetchOrderBook
181519
181768
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
181769
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/GetOrderBookFull
181770
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/GetOrderBook
181520
181771
  * @param {string} symbol unified symbol of the market to fetch the order book for
181521
181772
  * @param {int} [limit] the maximum amount of order book entries to return
181522
181773
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -181625,6 +181876,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181625
181876
  * @method
181626
181877
  * @name luno#fetchOrder
181627
181878
  * @description fetches information on an order made by the user
181879
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/GetOrder
181628
181880
  * @param {string} symbol not used by luno fetchOrder
181629
181881
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181630
181882
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -181656,6 +181908,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181656
181908
  * @method
181657
181909
  * @name luno#fetchOrders
181658
181910
  * @description fetches information on multiple orders made by the user
181911
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
181659
181912
  * @param {string} symbol unified market symbol of the market orders were made in
181660
181913
  * @param {int} [since] the earliest time in ms to fetch orders for
181661
181914
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -181669,6 +181922,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181669
181922
  * @method
181670
181923
  * @name luno#fetchOpenOrders
181671
181924
  * @description fetch all unfilled currently open orders
181925
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
181672
181926
  * @param {string} symbol unified market symbol
181673
181927
  * @param {int} [since] the earliest time in ms to fetch open orders for
181674
181928
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -181682,6 +181936,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181682
181936
  * @method
181683
181937
  * @name luno#fetchClosedOrders
181684
181938
  * @description fetches information on multiple closed orders made by the user
181939
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
181685
181940
  * @param {string} symbol unified market symbol of the market orders were made in
181686
181941
  * @param {int} [since] the earliest time in ms to fetch orders for
181687
181942
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -181732,6 +181987,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181732
181987
  * @method
181733
181988
  * @name luno#fetchTickers
181734
181989
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
181990
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/GetTickers
181735
181991
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
181736
181992
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181737
181993
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -181756,6 +182012,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181756
182012
  * @method
181757
182013
  * @name luno#fetchTicker
181758
182014
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
182015
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/GetTicker
181759
182016
  * @param {string} symbol unified symbol of the market to fetch the ticker for
181760
182017
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181761
182018
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -181877,6 +182134,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181877
182134
  * @method
181878
182135
  * @name luno#fetchTrades
181879
182136
  * @description get the list of most recent trades for a particular symbol
182137
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/ListTrades
181880
182138
  * @param {string} symbol unified symbol of the market to fetch trades for
181881
182139
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
181882
182140
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -181977,6 +182235,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181977
182235
  * @method
181978
182236
  * @name luno#fetchMyTrades
181979
182237
  * @description fetch all trades made by the user
182238
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListUserTrades
181980
182239
  * @param {string} symbol unified market symbol
181981
182240
  * @param {int} [since] the earliest time in ms to fetch trades for
181982
182241
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -182027,6 +182286,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
182027
182286
  * @method
182028
182287
  * @name luno#fetchTradingFee
182029
182288
  * @description fetch the trading fees for a market
182289
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/getFeeInfo
182030
182290
  * @param {string} symbol unified market symbol
182031
182291
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182032
182292
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -182056,6 +182316,8 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
182056
182316
  * @method
182057
182317
  * @name luno#createOrder
182058
182318
  * @description create a trade order
182319
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/PostMarketOrder
182320
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/PostLimitOrder
182059
182321
  * @param {string} symbol unified symbol of the market to create an order in
182060
182322
  * @param {string} type 'market' or 'limit'
182061
182323
  * @param {string} side 'buy' or 'sell'
@@ -182097,6 +182359,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
182097
182359
  * @method
182098
182360
  * @name luno#cancelOrder
182099
182361
  * @description cancels an open order
182362
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/StopOrder
182100
182363
  * @param {string} id order id
182101
182364
  * @param {string} symbol unified symbol of the market the order was made in
182102
182365
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -182128,6 +182391,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
182128
182391
  * @method
182129
182392
  * @name luno#fetchLedger
182130
182393
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
182394
+ * @see https://www.luno.com/en/developers/api#tag/Accounts/operation/ListTransactions
182131
182395
  * @param {string} code unified currency code, default is undefined
182132
182396
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
182133
182397
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -182488,6 +182752,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182488
182752
  * @method
182489
182753
  * @name lykke#fetchCurrencies
182490
182754
  * @description fetches all available currencies on an exchange
182755
+ * @see https://lykkecity.github.io/Trading-API/#get-all-assets
182491
182756
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182492
182757
  * @returns {object} an associative dictionary of currencies
182493
182758
  */
@@ -182566,6 +182831,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182566
182831
  * @method
182567
182832
  * @name lykke#fetchMarkets
182568
182833
  * @description retrieves data on all markets for lykke
182834
+ * @see https://lykkecity.github.io/Trading-API/#get-asset-by-id
182569
182835
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182570
182836
  * @returns {object[]} an array of objects representing market data
182571
182837
  */
@@ -182725,6 +182991,8 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182725
182991
  * @method
182726
182992
  * @name lykke#fetchTicker
182727
182993
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
182994
+ * @see https://lykkecity.github.io/Trading-API/#get-current-prices
182995
+ * @see https://lykkecity.github.io/Trading-API/#24hr-ticker-price-change-statistics
182728
182996
  * @param {string} symbol unified symbol of the market to fetch the ticker for
182729
182997
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182730
182998
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -182784,6 +183052,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182784
183052
  * @method
182785
183053
  * @name lykke#fetchTickers
182786
183054
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
183055
+ * @see https://lykkecity.github.io/Trading-API/#24hr-ticker-price-change-statistics
182787
183056
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
182788
183057
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182789
183058
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -182815,6 +183084,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182815
183084
  * @method
182816
183085
  * @name lykke#fetchOrderBook
182817
183086
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
183087
+ * @see https://lykkecity.github.io/Trading-API/#asset-pair-order-book-ticker
182818
183088
  * @param {string} symbol unified symbol of the market to fetch the order book for
182819
183089
  * @param {int} [limit] the maximum amount of order book entries to return
182820
183090
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -182919,6 +183189,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182919
183189
  * @method
182920
183190
  * @name lykke#fetchTrades
182921
183191
  * @description get the list of most recent trades for a particular symbol
183192
+ * @see https://lykkecity.github.io/Trading-API/#get-public-trades
182922
183193
  * @param {string} symbol unified symbol of the market to fetch trades for
182923
183194
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
182924
183195
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -182983,6 +183254,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182983
183254
  * @method
182984
183255
  * @name lykke#fetchBalance
182985
183256
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
183257
+ * @see https://lykkecity.github.io/Trading-API/#get-the-current-balance
182986
183258
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182987
183259
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
182988
183260
  */
@@ -183078,6 +183350,8 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183078
183350
  * @method
183079
183351
  * @name lykke#createOrder
183080
183352
  * @description create a trade order
183353
+ * @see https://lykkecity.github.io/Trading-API/#place-a-limit-order
183354
+ * @see https://lykkecity.github.io/Trading-API/#place-a-market-order
183081
183355
  * @param {string} symbol unified symbol of the market to create an order in
183082
183356
  * @param {string} type 'market' or 'limit'
183083
183357
  * @param {string} side 'buy' or 'sell'
@@ -183154,6 +183428,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183154
183428
  * @method
183155
183429
  * @name lykke#cancelOrder
183156
183430
  * @description cancels an open order
183431
+ * @see https://lykkecity.github.io/Trading-API/#cancel-orders-by-id
183157
183432
  * @param {string} id order id
183158
183433
  * @param {string} symbol unified symbol of the market the order was made in
183159
183434
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -183175,6 +183450,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183175
183450
  * @method
183176
183451
  * @name lykke#cancelAllOrders
183177
183452
  * @description cancel all open orders
183453
+ * @see https://lykkecity.github.io/Trading-API/#mass-cancel-orders
183178
183454
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
183179
183455
  * @param {object} [params] extra parameters specific to the exchange API endpoint
183180
183456
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -183201,6 +183477,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183201
183477
  * @method
183202
183478
  * @name lykke#fetchOrder
183203
183479
  * @description fetches information on an order made by the user
183480
+ * @see https://lykkecity.github.io/Trading-API/#get-order-by-id
183204
183481
  * @param {string} symbol not used by lykke fetchOrder
183205
183482
  * @param {object} [params] extra parameters specific to the exchange API endpoint
183206
183483
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -183237,6 +183514,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183237
183514
  * @method
183238
183515
  * @name lykke#fetchOpenOrders
183239
183516
  * @description fetch all unfilled currently open orders
183517
+ * @see https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
183240
183518
  * @param {string} symbol unified market symbol
183241
183519
  * @param {int} [since] the earliest time in ms to fetch open orders for
183242
183520
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -183285,6 +183563,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183285
183563
  * @method
183286
183564
  * @name lykke#fetchClosedOrders
183287
183565
  * @description fetches information on multiple closed orders made by the user
183566
+ * @see https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
183288
183567
  * @param {string} symbol unified market symbol of the market orders were made in
183289
183568
  * @param {int} [since] the earliest time in ms to fetch orders for
183290
183569
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -183333,6 +183612,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183333
183612
  * @method
183334
183613
  * @name lykke#fetchMyTrades
183335
183614
  * @description fetch all trades made by the user
183615
+ * @see https://lykkecity.github.io/Trading-API/#get-trade-history
183336
183616
  * @param {string} symbol unified market symbol
183337
183617
  * @param {int} [since] the earliest time in ms to fetch trades for
183338
183618
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -183392,6 +183672,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183392
183672
  * @method
183393
183673
  * @name lykke#fetchDepositAddress
183394
183674
  * @description fetch the deposit address for a currency associated with this account
183675
+ * @see https://lykkecity.github.io/Trading-API/#get-deposit-address-for-a-given-asset
183395
183676
  * @param {string} code unified currency code
183396
183677
  * @param {object} [params] extra parameters specific to the exchange API endpoint
183397
183678
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -183489,6 +183770,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183489
183770
  * @method
183490
183771
  * @name lykke#fetchDepositsWithdrawals
183491
183772
  * @description fetch history of deposits and withdrawals
183773
+ * @see https://lykkecity.github.io/Trading-API/#get-the-history-of-withdrawals-and-deposits
183492
183774
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
183493
183775
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
183494
183776
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -183531,6 +183813,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183531
183813
  * @method
183532
183814
  * @name lykke#withdraw
183533
183815
  * @description make a withdrawal
183816
+ * @see https://lykkecity.github.io/Trading-API/#withdrawal
183534
183817
  * @param {string} code unified currency code
183535
183818
  * @param {float} amount the amount to withdraw
183536
183819
  * @param {string} address the address to withdraw to
@@ -190310,6 +190593,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190310
190593
  * @method
190311
190594
  * @name ndax#signIn
190312
190595
  * @description sign in, must be called prior to using other authenticated methods
190596
+ * @see https://apidoc.ndax.io/#authenticate2fa
190313
190597
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190314
190598
  * @returns response from exchange
190315
190599
  */
@@ -190363,6 +190647,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190363
190647
  * @method
190364
190648
  * @name ndax#fetchCurrencies
190365
190649
  * @description fetches all available currencies on an exchange
190650
+ * @see https://apidoc.ndax.io/#getproduct
190366
190651
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190367
190652
  * @returns {object} an associative dictionary of currencies
190368
190653
  */
@@ -190432,6 +190717,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190432
190717
  * @method
190433
190718
  * @name ndax#fetchMarkets
190434
190719
  * @description retrieves data on all markets for ndax
190720
+ * @see https://apidoc.ndax.io/#getinstruments
190435
190721
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190436
190722
  * @returns {object[]} an array of objects representing market data
190437
190723
  */
@@ -190591,6 +190877,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190591
190877
  * @method
190592
190878
  * @name ndax#fetchOrderBook
190593
190879
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
190880
+ * @see https://apidoc.ndax.io/#getl2snapshot
190594
190881
  * @param {string} symbol unified symbol of the market to fetch the order book for
190595
190882
  * @param {int} [limit] the maximum amount of order book entries to return
190596
190883
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -190701,6 +190988,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190701
190988
  * @method
190702
190989
  * @name ndax#fetchTicker
190703
190990
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
190991
+ * @see https://apidoc.ndax.io/#getlevel1
190704
190992
  * @param {string} symbol unified symbol of the market to fetch the ticker for
190705
190993
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190706
190994
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -190773,6 +191061,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190773
191061
  * @method
190774
191062
  * @name ndax#fetchOHLCV
190775
191063
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
191064
+ * @see https://apidoc.ndax.io/#gettickerhistory
190776
191065
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
190777
191066
  * @param {string} timeframe the length of time each candle represents
190778
191067
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -191019,6 +191308,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191019
191308
  * @method
191020
191309
  * @name ndax#fetchAccounts
191021
191310
  * @description fetch all the accounts associated with a profile
191311
+ * @see https://apidoc.ndax.io/#getuseraccounts
191022
191312
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191023
191313
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
191024
191314
  */
@@ -191072,6 +191362,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191072
191362
  * @method
191073
191363
  * @name ndax#fetchBalance
191074
191364
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
191365
+ * @see https://apidoc.ndax.io/#getaccountpositions
191075
191366
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191076
191367
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
191077
191368
  */
@@ -191199,6 +191490,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191199
191490
  * @method
191200
191491
  * @name ndax#fetchLedger
191201
191492
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
191493
+ * @see https://apidoc.ndax.io/#getaccounttransactions
191202
191494
  * @param {string} code unified currency code, default is undefined
191203
191495
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
191204
191496
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -191353,6 +191645,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191353
191645
  * @method
191354
191646
  * @name ndax#createOrder
191355
191647
  * @description create a trade order
191648
+ * @see https://apidoc.ndax.io/#sendorder
191356
191649
  * @param {string} symbol unified symbol of the market to create an order in
191357
191650
  * @param {string} type 'market' or 'limit'
191358
191651
  * @param {string} side 'buy' or 'sell'
@@ -191471,6 +191764,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191471
191764
  * @method
191472
191765
  * @name ndax#fetchMyTrades
191473
191766
  * @description fetch all trades made by the user
191767
+ * @see https://apidoc.ndax.io/#gettradeshistory
191474
191768
  * @param {string} symbol unified market symbol
191475
191769
  * @param {int} [since] the earliest time in ms to fetch trades for
191476
191770
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -191558,6 +191852,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191558
191852
  * @method
191559
191853
  * @name ndax#cancelAllOrders
191560
191854
  * @description cancel all open orders
191855
+ * @see https://apidoc.ndax.io/#cancelallorders
191561
191856
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
191562
191857
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191563
191858
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -191592,6 +191887,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191592
191887
  * @method
191593
191888
  * @name ndax#cancelOrder
191594
191889
  * @description cancels an open order
191890
+ * @see https://apidoc.ndax.io/#cancelorder
191595
191891
  * @param {string} id order id
191596
191892
  * @param {string} symbol unified symbol of the market the order was made in
191597
191893
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -191631,6 +191927,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191631
191927
  * @method
191632
191928
  * @name ndax#fetchOpenOrders
191633
191929
  * @description fetch all unfilled currently open orders
191930
+ * @see https://apidoc.ndax.io/#getopenorders
191634
191931
  * @param {string} symbol unified market symbol
191635
191932
  * @param {int} [since] the earliest time in ms to fetch open orders for
191636
191933
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -191709,6 +192006,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191709
192006
  * @method
191710
192007
  * @name ndax#fetchOrders
191711
192008
  * @description fetches information on multiple orders made by the user
192009
+ * @see https://apidoc.ndax.io/#getorderhistory
191712
192010
  * @param {string} symbol unified market symbol of the market orders were made in
191713
192011
  * @param {int} [since] the earliest time in ms to fetch orders for
191714
192012
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -191803,6 +192101,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191803
192101
  * @method
191804
192102
  * @name ndax#fetchOrder
191805
192103
  * @description fetches information on an order made by the user
192104
+ * @see https://apidoc.ndax.io/#getorderstatus
191806
192105
  * @param {string} symbol unified symbol of the market the order was made in
191807
192106
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191808
192107
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -191878,6 +192177,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191878
192177
  * @method
191879
192178
  * @name ndax#fetchOrderTrades
191880
192179
  * @description fetch all the trades made from a single order
192180
+ * @see https://apidoc.ndax.io/#getorderhistorybyorderid
191881
192181
  * @param {string} id order id
191882
192182
  * @param {string} symbol unified market symbol
191883
192183
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -192106,6 +192406,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
192106
192406
  * @method
192107
192407
  * @name ndax#fetchWithdrawals
192108
192408
  * @description fetch all withdrawals made from an account
192409
+ * @see https://apidoc.ndax.io/#getwithdraws
192109
192410
  * @param {string} code unified currency code
192110
192411
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
192111
192412
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -219330,7 +219631,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219330
219631
  */
219331
219632
  await this.loadMarkets();
219332
219633
  const market = this.market(symbol);
219333
- const channel = 'depth-realtime' + ':' + market['id'];
219634
+ const channel = 'depth' + ':' + market['id'];
219334
219635
  params = this.extend(params, {
219335
219636
  'ch': channel,
219336
219637
  });
@@ -219340,7 +219641,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219340
219641
  async watchOrderBookSnapshot(symbol, limit = undefined, params = {}) {
219341
219642
  await this.loadMarkets();
219342
219643
  const market = this.market(symbol);
219343
- const action = 'depth-snapshot-realtime';
219644
+ const action = 'depth-snapshot';
219344
219645
  const channel = action + ':' + market['id'];
219345
219646
  params = this.extend(params, {
219346
219647
  'action': action,
@@ -219352,6 +219653,15 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219352
219653
  const orderbook = await this.watchPublic(channel, params);
219353
219654
  return orderbook.limit();
219354
219655
  }
219656
+ async fetchOrderBookSnapshot(symbol, limit = undefined, params = {}) {
219657
+ const restOrderBook = await this.fetchRestOrderBookSafe(symbol, limit, params);
219658
+ if (!(symbol in this.orderbooks)) {
219659
+ this.orderbooks[symbol] = this.orderBook();
219660
+ }
219661
+ const orderbook = this.orderbooks[symbol];
219662
+ orderbook.reset(restOrderBook);
219663
+ return orderbook;
219664
+ }
219355
219665
  handleOrderBookSnapshot(client, message) {
219356
219666
  //
219357
219667
  // {
@@ -219988,8 +220298,8 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219988
220298
  'ping': this.handlePing,
219989
220299
  'auth': this.handleAuthenticate,
219990
220300
  'sub': this.handleSubscriptionStatus,
219991
- 'depth-realtime': this.handleOrderBook,
219992
- 'depth-snapshot-realtime': this.handleOrderBookSnapshot,
220301
+ 'depth': this.handleOrderBook,
220302
+ 'depth-snapshot': this.handleOrderBookSnapshot,
219993
220303
  'trades': this.handleTrades,
219994
220304
  'bar': this.handleOHLCV,
219995
220305
  'balance': this.handleBalance,
@@ -220016,7 +220326,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
220016
220326
  // { m: 'sub', id: "1647515701", ch: "depth:BTC/USDT", code: 0 }
220017
220327
  //
220018
220328
  const channel = this.safeString(message, 'ch', '');
220019
- if (channel.indexOf('depth-realtime') > -1) {
220329
+ if (channel.indexOf('depth') > -1 && !(channel.indexOf('depth-snapshot') > -1)) {
220020
220330
  this.handleOrderBookSubscription(client, message);
220021
220331
  }
220022
220332
  return message;
@@ -220025,12 +220335,18 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
220025
220335
  const channel = this.safeString(message, 'ch');
220026
220336
  const parts = channel.split(':');
220027
220337
  const marketId = parts[1];
220028
- const symbol = this.safeSymbol(marketId);
220338
+ const market = this.safeMarket(marketId);
220339
+ const symbol = market['symbol'];
220029
220340
  if (symbol in this.orderbooks) {
220030
220341
  delete this.orderbooks[symbol];
220031
220342
  }
220032
220343
  this.orderbooks[symbol] = this.orderBook({});
220033
- this.spawn(this.watchOrderBookSnapshot, symbol);
220344
+ if (this.options['defaultType'] === 'swap' || market['contract']) {
220345
+ this.spawn(this.fetchOrderBookSnapshot, symbol);
220346
+ }
220347
+ else {
220348
+ this.spawn(this.watchOrderBookSnapshot, symbol);
220349
+ }
220034
220350
  }
220035
220351
  async pong(client, message) {
220036
220352
  //
@@ -227045,6 +227361,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227045
227361
  // "clientOid": "798d1425-d31d-4ada-a51b-ec701e00a1d9",
227046
227362
  // "price": "35000.00",
227047
227363
  // "size": "7.0000",
227364
+ // "newSize": "500.0000",
227048
227365
  // "notional": "7.000000",
227049
227366
  // "orderType": "limit",
227050
227367
  // "force": "gtc",
@@ -227212,6 +227529,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227212
227529
  // "clientOid": "798d1425-d31d-4ada-a51b-ec701e00a1d9",
227213
227530
  // "price": "35000.00",
227214
227531
  // "size": "7.0000",
227532
+ // "newSize": "500.0000",
227215
227533
  // "notional": "7.000000",
227216
227534
  // "orderType": "limit",
227217
227535
  // "force": "gtc",
@@ -227319,6 +227637,25 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227319
227637
  };
227320
227638
  }
227321
227639
  const triggerPrice = this.safeNumber(order, 'triggerPrice');
227640
+ const price = this.safeString(order, 'price');
227641
+ const avgPrice = this.omitZero(this.safeString2(order, 'priceAvg', 'fillPrice'));
227642
+ let cost = this.safeStringN(order, ['notional', 'notionalUsd', 'quoteSize']);
227643
+ const side = this.safeString(order, 'side');
227644
+ const type = this.safeString(order, 'orderType');
227645
+ if (side === 'buy' && market['spot'] && (type === 'market')) {
227646
+ cost = this.safeString(order, 'newSize', cost);
227647
+ }
227648
+ let filled = this.safeString2(order, 'accBaseVolume', 'baseVolume');
227649
+ if (market['spot'] && (rawStatus !== 'live')) {
227650
+ filled = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringDiv(cost, avgPrice);
227651
+ }
227652
+ let amount = this.safeString(order, 'baseVolume');
227653
+ if (!market['spot'] || !(side === 'buy' && type === 'market')) {
227654
+ amount = this.safeString(order, 'newSize', amount);
227655
+ }
227656
+ if (market['swap'] && (amount === undefined)) {
227657
+ amount = this.safeString(order, 'size');
227658
+ }
227322
227659
  return this.safeOrder({
227323
227660
  'info': order,
227324
227661
  'symbol': symbol,
@@ -227327,17 +227664,17 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227327
227664
  'timestamp': timestamp,
227328
227665
  'datetime': this.iso8601(timestamp),
227329
227666
  'lastTradeTimestamp': this.safeInteger(order, 'uTime'),
227330
- 'type': this.safeString(order, 'orderType'),
227667
+ 'type': type,
227331
227668
  'timeInForce': this.safeStringUpper(order, 'force'),
227332
227669
  'postOnly': undefined,
227333
- 'side': this.safeString(order, 'side'),
227334
- 'price': this.safeString(order, 'price'),
227670
+ 'side': side,
227671
+ 'price': price,
227335
227672
  'stopPrice': triggerPrice,
227336
227673
  'triggerPrice': triggerPrice,
227337
- 'amount': this.safeString(order, 'baseVolume'),
227338
- 'cost': this.safeStringN(order, ['notional', 'notionalUsd', 'quoteSize']),
227339
- 'average': this.omitZero(this.safeString2(order, 'priceAvg', 'fillPrice')),
227340
- 'filled': this.safeString2(order, 'accBaseVolume', 'baseVolume'),
227674
+ 'amount': amount,
227675
+ 'cost': cost,
227676
+ 'average': avgPrice,
227677
+ 'filled': filled,
227341
227678
  'remaining': undefined,
227342
227679
  'status': this.parseWsOrderStatus(rawStatus),
227343
227680
  'fee': feeObject,
@@ -232123,7 +232460,7 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
232123
232460
  // usually it takes at least 4-5 deltas to resolve
232124
232461
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 6);
232125
232462
  if (cacheLength === snapshotDelay) {
232126
- this.spawn(this.loadOrderBook, client, messageHash, symbol);
232463
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, null, {});
232127
232464
  }
232128
232465
  storedOrderBook.cache.push(delta);
232129
232466
  return;
@@ -259363,6 +259700,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
259363
259700
  const symbol = this.safeSymbol(marketId);
259364
259701
  const messageHash = 'orderbook:' + symbol;
259365
259702
  const subscription = this.safeValue(client.subscriptions, messageHash);
259703
+ const limit = this.safeInteger(subscription, 'limit');
259366
259704
  if (subscription === true) {
259367
259705
  // we set client.subscriptions[messageHash] to 1
259368
259706
  // once we have received the first delta and initialized the orderbook
@@ -259375,7 +259713,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
259375
259713
  const cacheLength = storedOrderBook.cache.length;
259376
259714
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 25);
259377
259715
  if (cacheLength === snapshotDelay) {
259378
- this.spawn(this.loadOrderBook, client, messageHash, symbol);
259716
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
259379
259717
  }
259380
259718
  storedOrderBook.cache.push(data);
259381
259719
  return;
@@ -287156,9 +287494,9 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
287156
287494
  'fetchBalance': true,
287157
287495
  'fetchCanceledOrders': true,
287158
287496
  'fetchClosedOrders': true,
287497
+ 'fetchDeposit': true,
287159
287498
  'fetchDepositAddress': true,
287160
287499
  'fetchDepositAddresses': true,
287161
- 'fetchDeposit': true,
287162
287500
  'fetchDeposits': true,
287163
287501
  'fetchFundingHistory': false,
287164
287502
  'fetchFundingRate': false,
@@ -288142,6 +288480,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288142
288480
  * @name upbit#createOrder
288143
288481
  * @description create a trade order
288144
288482
  * @see https://docs.upbit.com/reference/%EC%A3%BC%EB%AC%B8%ED%95%98%EA%B8%B0
288483
+ * @see https://global-docs.upbit.com/reference/order
288145
288484
  * @param {string} symbol unified symbol of the market to create an order in
288146
288485
  * @param {string} type 'market' or 'limit'
288147
288486
  * @param {string} side 'buy' or 'sell'
@@ -288149,6 +288488,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288149
288488
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
288150
288489
  * @param {object} [params] extra parameters specific to the exchange API endpoint
288151
288490
  * @param {float} [params.cost] for market buy orders, the quote quantity that can be used as an alternative for the amount
288491
+ * @param {string} [params.timeInForce] 'IOC' or 'FOK'
288152
288492
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
288153
288493
  */
288154
288494
  await this.loadMarkets();
@@ -288205,6 +288545,13 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288205
288545
  if (clientOrderId !== undefined) {
288206
288546
  request['identifier'] = clientOrderId;
288207
288547
  }
288548
+ if (type !== 'market') {
288549
+ const timeInForce = this.safeStringLower2(params, 'timeInForce', 'time_in_force');
288550
+ params = this.omit(params, 'timeInForce');
288551
+ if (timeInForce !== undefined) {
288552
+ request['time_in_force'] = timeInForce;
288553
+ }
288554
+ }
288208
288555
  params = this.omit(params, ['clientOrderId', 'identifier']);
288209
288556
  const response = await this.privatePostOrders(this.extend(request, params));
288210
288557
  //
@@ -288988,7 +289335,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288988
289335
  }
288989
289336
  if (api === 'private') {
288990
289337
  this.checkRequiredCredentials();
288991
- const nonce = this.nonce();
289338
+ const nonce = this.uuid();
288992
289339
  const request = {
288993
289340
  'access_key': this.apiKey,
288994
289341
  'nonce': nonce,
@@ -307318,7 +307665,7 @@ SOFTWARE.
307318
307665
 
307319
307666
  //-----------------------------------------------------------------------------
307320
307667
  // this is updated by vss.js when building
307321
- const version = '4.2.48';
307668
+ const version = '4.2.49';
307322
307669
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
307323
307670
  //-----------------------------------------------------------------------------
307324
307671