ccxt 4.2.47 → 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 (59) hide show
  1. package/README.md +3 -3
  2. package/build.sh +7 -0
  3. package/dist/ccxt.browser.js +681 -84
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/binance.js +10 -4
  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/idex.js +52 -1
  14. package/dist/cjs/src/independentreserve.js +48 -0
  15. package/dist/cjs/src/indodax.js +120 -19
  16. package/dist/cjs/src/latoken.js +16 -0
  17. package/dist/cjs/src/luno.js +18 -0
  18. package/dist/cjs/src/lykke.js +19 -0
  19. package/dist/cjs/src/ndax.js +18 -0
  20. package/dist/cjs/src/okx.js +32 -5
  21. package/dist/cjs/src/pro/ascendex.js +22 -7
  22. package/dist/cjs/src/pro/bitget.js +28 -7
  23. package/dist/cjs/src/pro/bitstamp.js +1 -1
  24. package/dist/cjs/src/pro/hitbtc.js +6 -11
  25. package/dist/cjs/src/pro/mexc.js +2 -1
  26. package/dist/cjs/src/upbit.js +100 -17
  27. package/js/ccxt.d.ts +1 -1
  28. package/js/ccxt.js +1 -1
  29. package/js/src/abstract/bitstamp.d.ts +8 -0
  30. package/js/src/abstract/indodax.d.ts +9 -8
  31. package/js/src/binance.js +10 -4
  32. package/js/src/bitmart.js +30 -4
  33. package/js/src/bitstamp.js +8 -0
  34. package/js/src/btcalpha.js +4 -0
  35. package/js/src/btcmarkets.js +4 -0
  36. package/js/src/btcturk.js +4 -0
  37. package/js/src/bybit.d.ts +3 -1
  38. package/js/src/bybit.js +138 -6
  39. package/js/src/idex.d.ts +7 -0
  40. package/js/src/idex.js +52 -1
  41. package/js/src/independentreserve.d.ts +15 -1
  42. package/js/src/independentreserve.js +48 -0
  43. package/js/src/indodax.d.ts +3 -1
  44. package/js/src/indodax.js +120 -19
  45. package/js/src/latoken.js +16 -0
  46. package/js/src/luno.js +18 -0
  47. package/js/src/lykke.js +19 -0
  48. package/js/src/ndax.js +18 -0
  49. package/js/src/okx.js +32 -5
  50. package/js/src/pro/ascendex.d.ts +1 -0
  51. package/js/src/pro/ascendex.js +22 -7
  52. package/js/src/pro/bitget.js +28 -7
  53. package/js/src/pro/bitstamp.js +1 -1
  54. package/js/src/pro/hitbtc.js +6 -11
  55. package/js/src/pro/mexc.js +2 -1
  56. package/js/src/upbit.d.ts +2 -0
  57. package/js/src/upbit.js +100 -17
  58. package/package.json +3 -1
  59. 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'),
@@ -23830,12 +23834,14 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23830
23834
  const trailingDelta = this.safeString(params, 'trailingDelta');
23831
23835
  const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
23832
23836
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
23837
+ const priceMatch = this.safeString(params, 'priceMatch');
23833
23838
  const isTrailingPercentOrder = trailingPercent !== undefined;
23834
23839
  const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
23835
23840
  const isTakeProfit = takeProfitPrice !== undefined;
23836
23841
  const isTriggerOrder = triggerPrice !== undefined;
23837
23842
  const isConditional = isTriggerOrder || isTrailingPercentOrder || isStopLoss || isTakeProfit;
23838
23843
  const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
23844
+ const isPriceMatch = priceMatch !== undefined;
23839
23845
  let uppercaseType = type.toUpperCase();
23840
23846
  let stopPrice = undefined;
23841
23847
  if (isTrailingPercentOrder) {
@@ -24016,7 +24022,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24016
24022
  request['quantity'] = this.amountToPrecision(symbol, amount);
24017
24023
  }
24018
24024
  }
24019
- if (priceIsRequired) {
24025
+ if (priceIsRequired && !isPriceMatch) {
24020
24026
  if (price === undefined) {
24021
24027
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + ' createOrder() requires a price argument for a ' + type + ' order');
24022
24028
  }
@@ -55753,7 +55759,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55753
55759
  }
55754
55760
  parseTicker(ticker, market = undefined) {
55755
55761
  //
55756
- // spot
55762
+ // spot (REST)
55757
55763
  //
55758
55764
  // {
55759
55765
  // "symbol": "SOLAR_USDT",
@@ -55773,6 +55779,17 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55773
55779
  // "timestamp": 1667403439367
55774
55780
  // }
55775
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
+ //
55776
55793
  // swap
55777
55794
  //
55778
55795
  // {
@@ -55788,7 +55805,11 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55788
55805
  // "legal_coin_price":"0.1302699"
55789
55806
  // }
55790
55807
  //
55791
- 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
+ }
55792
55813
  const marketId = this.safeString2(ticker, 'symbol', 'contract_symbol');
55793
55814
  market = this.safeMarket(marketId, market);
55794
55815
  const symbol = market['symbol'];
@@ -55804,9 +55825,20 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
55804
55825
  percentage = '0';
55805
55826
  }
55806
55827
  }
55807
- const baseVolume = this.safeString(ticker, 'base_volume_24h');
55828
+ let baseVolume = this.safeString(ticker, 'base_volume_24h');
55808
55829
  let quoteVolume = this.safeString(ticker, 'quote_volume_24h');
55809
- 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
+ }
55810
55842
  const average = this.safeString2(ticker, 'avg_price', 'index_price');
55811
55843
  const high = this.safeString2(ticker, 'high_24h', 'high_price');
55812
55844
  const low = this.safeString2(ticker, 'low_24h', 'low_price');
@@ -69146,6 +69178,14 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69146
69178
  'eurcv_address/': 1,
69147
69179
  'pyusd_withdrawal/': 1,
69148
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,
69149
69189
  },
69150
69190
  },
69151
69191
  },
@@ -79219,6 +79259,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
79219
79259
  'cancelOrder': true,
79220
79260
  'closeAllPositions': false,
79221
79261
  'closePosition': false,
79262
+ 'createDepositAddress': false,
79222
79263
  'createOrder': true,
79223
79264
  'createReduceOnlyOrder': false,
79224
79265
  'createStopLimitOrder': false,
@@ -79231,6 +79272,9 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
79231
79272
  'fetchCrossBorrowRate': false,
79232
79273
  'fetchCrossBorrowRates': false,
79233
79274
  'fetchDeposit': false,
79275
+ 'fetchDepositAddress': false,
79276
+ 'fetchDepositAddresses': false,
79277
+ 'fetchDepositAddressesByNetwork': false,
79234
79278
  'fetchDeposits': true,
79235
79279
  'fetchFundingHistory': false,
79236
79280
  'fetchFundingRate': false,
@@ -80753,6 +80797,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80753
80797
  'cancelOrders': true,
80754
80798
  'closeAllPositions': false,
80755
80799
  'closePosition': false,
80800
+ 'createDepositAddress': false,
80756
80801
  'createOrder': true,
80757
80802
  'createReduceOnlyOrder': false,
80758
80803
  'fetchBalance': true,
@@ -80761,6 +80806,9 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80761
80806
  'fetchClosedOrders': 'emulated',
80762
80807
  'fetchCrossBorrowRate': false,
80763
80808
  'fetchCrossBorrowRates': false,
80809
+ 'fetchDepositAddress': false,
80810
+ 'fetchDepositAddresses': false,
80811
+ 'fetchDepositAddressesByNetwork': false,
80764
80812
  'fetchDeposits': true,
80765
80813
  'fetchDepositsWithdrawals': true,
80766
80814
  'fetchFundingHistory': false,
@@ -82018,6 +82066,7 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82018
82066
  'cancelOrder': true,
82019
82067
  'closeAllPositions': false,
82020
82068
  'closePosition': false,
82069
+ 'createDepositAddress': false,
82021
82070
  'createOrder': true,
82022
82071
  'createReduceOnlyOrder': false,
82023
82072
  'fetchBalance': true,
@@ -82025,6 +82074,9 @@ class btcturk extends _abstract_btcturk_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
82025
82074
  'fetchBorrowRateHistory': false,
82026
82075
  'fetchCrossBorrowRate': false,
82027
82076
  'fetchCrossBorrowRates': false,
82077
+ 'fetchDepositAddress': false,
82078
+ 'fetchDepositAddresses': false,
82079
+ 'fetchDepositAddressesByNetwork': false,
82028
82080
  'fetchFundingHistory': false,
82029
82081
  'fetchFundingRate': false,
82030
82082
  'fetchFundingRateHistory': false,
@@ -83019,6 +83071,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
83019
83071
  'fetchMarketLeverageTiers': true,
83020
83072
  'fetchMarkets': true,
83021
83073
  'fetchMarkOHLCV': true,
83074
+ 'fetchMyLiquidations': true,
83022
83075
  'fetchMySettlementHistory': true,
83023
83076
  'fetchMyTrades': true,
83024
83077
  'fetchOHLCV': true,
@@ -87514,7 +87567,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
87514
87567
  let paginate = false;
87515
87568
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
87516
87569
  if (paginate) {
87517
- 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);
87518
87571
  }
87519
87572
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
87520
87573
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -87692,7 +87745,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
87692
87745
  let paginate = false;
87693
87746
  [paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
87694
87747
  if (paginate) {
87695
- 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);
87696
87749
  }
87697
87750
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
87698
87751
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -88064,7 +88117,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
88064
88117
  let paginate = false;
88065
88118
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
88066
88119
  if (paginate) {
88067
- 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);
88068
88121
  }
88069
88122
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
88070
88123
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -88266,7 +88319,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
88266
88319
  let paginate = false;
88267
88320
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
88268
88321
  if (paginate) {
88269
- 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);
88270
88323
  }
88271
88324
  let request = {
88272
88325
  // 'coin': currency['id'],
@@ -88334,7 +88387,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
88334
88387
  let paginate = false;
88335
88388
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
88336
88389
  if (paginate) {
88337
- 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);
88338
88391
  }
88339
88392
  let request = {
88340
88393
  // 'coin': currency['id'],
@@ -89854,7 +89907,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
89854
89907
  let paginate = false;
89855
89908
  [paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
89856
89909
  if (paginate) {
89857
- 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);
89858
89911
  }
89859
89912
  let currency = undefined;
89860
89913
  let request = {};
@@ -90689,6 +90742,137 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
90689
90742
  'info': greeks,
90690
90743
  };
90691
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
+ }
90692
90876
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
90693
90877
  let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
90694
90878
  if (api === 'public') {
@@ -158184,8 +158368,10 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158184
158368
  'fetchPositions': false,
158185
158369
  'fetchPositionsRisk': false,
158186
158370
  'fetchPremiumIndexOHLCV': false,
158371
+ 'fetchStatus': true,
158187
158372
  'fetchTicker': true,
158188
158373
  'fetchTickers': true,
158374
+ 'fetchTime': true,
158189
158375
  'fetchTrades': true,
158190
158376
  'fetchTradingFee': false,
158191
158377
  'fetchTradingFees': true,
@@ -158299,6 +158485,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158299
158485
  * @method
158300
158486
  * @name idex#fetchMarkets
158301
158487
  * @description retrieves data on all markets for idex
158488
+ * @see https://api-docs-v3.idex.io/#get-markets
158302
158489
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158303
158490
  * @returns {object[]} an array of objects representing market data
158304
158491
  */
@@ -158429,6 +158616,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158429
158616
  * @method
158430
158617
  * @name idex#fetchTicker
158431
158618
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
158619
+ * @see https://api-docs-v3.idex.io/#get-tickers
158432
158620
  * @param {string} symbol unified symbol of the market to fetch the ticker for
158433
158621
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158434
158622
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -158465,6 +158653,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158465
158653
  * @method
158466
158654
  * @name idex#fetchTickers
158467
158655
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
158656
+ * @see https://api-docs-v3.idex.io/#get-tickers
158468
158657
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
158469
158658
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158470
158659
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -158541,6 +158730,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158541
158730
  * @method
158542
158731
  * @name idex#fetchOHLCV
158543
158732
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
158733
+ * @see https://api-docs-v3.idex.io/#get-candles
158544
158734
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
158545
158735
  * @param {string} timeframe the length of time each candle represents
158546
158736
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -158603,6 +158793,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158603
158793
  * @method
158604
158794
  * @name idex#fetchTrades
158605
158795
  * @description get the list of most recent trades for a particular symbol
158796
+ * @see https://api-docs-v3.idex.io/#get-trades
158606
158797
  * @param {string} symbol unified symbol of the market to fetch trades for
158607
158798
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
158608
158799
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -158716,6 +158907,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158716
158907
  * @method
158717
158908
  * @name idex#fetchTradingFees
158718
158909
  * @description fetch the trading fees for multiple markets
158910
+ * @see https://api-docs-v3.idex.io/#get-api-account
158719
158911
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158720
158912
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
158721
158913
  */
@@ -158761,6 +158953,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158761
158953
  * @method
158762
158954
  * @name idex#fetchOrderBook
158763
158955
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
158956
+ * @see https://api-docs-v3.idex.io/#get-order-books
158764
158957
  * @param {string} symbol unified symbol of the market to fetch the order book for
158765
158958
  * @param {int} [limit] the maximum amount of order book entries to return
158766
158959
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -158824,6 +159017,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158824
159017
  * @method
158825
159018
  * @name idex#fetchCurrencies
158826
159019
  * @description fetches all available currencies on an exchange
159020
+ * @see https://api-docs-v3.idex.io/#get-assets
158827
159021
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158828
159022
  * @returns {object} an associative dictionary of currencies
158829
159023
  */
@@ -158889,6 +159083,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158889
159083
  * @method
158890
159084
  * @name idex#fetchBalance
158891
159085
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
159086
+ * @see https://api-docs-v3.idex.io/#get-balances
158892
159087
  * @param {object} [params] extra parameters specific to the exchange API endpoint
158893
159088
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
158894
159089
  */
@@ -158933,6 +159128,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
158933
159128
  * @method
158934
159129
  * @name idex#fetchMyTrades
158935
159130
  * @description fetch all trades made by the user
159131
+ * @see https://api-docs-v3.idex.io/#get-fills
158936
159132
  * @param {string} symbol unified market symbol
158937
159133
  * @param {int} [since] the earliest time in ms to fetch trades for
158938
159134
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -159001,6 +159197,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159001
159197
  * @method
159002
159198
  * @name idex#fetchOrder
159003
159199
  * @description fetches information on an order made by the user
159200
+ * @see https://api-docs-v3.idex.io/#get-orders
159004
159201
  * @param {string} symbol unified symbol of the market the order was made in
159005
159202
  * @param {object} [params] extra parameters specific to the exchange API endpoint
159006
159203
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -159015,6 +159212,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159015
159212
  * @method
159016
159213
  * @name idex#fetchOpenOrders
159017
159214
  * @description fetch all unfilled currently open orders
159215
+ * @see https://api-docs-v3.idex.io/#get-orders
159018
159216
  * @param {string} symbol unified market symbol
159019
159217
  * @param {int} [since] the earliest time in ms to fetch open orders for
159020
159218
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -159031,6 +159229,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159031
159229
  * @method
159032
159230
  * @name idex#fetchClosedOrders
159033
159231
  * @description fetches information on multiple closed orders made by the user
159232
+ * @see https://api-docs-v3.idex.io/#get-orders
159034
159233
  * @param {string} symbol unified market symbol of the market orders were made in
159035
159234
  * @param {int} [since] the earliest time in ms to fetch orders for
159036
159235
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -159242,16 +159441,20 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159242
159441
  * @method
159243
159442
  * @name idex#createOrder
159244
159443
  * @description create a trade order, https://docs.idex.io/#create-order
159444
+ * @see https://api-docs-v3.idex.io/#create-order
159245
159445
  * @param {string} symbol unified symbol of the market to create an order in
159246
159446
  * @param {string} type 'market' or 'limit'
159247
159447
  * @param {string} side 'buy' or 'sell'
159248
159448
  * @param {float} amount how much of currency you want to trade in units of base currency
159249
159449
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
159250
159450
  * @param {object} [params] extra parameters specific to the exchange API endpoint
159451
+ * @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
159251
159452
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
159252
159453
  */
159253
159454
  this.checkRequiredCredentials();
159254
159455
  await this.loadMarkets();
159456
+ const testOrder = this.safeBool(params, 'test', false);
159457
+ params = this.omit(params, 'test');
159255
159458
  const market = this.market(symbol);
159256
159459
  const nonce = this.uuidv1();
159257
159460
  let typeEnum = undefined;
@@ -159432,7 +159635,13 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159432
159635
  // "avgExecutionPrice": "0.09905990"
159433
159636
  // }
159434
159637
  // we don't use extend here because it is a signed endpoint
159435
- const response = await this.privatePostOrders(request);
159638
+ let response = undefined;
159639
+ if (testOrder) {
159640
+ response = await this.privatePostOrdersTest(request);
159641
+ }
159642
+ else {
159643
+ response = await this.privatePostOrders(request);
159644
+ }
159436
159645
  return this.parseOrder(response, market);
159437
159646
  }
159438
159647
  async withdraw(code, amount, address, tag = undefined, params = {}) {
@@ -159440,6 +159649,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159440
159649
  * @method
159441
159650
  * @name idex#withdraw
159442
159651
  * @description make a withdrawal
159652
+ * @see https://api-docs-v3.idex.io/#withdraw-funds
159443
159653
  * @param {string} code unified currency code
159444
159654
  * @param {float} amount the amount to withdraw
159445
159655
  * @param {string} address the address to withdraw to
@@ -159493,6 +159703,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159493
159703
  * @method
159494
159704
  * @name idex#cancelAllOrders
159495
159705
  * @description cancel all open orders
159706
+ * @see https://api-docs-v3.idex.io/#cancel-order
159496
159707
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
159497
159708
  * @param {object} [params] extra parameters specific to the exchange API endpoint
159498
159709
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -159532,6 +159743,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159532
159743
  * @method
159533
159744
  * @name idex#cancelOrder
159534
159745
  * @description cancels an open order
159746
+ * @see https://api-docs-v3.idex.io/#cancel-order
159535
159747
  * @param {string} id order id
159536
159748
  * @param {string} symbol unified symbol of the market the order was made in
159537
159749
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -159583,6 +159795,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159583
159795
  * @method
159584
159796
  * @name idex#fetchDeposit
159585
159797
  * @description fetch information on a deposit
159798
+ * @see https://api-docs-v3.idex.io/#get-deposits
159586
159799
  * @param {string} id deposit id
159587
159800
  * @param {string} code not used by idex fetchDeposit ()
159588
159801
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -159603,6 +159816,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159603
159816
  * @method
159604
159817
  * @name idex#fetchDeposits
159605
159818
  * @description fetch all deposits made to an account
159819
+ * @see https://api-docs-v3.idex.io/#get-deposits
159606
159820
  * @param {string} code unified currency code
159607
159821
  * @param {int} [since] the earliest time in ms to fetch deposits for
159608
159822
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -159614,11 +159828,30 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159614
159828
  }, params);
159615
159829
  return await this.fetchTransactionsHelper(code, since, limit, params);
159616
159830
  }
159831
+ async fetchStatus(params = {}) {
159832
+ /**
159833
+ * @method
159834
+ * @name idex#fetchStatus
159835
+ * @description the latest known information on the availability of the exchange API
159836
+ * @see https://api-docs-v3.idex.io/#get-ping
159837
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
159838
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
159839
+ */
159840
+ const response = await this.publicGetPing(params);
159841
+ return {
159842
+ 'status': 'ok',
159843
+ 'updated': undefined,
159844
+ 'eta': undefined,
159845
+ 'url': undefined,
159846
+ 'info': response,
159847
+ };
159848
+ }
159617
159849
  async fetchTime(params = {}) {
159618
159850
  /**
159619
159851
  * @method
159620
159852
  * @name idex#fetchTime
159621
159853
  * @description fetches the current integer timestamp in milliseconds from the exchange server
159854
+ * @see https://api-docs-v3.idex.io/#get-time
159622
159855
  * @param {object} [params] extra parameters specific to the exchange API endpoint
159623
159856
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
159624
159857
  */
@@ -159633,6 +159866,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159633
159866
  * @method
159634
159867
  * @name idex#fetchWithdrawal
159635
159868
  * @description fetch data on a currency withdrawal via the withdrawal id
159869
+ * @see https://api-docs-v3.idex.io/#get-withdrawals
159636
159870
  * @param {string} id withdrawal id
159637
159871
  * @param {string} code not used by idex.fetchWithdrawal
159638
159872
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -159653,6 +159887,7 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
159653
159887
  * @method
159654
159888
  * @name idex#fetchWithdrawals
159655
159889
  * @description fetch all withdrawals made from an account
159890
+ * @see https://api-docs-v3.idex.io/#get-withdrawals
159656
159891
  * @param {string} code unified currency code
159657
159892
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
159658
159893
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -159982,6 +160217,9 @@ class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORT
159982
160217
  'fetchClosedOrders': true,
159983
160218
  'fetchCrossBorrowRate': false,
159984
160219
  'fetchCrossBorrowRates': false,
160220
+ 'fetchDepositAddress': true,
160221
+ 'fetchDepositAddresses': false,
160222
+ 'fetchDepositAddressesByNetwork': false,
159985
160223
  'fetchFundingHistory': false,
159986
160224
  'fetchFundingRate': false,
159987
160225
  'fetchFundingRateHistory': false,
@@ -160661,6 +160899,51 @@ class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORT
160661
160899
  };
160662
160900
  return await this.privatePostCancelOrder(this.extend(request, params));
160663
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
+ }
160664
160947
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
160665
160948
  let url = this.urls['api'][api] + '/' + path;
160666
160949
  if (api === 'public') {
@@ -160808,7 +161091,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
160808
161091
  'urls': {
160809
161092
  'logo': 'https://user-images.githubusercontent.com/51840849/87070508-9358c880-c221-11ea-8dc5-5391afbbb422.jpg',
160810
161093
  'api': {
160811
- 'public': 'https://indodax.com/api',
161094
+ 'public': 'https://indodax.com',
160812
161095
  'private': 'https://indodax.com/tapi',
160813
161096
  },
160814
161097
  'www': 'https://www.indodax.com',
@@ -160818,14 +161101,15 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
160818
161101
  'api': {
160819
161102
  'public': {
160820
161103
  'get': {
160821
- 'server_time': 5,
160822
- 'pairs': 5,
160823
- 'price_increments': 5,
160824
- 'summaries': 5,
160825
- 'ticker_all': 5,
160826
- '{pair}/ticker': 5,
160827
- '{pair}/trades': 5,
160828
- '{pair}/depth': 5,
161104
+ 'api/server_time': 5,
161105
+ 'api/pairs': 5,
161106
+ 'api/price_increments': 5,
161107
+ 'api/summaries': 5,
161108
+ 'api/ticker/{pair}': 5,
161109
+ 'api/ticker_all': 5,
161110
+ 'api/trades/{pair}': 5,
161111
+ 'api/depth/{pair}': 5,
161112
+ 'tradingview/history_v2': 5,
160829
161113
  },
160830
161114
  },
160831
161115
  'private': {
@@ -160890,6 +161174,16 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
160890
161174
  // 'ETH': 'eth'
160891
161175
  // 'BASE': 'base'
160892
161176
  },
161177
+ 'timeframes': {
161178
+ '1m': '1',
161179
+ '15m': '15',
161180
+ '30m': '30',
161181
+ '1h': '60',
161182
+ '4h': '240',
161183
+ '1d': '1D',
161184
+ '3d': '3D',
161185
+ '1w': '1W',
161186
+ },
160893
161187
  },
160894
161188
  'commonCurrencies': {
160895
161189
  'STR': 'XLM',
@@ -160909,10 +161203,11 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
160909
161203
  * @method
160910
161204
  * @name indodax#fetchTime
160911
161205
  * @description fetches the current integer timestamp in milliseconds from the exchange server
161206
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#server-time
160912
161207
  * @param {object} [params] extra parameters specific to the exchange API endpoint
160913
161208
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
160914
161209
  */
160915
- const response = await this.publicGetServerTime(params);
161210
+ const response = await this.publicGetApiServerTime(params);
160916
161211
  //
160917
161212
  // {
160918
161213
  // "timezone": "UTC",
@@ -160926,10 +161221,11 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
160926
161221
  * @method
160927
161222
  * @name indodax#fetchMarkets
160928
161223
  * @description retrieves data on all markets for indodax
161224
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#pairs
160929
161225
  * @param {object} [params] extra parameters specific to the exchange API endpoint
160930
161226
  * @returns {object[]} an array of objects representing market data
160931
161227
  */
160932
- const response = await this.publicGetPairs(params);
161228
+ const response = await this.publicGetApiPairs(params);
160933
161229
  //
160934
161230
  // [
160935
161231
  // {
@@ -161046,6 +161342,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161046
161342
  * @method
161047
161343
  * @name indodax#fetchBalance
161048
161344
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
161345
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#get-info-endpoint
161049
161346
  * @param {object} [params] extra parameters specific to the exchange API endpoint
161050
161347
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
161051
161348
  */
@@ -161088,6 +161385,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161088
161385
  * @method
161089
161386
  * @name indodax#fetchOrderBook
161090
161387
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
161388
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#depth
161091
161389
  * @param {string} symbol unified symbol of the market to fetch the order book for
161092
161390
  * @param {int} [limit] the maximum amount of order book entries to return
161093
161391
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -161096,9 +161394,9 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161096
161394
  await this.loadMarkets();
161097
161395
  const market = this.market(symbol);
161098
161396
  const request = {
161099
- 'pair': market['id'],
161397
+ 'pair': market['base'] + market['quote'],
161100
161398
  };
161101
- const orderbook = await this.publicGetPairDepth(this.extend(request, params));
161399
+ const orderbook = await this.publicGetApiDepthPair(this.extend(request, params));
161102
161400
  return this.parseOrderBook(orderbook, market['symbol'], undefined, 'buy', 'sell');
161103
161401
  }
161104
161402
  parseTicker(ticker, market = undefined) {
@@ -161147,6 +161445,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161147
161445
  * @method
161148
161446
  * @name indodax#fetchTicker
161149
161447
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
161448
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#ticker
161150
161449
  * @param {string} symbol unified symbol of the market to fetch the ticker for
161151
161450
  * @param {object} [params] extra parameters specific to the exchange API endpoint
161152
161451
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -161154,9 +161453,9 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161154
161453
  await this.loadMarkets();
161155
161454
  const market = this.market(symbol);
161156
161455
  const request = {
161157
- 'pair': market['id'],
161456
+ 'pair': market['base'] + market['quote'],
161158
161457
  };
161159
- const response = await this.publicGetPairTicker(this.extend(request, params));
161458
+ const response = await this.publicGetApiTickerPair(this.extend(request, params));
161160
161459
  //
161161
161460
  // {
161162
161461
  // "ticker": {
@@ -161201,7 +161500,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161201
161500
  // }
161202
161501
  // }
161203
161502
  //
161204
- const response = await this.publicGetTickerAll(params);
161503
+ const response = await this.publicGetApiTickerAll(params);
161205
161504
  const tickers = this.safeValue(response, 'tickers');
161206
161505
  return this.parseTickers(tickers, symbols);
161207
161506
  }
@@ -161228,6 +161527,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161228
161527
  * @method
161229
161528
  * @name indodax#fetchTrades
161230
161529
  * @description get the list of most recent trades for a particular symbol
161530
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#trades
161231
161531
  * @param {string} symbol unified symbol of the market to fetch trades for
161232
161532
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
161233
161533
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -161237,11 +161537,81 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161237
161537
  await this.loadMarkets();
161238
161538
  const market = this.market(symbol);
161239
161539
  const request = {
161240
- 'pair': market['id'],
161540
+ 'pair': market['base'] + market['quote'],
161241
161541
  };
161242
- const response = await this.publicGetPairTrades(this.extend(request, params));
161542
+ const response = await this.publicGetApiTradesPair(this.extend(request, params));
161243
161543
  return this.parseTrades(response, market, since, limit);
161244
161544
  }
161545
+ parseOHLCV(ohlcv, market = undefined) {
161546
+ //
161547
+ // {
161548
+ // "Time": 1708416900,
161549
+ // "Open": 51707.52,
161550
+ // "High": 51707.52,
161551
+ // "Low": 51707.52,
161552
+ // "Close": 51707.52,
161553
+ // "Volume": "0"
161554
+ // }
161555
+ //
161556
+ return [
161557
+ this.safeTimestamp(ohlcv, 'Time'),
161558
+ this.safeNumber(ohlcv, 'Open'),
161559
+ this.safeNumber(ohlcv, 'High'),
161560
+ this.safeNumber(ohlcv, 'Low'),
161561
+ this.safeNumber(ohlcv, 'Close'),
161562
+ this.safeNumber(ohlcv, 'Volume'),
161563
+ ];
161564
+ }
161565
+ async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
161566
+ /**
161567
+ * @method
161568
+ * @name indodax#fetchOHLCV
161569
+ * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
161570
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
161571
+ * @param {string} timeframe the length of time each candle represents
161572
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
161573
+ * @param {int} [limit] the maximum amount of candles to fetch
161574
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
161575
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
161576
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
161577
+ */
161578
+ await this.loadMarkets();
161579
+ const market = this.market(symbol);
161580
+ const timeframes = this.options['timeframes'];
161581
+ const selectedTimeframe = this.safeString(timeframes, timeframe, timeframe);
161582
+ const now = this.seconds();
161583
+ const until = this.safeInteger2(params, 'until', 'till', now);
161584
+ params = this.omit(params, ['until', 'till']);
161585
+ const request = {
161586
+ 'to': until,
161587
+ 'tf': selectedTimeframe,
161588
+ 'symbol': market['base'] + market['quote'],
161589
+ };
161590
+ if (limit === undefined) {
161591
+ limit = 1000;
161592
+ }
161593
+ if (since !== undefined) {
161594
+ request['from'] = Math.floor(since / 1000);
161595
+ }
161596
+ else {
161597
+ const duration = this.parseTimeframe(timeframe);
161598
+ request['from'] = now - limit * duration - 1;
161599
+ }
161600
+ const response = await this.publicGetTradingviewHistoryV2(this.extend(request, params));
161601
+ //
161602
+ // [
161603
+ // {
161604
+ // "Time": 1708416900,
161605
+ // "Open": 51707.52,
161606
+ // "High": 51707.52,
161607
+ // "Low": 51707.52,
161608
+ // "Close": 51707.52,
161609
+ // "Volume": "0"
161610
+ // }
161611
+ // ]
161612
+ //
161613
+ return this.parseOHLCVs(response, market, timeframe, since, limit);
161614
+ }
161245
161615
  parseOrderStatus(status) {
161246
161616
  const statuses = {
161247
161617
  'open': 'open',
@@ -161333,6 +161703,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161333
161703
  * @method
161334
161704
  * @name indodax#fetchOrder
161335
161705
  * @description fetches information on an order made by the user
161706
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#get-order-endpoints
161336
161707
  * @param {string} symbol unified symbol of the market the order was made in
161337
161708
  * @param {object} [params] extra parameters specific to the exchange API endpoint
161338
161709
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -161357,6 +161728,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161357
161728
  * @method
161358
161729
  * @name indodax#fetchOpenOrders
161359
161730
  * @description fetch all unfilled currently open orders
161731
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#open-orders-endpoints
161360
161732
  * @param {string} symbol unified market symbol
161361
161733
  * @param {int} [since] the earliest time in ms to fetch open orders for
161362
161734
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -161397,6 +161769,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161397
161769
  * @method
161398
161770
  * @name indodax#fetchClosedOrders
161399
161771
  * @description fetches information on multiple closed orders made by the user
161772
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#order-history
161400
161773
  * @param {string} symbol unified market symbol of the market orders were made in
161401
161774
  * @param {int} [since] the earliest time in ms to fetch orders for
161402
161775
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -161421,6 +161794,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161421
161794
  * @method
161422
161795
  * @name indodax#createOrder
161423
161796
  * @description create a trade order
161797
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#trade-endpoints
161424
161798
  * @param {string} symbol unified symbol of the market to create an order in
161425
161799
  * @param {string} type 'market' or 'limit'
161426
161800
  * @param {string} side 'buy' or 'sell'
@@ -161460,6 +161834,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161460
161834
  * @method
161461
161835
  * @name indodax#cancelOrder
161462
161836
  * @description cancels an open order
161837
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#cancel-order-endpoints
161463
161838
  * @param {string} id order id
161464
161839
  * @param {string} symbol unified symbol of the market the order was made in
161465
161840
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -161486,6 +161861,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161486
161861
  * @method
161487
161862
  * @name indodax#fetchTransactionFee
161488
161863
  * @description fetch the fee for a transaction
161864
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#withdraw-fee-endpoints
161489
161865
  * @param {string} code unified currency code
161490
161866
  * @param {object} [params] extra parameters specific to the exchange API endpoint
161491
161867
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -161519,6 +161895,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161519
161895
  * @method
161520
161896
  * @name indodax#fetchDepositsWithdrawals
161521
161897
  * @description fetch history of deposits and withdrawals
161898
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#transaction-history-endpoints
161522
161899
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
161523
161900
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
161524
161901
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -161620,6 +161997,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161620
161997
  * @method
161621
161998
  * @name indodax#withdraw
161622
161999
  * @description make a withdrawal
162000
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#withdraw-coin-endpoints
161623
162001
  * @param {string} code unified currency code
161624
162002
  * @param {float} amount the amount to withdraw
161625
162003
  * @param {string} address the address to withdraw to
@@ -161753,6 +162131,7 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161753
162131
  * @method
161754
162132
  * @name indodax#fetchDepositAddresses
161755
162133
  * @description fetch deposit addresses for multiple currencies and chain types
162134
+ * @see https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#general-information-on-endpoints
161756
162135
  * @param {string[]} [codes] list of unified currency codes, default is undefined
161757
162136
  * @param {object} [params] extra parameters specific to the exchange API endpoint
161758
162137
  * @returns {object} a list of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -161835,7 +162214,12 @@ class indodax extends _abstract_indodax_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
161835
162214
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
161836
162215
  let url = this.urls['api'][api];
161837
162216
  if (api === 'public') {
161838
- url += '/' + this.implodeParams(path, params);
162217
+ const query = this.omit(params, this.extractParams(path));
162218
+ const requestPath = '/' + this.implodeParams(path, params);
162219
+ url = url + requestPath;
162220
+ if (Object.keys(query).length) {
162221
+ url += '?' + this.urlencodeWithArrayRepeat(query);
162222
+ }
161839
162223
  }
161840
162224
  else {
161841
162225
  this.checkRequiredCredentials();
@@ -176641,6 +177025,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
176641
177025
  * @method
176642
177026
  * @name latoken#fetchTime
176643
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
176644
177029
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176645
177030
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
176646
177031
  */
@@ -176657,6 +177042,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
176657
177042
  * @method
176658
177043
  * @name latoken#fetchMarkets
176659
177044
  * @description retrieves data on all markets for latoken
177045
+ * @see https://api.latoken.com/doc/v2/#tag/Pair/operation/getActivePairs
176660
177046
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176661
177047
  * @returns {object[]} an array of objects representing market data
176662
177048
  */
@@ -176893,6 +177279,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
176893
177279
  * @method
176894
177280
  * @name latoken#fetchBalance
176895
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
176896
177283
  * @param {object} [params] extra parameters specific to the exchange API endpoint
176897
177284
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
176898
177285
  */
@@ -176959,6 +177346,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
176959
177346
  * @method
176960
177347
  * @name latoken#fetchOrderBook
176961
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
176962
177350
  * @param {string} symbol unified symbol of the market to fetch the order book for
176963
177351
  * @param {int} [limit] the maximum amount of order book entries to return
176964
177352
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -177044,6 +177432,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177044
177432
  * @method
177045
177433
  * @name latoken#fetchTicker
177046
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
177047
177436
  * @param {string} symbol unified symbol of the market to fetch the ticker for
177048
177437
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177049
177438
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -177082,6 +177471,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177082
177471
  * @method
177083
177472
  * @name latoken#fetchTickers
177084
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
177085
177475
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
177086
177476
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177087
177477
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -177204,6 +177594,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177204
177594
  * @method
177205
177595
  * @name latoken#fetchTrades
177206
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
177207
177598
  * @param {string} symbol unified symbol of the market to fetch trades for
177208
177599
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
177209
177600
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -177236,6 +177627,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177236
177627
  * @method
177237
177628
  * @name latoken#fetchTradingFee
177238
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
177239
177632
  * @param {string} symbol unified market symbol
177240
177633
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177241
177634
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -177305,6 +177698,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177305
177698
  * @method
177306
177699
  * @name latoken#fetchMyTrades
177307
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
177308
177703
  * @param {string} symbol unified market symbol
177309
177704
  * @param {int} [since] the earliest time in ms to fetch trades for
177310
177705
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -177812,6 +178207,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177812
178207
  * @name latoken#fetchTransactions
177813
178208
  * @deprecated
177814
178209
  * @description use fetchDepositsWithdrawals instead
178210
+ * @see https://api.latoken.com/doc/v2/#tag/Transaction/operation/getUserTransactions
177815
178211
  * @param {string} code unified currency code for the currency of the transactions, default is undefined
177816
178212
  * @param {int} [since] timestamp in ms of the earliest transaction, default is undefined
177817
178213
  * @param {int} [limit] max number of transactions to return, default is undefined
@@ -177940,6 +178336,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177940
178336
  * @method
177941
178337
  * @name latoken#fetchTransfers
177942
178338
  * @description fetch a history of internal transfers made on an account
178339
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
177943
178340
  * @param {string} code unified currency code of the currency transferred
177944
178341
  * @param {int} [since] the earliest time in ms to fetch transfers for
177945
178342
  * @param {int} [limit] the maximum number of transfers structures to retrieve
@@ -177988,6 +178385,9 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
177988
178385
  * @method
177989
178386
  * @name latoken#transfer
177990
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
177991
178391
  * @param {string} code unified currency code
177992
178392
  * @param {float} amount amount to transfer
177993
178393
  * @param {string} fromAccount account to transfer from
@@ -181197,6 +181597,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181197
181597
  * @method
181198
181598
  * @name luno#fetchMarkets
181199
181599
  * @description retrieves data on all markets for luno
181600
+ * @see https://www.luno.com/en/developers/api#tag/Market/operation/Markets
181200
181601
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181201
181602
  * @returns {object[]} an array of objects representing market data
181202
181603
  */
@@ -181287,6 +181688,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181287
181688
  * @method
181288
181689
  * @name luno#fetchAccounts
181289
181690
  * @description fetch all the accounts associated with a profile
181691
+ * @see https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
181290
181692
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181291
181693
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
181292
181694
  */
@@ -181341,6 +181743,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181341
181743
  * @method
181342
181744
  * @name luno#fetchBalance
181343
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
181344
181747
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181345
181748
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
181346
181749
  */
@@ -181363,6 +181766,8 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181363
181766
  * @method
181364
181767
  * @name luno#fetchOrderBook
181365
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
181366
181771
  * @param {string} symbol unified symbol of the market to fetch the order book for
181367
181772
  * @param {int} [limit] the maximum amount of order book entries to return
181368
181773
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -181471,6 +181876,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181471
181876
  * @method
181472
181877
  * @name luno#fetchOrder
181473
181878
  * @description fetches information on an order made by the user
181879
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/GetOrder
181474
181880
  * @param {string} symbol not used by luno fetchOrder
181475
181881
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181476
181882
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -181502,6 +181908,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181502
181908
  * @method
181503
181909
  * @name luno#fetchOrders
181504
181910
  * @description fetches information on multiple orders made by the user
181911
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
181505
181912
  * @param {string} symbol unified market symbol of the market orders were made in
181506
181913
  * @param {int} [since] the earliest time in ms to fetch orders for
181507
181914
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -181515,6 +181922,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181515
181922
  * @method
181516
181923
  * @name luno#fetchOpenOrders
181517
181924
  * @description fetch all unfilled currently open orders
181925
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
181518
181926
  * @param {string} symbol unified market symbol
181519
181927
  * @param {int} [since] the earliest time in ms to fetch open orders for
181520
181928
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -181528,6 +181936,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181528
181936
  * @method
181529
181937
  * @name luno#fetchClosedOrders
181530
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
181531
181940
  * @param {string} symbol unified market symbol of the market orders were made in
181532
181941
  * @param {int} [since] the earliest time in ms to fetch orders for
181533
181942
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -181578,6 +181987,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181578
181987
  * @method
181579
181988
  * @name luno#fetchTickers
181580
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
181581
181991
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
181582
181992
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181583
181993
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -181602,6 +182012,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181602
182012
  * @method
181603
182013
  * @name luno#fetchTicker
181604
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
181605
182016
  * @param {string} symbol unified symbol of the market to fetch the ticker for
181606
182017
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181607
182018
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -181723,6 +182134,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181723
182134
  * @method
181724
182135
  * @name luno#fetchTrades
181725
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
181726
182138
  * @param {string} symbol unified symbol of the market to fetch trades for
181727
182139
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
181728
182140
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -181823,6 +182235,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181823
182235
  * @method
181824
182236
  * @name luno#fetchMyTrades
181825
182237
  * @description fetch all trades made by the user
182238
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListUserTrades
181826
182239
  * @param {string} symbol unified market symbol
181827
182240
  * @param {int} [since] the earliest time in ms to fetch trades for
181828
182241
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -181873,6 +182286,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181873
182286
  * @method
181874
182287
  * @name luno#fetchTradingFee
181875
182288
  * @description fetch the trading fees for a market
182289
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/getFeeInfo
181876
182290
  * @param {string} symbol unified market symbol
181877
182291
  * @param {object} [params] extra parameters specific to the exchange API endpoint
181878
182292
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -181902,6 +182316,8 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181902
182316
  * @method
181903
182317
  * @name luno#createOrder
181904
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
181905
182321
  * @param {string} symbol unified symbol of the market to create an order in
181906
182322
  * @param {string} type 'market' or 'limit'
181907
182323
  * @param {string} side 'buy' or 'sell'
@@ -181943,6 +182359,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181943
182359
  * @method
181944
182360
  * @name luno#cancelOrder
181945
182361
  * @description cancels an open order
182362
+ * @see https://www.luno.com/en/developers/api#tag/Orders/operation/StopOrder
181946
182363
  * @param {string} id order id
181947
182364
  * @param {string} symbol unified symbol of the market the order was made in
181948
182365
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -181974,6 +182391,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
181974
182391
  * @method
181975
182392
  * @name luno#fetchLedger
181976
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
181977
182395
  * @param {string} code unified currency code, default is undefined
181978
182396
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
181979
182397
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -182334,6 +182752,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182334
182752
  * @method
182335
182753
  * @name lykke#fetchCurrencies
182336
182754
  * @description fetches all available currencies on an exchange
182755
+ * @see https://lykkecity.github.io/Trading-API/#get-all-assets
182337
182756
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182338
182757
  * @returns {object} an associative dictionary of currencies
182339
182758
  */
@@ -182412,6 +182831,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182412
182831
  * @method
182413
182832
  * @name lykke#fetchMarkets
182414
182833
  * @description retrieves data on all markets for lykke
182834
+ * @see https://lykkecity.github.io/Trading-API/#get-asset-by-id
182415
182835
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182416
182836
  * @returns {object[]} an array of objects representing market data
182417
182837
  */
@@ -182571,6 +182991,8 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182571
182991
  * @method
182572
182992
  * @name lykke#fetchTicker
182573
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
182574
182996
  * @param {string} symbol unified symbol of the market to fetch the ticker for
182575
182997
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182576
182998
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -182630,6 +183052,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182630
183052
  * @method
182631
183053
  * @name lykke#fetchTickers
182632
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
182633
183056
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
182634
183057
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182635
183058
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -182661,6 +183084,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182661
183084
  * @method
182662
183085
  * @name lykke#fetchOrderBook
182663
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
182664
183088
  * @param {string} symbol unified symbol of the market to fetch the order book for
182665
183089
  * @param {int} [limit] the maximum amount of order book entries to return
182666
183090
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -182765,6 +183189,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182765
183189
  * @method
182766
183190
  * @name lykke#fetchTrades
182767
183191
  * @description get the list of most recent trades for a particular symbol
183192
+ * @see https://lykkecity.github.io/Trading-API/#get-public-trades
182768
183193
  * @param {string} symbol unified symbol of the market to fetch trades for
182769
183194
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
182770
183195
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -182829,6 +183254,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182829
183254
  * @method
182830
183255
  * @name lykke#fetchBalance
182831
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
182832
183258
  * @param {object} [params] extra parameters specific to the exchange API endpoint
182833
183259
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
182834
183260
  */
@@ -182924,6 +183350,8 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
182924
183350
  * @method
182925
183351
  * @name lykke#createOrder
182926
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
182927
183355
  * @param {string} symbol unified symbol of the market to create an order in
182928
183356
  * @param {string} type 'market' or 'limit'
182929
183357
  * @param {string} side 'buy' or 'sell'
@@ -183000,6 +183428,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183000
183428
  * @method
183001
183429
  * @name lykke#cancelOrder
183002
183430
  * @description cancels an open order
183431
+ * @see https://lykkecity.github.io/Trading-API/#cancel-orders-by-id
183003
183432
  * @param {string} id order id
183004
183433
  * @param {string} symbol unified symbol of the market the order was made in
183005
183434
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -183021,6 +183450,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183021
183450
  * @method
183022
183451
  * @name lykke#cancelAllOrders
183023
183452
  * @description cancel all open orders
183453
+ * @see https://lykkecity.github.io/Trading-API/#mass-cancel-orders
183024
183454
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
183025
183455
  * @param {object} [params] extra parameters specific to the exchange API endpoint
183026
183456
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -183047,6 +183477,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183047
183477
  * @method
183048
183478
  * @name lykke#fetchOrder
183049
183479
  * @description fetches information on an order made by the user
183480
+ * @see https://lykkecity.github.io/Trading-API/#get-order-by-id
183050
183481
  * @param {string} symbol not used by lykke fetchOrder
183051
183482
  * @param {object} [params] extra parameters specific to the exchange API endpoint
183052
183483
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -183083,6 +183514,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183083
183514
  * @method
183084
183515
  * @name lykke#fetchOpenOrders
183085
183516
  * @description fetch all unfilled currently open orders
183517
+ * @see https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
183086
183518
  * @param {string} symbol unified market symbol
183087
183519
  * @param {int} [since] the earliest time in ms to fetch open orders for
183088
183520
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -183131,6 +183563,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183131
183563
  * @method
183132
183564
  * @name lykke#fetchClosedOrders
183133
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
183134
183567
  * @param {string} symbol unified market symbol of the market orders were made in
183135
183568
  * @param {int} [since] the earliest time in ms to fetch orders for
183136
183569
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -183179,6 +183612,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183179
183612
  * @method
183180
183613
  * @name lykke#fetchMyTrades
183181
183614
  * @description fetch all trades made by the user
183615
+ * @see https://lykkecity.github.io/Trading-API/#get-trade-history
183182
183616
  * @param {string} symbol unified market symbol
183183
183617
  * @param {int} [since] the earliest time in ms to fetch trades for
183184
183618
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -183238,6 +183672,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183238
183672
  * @method
183239
183673
  * @name lykke#fetchDepositAddress
183240
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
183241
183676
  * @param {string} code unified currency code
183242
183677
  * @param {object} [params] extra parameters specific to the exchange API endpoint
183243
183678
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -183335,6 +183770,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183335
183770
  * @method
183336
183771
  * @name lykke#fetchDepositsWithdrawals
183337
183772
  * @description fetch history of deposits and withdrawals
183773
+ * @see https://lykkecity.github.io/Trading-API/#get-the-history-of-withdrawals-and-deposits
183338
183774
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
183339
183775
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
183340
183776
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -183377,6 +183813,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
183377
183813
  * @method
183378
183814
  * @name lykke#withdraw
183379
183815
  * @description make a withdrawal
183816
+ * @see https://lykkecity.github.io/Trading-API/#withdrawal
183380
183817
  * @param {string} code unified currency code
183381
183818
  * @param {float} amount the amount to withdraw
183382
183819
  * @param {string} address the address to withdraw to
@@ -190156,6 +190593,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190156
190593
  * @method
190157
190594
  * @name ndax#signIn
190158
190595
  * @description sign in, must be called prior to using other authenticated methods
190596
+ * @see https://apidoc.ndax.io/#authenticate2fa
190159
190597
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190160
190598
  * @returns response from exchange
190161
190599
  */
@@ -190209,6 +190647,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190209
190647
  * @method
190210
190648
  * @name ndax#fetchCurrencies
190211
190649
  * @description fetches all available currencies on an exchange
190650
+ * @see https://apidoc.ndax.io/#getproduct
190212
190651
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190213
190652
  * @returns {object} an associative dictionary of currencies
190214
190653
  */
@@ -190278,6 +190717,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190278
190717
  * @method
190279
190718
  * @name ndax#fetchMarkets
190280
190719
  * @description retrieves data on all markets for ndax
190720
+ * @see https://apidoc.ndax.io/#getinstruments
190281
190721
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190282
190722
  * @returns {object[]} an array of objects representing market data
190283
190723
  */
@@ -190437,6 +190877,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190437
190877
  * @method
190438
190878
  * @name ndax#fetchOrderBook
190439
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
190440
190881
  * @param {string} symbol unified symbol of the market to fetch the order book for
190441
190882
  * @param {int} [limit] the maximum amount of order book entries to return
190442
190883
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -190547,6 +190988,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190547
190988
  * @method
190548
190989
  * @name ndax#fetchTicker
190549
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
190550
190992
  * @param {string} symbol unified symbol of the market to fetch the ticker for
190551
190993
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190552
190994
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -190619,6 +191061,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190619
191061
  * @method
190620
191062
  * @name ndax#fetchOHLCV
190621
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
190622
191065
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
190623
191066
  * @param {string} timeframe the length of time each candle represents
190624
191067
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -190865,6 +191308,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190865
191308
  * @method
190866
191309
  * @name ndax#fetchAccounts
190867
191310
  * @description fetch all the accounts associated with a profile
191311
+ * @see https://apidoc.ndax.io/#getuseraccounts
190868
191312
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190869
191313
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
190870
191314
  */
@@ -190918,6 +191362,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190918
191362
  * @method
190919
191363
  * @name ndax#fetchBalance
190920
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
190921
191366
  * @param {object} [params] extra parameters specific to the exchange API endpoint
190922
191367
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
190923
191368
  */
@@ -191045,6 +191490,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191045
191490
  * @method
191046
191491
  * @name ndax#fetchLedger
191047
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
191048
191494
  * @param {string} code unified currency code, default is undefined
191049
191495
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
191050
191496
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -191199,6 +191645,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191199
191645
  * @method
191200
191646
  * @name ndax#createOrder
191201
191647
  * @description create a trade order
191648
+ * @see https://apidoc.ndax.io/#sendorder
191202
191649
  * @param {string} symbol unified symbol of the market to create an order in
191203
191650
  * @param {string} type 'market' or 'limit'
191204
191651
  * @param {string} side 'buy' or 'sell'
@@ -191317,6 +191764,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191317
191764
  * @method
191318
191765
  * @name ndax#fetchMyTrades
191319
191766
  * @description fetch all trades made by the user
191767
+ * @see https://apidoc.ndax.io/#gettradeshistory
191320
191768
  * @param {string} symbol unified market symbol
191321
191769
  * @param {int} [since] the earliest time in ms to fetch trades for
191322
191770
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -191404,6 +191852,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191404
191852
  * @method
191405
191853
  * @name ndax#cancelAllOrders
191406
191854
  * @description cancel all open orders
191855
+ * @see https://apidoc.ndax.io/#cancelallorders
191407
191856
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
191408
191857
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191409
191858
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -191438,6 +191887,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191438
191887
  * @method
191439
191888
  * @name ndax#cancelOrder
191440
191889
  * @description cancels an open order
191890
+ * @see https://apidoc.ndax.io/#cancelorder
191441
191891
  * @param {string} id order id
191442
191892
  * @param {string} symbol unified symbol of the market the order was made in
191443
191893
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -191477,6 +191927,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191477
191927
  * @method
191478
191928
  * @name ndax#fetchOpenOrders
191479
191929
  * @description fetch all unfilled currently open orders
191930
+ * @see https://apidoc.ndax.io/#getopenorders
191480
191931
  * @param {string} symbol unified market symbol
191481
191932
  * @param {int} [since] the earliest time in ms to fetch open orders for
191482
191933
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -191555,6 +192006,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191555
192006
  * @method
191556
192007
  * @name ndax#fetchOrders
191557
192008
  * @description fetches information on multiple orders made by the user
192009
+ * @see https://apidoc.ndax.io/#getorderhistory
191558
192010
  * @param {string} symbol unified market symbol of the market orders were made in
191559
192011
  * @param {int} [since] the earliest time in ms to fetch orders for
191560
192012
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -191649,6 +192101,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191649
192101
  * @method
191650
192102
  * @name ndax#fetchOrder
191651
192103
  * @description fetches information on an order made by the user
192104
+ * @see https://apidoc.ndax.io/#getorderstatus
191652
192105
  * @param {string} symbol unified symbol of the market the order was made in
191653
192106
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191654
192107
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -191724,6 +192177,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191724
192177
  * @method
191725
192178
  * @name ndax#fetchOrderTrades
191726
192179
  * @description fetch all the trades made from a single order
192180
+ * @see https://apidoc.ndax.io/#getorderhistorybyorderid
191727
192181
  * @param {string} id order id
191728
192182
  * @param {string} symbol unified market symbol
191729
192183
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -191952,6 +192406,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
191952
192406
  * @method
191953
192407
  * @name ndax#fetchWithdrawals
191954
192408
  * @description fetch all withdrawals made from an account
192409
+ * @see https://apidoc.ndax.io/#getwithdraws
191955
192410
  * @param {string} code unified currency code
191956
192411
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
191957
192412
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -203240,6 +203695,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
203240
203695
  * @method
203241
203696
  * @name okx#fetchPositions
203242
203697
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
203698
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-positions-history history
203243
203699
  * @description fetch all open positions
203244
203700
  * @param {string[]|undefined} symbols list of unified market symbols
203245
203701
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -203380,13 +203836,38 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
203380
203836
  // "vegaBS": "",
203381
203837
  // "vegaPA": ""
203382
203838
  // }
203839
+ // history
203840
+ // {
203841
+ // "cTime":"1708351230102",
203842
+ // "ccy":"USDT",
203843
+ // "closeAvgPx":"1.2567",
203844
+ // "closeTotalPos":"40",
203845
+ // "direction":"short",
203846
+ // "fee":"-0.0351036",
203847
+ // "fundingFee":"0",
203848
+ // "instId":"SUSHI-USDT-SWAP",
203849
+ // "instType":"SWAP",
203850
+ // "lever":"10.0",
203851
+ // "liqPenalty":"0",
203852
+ // "mgnMode":"isolated",
203853
+ // "openAvgPx":"1.2462",
203854
+ // "openMaxPos":"40",
203855
+ // "pnl":"-0.42",
203856
+ // "pnlRatio":"-0.0912982667308618",
203857
+ // "posId":"666159086676836352",
203858
+ // "realizedPnl":"-0.4551036",
203859
+ // "triggerPx":"",
203860
+ // "type":"2",
203861
+ // "uTime":"1708354805699",
203862
+ // "uly":"SUSHI-USDT"
203863
+ // }
203383
203864
  //
203384
203865
  const marketId = this.safeString(position, 'instId');
203385
203866
  market = this.safeMarket(marketId, market);
203386
203867
  const symbol = market['symbol'];
203387
203868
  const pos = this.safeString(position, 'pos'); // 'pos' field: One way mode: 0 if position is not open, 1 if open | Two way (hedge) mode: -1 if short, 1 if long, 0 if position is not open
203388
203869
  const contractsAbs = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(pos);
203389
- let side = this.safeString(position, 'posSide');
203870
+ let side = this.safeString2(position, 'posSide', 'direction');
203390
203871
  const hedged = side !== 'net';
203391
203872
  const contracts = this.parseNumber(contractsAbs);
203392
203873
  if (market['margin']) {
@@ -203427,7 +203908,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
203427
203908
  const notional = this.parseNumber(notionalString);
203428
203909
  const marginMode = this.safeString(position, 'mgnMode');
203429
203910
  let initialMarginString = undefined;
203430
- const entryPriceString = this.safeString(position, 'avgPx');
203911
+ const entryPriceString = this.safeString2(position, 'avgPx', 'openAvgPx');
203431
203912
  const unrealizedPnlString = this.safeString(position, 'upl');
203432
203913
  const leverageString = this.safeString(position, 'lever');
203433
203914
  let initialMarginPercentage = undefined;
@@ -203458,23 +203939,24 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
203458
203939
  const marginRatio = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(maintenanceMarginString, collateralString, 4));
203459
203940
  return this.safePosition({
203460
203941
  'info': position,
203461
- 'id': undefined,
203942
+ 'id': this.safeString(position, 'posId'),
203462
203943
  'symbol': symbol,
203463
203944
  'notional': notional,
203464
203945
  'marginMode': marginMode,
203465
203946
  'liquidationPrice': liquidationPrice,
203466
203947
  'entryPrice': this.parseNumber(entryPriceString),
203467
203948
  'unrealizedPnl': this.parseNumber(unrealizedPnlString),
203949
+ 'realizedPnl': this.safeNumber(position, 'realizedPnl'),
203468
203950
  'percentage': percentage,
203469
203951
  'contracts': contracts,
203470
203952
  'contractSize': contractSize,
203471
203953
  'markPrice': this.parseNumber(markPriceString),
203472
- 'lastPrice': undefined,
203954
+ 'lastPrice': this.safeNumber(position, 'closeAvgPx'),
203473
203955
  'side': side,
203474
203956
  'hedged': hedged,
203475
203957
  'timestamp': timestamp,
203476
203958
  'datetime': this.iso8601(timestamp),
203477
- 'lastUpdateTimestamp': undefined,
203959
+ 'lastUpdateTimestamp': this.safeInteger(position, 'uTime'),
203478
203960
  'maintenanceMargin': maintenanceMargin,
203479
203961
  'maintenanceMarginPercentage': maintenanceMarginPercentage,
203480
203962
  'collateral': this.parseNumber(collateralString),
@@ -219149,7 +219631,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219149
219631
  */
219150
219632
  await this.loadMarkets();
219151
219633
  const market = this.market(symbol);
219152
- const channel = 'depth-realtime' + ':' + market['id'];
219634
+ const channel = 'depth' + ':' + market['id'];
219153
219635
  params = this.extend(params, {
219154
219636
  'ch': channel,
219155
219637
  });
@@ -219159,7 +219641,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219159
219641
  async watchOrderBookSnapshot(symbol, limit = undefined, params = {}) {
219160
219642
  await this.loadMarkets();
219161
219643
  const market = this.market(symbol);
219162
- const action = 'depth-snapshot-realtime';
219644
+ const action = 'depth-snapshot';
219163
219645
  const channel = action + ':' + market['id'];
219164
219646
  params = this.extend(params, {
219165
219647
  'action': action,
@@ -219171,6 +219653,15 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219171
219653
  const orderbook = await this.watchPublic(channel, params);
219172
219654
  return orderbook.limit();
219173
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
+ }
219174
219665
  handleOrderBookSnapshot(client, message) {
219175
219666
  //
219176
219667
  // {
@@ -219807,8 +220298,8 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219807
220298
  'ping': this.handlePing,
219808
220299
  'auth': this.handleAuthenticate,
219809
220300
  'sub': this.handleSubscriptionStatus,
219810
- 'depth-realtime': this.handleOrderBook,
219811
- 'depth-snapshot-realtime': this.handleOrderBookSnapshot,
220301
+ 'depth': this.handleOrderBook,
220302
+ 'depth-snapshot': this.handleOrderBookSnapshot,
219812
220303
  'trades': this.handleTrades,
219813
220304
  'bar': this.handleOHLCV,
219814
220305
  'balance': this.handleBalance,
@@ -219835,7 +220326,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219835
220326
  // { m: 'sub', id: "1647515701", ch: "depth:BTC/USDT", code: 0 }
219836
220327
  //
219837
220328
  const channel = this.safeString(message, 'ch', '');
219838
- if (channel.indexOf('depth-realtime') > -1) {
220329
+ if (channel.indexOf('depth') > -1 && !(channel.indexOf('depth-snapshot') > -1)) {
219839
220330
  this.handleOrderBookSubscription(client, message);
219840
220331
  }
219841
220332
  return message;
@@ -219844,12 +220335,18 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
219844
220335
  const channel = this.safeString(message, 'ch');
219845
220336
  const parts = channel.split(':');
219846
220337
  const marketId = parts[1];
219847
- const symbol = this.safeSymbol(marketId);
220338
+ const market = this.safeMarket(marketId);
220339
+ const symbol = market['symbol'];
219848
220340
  if (symbol in this.orderbooks) {
219849
220341
  delete this.orderbooks[symbol];
219850
220342
  }
219851
220343
  this.orderbooks[symbol] = this.orderBook({});
219852
- 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
+ }
219853
220350
  }
219854
220351
  async pong(client, message) {
219855
220352
  //
@@ -226864,6 +227361,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
226864
227361
  // "clientOid": "798d1425-d31d-4ada-a51b-ec701e00a1d9",
226865
227362
  // "price": "35000.00",
226866
227363
  // "size": "7.0000",
227364
+ // "newSize": "500.0000",
226867
227365
  // "notional": "7.000000",
226868
227366
  // "orderType": "limit",
226869
227367
  // "force": "gtc",
@@ -227031,6 +227529,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227031
227529
  // "clientOid": "798d1425-d31d-4ada-a51b-ec701e00a1d9",
227032
227530
  // "price": "35000.00",
227033
227531
  // "size": "7.0000",
227532
+ // "newSize": "500.0000",
227034
227533
  // "notional": "7.000000",
227035
227534
  // "orderType": "limit",
227036
227535
  // "force": "gtc",
@@ -227138,6 +227637,25 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227138
227637
  };
227139
227638
  }
227140
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
+ }
227141
227659
  return this.safeOrder({
227142
227660
  'info': order,
227143
227661
  'symbol': symbol,
@@ -227146,17 +227664,17 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
227146
227664
  'timestamp': timestamp,
227147
227665
  'datetime': this.iso8601(timestamp),
227148
227666
  'lastTradeTimestamp': this.safeInteger(order, 'uTime'),
227149
- 'type': this.safeString(order, 'orderType'),
227667
+ 'type': type,
227150
227668
  'timeInForce': this.safeStringUpper(order, 'force'),
227151
227669
  'postOnly': undefined,
227152
- 'side': this.safeString(order, 'side'),
227153
- 'price': this.safeString(order, 'price'),
227670
+ 'side': side,
227671
+ 'price': price,
227154
227672
  'stopPrice': triggerPrice,
227155
227673
  'triggerPrice': triggerPrice,
227156
- 'amount': this.safeString(order, 'baseVolume'),
227157
- 'cost': this.safeStringN(order, ['notional', 'notionalUsd', 'quoteSize']),
227158
- 'average': this.omitZero(this.safeString2(order, 'priceAvg', 'fillPrice')),
227159
- 'filled': this.safeString2(order, 'accBaseVolume', 'baseVolume'),
227674
+ 'amount': amount,
227675
+ 'cost': cost,
227676
+ 'average': avgPrice,
227677
+ 'filled': filled,
227160
227678
  'remaining': undefined,
227161
227679
  'status': this.parseWsOrderStatus(rawStatus),
227162
227680
  'fee': feeObject,
@@ -231942,7 +232460,7 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
231942
232460
  // usually it takes at least 4-5 deltas to resolve
231943
232461
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 6);
231944
232462
  if (cacheLength === snapshotDelay) {
231945
- this.spawn(this.loadOrderBook, client, messageHash, symbol);
232463
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, null, {});
231946
232464
  }
231947
232465
  storedOrderBook.cache.push(delta);
231948
232466
  return;
@@ -246774,7 +247292,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246774
247292
  'symbols': [market['id']],
246775
247293
  },
246776
247294
  };
246777
- const orderbook = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
247295
+ const orderbook = await this.subscribePublic(name, 'orderbooks', [symbol], this.deepExtend(request, params));
246778
247296
  return orderbook.limit();
246779
247297
  }
246780
247298
  handleOrderBook(client, message) {
@@ -246803,13 +247321,12 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246803
247321
  //
246804
247322
  const data = this.safeValue2(message, 'snapshot', 'update', {});
246805
247323
  const marketIds = Object.keys(data);
246806
- const channel = this.safeString(message, 'ch');
246807
247324
  for (let i = 0; i < marketIds.length; i++) {
246808
247325
  const marketId = marketIds[i];
246809
247326
  const market = this.safeMarket(marketId);
246810
247327
  const symbol = market['symbol'];
246811
247328
  const item = data[marketId];
246812
- const messageHash = channel + '::' + symbol;
247329
+ const messageHash = 'orderbooks::' + symbol;
246813
247330
  if (!(symbol in this.orderbooks)) {
246814
247331
  const subscription = this.safeValue(client.subscriptions, messageHash, {});
246815
247332
  const limit = this.safeInteger(subscription, 'limit');
@@ -246867,7 +247384,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246867
247384
  'symbols': [market['id']],
246868
247385
  },
246869
247386
  };
246870
- const result = await this.subscribePublic(name, 'ticker', [symbol], this.deepExtend(request, params));
247387
+ const result = await this.subscribePublic(name, 'tickers', [symbol], this.deepExtend(request, params));
246871
247388
  return this.safeValue(result, symbol);
246872
247389
  }
246873
247390
  async watchTickers(symbols = undefined, params = {}) {
@@ -246950,7 +247467,6 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246950
247467
  //
246951
247468
  const data = this.safeValue(message, 'data', {});
246952
247469
  const marketIds = Object.keys(data);
246953
- const channel = this.safeString(message, 'ch');
246954
247470
  const newTickers = {};
246955
247471
  for (let i = 0; i < marketIds.length; i++) {
246956
247472
  const marketId = marketIds[i];
@@ -246959,8 +247475,6 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246959
247475
  const ticker = this.parseWsTicker(data[marketId], market);
246960
247476
  this.tickers[symbol] = ticker;
246961
247477
  newTickers[symbol] = ticker;
246962
- const messageHash = channel + '::' + symbol;
246963
- client.resolve(newTickers, messageHash);
246964
247478
  }
246965
247479
  client.resolve(newTickers, 'tickers');
246966
247480
  const messageHashes = this.findMessageHashes(client, 'tickers::');
@@ -246976,7 +247490,6 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
246976
247490
  client.resolve(tickers, messageHash);
246977
247491
  }
246978
247492
  }
246979
- client.resolve(this.tickers, channel);
246980
247493
  return message;
246981
247494
  }
246982
247495
  parseWsTicker(ticker, market = undefined) {
@@ -247057,7 +247570,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247057
247570
  request['limit'] = limit;
247058
247571
  }
247059
247572
  const name = 'trades';
247060
- const trades = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
247573
+ const trades = await this.subscribePublic(name, 'trades', [symbol], this.deepExtend(request, params));
247061
247574
  if (this.newUpdates) {
247062
247575
  limit = trades.getLimit(symbol, limit);
247063
247576
  }
@@ -247186,7 +247699,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247186
247699
  if (limit !== undefined) {
247187
247700
  request['params']['limit'] = limit;
247188
247701
  }
247189
- const ohlcv = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
247702
+ const ohlcv = await this.subscribePublic(name, 'candles', [symbol], this.deepExtend(request, params));
247190
247703
  if (this.newUpdates) {
247191
247704
  limit = ohlcv.getLimit(symbol, limit);
247192
247705
  }
@@ -247247,7 +247760,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
247247
247760
  for (let j = 0; j < ohlcvs.length; j++) {
247248
247761
  stored.append(ohlcvs[j]);
247249
247762
  }
247250
- const messageHash = channel + '::' + symbol;
247763
+ const messageHash = 'candles::' + symbol;
247251
247764
  client.resolve(stored, messageHash);
247252
247765
  }
247253
247766
  return message;
@@ -259187,6 +259700,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
259187
259700
  const symbol = this.safeSymbol(marketId);
259188
259701
  const messageHash = 'orderbook:' + symbol;
259189
259702
  const subscription = this.safeValue(client.subscriptions, messageHash);
259703
+ const limit = this.safeInteger(subscription, 'limit');
259190
259704
  if (subscription === true) {
259191
259705
  // we set client.subscriptions[messageHash] to 1
259192
259706
  // once we have received the first delta and initialized the orderbook
@@ -259199,7 +259713,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
259199
259713
  const cacheLength = storedOrderBook.cache.length;
259200
259714
  const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 25);
259201
259715
  if (cacheLength === snapshotDelay) {
259202
- this.spawn(this.loadOrderBook, client, messageHash, symbol);
259716
+ this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
259203
259717
  }
259204
259718
  storedOrderBook.cache.push(data);
259205
259719
  return;
@@ -286980,6 +287494,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
286980
287494
  'fetchBalance': true,
286981
287495
  'fetchCanceledOrders': true,
286982
287496
  'fetchClosedOrders': true,
287497
+ 'fetchDeposit': true,
286983
287498
  'fetchDepositAddress': true,
286984
287499
  'fetchDepositAddresses': true,
286985
287500
  'fetchDeposits': true,
@@ -287007,6 +287522,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
287007
287522
  'fetchTradingFee': true,
287008
287523
  'fetchTradingFees': false,
287009
287524
  'fetchTransactions': false,
287525
+ 'fetchWithdrawal': true,
287010
287526
  'fetchWithdrawals': true,
287011
287527
  'transfer': false,
287012
287528
  'withdraw': true,
@@ -287964,6 +288480,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
287964
288480
  * @name upbit#createOrder
287965
288481
  * @description create a trade order
287966
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
287967
288484
  * @param {string} symbol unified symbol of the market to create an order in
287968
288485
  * @param {string} type 'market' or 'limit'
287969
288486
  * @param {string} side 'buy' or 'sell'
@@ -287971,6 +288488,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
287971
288488
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
287972
288489
  * @param {object} [params] extra parameters specific to the exchange API endpoint
287973
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'
287974
288492
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
287975
288493
  */
287976
288494
  await this.loadMarkets();
@@ -288027,6 +288545,13 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288027
288545
  if (clientOrderId !== undefined) {
288028
288546
  request['identifier'] = clientOrderId;
288029
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
+ }
288030
288555
  params = this.omit(params, ['clientOrderId', 'identifier']);
288031
288556
  const response = await this.privatePostOrders(this.extend(request, params));
288032
288557
  //
@@ -288132,6 +288657,45 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288132
288657
  //
288133
288658
  return this.parseTransactions(response, currency, since, limit);
288134
288659
  }
288660
+ async fetchDeposit(id, code = undefined, params = {}) {
288661
+ /**
288662
+ * @method
288663
+ * @name upbit#fetchDeposit
288664
+ * @description fetch information on a deposit
288665
+ * @see https://global-docs.upbit.com/reference/individual-deposit-inquiry
288666
+ * @param {string} id the unique id for the deposit
288667
+ * @param {string} [code] unified currency code of the currency deposited
288668
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
288669
+ * @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
288670
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
288671
+ */
288672
+ await this.loadMarkets();
288673
+ const request = {
288674
+ 'uuid': id,
288675
+ };
288676
+ let currency = undefined;
288677
+ if (code !== undefined) {
288678
+ currency = this.currency(code);
288679
+ request['currency'] = currency['id'];
288680
+ }
288681
+ const response = await this.privateGetDeposit(this.extend(request, params));
288682
+ //
288683
+ // {
288684
+ // "type": "deposit",
288685
+ // "uuid": "7f54527e-2eee-4268-860e-fd8b9d7fe3c7",
288686
+ // "currency": "ADA",
288687
+ // "net_type": "ADA",
288688
+ // "txid": "99795bbfeca91eaa071068bb659b33eeb65d8aaff2551fdf7c78f345d188952b",
288689
+ // "state": "ACCEPTED",
288690
+ // "created_at": "2023-12-12T04:58:41Z",
288691
+ // "done_at": "2023-12-12T05:31:50Z",
288692
+ // "amount": "35.72344",
288693
+ // "fee": "0.0",
288694
+ // "transaction_type": "default"
288695
+ // }
288696
+ //
288697
+ return this.parseTransaction(response, currency);
288698
+ }
288135
288699
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
288136
288700
  /**
288137
288701
  * @method
@@ -288176,13 +288740,52 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288176
288740
  //
288177
288741
  return this.parseTransactions(response, currency, since, limit);
288178
288742
  }
288743
+ async fetchWithdrawal(id, code = undefined, params = {}) {
288744
+ /**
288745
+ * @method
288746
+ * @name upbit#fetchWithdrawal
288747
+ * @description fetch data on a currency withdrawal via the withdrawal id
288748
+ * @see https://global-docs.upbit.com/reference/individual-withdrawal-inquiry
288749
+ * @param {string} id the unique id for the withdrawal
288750
+ * @param {string} [code] unified currency code of the currency withdrawn
288751
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
288752
+ * @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
288753
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
288754
+ */
288755
+ await this.loadMarkets();
288756
+ const request = {
288757
+ 'uuid': id,
288758
+ };
288759
+ let currency = undefined;
288760
+ if (code !== undefined) {
288761
+ currency = this.currency(code);
288762
+ request['currency'] = currency['id'];
288763
+ }
288764
+ const response = await this.privateGetWithdraw(this.extend(request, params));
288765
+ //
288766
+ // {
288767
+ // "type": "withdraw",
288768
+ // "uuid": "95ef274b-23a6-4de4-95b0-5cbef4ca658f",
288769
+ // "currency": "ADA",
288770
+ // "net_type": "ADA",
288771
+ // "txid": "b1528f149297a71671b86636f731f8fdb0ff53da0f1d8c19093d59df96f34583",
288772
+ // "state": "DONE",
288773
+ // "created_at": "2023-12-14T02:46:52Z",
288774
+ // "done_at": "2023-12-14T03:10:11Z",
288775
+ // "amount": "35.22344",
288776
+ // "fee": "0.5",
288777
+ // "transaction_type": "default"
288778
+ // }
288779
+ //
288780
+ return this.parseTransaction(response, currency);
288781
+ }
288179
288782
  parseTransactionStatus(status) {
288180
288783
  const statuses = {
288181
288784
  'submitting': 'pending',
288182
288785
  'submitted': 'pending',
288183
288786
  'almost_accepted': 'pending',
288184
288787
  'rejected': 'failed',
288185
- 'accepted': 'pending',
288788
+ 'accepted': 'ok',
288186
288789
  'processing': 'pending',
288187
288790
  'done': 'ok',
288188
288791
  'canceled': 'canceled', // 취소됨
@@ -288191,7 +288794,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288191
288794
  }
288192
288795
  parseTransaction(transaction, currency = undefined) {
288193
288796
  //
288194
- // fetchDeposits
288797
+ // fetchDeposits, fetchDeposit
288195
288798
  //
288196
288799
  // {
288197
288800
  // "type": "deposit",
@@ -288205,7 +288808,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288205
288808
  // "fee": "0.0"
288206
288809
  // }
288207
288810
  //
288208
- // fetchWithdrawals
288811
+ // fetchWithdrawals, fetchWithdrawal
288209
288812
  //
288210
288813
  // {
288211
288814
  // "type": "withdraw",
@@ -288220,27 +288823,21 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288220
288823
  // "krw_amount": "80420.0"
288221
288824
  // }
288222
288825
  //
288223
- const id = this.safeString(transaction, 'uuid');
288224
- const amount = this.safeNumber(transaction, 'amount');
288225
288826
  const address = undefined; // not present in the data structure received from the exchange
288226
288827
  const tag = undefined; // not present in the data structure received from the exchange
288227
- const txid = this.safeString(transaction, 'txid');
288228
288828
  const updatedRaw = this.safeString(transaction, 'done_at');
288229
- const updated = this.parse8601(updatedRaw);
288230
288829
  const timestamp = this.parse8601(this.safeString(transaction, 'created_at', updatedRaw));
288231
288830
  let type = this.safeString(transaction, 'type');
288232
288831
  if (type === 'withdraw') {
288233
288832
  type = 'withdrawal';
288234
288833
  }
288235
288834
  const currencyId = this.safeString(transaction, 'currency');
288236
- const code = this.safeCurrencyCode(currencyId);
288237
- const status = this.parseTransactionStatus(this.safeStringLower(transaction, 'state'));
288238
- const feeCost = this.safeNumber(transaction, 'fee');
288835
+ const code = this.safeCurrencyCode(currencyId, currency);
288239
288836
  return {
288240
288837
  'info': transaction,
288241
- 'id': id,
288838
+ 'id': this.safeString(transaction, 'uuid'),
288242
288839
  'currency': code,
288243
- 'amount': amount,
288840
+ 'amount': this.safeNumber(transaction, 'amount'),
288244
288841
  'network': undefined,
288245
288842
  'address': address,
288246
288843
  'addressTo': undefined,
@@ -288248,17 +288845,17 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288248
288845
  'tag': tag,
288249
288846
  'tagTo': undefined,
288250
288847
  'tagFrom': undefined,
288251
- 'status': status,
288848
+ 'status': this.parseTransactionStatus(this.safeStringLower(transaction, 'state')),
288252
288849
  'type': type,
288253
- 'updated': updated,
288254
- 'txid': txid,
288850
+ 'updated': this.parse8601(updatedRaw),
288851
+ 'txid': this.safeString(transaction, 'txid'),
288255
288852
  'timestamp': timestamp,
288256
288853
  'datetime': this.iso8601(timestamp),
288257
288854
  'internal': undefined,
288258
288855
  'comment': undefined,
288259
288856
  'fee': {
288260
288857
  'currency': code,
288261
- 'cost': feeCost,
288858
+ 'cost': this.safeNumber(transaction, 'fee'),
288262
288859
  },
288263
288860
  };
288264
288861
  }
@@ -288738,7 +289335,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
288738
289335
  }
288739
289336
  if (api === 'private') {
288740
289337
  this.checkRequiredCredentials();
288741
- const nonce = this.nonce();
289338
+ const nonce = this.uuid();
288742
289339
  const request = {
288743
289340
  'access_key': this.apiKey,
288744
289341
  'nonce': nonce,
@@ -307068,7 +307665,7 @@ SOFTWARE.
307068
307665
 
307069
307666
  //-----------------------------------------------------------------------------
307070
307667
  // this is updated by vss.js when building
307071
- const version = '4.2.47';
307668
+ const version = '4.2.49';
307072
307669
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
307073
307670
  //-----------------------------------------------------------------------------
307074
307671