ccxt 4.2.45 → 4.2.46

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 (71) hide show
  1. package/CHANGELOG.md +3099 -8415
  2. package/README.md +4 -4
  3. package/change.sh +4 -2
  4. package/dist/ccxt.browser.js +381 -58
  5. package/dist/ccxt.browser.min.js +7 -7
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/base/ws/Cache.js +13 -5
  8. package/dist/cjs/src/base/ws/OrderBook.js +2 -2
  9. package/dist/cjs/src/binance.js +34 -12
  10. package/dist/cjs/src/bitfinex2.js +1 -0
  11. package/dist/cjs/src/bithumb.js +5 -0
  12. package/dist/cjs/src/btcturk.js +11 -0
  13. package/dist/cjs/src/coinbase.js +9 -5
  14. package/dist/cjs/src/coincheck.js +11 -0
  15. package/dist/cjs/src/coinmate.js +114 -1
  16. package/dist/cjs/src/coinspot.js +7 -0
  17. package/dist/cjs/src/cryptocom.js +2 -2
  18. package/dist/cjs/src/hitbtc.js +2 -0
  19. package/dist/cjs/src/idex.js +60 -1
  20. package/dist/cjs/src/latoken.js +3 -0
  21. package/dist/cjs/src/mercado.js +3 -0
  22. package/dist/cjs/src/oceanex.js +3 -0
  23. package/dist/cjs/src/okx.js +1 -0
  24. package/dist/cjs/src/pro/bitget.js +12 -8
  25. package/dist/cjs/src/pro/bitmart.js +11 -11
  26. package/dist/cjs/src/pro/bitmex.js +4 -4
  27. package/dist/cjs/src/pro/cex.js +2 -2
  28. package/dist/cjs/src/pro/gemini.js +4 -3
  29. package/dist/cjs/src/timex.js +65 -0
  30. package/js/ccxt.d.ts +1 -1
  31. package/js/ccxt.js +1 -1
  32. package/js/src/abstract/bequant.d.ts +2 -0
  33. package/js/src/abstract/bitcoincom.d.ts +2 -0
  34. package/js/src/abstract/bithumb.d.ts +5 -0
  35. package/js/src/abstract/coinmate.d.ts +12 -0
  36. package/js/src/abstract/fmfwio.d.ts +2 -0
  37. package/js/src/abstract/hitbtc.d.ts +2 -0
  38. package/js/src/abstract/hitbtc3.d.ts +2 -0
  39. package/js/src/abstract/okx.d.ts +1 -0
  40. package/js/src/base/Exchange.d.ts +9 -7
  41. package/js/src/base/ws/Cache.d.ts +5 -1
  42. package/js/src/base/ws/Cache.js +13 -5
  43. package/js/src/base/ws/OrderBook.d.ts +5 -1
  44. package/js/src/base/ws/OrderBook.js +3 -3
  45. package/js/src/binance.d.ts +1 -1
  46. package/js/src/binance.js +34 -12
  47. package/js/src/bitfinex2.js +1 -0
  48. package/js/src/bithumb.js +5 -0
  49. package/js/src/btcturk.js +11 -0
  50. package/js/src/coinbase.js +9 -5
  51. package/js/src/coincheck.js +11 -0
  52. package/js/src/coinmate.d.ts +3 -1
  53. package/js/src/coinmate.js +114 -1
  54. package/js/src/coinspot.js +7 -0
  55. package/js/src/cryptocom.js +2 -2
  56. package/js/src/hitbtc.js +2 -0
  57. package/js/src/idex.d.ts +14 -0
  58. package/js/src/idex.js +60 -1
  59. package/js/src/latoken.js +3 -0
  60. package/js/src/mercado.js +3 -0
  61. package/js/src/oceanex.js +3 -0
  62. package/js/src/okx.js +1 -0
  63. package/js/src/pro/bitget.js +12 -8
  64. package/js/src/pro/bitmart.js +11 -11
  65. package/js/src/pro/bitmex.js +4 -4
  66. package/js/src/pro/cex.js +2 -2
  67. package/js/src/pro/gemini.js +4 -3
  68. package/js/src/timex.d.ts +14 -0
  69. package/js/src/timex.js +65 -0
  70. package/package.json +1 -1
  71. package/skip-tests.json +4 -0
@@ -175,6 +175,7 @@ class coinspot extends coinspot$1 {
175
175
  * @method
176
176
  * @name coinspot#fetchBalance
177
177
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
178
+ * @see https://www.coinspot.com.au/api#listmybalance
178
179
  * @param {object} [params] extra parameters specific to the exchange API endpoint
179
180
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
180
181
  */
@@ -204,6 +205,7 @@ class coinspot extends coinspot$1 {
204
205
  * @method
205
206
  * @name coinspot#fetchOrderBook
206
207
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
208
+ * @see https://www.coinspot.com.au/api#listopenorders
207
209
  * @param {string} symbol unified symbol of the market to fetch the order book for
208
210
  * @param {int} [limit] the maximum amount of order book entries to return
209
211
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -257,6 +259,7 @@ class coinspot extends coinspot$1 {
257
259
  * @method
258
260
  * @name coinspot#fetchTicker
259
261
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
262
+ * @see https://www.coinspot.com.au/api#latestprices
260
263
  * @param {string} symbol unified symbol of the market to fetch the ticker for
261
264
  * @param {object} [params] extra parameters specific to the exchange API endpoint
262
265
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -330,6 +333,7 @@ class coinspot extends coinspot$1 {
330
333
  * @method
331
334
  * @name coinspot#fetchTrades
332
335
  * @description get the list of most recent trades for a particular symbol
336
+ * @see https://www.coinspot.com.au/api#orderhistory
333
337
  * @param {string} symbol unified symbol of the market to fetch trades for
334
338
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
335
339
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -358,6 +362,7 @@ class coinspot extends coinspot$1 {
358
362
  * @method
359
363
  * @name coinspot#fetchMyTrades
360
364
  * @description fetch all trades made by the user
365
+ * @see https://www.coinspot.com.au/api#rotransaction
361
366
  * @param {string} symbol unified market symbol
362
367
  * @param {int} [since] the earliest time in ms to fetch trades for
363
368
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -513,6 +518,8 @@ class coinspot extends coinspot$1 {
513
518
  * @method
514
519
  * @name coinspot#cancelOrder
515
520
  * @description cancels an open order
521
+ * @see https://www.coinspot.com.au/api#cancelbuyorder
522
+ * @see https://www.coinspot.com.au/api#cancelsellorder
516
523
  * @param {string} id order id
517
524
  * @param {string} symbol not used by coinspot cancelOrder ()
518
525
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2316,13 +2316,13 @@ class cryptocom extends cryptocom$1 {
2316
2316
  * @method
2317
2317
  * @name cryptocom#fetchDepositWithdrawFees
2318
2318
  * @description fetch deposit and withdraw fees
2319
- * @see https://exchange-docs.crypto.com/spot/index.html#private-get-currency-networks
2319
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
2320
2320
  * @param {string[]|undefined} codes list of unified currency codes
2321
2321
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2322
2322
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2323
2323
  */
2324
2324
  await this.loadMarkets();
2325
- const response = await this.v2PrivatePostPrivateGetCurrencyNetworks(params);
2325
+ const response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
2326
2326
  const data = this.safeValue(response, 'result');
2327
2327
  const currencyMap = this.safeValue(data, 'currency_map');
2328
2328
  return this.parseDepositWithdrawFees(currencyMap, codes, 'full_name');
@@ -138,6 +138,8 @@ class hitbtc extends hitbtc$1 {
138
138
  'public/orderbook/{symbol}': 10,
139
139
  'public/candles': 10,
140
140
  'public/candles/{symbol}': 10,
141
+ 'public/converted/candles': 10,
142
+ 'public/converted/candles/{symbol}': 10,
141
143
  'public/futures/info': 10,
142
144
  'public/futures/info/{symbol}': 10,
143
145
  'public/futures/history/funding': 10,
@@ -53,6 +53,9 @@ class idex extends idex$1 {
53
53
  'fetchCrossBorrowRates': false,
54
54
  'fetchCurrencies': true,
55
55
  'fetchDeposit': true,
56
+ 'fetchDepositAddress': true,
57
+ 'fetchDepositAddresses': false,
58
+ 'fetchDepositAddressesByNetwork': false,
56
59
  'fetchDeposits': true,
57
60
  'fetchFundingHistory': false,
58
61
  'fetchFundingRate': false,
@@ -112,7 +115,7 @@ class idex extends idex$1 {
112
115
  },
113
116
  'www': 'https://idex.io',
114
117
  'doc': [
115
- 'https://docs.idex.io/',
118
+ 'https://api-docs-v3.idex.io/',
116
119
  ],
117
120
  },
118
121
  'api': {
@@ -1700,6 +1703,62 @@ class idex extends idex$1 {
1700
1703
  const authenticated = hasApiKey && hasSecret && hasWalletAddress && hasPrivateKey;
1701
1704
  return authenticated ? (defaultCost / 2) : defaultCost;
1702
1705
  }
1706
+ async fetchDepositAddress(code = undefined, params = {}) {
1707
+ /**
1708
+ * @method
1709
+ * @name idex#fetchDepositAddress
1710
+ * @description fetch the Polygon address of the wallet
1711
+ * @see https://api-docs-v3.idex.io/#get-wallets
1712
+ * @param {string} code not used by idex
1713
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1714
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1715
+ */
1716
+ const request = {};
1717
+ request['nonce'] = this.uuidv1();
1718
+ const response = await this.privateGetWallets(this.extend(request, params));
1719
+ //
1720
+ // [
1721
+ // {
1722
+ // address: "0x37A1827CA64C94A26028bDCb43FBDCB0bf6DAf5B",
1723
+ // totalPortfolioValueUsd: "0.00",
1724
+ // time: "1678342148086"
1725
+ // },
1726
+ // {
1727
+ // address: "0x0Ef3456E616552238B0c562d409507Ed6051A7b3",
1728
+ // totalPortfolioValueUsd: "15.90",
1729
+ // time: "1691697811659"
1730
+ // }
1731
+ // ]
1732
+ //
1733
+ return this.parseDepositAddress(response);
1734
+ }
1735
+ parseDepositAddress(depositAddress, currency = undefined) {
1736
+ //
1737
+ // [
1738
+ // {
1739
+ // address: "0x37A1827CA64C94A26028bDCb43FBDCB0bf6DAf5B",
1740
+ // totalPortfolioValueUsd: "0.00",
1741
+ // time: "1678342148086"
1742
+ // },
1743
+ // {
1744
+ // address: "0x0Ef3456E616552238B0c562d409507Ed6051A7b3",
1745
+ // totalPortfolioValueUsd: "15.90",
1746
+ // time: "1691697811659"
1747
+ // }
1748
+ // ]
1749
+ //
1750
+ const length = depositAddress.length;
1751
+ const entry = this.safeDict(depositAddress, length - 1);
1752
+ const address = this.safeString(entry, 'address');
1753
+ this.checkAddress(address);
1754
+ return {
1755
+ 'info': depositAddress,
1756
+ 'currency': undefined,
1757
+ 'address': address,
1758
+ 'tag': undefined,
1759
+ 'network': 'MATIC',
1760
+ };
1761
+ }
1703
1762
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1704
1763
  const network = this.safeString(this.options, 'network', 'ETH');
1705
1764
  const version = this.safeString(this.options, 'version', 'v1');
@@ -41,6 +41,9 @@ class latoken extends latoken$1 {
41
41
  'fetchCrossBorrowRate': false,
42
42
  'fetchCrossBorrowRates': false,
43
43
  'fetchCurrencies': true,
44
+ 'fetchDepositAddress': false,
45
+ 'fetchDepositAddresses': false,
46
+ 'fetchDepositAddressesByNetwork': false,
44
47
  'fetchDepositsWithdrawals': true,
45
48
  'fetchDepositWithdrawFees': false,
46
49
  'fetchIsolatedBorrowRate': false,
@@ -40,6 +40,9 @@ class mercado extends mercado$1 {
40
40
  'fetchBorrowRateHistory': false,
41
41
  'fetchCrossBorrowRate': false,
42
42
  'fetchCrossBorrowRates': false,
43
+ 'fetchDepositAddress': false,
44
+ 'fetchDepositAddresses': false,
45
+ 'fetchDepositAddressesByNetwork': false,
43
46
  'fetchFundingHistory': false,
44
47
  'fetchFundingRate': false,
45
48
  'fetchFundingRateHistory': false,
@@ -47,6 +47,9 @@ class oceanex extends oceanex$1 {
47
47
  'fetchClosedOrders': true,
48
48
  'fetchCrossBorrowRate': false,
49
49
  'fetchCrossBorrowRates': false,
50
+ 'fetchDepositAddress': false,
51
+ 'fetchDepositAddresses': false,
52
+ 'fetchDepositAddressesByNetwork': false,
50
53
  'fetchIsolatedBorrowRate': false,
51
54
  'fetchIsolatedBorrowRates': false,
52
55
  'fetchMarkets': true,
@@ -444,6 +444,7 @@ class okx extends okx$1 {
444
444
  'account/quick-margin-borrow-repay': 4,
445
445
  'account/borrow-repay': 5 / 3,
446
446
  'account/simulated_margin': 10,
447
+ 'account/position-builder': 10,
447
448
  'account/set-riskOffset-type': 2,
448
449
  'account/activate-option': 4,
449
450
  'account/set-auto-loan': 4,
@@ -518,13 +518,15 @@ class bitget extends bitget$1 {
518
518
  const rawOrderBook = this.safeValue(data, 0);
519
519
  const timestamp = this.safeInteger(rawOrderBook, 'ts');
520
520
  const incrementalBook = channel === 'books';
521
- let storedOrderBook = undefined;
522
521
  if (incrementalBook) {
523
- storedOrderBook = this.safeValue(this.orderbooks, symbol);
524
- if (storedOrderBook === undefined) {
525
- storedOrderBook = this.countedOrderBook({});
526
- storedOrderBook['symbol'] = symbol;
522
+ // storedOrderBook = this.safeValue (this.orderbooks, symbol);
523
+ if (!(symbol in this.orderbooks)) {
524
+ // const ob = this.orderBook ({});
525
+ const ob = this.countedOrderBook({});
526
+ ob['symbol'] = symbol;
527
+ this.orderbooks[symbol] = ob;
527
528
  }
529
+ const storedOrderBook = this.orderbooks[symbol];
528
530
  const asks = this.safeValue(rawOrderBook, 'asks', []);
529
531
  const bids = this.safeValue(rawOrderBook, 'bids', []);
530
532
  this.handleDeltas(storedOrderBook['asks'], asks);
@@ -559,10 +561,12 @@ class bitget extends bitget$1 {
559
561
  }
560
562
  }
561
563
  else {
562
- storedOrderBook = this.parseOrderBook(rawOrderBook, symbol, timestamp);
564
+ const orderbook = this.orderBook({});
565
+ const parsedOrderbook = this.parseOrderBook(rawOrderBook, symbol, timestamp);
566
+ orderbook.reset(parsedOrderbook);
567
+ this.orderbooks[symbol] = orderbook;
563
568
  }
564
- this.orderbooks[symbol] = storedOrderBook;
565
- client.resolve(storedOrderBook, messageHash);
569
+ client.resolve(this.orderbooks[symbol], messageHash);
566
570
  }
567
571
  handleDelta(bookside, delta) {
568
572
  const bidAsk = this.parseBidAsk(delta, 0, 1);
@@ -1317,13 +1317,13 @@ class bitmart extends bitmart$1 {
1317
1317
  const update = datas[i];
1318
1318
  const marketId = this.safeString(update, 'symbol');
1319
1319
  const symbol = this.safeSymbol(marketId);
1320
- let orderbook = this.safeDict(this.orderbooks, symbol);
1321
- if (orderbook === undefined) {
1322
- orderbook = this.orderBook({}, limit);
1323
- orderbook['symbol'] = symbol;
1324
- this.orderbooks[symbol] = orderbook;
1320
+ if (!(symbol in this.orderbooks)) {
1321
+ const ob = this.orderBook({}, limit);
1322
+ ob['symbol'] = symbol;
1323
+ this.orderbooks[symbol] = ob;
1325
1324
  }
1326
- const type = this.safeValue(update, 'type');
1325
+ const orderbook = this.orderbooks[symbol];
1326
+ const type = this.safeString(update, 'type');
1327
1327
  if ((type === 'snapshot') || (!(channelName.indexOf('increase') >= 0))) {
1328
1328
  orderbook.reset({});
1329
1329
  }
@@ -1347,12 +1347,12 @@ class bitmart extends bitmart$1 {
1347
1347
  const depths = data['depths'];
1348
1348
  const marketId = this.safeString(data, 'symbol');
1349
1349
  const symbol = this.safeSymbol(marketId);
1350
- let orderbook = this.safeDict(this.orderbooks, symbol);
1351
- if (orderbook === undefined) {
1352
- orderbook = this.orderBook({}, limit);
1353
- orderbook['symbol'] = symbol;
1354
- this.orderbooks[symbol] = orderbook;
1350
+ if (!(symbol in this.orderbooks)) {
1351
+ const ob = this.orderBook({}, limit);
1352
+ ob['symbol'] = symbol;
1353
+ this.orderbooks[symbol] = ob;
1355
1354
  }
1355
+ const orderbook = this.orderbooks[symbol];
1356
1356
  const way = this.safeNumber(data, 'way');
1357
1357
  const side = (way === 1) ? 'bids' : 'asks';
1358
1358
  if (way === 1) {
@@ -348,11 +348,11 @@ class bitmex extends bitmex$1 {
348
348
  const market = this.safeMarket(marketId);
349
349
  const symbol = market['symbol'];
350
350
  const messageHash = table + ':' + marketId;
351
- let ticker = this.safeDict(this.tickers, symbol, {});
351
+ const ticker = this.safeDict(this.tickers, symbol, {});
352
352
  const info = this.safeDict(ticker, 'info', {});
353
- ticker = this.parseTicker(this.extend(info, update), market);
354
- tickers[symbol] = ticker;
355
- this.tickers[symbol] = ticker;
353
+ const parsedTicker = this.parseTicker(this.extend(info, update), market);
354
+ tickers[symbol] = parsedTicker;
355
+ this.tickers[symbol] = parsedTicker;
356
356
  client.resolve(ticker, messageHash);
357
357
  }
358
358
  client.resolve(tickers, 'instrument');
@@ -171,7 +171,7 @@ class cex extends cex$1 {
171
171
  stored.append(parsed);
172
172
  }
173
173
  const messageHash = 'trades';
174
- this.trades = stored;
174
+ this.trades = stored; // trades don't have symbol
175
175
  client.resolve(this.trades, messageHash);
176
176
  }
177
177
  parseWsOldTrade(trade, market = undefined) {
@@ -215,7 +215,7 @@ class cex extends cex$1 {
215
215
  // }
216
216
  //
217
217
  const data = this.safeValue(message, 'data', []);
218
- const stored = this.trades;
218
+ const stored = this.trades; // to do fix this, this.trades is not meant to be used like this
219
219
  for (let i = 0; i < data.length; i++) {
220
220
  const rawTrade = data[i];
221
221
  const parsed = this.parseWsOldTrade(rawTrade);
@@ -460,10 +460,11 @@ class gemini extends gemini$1 {
460
460
  const market = this.safeMarket(marketId.toLowerCase());
461
461
  const symbol = market['symbol'];
462
462
  const messageHash = 'orderbook:' + symbol;
463
- let orderbook = this.safeDict(this.orderbooks, symbol);
464
- if (orderbook === undefined) {
465
- orderbook = this.orderBook();
463
+ if (!(symbol in this.orderbooks)) {
464
+ const ob = this.orderBook();
465
+ this.orderbooks[symbol] = ob;
466
466
  }
467
+ const orderbook = this.orderbooks[symbol];
467
468
  const bids = orderbook['bids'];
468
469
  const asks = orderbook['asks'];
469
470
  for (let i = 0; i < rawOrderBookChanges.length; i++) {
@@ -41,6 +41,9 @@ class timex extends timex$1 {
41
41
  'fetchCrossBorrowRates': false,
42
42
  'fetchCurrencies': true,
43
43
  'fetchDeposit': false,
44
+ 'fetchDepositAddress': true,
45
+ 'fetchDepositAddresses': false,
46
+ 'fetchDepositAddressesByNetwork': false,
44
47
  'fetchDeposits': true,
45
48
  'fetchFundingHistory': false,
46
49
  'fetchFundingRate': false,
@@ -1521,7 +1524,69 @@ class timex extends timex$1 {
1521
1524
  'trades': rawTrades,
1522
1525
  }, market);
1523
1526
  }
1527
+ async fetchDepositAddress(code, params = {}) {
1528
+ /**
1529
+ * @method
1530
+ * @name timex#fetchDepositAddress
1531
+ * @description fetch the deposit address for a currency associated with this account, does not accept params["network"]
1532
+ * @param {string} code unified currency code
1533
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1534
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1535
+ */
1536
+ await this.loadMarkets();
1537
+ const currency = this.currency(code);
1538
+ const request = {
1539
+ 'symbol': currency['code'],
1540
+ };
1541
+ const response = await this.currenciesGetSSymbol(this.extend(request, params));
1542
+ //
1543
+ // {
1544
+ // id: '1',
1545
+ // currency: {
1546
+ // symbol: 'BTC',
1547
+ // name: 'Bitcoin',
1548
+ // address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',
1549
+ // decimals: '8',
1550
+ // tradeDecimals: '20',
1551
+ // fiatSymbol: 'BTC',
1552
+ // depositEnabled: true,
1553
+ // withdrawalEnabled: true,
1554
+ // transferEnabled: true,
1555
+ // active: true
1556
+ // }
1557
+ // }
1558
+ //
1559
+ const data = this.safeDict(response, 'currency', {});
1560
+ return this.parseDepositAddress(data, currency);
1561
+ }
1562
+ parseDepositAddress(depositAddress, currency = undefined) {
1563
+ //
1564
+ // {
1565
+ // symbol: 'BTC',
1566
+ // name: 'Bitcoin',
1567
+ // address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',
1568
+ // decimals: '8',
1569
+ // tradeDecimals: '20',
1570
+ // fiatSymbol: 'BTC',
1571
+ // depositEnabled: true,
1572
+ // withdrawalEnabled: true,
1573
+ // transferEnabled: true,
1574
+ // active: true
1575
+ // }
1576
+ //
1577
+ const currencyId = this.safeString(depositAddress, 'symbol');
1578
+ return {
1579
+ 'info': depositAddress,
1580
+ 'currency': this.safeCurrencyCode(currencyId, currency),
1581
+ 'address': this.safeString(depositAddress, 'address'),
1582
+ 'tag': undefined,
1583
+ 'network': undefined,
1584
+ };
1585
+ }
1524
1586
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1587
+ const paramsToExtract = this.extractParams(path);
1588
+ path = this.implodeParams(path, params);
1589
+ params = this.omit(params, paramsToExtract);
1525
1590
  let url = this.urls['api']['rest'] + '/' + api + '/' + path;
1526
1591
  if (Object.keys(params).length) {
1527
1592
  url += '?' + this.urlencodeWithArrayRepeat(params);
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.2.44";
7
+ declare const version = "4.2.45";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.45';
41
+ const version = '4.2.46';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -17,6 +17,8 @@ interface hitbtc {
17
17
  publicGetPublicOrderbookSymbol(params?: {}): Promise<implicitReturnType>;
18
18
  publicGetPublicCandles(params?: {}): Promise<implicitReturnType>;
19
19
  publicGetPublicCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
+ publicGetPublicConvertedCandles(params?: {}): Promise<implicitReturnType>;
21
+ publicGetPublicConvertedCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
22
  publicGetPublicFuturesInfo(params?: {}): Promise<implicitReturnType>;
21
23
  publicGetPublicFuturesInfoSymbol(params?: {}): Promise<implicitReturnType>;
22
24
  publicGetPublicFuturesHistoryFunding(params?: {}): Promise<implicitReturnType>;
@@ -17,6 +17,8 @@ interface fmfwio {
17
17
  publicGetPublicOrderbookSymbol(params?: {}): Promise<implicitReturnType>;
18
18
  publicGetPublicCandles(params?: {}): Promise<implicitReturnType>;
19
19
  publicGetPublicCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
+ publicGetPublicConvertedCandles(params?: {}): Promise<implicitReturnType>;
21
+ publicGetPublicConvertedCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
22
  publicGetPublicFuturesInfo(params?: {}): Promise<implicitReturnType>;
21
23
  publicGetPublicFuturesInfoSymbol(params?: {}): Promise<implicitReturnType>;
22
24
  publicGetPublicFuturesHistoryFunding(params?: {}): Promise<implicitReturnType>;
@@ -6,6 +6,11 @@ interface Exchange {
6
6
  publicGetOrderbookALLQuoteId(params?: {}): Promise<implicitReturnType>;
7
7
  publicGetOrderbookBaseIdQuoteId(params?: {}): Promise<implicitReturnType>;
8
8
  publicGetTransactionHistoryBaseIdQuoteId(params?: {}): Promise<implicitReturnType>;
9
+ publicGetNetworkInfo(params?: {}): Promise<implicitReturnType>;
10
+ publicGetAssetsstatusMultichainALL(params?: {}): Promise<implicitReturnType>;
11
+ publicGetAssetsstatusMultichainCurrency(params?: {}): Promise<implicitReturnType>;
12
+ publicGetWithdrawMinimumALL(params?: {}): Promise<implicitReturnType>;
13
+ publicGetWithdrawMinimumCurrency(params?: {}): Promise<implicitReturnType>;
9
14
  publicGetAssetsstatusALL(params?: {}): Promise<implicitReturnType>;
10
15
  publicGetAssetsstatusBaseId(params?: {}): Promise<implicitReturnType>;
11
16
  publicGetCandlestickBaseIdQuoteIdInterval(params?: {}): Promise<implicitReturnType>;
@@ -3,6 +3,8 @@ import { Exchange as _Exchange } from '../base/Exchange.js';
3
3
  interface Exchange {
4
4
  publicGetOrderBook(params?: {}): Promise<implicitReturnType>;
5
5
  publicGetTicker(params?: {}): Promise<implicitReturnType>;
6
+ publicGetTickerAll(params?: {}): Promise<implicitReturnType>;
7
+ publicGetProducts(params?: {}): Promise<implicitReturnType>;
6
8
  publicGetTransactions(params?: {}): Promise<implicitReturnType>;
7
9
  publicGetTradingPairs(params?: {}): Promise<implicitReturnType>;
8
10
  privatePostBalances(params?: {}): Promise<implicitReturnType>;
@@ -47,6 +49,16 @@ interface Exchange {
47
49
  privatePostUnconfirmedEthereumDeposits(params?: {}): Promise<implicitReturnType>;
48
50
  privatePostUnconfirmedLitecoinDeposits(params?: {}): Promise<implicitReturnType>;
49
51
  privatePostUnconfirmedRippleDeposits(params?: {}): Promise<implicitReturnType>;
52
+ privatePostCancelAllOpenOrders(params?: {}): Promise<implicitReturnType>;
53
+ privatePostWithdrawVirtualCurrency(params?: {}): Promise<implicitReturnType>;
54
+ privatePostVirtualCurrencyDepositAddresses(params?: {}): Promise<implicitReturnType>;
55
+ privatePostUnconfirmedVirtualCurrencyDeposits(params?: {}): Promise<implicitReturnType>;
56
+ privatePostAdaWithdrawal(params?: {}): Promise<implicitReturnType>;
57
+ privatePostAdaDepositAddresses(params?: {}): Promise<implicitReturnType>;
58
+ privatePostUnconfirmedAdaDeposits(params?: {}): Promise<implicitReturnType>;
59
+ privatePostSolWithdrawal(params?: {}): Promise<implicitReturnType>;
60
+ privatePostSolDepositAddresses(params?: {}): Promise<implicitReturnType>;
61
+ privatePostUnconfirmedSolDeposits(params?: {}): Promise<implicitReturnType>;
50
62
  }
51
63
  declare abstract class Exchange extends _Exchange {
52
64
  }
@@ -17,6 +17,8 @@ interface hitbtc {
17
17
  publicGetPublicOrderbookSymbol(params?: {}): Promise<implicitReturnType>;
18
18
  publicGetPublicCandles(params?: {}): Promise<implicitReturnType>;
19
19
  publicGetPublicCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
+ publicGetPublicConvertedCandles(params?: {}): Promise<implicitReturnType>;
21
+ publicGetPublicConvertedCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
22
  publicGetPublicFuturesInfo(params?: {}): Promise<implicitReturnType>;
21
23
  publicGetPublicFuturesInfoSymbol(params?: {}): Promise<implicitReturnType>;
22
24
  publicGetPublicFuturesHistoryFunding(params?: {}): Promise<implicitReturnType>;
@@ -17,6 +17,8 @@ interface Exchange {
17
17
  publicGetPublicOrderbookSymbol(params?: {}): Promise<implicitReturnType>;
18
18
  publicGetPublicCandles(params?: {}): Promise<implicitReturnType>;
19
19
  publicGetPublicCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
+ publicGetPublicConvertedCandles(params?: {}): Promise<implicitReturnType>;
21
+ publicGetPublicConvertedCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
22
  publicGetPublicFuturesInfo(params?: {}): Promise<implicitReturnType>;
21
23
  publicGetPublicFuturesInfoSymbol(params?: {}): Promise<implicitReturnType>;
22
24
  publicGetPublicFuturesHistoryFunding(params?: {}): Promise<implicitReturnType>;
@@ -17,6 +17,8 @@ interface hitbtc {
17
17
  publicGetPublicOrderbookSymbol(params?: {}): Promise<implicitReturnType>;
18
18
  publicGetPublicCandles(params?: {}): Promise<implicitReturnType>;
19
19
  publicGetPublicCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
+ publicGetPublicConvertedCandles(params?: {}): Promise<implicitReturnType>;
21
+ publicGetPublicConvertedCandlesSymbol(params?: {}): Promise<implicitReturnType>;
20
22
  publicGetPublicFuturesInfo(params?: {}): Promise<implicitReturnType>;
21
23
  publicGetPublicFuturesInfoSymbol(params?: {}): Promise<implicitReturnType>;
22
24
  publicGetPublicFuturesHistoryFunding(params?: {}): Promise<implicitReturnType>;
@@ -245,6 +245,7 @@ interface Exchange {
245
245
  privatePostAccountQuickMarginBorrowRepay(params?: {}): Promise<implicitReturnType>;
246
246
  privatePostAccountBorrowRepay(params?: {}): Promise<implicitReturnType>;
247
247
  privatePostAccountSimulatedMargin(params?: {}): Promise<implicitReturnType>;
248
+ privatePostAccountPositionBuilder(params?: {}): Promise<implicitReturnType>;
248
249
  privatePostAccountSetRiskOffsetType(params?: {}): Promise<implicitReturnType>;
249
250
  privatePostAccountActivateOption(params?: {}): Promise<implicitReturnType>;
250
251
  privatePostAccountSetAutoLoan(params?: {}): Promise<implicitReturnType>;
@@ -5,6 +5,8 @@ import WsClient from './ws/WsClient.js';
5
5
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
6
6
  import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Str, Num, MarketInterface, CurrencyInterface, Account } from './types.js';
7
7
  export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, Liquidation, FundingHistory, Greeks } from './types.js';
8
+ import { ArrayCache } from './ws/Cache.js';
9
+ import { OrderBook as Ob } from './ws/OrderBook.js';
8
10
  /**
9
11
  * @class Exchange
10
12
  */
@@ -73,15 +75,15 @@ export default class Exchange {
73
75
  walletAddress: string;
74
76
  token: string;
75
77
  balance: {};
76
- orderbooks: {};
77
- tickers: {};
78
- bidsasks: {};
79
- orders: any;
80
- triggerOrders: any;
81
- trades: any;
78
+ orderbooks: Dictionary<Ob>;
79
+ tickers: Dictionary<Ticker>;
80
+ bidsasks: Dictionary<Ticker>;
81
+ orders: ArrayCache;
82
+ triggerOrders: ArrayCache;
83
+ trades: Dictionary<ArrayCache>;
82
84
  transactions: {};
83
85
  ohlcvs: any;
84
- myTrades: any;
86
+ myTrades: ArrayCache;
85
87
  positions: any;
86
88
  urls: {
87
89
  logo?: string;
@@ -1,8 +1,12 @@
1
+ interface CustomArray extends Array {
2
+ hashmap: object;
3
+ }
1
4
  declare class BaseCache extends Array {
2
5
  constructor(maxSize?: any);
3
6
  clear(): void;
4
7
  }
5
- declare class ArrayCache extends BaseCache {
8
+ declare class ArrayCache extends BaseCache implements CustomArray {
9
+ hashmap: object;
6
10
  constructor(maxSize?: any);
7
11
  getLimit(symbol: any, limit: any): any;
8
12
  append(item: any): void;
@@ -22,6 +22,7 @@ class BaseCache extends Array {
22
22
  class ArrayCache extends BaseCache {
23
23
  constructor(maxSize = undefined) {
24
24
  super(maxSize);
25
+ this.hashmap = {};
25
26
  Object.defineProperty(this, 'nestedNewUpdatesBySymbol', {
26
27
  __proto__: null,
27
28
  value: false,
@@ -47,6 +48,12 @@ class ArrayCache extends BaseCache {
47
48
  value: false,
48
49
  writable: true,
49
50
  });
51
+ Object.defineProperty(this, 'hashmap', {
52
+ __proto__: null,
53
+ value: {},
54
+ writable: true,
55
+ enumerable: false,
56
+ });
50
57
  }
51
58
  getLimit(symbol, limit) {
52
59
  let newUpdatesValue = undefined;
@@ -126,6 +133,7 @@ class ArrayCacheByTimestamp extends BaseCache {
126
133
  if (item[0] in this.hashmap) {
127
134
  const reference = this.hashmap[item[0]];
128
135
  if (reference !== item) {
136
+ // eslint-disable-next-line
129
137
  for (const prop in item) {
130
138
  reference[prop] = item[prop];
131
139
  }
@@ -151,11 +159,11 @@ class ArrayCacheBySymbolById extends ArrayCache {
151
159
  constructor(maxSize = undefined) {
152
160
  super(maxSize);
153
161
  this.nestedNewUpdatesBySymbol = true;
154
- Object.defineProperty(this, 'hashmap', {
155
- __proto__: null,
156
- value: {},
157
- writable: true,
158
- });
162
+ // Object.defineProperty (this, 'hashmap', {
163
+ // __proto__: null, // make it invisible
164
+ // value: {},
165
+ // writable: true,
166
+ // })
159
167
  }
160
168
  append(item) {
161
169
  const byId = this.hashmap[item.symbol] = this.hashmap[item.symbol] || {};
@@ -1,4 +1,8 @@
1
- declare class OrderBook {
1
+ interface CustomOrderBookProp {
2
+ cache: any[];
3
+ }
4
+ declare class OrderBook implements CustomOrderBookProp {
5
+ cache: any[];
2
6
  constructor(snapshot?: {}, depth?: any);
3
7
  limit(): this;
4
8
  update(snapshot: any): this;