ccxt 4.2.48 → 4.2.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +3 -3
  2. package/build.sh +7 -0
  3. package/dist/ccxt.browser.js +379 -32
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/binance.js +7 -3
  7. package/dist/cjs/src/bitmart.js +30 -4
  8. package/dist/cjs/src/bitstamp.js +8 -0
  9. package/dist/cjs/src/btcalpha.js +4 -0
  10. package/dist/cjs/src/btcmarkets.js +4 -0
  11. package/dist/cjs/src/btcturk.js +4 -0
  12. package/dist/cjs/src/bybit.js +138 -6
  13. package/dist/cjs/src/independentreserve.js +48 -0
  14. package/dist/cjs/src/latoken.js +16 -0
  15. package/dist/cjs/src/luno.js +18 -0
  16. package/dist/cjs/src/lykke.js +19 -0
  17. package/dist/cjs/src/ndax.js +18 -0
  18. package/dist/cjs/src/pro/ascendex.js +22 -7
  19. package/dist/cjs/src/pro/bitget.js +28 -7
  20. package/dist/cjs/src/pro/bitstamp.js +1 -1
  21. package/dist/cjs/src/pro/mexc.js +2 -1
  22. package/dist/cjs/src/upbit.js +11 -2
  23. package/js/ccxt.d.ts +1 -1
  24. package/js/ccxt.js +1 -1
  25. package/js/src/abstract/bitstamp.d.ts +8 -0
  26. package/js/src/binance.js +7 -3
  27. package/js/src/bitmart.js +30 -4
  28. package/js/src/bitstamp.js +8 -0
  29. package/js/src/btcalpha.js +4 -0
  30. package/js/src/btcmarkets.js +4 -0
  31. package/js/src/btcturk.js +4 -0
  32. package/js/src/bybit.d.ts +3 -1
  33. package/js/src/bybit.js +138 -6
  34. package/js/src/independentreserve.d.ts +15 -1
  35. package/js/src/independentreserve.js +48 -0
  36. package/js/src/latoken.js +16 -0
  37. package/js/src/luno.js +18 -0
  38. package/js/src/lykke.js +19 -0
  39. package/js/src/ndax.js +18 -0
  40. package/js/src/pro/ascendex.d.ts +1 -0
  41. package/js/src/pro/ascendex.js +22 -7
  42. package/js/src/pro/bitget.js +28 -7
  43. package/js/src/pro/bitstamp.js +1 -1
  44. package/js/src/pro/mexc.js +2 -1
  45. package/js/src/upbit.js +11 -2
  46. package/package.json +3 -1
  47. package/skip-tests.json +4 -2
package/dist/cjs/ccxt.js CHANGED
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
177
177
 
178
178
  //-----------------------------------------------------------------------------
179
179
  // this is updated by vss.js when building
180
- const version = '4.2.48';
180
+ const version = '4.2.49';
181
181
  Exchange["default"].ccxtVersion = version;
182
182
  const exchanges = {
183
183
  'ace': ace,
@@ -3017,7 +3017,7 @@ class binance extends binance$1 {
3017
3017
  let fees = this.fees;
3018
3018
  let linear = undefined;
3019
3019
  let inverse = undefined;
3020
- const strike = this.safeInteger(market, 'strikePrice');
3020
+ const strike = this.safeString(market, 'strikePrice');
3021
3021
  let symbol = base + '/' + quote;
3022
3022
  if (contract) {
3023
3023
  if (swap) {
@@ -3027,7 +3027,7 @@ class binance extends binance$1 {
3027
3027
  symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry);
3028
3028
  }
3029
3029
  else if (option) {
3030
- symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry) + '-' + this.numberToString(strike) + '-' + this.safeString(optionParts, 3);
3030
+ symbol = symbol + ':' + settle + '-' + this.yymmdd(expiry) + '-' + strike + '-' + this.safeString(optionParts, 3);
3031
3031
  }
3032
3032
  contractSize = this.safeNumber2(market, 'contractSize', 'unit', this.parseNumber('1'));
3033
3033
  linear = settle === quote;
@@ -3060,6 +3060,10 @@ class binance extends binance$1 {
3060
3060
  unifiedType = 'option';
3061
3061
  active = undefined;
3062
3062
  }
3063
+ let parsedStrike = undefined;
3064
+ if (strike !== undefined) {
3065
+ parsedStrike = this.parseToNumeric(strike);
3066
+ }
3063
3067
  const entry = {
3064
3068
  'id': id,
3065
3069
  'lowercaseId': lowercaseId,
@@ -3085,7 +3089,7 @@ class binance extends binance$1 {
3085
3089
  'contractSize': contractSize,
3086
3090
  'expiry': expiry,
3087
3091
  'expiryDatetime': this.iso8601(expiry),
3088
- 'strike': strike,
3092
+ 'strike': parsedStrike,
3089
3093
  'optionType': this.safeStringLower(market, 'side'),
3090
3094
  'precision': {
3091
3095
  'amount': this.safeInteger2(market, 'quantityPrecision', 'quantityScale'),
@@ -1123,7 +1123,7 @@ class bitmart extends bitmart$1 {
1123
1123
  }
1124
1124
  parseTicker(ticker, market = undefined) {
1125
1125
  //
1126
- // spot
1126
+ // spot (REST)
1127
1127
  //
1128
1128
  // {
1129
1129
  // "symbol": "SOLAR_USDT",
@@ -1143,6 +1143,17 @@ class bitmart extends bitmart$1 {
1143
1143
  // "timestamp": 1667403439367
1144
1144
  // }
1145
1145
  //
1146
+ // spot (WS)
1147
+ // {
1148
+ // "symbol":"BTC_USDT",
1149
+ // "last_price":"146.24",
1150
+ // "open_24h":"147.17",
1151
+ // "high_24h":"147.48",
1152
+ // "low_24h":"143.88",
1153
+ // "base_volume_24h":"117387.58", // NOT base, but quote currency!!!
1154
+ // "s_t": 1610936002
1155
+ // }
1156
+ //
1146
1157
  // swap
1147
1158
  //
1148
1159
  // {
@@ -1158,7 +1169,11 @@ class bitmart extends bitmart$1 {
1158
1169
  // "legal_coin_price":"0.1302699"
1159
1170
  // }
1160
1171
  //
1161
- const timestamp = this.safeInteger(ticker, 'timestamp');
1172
+ let timestamp = this.safeInteger(ticker, 'timestamp');
1173
+ if (timestamp === undefined) {
1174
+ // ticker from WS has a different field (in seconds)
1175
+ timestamp = this.safeIntegerProduct(ticker, 's_t', 1000);
1176
+ }
1162
1177
  const marketId = this.safeString2(ticker, 'symbol', 'contract_symbol');
1163
1178
  market = this.safeMarket(marketId, market);
1164
1179
  const symbol = market['symbol'];
@@ -1174,9 +1189,20 @@ class bitmart extends bitmart$1 {
1174
1189
  percentage = '0';
1175
1190
  }
1176
1191
  }
1177
- const baseVolume = this.safeString(ticker, 'base_volume_24h');
1192
+ let baseVolume = this.safeString(ticker, 'base_volume_24h');
1178
1193
  let quoteVolume = this.safeString(ticker, 'quote_volume_24h');
1179
- quoteVolume = this.safeString(ticker, 'volume_24h', quoteVolume);
1194
+ if (quoteVolume === undefined) {
1195
+ if (baseVolume === undefined) {
1196
+ // this is swap
1197
+ quoteVolume = this.safeString(ticker, 'volume_24h', quoteVolume);
1198
+ }
1199
+ else {
1200
+ // this is a ticker from websockets
1201
+ // contrary to name and documentation, base_volume_24h is actually the quote volume
1202
+ quoteVolume = baseVolume;
1203
+ baseVolume = undefined;
1204
+ }
1205
+ }
1180
1206
  const average = this.safeString2(ticker, 'avg_price', 'index_price');
1181
1207
  const high = this.safeString2(ticker, 'high_24h', 'high_price');
1182
1208
  const low = this.safeString2(ticker, 'low_24h', 'low_price');
@@ -348,6 +348,14 @@ class bitstamp extends bitstamp$1 {
348
348
  'eurcv_address/': 1,
349
349
  'pyusd_withdrawal/': 1,
350
350
  'pyusd_address/': 1,
351
+ 'lmwr_withdrawal/': 1,
352
+ 'lmwr_address/': 1,
353
+ 'pepe_withdrawal/': 1,
354
+ 'pepe_address/': 1,
355
+ 'blur_withdrawal/': 1,
356
+ 'blur_address/': 1,
357
+ 'vext_withdrawal/': 1,
358
+ 'vext_address/': 1,
351
359
  },
352
360
  },
353
361
  },
@@ -30,6 +30,7 @@ class btcalpha extends btcalpha$1 {
30
30
  'cancelOrder': true,
31
31
  'closeAllPositions': false,
32
32
  'closePosition': false,
33
+ 'createDepositAddress': false,
33
34
  'createOrder': true,
34
35
  'createReduceOnlyOrder': false,
35
36
  'createStopLimitOrder': false,
@@ -42,6 +43,9 @@ class btcalpha extends btcalpha$1 {
42
43
  'fetchCrossBorrowRate': false,
43
44
  'fetchCrossBorrowRates': false,
44
45
  'fetchDeposit': false,
46
+ 'fetchDepositAddress': false,
47
+ 'fetchDepositAddresses': false,
48
+ 'fetchDepositAddressesByNetwork': false,
45
49
  'fetchDeposits': true,
46
50
  'fetchFundingHistory': false,
47
51
  'fetchFundingRate': false,
@@ -32,6 +32,7 @@ class btcmarkets extends btcmarkets$1 {
32
32
  'cancelOrders': true,
33
33
  'closeAllPositions': false,
34
34
  'closePosition': false,
35
+ 'createDepositAddress': false,
35
36
  'createOrder': true,
36
37
  'createReduceOnlyOrder': false,
37
38
  'fetchBalance': true,
@@ -40,6 +41,9 @@ class btcmarkets extends btcmarkets$1 {
40
41
  'fetchClosedOrders': 'emulated',
41
42
  'fetchCrossBorrowRate': false,
42
43
  'fetchCrossBorrowRates': false,
44
+ 'fetchDepositAddress': false,
45
+ 'fetchDepositAddresses': false,
46
+ 'fetchDepositAddressesByNetwork': false,
43
47
  'fetchDeposits': true,
44
48
  'fetchDepositsWithdrawals': true,
45
49
  'fetchFundingHistory': false,
@@ -31,6 +31,7 @@ class btcturk extends btcturk$1 {
31
31
  'cancelOrder': true,
32
32
  'closeAllPositions': false,
33
33
  'closePosition': false,
34
+ 'createDepositAddress': false,
34
35
  'createOrder': true,
35
36
  'createReduceOnlyOrder': false,
36
37
  'fetchBalance': true,
@@ -38,6 +39,9 @@ class btcturk extends btcturk$1 {
38
39
  'fetchBorrowRateHistory': false,
39
40
  'fetchCrossBorrowRate': false,
40
41
  'fetchCrossBorrowRates': false,
42
+ 'fetchDepositAddress': false,
43
+ 'fetchDepositAddresses': false,
44
+ 'fetchDepositAddressesByNetwork': false,
41
45
  'fetchFundingHistory': false,
42
46
  'fetchFundingRate': false,
43
47
  'fetchFundingRateHistory': false,
@@ -81,6 +81,7 @@ class bybit extends bybit$1 {
81
81
  'fetchMarketLeverageTiers': true,
82
82
  'fetchMarkets': true,
83
83
  'fetchMarkOHLCV': true,
84
+ 'fetchMyLiquidations': true,
84
85
  'fetchMySettlementHistory': true,
85
86
  'fetchMyTrades': true,
86
87
  'fetchOHLCV': true,
@@ -4576,7 +4577,7 @@ class bybit extends bybit$1 {
4576
4577
  let paginate = false;
4577
4578
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
4578
4579
  if (paginate) {
4579
- return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
4580
+ return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
4580
4581
  }
4581
4582
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
4582
4583
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -4754,7 +4755,7 @@ class bybit extends bybit$1 {
4754
4755
  let paginate = false;
4755
4756
  [paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
4756
4757
  if (paginate) {
4757
- return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
4758
+ return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
4758
4759
  }
4759
4760
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
4760
4761
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -5126,7 +5127,7 @@ class bybit extends bybit$1 {
5126
5127
  let paginate = false;
5127
5128
  [paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
5128
5129
  if (paginate) {
5129
- return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 100);
5130
+ return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
5130
5131
  }
5131
5132
  const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
5132
5133
  const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
@@ -5328,7 +5329,7 @@ class bybit extends bybit$1 {
5328
5329
  let paginate = false;
5329
5330
  [paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
5330
5331
  if (paginate) {
5331
- return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
5332
+ return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
5332
5333
  }
5333
5334
  let request = {
5334
5335
  // 'coin': currency['id'],
@@ -5396,7 +5397,7 @@ class bybit extends bybit$1 {
5396
5397
  let paginate = false;
5397
5398
  [paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
5398
5399
  if (paginate) {
5399
- return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
5400
+ return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
5400
5401
  }
5401
5402
  let request = {
5402
5403
  // 'coin': currency['id'],
@@ -6913,7 +6914,7 @@ class bybit extends bybit$1 {
6913
6914
  let paginate = false;
6914
6915
  [paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
6915
6916
  if (paginate) {
6916
- return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
6917
+ return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'cursor', undefined, 50);
6917
6918
  }
6918
6919
  let currency = undefined;
6919
6920
  let request = {};
@@ -7747,6 +7748,137 @@ class bybit extends bybit$1 {
7747
7748
  'info': greeks,
7748
7749
  };
7749
7750
  }
7751
+ async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
7752
+ /**
7753
+ * @method
7754
+ * @name bybit#fetchMyLiquidations
7755
+ * @description retrieves the users liquidated positions
7756
+ * @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
7757
+ * @param {string} [symbol] unified CCXT market symbol
7758
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
7759
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
7760
+ * @param {object} [params] exchange specific parameters for the exchange API endpoint
7761
+ * @param {string} [params.type] market type, ['swap', 'option', 'spot']
7762
+ * @param {string} [params.subType] market subType, ['linear', 'inverse']
7763
+ * @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)
7764
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
7765
+ */
7766
+ await this.loadMarkets();
7767
+ let paginate = false;
7768
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
7769
+ if (paginate) {
7770
+ return await this.fetchPaginatedCallCursor('fetchMyLiquidations', symbol, since, limit, params, 'nextPageCursor', 'cursor', undefined, 100);
7771
+ }
7772
+ let request = {
7773
+ 'execType': 'BustTrade',
7774
+ };
7775
+ let market = undefined;
7776
+ if (symbol !== undefined) {
7777
+ market = this.market(symbol);
7778
+ request['symbol'] = market['id'];
7779
+ }
7780
+ let type = undefined;
7781
+ [type, params] = this.getBybitType('fetchMyLiquidations', market, params);
7782
+ request['category'] = type;
7783
+ if (limit !== undefined) {
7784
+ request['limit'] = limit;
7785
+ }
7786
+ if (since !== undefined) {
7787
+ request['startTime'] = since;
7788
+ }
7789
+ [request, params] = this.handleUntilOption('endTime', request, params);
7790
+ const response = await this.privateGetV5ExecutionList(this.extend(request, params));
7791
+ //
7792
+ // {
7793
+ // "retCode": 0,
7794
+ // "retMsg": "OK",
7795
+ // "result": {
7796
+ // "nextPageCursor": "132766%3A2%2C132766%3A2",
7797
+ // "category": "linear",
7798
+ // "list": [
7799
+ // {
7800
+ // "symbol": "ETHPERP",
7801
+ // "orderType": "Market",
7802
+ // "underlyingPrice": "",
7803
+ // "orderLinkId": "",
7804
+ // "side": "Buy",
7805
+ // "indexPrice": "",
7806
+ // "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
7807
+ // "stopOrderType": "UNKNOWN",
7808
+ // "leavesQty": "0",
7809
+ // "execTime": "1672282722429",
7810
+ // "isMaker": false,
7811
+ // "execFee": "0.071409",
7812
+ // "feeRate": "0.0006",
7813
+ // "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
7814
+ // "tradeIv": "",
7815
+ // "blockTradeId": "",
7816
+ // "markPrice": "1183.54",
7817
+ // "execPrice": "1190.15",
7818
+ // "markIv": "",
7819
+ // "orderQty": "0.1",
7820
+ // "orderPrice": "1236.9",
7821
+ // "execValue": "119.015",
7822
+ // "execType": "Trade",
7823
+ // "execQty": "0.1"
7824
+ // }
7825
+ // ]
7826
+ // },
7827
+ // "retExtInfo": {},
7828
+ // "time": 1672283754510
7829
+ // }
7830
+ //
7831
+ const liquidations = this.addPaginationCursorToResult(response);
7832
+ return this.parseLiquidations(liquidations, market, since, limit);
7833
+ }
7834
+ parseLiquidation(liquidation, market = undefined) {
7835
+ //
7836
+ // {
7837
+ // "symbol": "ETHPERP",
7838
+ // "orderType": "Market",
7839
+ // "underlyingPrice": "",
7840
+ // "orderLinkId": "",
7841
+ // "side": "Buy",
7842
+ // "indexPrice": "",
7843
+ // "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
7844
+ // "stopOrderType": "UNKNOWN",
7845
+ // "leavesQty": "0",
7846
+ // "execTime": "1672282722429",
7847
+ // "isMaker": false,
7848
+ // "execFee": "0.071409",
7849
+ // "feeRate": "0.0006",
7850
+ // "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
7851
+ // "tradeIv": "",
7852
+ // "blockTradeId": "",
7853
+ // "markPrice": "1183.54",
7854
+ // "execPrice": "1190.15",
7855
+ // "markIv": "",
7856
+ // "orderQty": "0.1",
7857
+ // "orderPrice": "1236.9",
7858
+ // "execValue": "119.015",
7859
+ // "execType": "Trade",
7860
+ // "execQty": "0.1"
7861
+ // }
7862
+ //
7863
+ const marketId = this.safeString(liquidation, 'symbol');
7864
+ const timestamp = this.safeInteger(liquidation, 'execTime');
7865
+ const contractsString = this.safeString(liquidation, 'execQty');
7866
+ const contractSizeString = this.safeString(market, 'contractSize');
7867
+ const priceString = this.safeString(liquidation, 'execPrice');
7868
+ const baseValueString = Precise["default"].stringMul(contractsString, contractSizeString);
7869
+ const quoteValueString = Precise["default"].stringMul(baseValueString, priceString);
7870
+ return this.safeLiquidation({
7871
+ 'info': liquidation,
7872
+ 'symbol': this.safeSymbol(marketId, market),
7873
+ 'contracts': this.parseNumber(contractsString),
7874
+ 'contractSize': this.parseNumber(contractSizeString),
7875
+ 'price': this.parseNumber(priceString),
7876
+ 'baseValue': this.parseNumber(baseValueString),
7877
+ 'quoteValue': this.parseNumber(quoteValueString),
7878
+ 'timestamp': timestamp,
7879
+ 'datetime': this.iso8601(timestamp),
7880
+ });
7881
+ }
7750
7882
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
7751
7883
  let url = this.implodeHostname(this.urls['api'][api]) + '/' + path;
7752
7884
  if (api === 'public') {
@@ -41,6 +41,9 @@ class independentreserve extends independentreserve$1 {
41
41
  'fetchClosedOrders': true,
42
42
  'fetchCrossBorrowRate': false,
43
43
  'fetchCrossBorrowRates': false,
44
+ 'fetchDepositAddress': true,
45
+ 'fetchDepositAddresses': false,
46
+ 'fetchDepositAddressesByNetwork': false,
44
47
  'fetchFundingHistory': false,
45
48
  'fetchFundingRate': false,
46
49
  'fetchFundingRateHistory': false,
@@ -720,6 +723,51 @@ class independentreserve extends independentreserve$1 {
720
723
  };
721
724
  return await this.privatePostCancelOrder(this.extend(request, params));
722
725
  }
726
+ async fetchDepositAddress(code, params = {}) {
727
+ /**
728
+ * @method
729
+ * @name independentreserve#fetchDepositAddress
730
+ * @description fetch the deposit address for a currency associated with this account
731
+ * @see https://www.independentreserve.com/features/api#GetDigitalCurrencyDepositAddress
732
+ * @param {string} code unified currency code
733
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
734
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
735
+ */
736
+ await this.loadMarkets();
737
+ const currency = this.currency(code);
738
+ const request = {
739
+ 'primaryCurrencyCode': currency['id'],
740
+ };
741
+ const response = await this.privatePostGetDigitalCurrencyDepositAddress(this.extend(request, params));
742
+ //
743
+ // {
744
+ // Tag: '3307446684',
745
+ // DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
746
+ // LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
747
+ // NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
748
+ // }
749
+ //
750
+ return this.parseDepositAddress(response);
751
+ }
752
+ parseDepositAddress(depositAddress, currency = undefined) {
753
+ //
754
+ // {
755
+ // Tag: '3307446684',
756
+ // DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
757
+ // LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
758
+ // NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
759
+ // }
760
+ //
761
+ const address = this.safeString(depositAddress, 'DepositAddress');
762
+ this.checkAddress(address);
763
+ return {
764
+ 'info': depositAddress,
765
+ 'currency': this.safeString(currency, 'code'),
766
+ 'address': address,
767
+ 'tag': this.safeString(depositAddress, 'Tag'),
768
+ 'network': undefined,
769
+ };
770
+ }
723
771
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
724
772
  let url = this.urls['api'][api] + '/' + path;
725
773
  if (api === 'public') {
@@ -232,6 +232,7 @@ class latoken extends latoken$1 {
232
232
  * @method
233
233
  * @name latoken#fetchTime
234
234
  * @description fetches the current integer timestamp in milliseconds from the exchange server
235
+ * @see https://api.latoken.com/doc/v2/#tag/Time/operation/currentTime
235
236
  * @param {object} [params] extra parameters specific to the exchange API endpoint
236
237
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
237
238
  */
@@ -248,6 +249,7 @@ class latoken extends latoken$1 {
248
249
  * @method
249
250
  * @name latoken#fetchMarkets
250
251
  * @description retrieves data on all markets for latoken
252
+ * @see https://api.latoken.com/doc/v2/#tag/Pair/operation/getActivePairs
251
253
  * @param {object} [params] extra parameters specific to the exchange API endpoint
252
254
  * @returns {object[]} an array of objects representing market data
253
255
  */
@@ -484,6 +486,7 @@ class latoken extends latoken$1 {
484
486
  * @method
485
487
  * @name latoken#fetchBalance
486
488
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
489
+ * @see https://api.latoken.com/doc/v2/#tag/Account/operation/getBalancesByUser
487
490
  * @param {object} [params] extra parameters specific to the exchange API endpoint
488
491
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
489
492
  */
@@ -550,6 +553,7 @@ class latoken extends latoken$1 {
550
553
  * @method
551
554
  * @name latoken#fetchOrderBook
552
555
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
556
+ * @see https://api.latoken.com/doc/v2/#tag/Order-Book/operation/getOrderBook
553
557
  * @param {string} symbol unified symbol of the market to fetch the order book for
554
558
  * @param {int} [limit] the maximum amount of order book entries to return
555
559
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -635,6 +639,7 @@ class latoken extends latoken$1 {
635
639
  * @method
636
640
  * @name latoken#fetchTicker
637
641
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
642
+ * @see https://api.latoken.com/doc/v2/#tag/Ticker/operation/getTicker
638
643
  * @param {string} symbol unified symbol of the market to fetch the ticker for
639
644
  * @param {object} [params] extra parameters specific to the exchange API endpoint
640
645
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -673,6 +678,7 @@ class latoken extends latoken$1 {
673
678
  * @method
674
679
  * @name latoken#fetchTickers
675
680
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
681
+ * @see https://api.latoken.com/doc/v2/#tag/Ticker/operation/getAllTickers
676
682
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
677
683
  * @param {object} [params] extra parameters specific to the exchange API endpoint
678
684
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -795,6 +801,7 @@ class latoken extends latoken$1 {
795
801
  * @method
796
802
  * @name latoken#fetchTrades
797
803
  * @description get the list of most recent trades for a particular symbol
804
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByPair
798
805
  * @param {string} symbol unified symbol of the market to fetch trades for
799
806
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
800
807
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -827,6 +834,8 @@ class latoken extends latoken$1 {
827
834
  * @method
828
835
  * @name latoken#fetchTradingFee
829
836
  * @description fetch the trading fees for a market
837
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getFeeByPair
838
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getAuthFeeByPair
830
839
  * @param {string} symbol unified market symbol
831
840
  * @param {object} [params] extra parameters specific to the exchange API endpoint
832
841
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -896,6 +905,8 @@ class latoken extends latoken$1 {
896
905
  * @method
897
906
  * @name latoken#fetchMyTrades
898
907
  * @description fetch all trades made by the user
908
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByTrader
909
+ * @see https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByAssetAndTrader
899
910
  * @param {string} symbol unified market symbol
900
911
  * @param {int} [since] the earliest time in ms to fetch trades for
901
912
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1403,6 +1414,7 @@ class latoken extends latoken$1 {
1403
1414
  * @name latoken#fetchTransactions
1404
1415
  * @deprecated
1405
1416
  * @description use fetchDepositsWithdrawals instead
1417
+ * @see https://api.latoken.com/doc/v2/#tag/Transaction/operation/getUserTransactions
1406
1418
  * @param {string} code unified currency code for the currency of the transactions, default is undefined
1407
1419
  * @param {int} [since] timestamp in ms of the earliest transaction, default is undefined
1408
1420
  * @param {int} [limit] max number of transactions to return, default is undefined
@@ -1531,6 +1543,7 @@ class latoken extends latoken$1 {
1531
1543
  * @method
1532
1544
  * @name latoken#fetchTransfers
1533
1545
  * @description fetch a history of internal transfers made on an account
1546
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
1534
1547
  * @param {string} code unified currency code of the currency transferred
1535
1548
  * @param {int} [since] the earliest time in ms to fetch transfers for
1536
1549
  * @param {int} [limit] the maximum number of transfers structures to retrieve
@@ -1579,6 +1592,9 @@ class latoken extends latoken$1 {
1579
1592
  * @method
1580
1593
  * @name latoken#transfer
1581
1594
  * @description transfer currency internally between wallets on the same account
1595
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByEmail
1596
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferById
1597
+ * @see https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByPhone
1582
1598
  * @param {string} code unified currency code
1583
1599
  * @param {float} amount amount to transfer
1584
1600
  * @param {string} fromAccount account to transfer from