ccxt 4.2.44 → 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 (92) 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 +1242 -195
  5. package/dist/ccxt.browser.min.js +7 -7
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/base/Exchange.js +48 -0
  8. package/dist/cjs/src/base/ws/Cache.js +13 -5
  9. package/dist/cjs/src/base/ws/OrderBook.js +2 -2
  10. package/dist/cjs/src/binance.js +407 -21
  11. package/dist/cjs/src/bingx.js +43 -5
  12. package/dist/cjs/src/bitfinex2.js +1 -0
  13. package/dist/cjs/src/bithumb.js +5 -0
  14. package/dist/cjs/src/bitstamp.js +1 -1
  15. package/dist/cjs/src/btcturk.js +11 -0
  16. package/dist/cjs/src/bybit.js +96 -43
  17. package/dist/cjs/src/coinbase.js +228 -38
  18. package/dist/cjs/src/coincheck.js +11 -0
  19. package/dist/cjs/src/coinmate.js +114 -1
  20. package/dist/cjs/src/coinspot.js +7 -0
  21. package/dist/cjs/src/cryptocom.js +2 -2
  22. package/dist/cjs/src/deribit.js +1 -1
  23. package/dist/cjs/src/hitbtc.js +2 -0
  24. package/dist/cjs/src/idex.js +60 -1
  25. package/dist/cjs/src/latoken.js +3 -0
  26. package/dist/cjs/src/mercado.js +3 -0
  27. package/dist/cjs/src/oceanex.js +3 -0
  28. package/dist/cjs/src/okx.js +1 -0
  29. package/dist/cjs/src/pro/bitget.js +12 -8
  30. package/dist/cjs/src/pro/bitmart.js +11 -11
  31. package/dist/cjs/src/pro/bitmex.js +4 -4
  32. package/dist/cjs/src/pro/cex.js +2 -2
  33. package/dist/cjs/src/pro/gate.js +76 -42
  34. package/dist/cjs/src/pro/gemini.js +4 -3
  35. package/dist/cjs/src/pro/hitbtc.js +1 -0
  36. package/dist/cjs/src/probit.js +3 -3
  37. package/dist/cjs/src/timex.js +65 -0
  38. package/js/ccxt.d.ts +1 -1
  39. package/js/ccxt.js +1 -1
  40. package/js/src/abstract/bequant.d.ts +2 -0
  41. package/js/src/abstract/bitcoincom.d.ts +2 -0
  42. package/js/src/abstract/bithumb.d.ts +5 -0
  43. package/js/src/abstract/coinbase.d.ts +1 -0
  44. package/js/src/abstract/coinmate.d.ts +12 -0
  45. package/js/src/abstract/fmfwio.d.ts +2 -0
  46. package/js/src/abstract/hitbtc.d.ts +2 -0
  47. package/js/src/abstract/hitbtc3.d.ts +2 -0
  48. package/js/src/abstract/okx.d.ts +1 -0
  49. package/js/src/base/Exchange.d.ts +12 -6
  50. package/js/src/base/Exchange.js +48 -0
  51. package/js/src/base/ws/Cache.d.ts +5 -1
  52. package/js/src/base/ws/Cache.js +13 -5
  53. package/js/src/base/ws/OrderBook.d.ts +5 -1
  54. package/js/src/base/ws/OrderBook.js +3 -3
  55. package/js/src/binance.d.ts +2 -1
  56. package/js/src/binance.js +407 -21
  57. package/js/src/bingx.d.ts +2 -1
  58. package/js/src/bingx.js +43 -5
  59. package/js/src/bitfinex2.js +1 -0
  60. package/js/src/bithumb.js +5 -0
  61. package/js/src/bitstamp.js +1 -1
  62. package/js/src/btcturk.js +11 -0
  63. package/js/src/bybit.d.ts +4 -1
  64. package/js/src/bybit.js +96 -43
  65. package/js/src/coinbase.d.ts +10 -4
  66. package/js/src/coinbase.js +228 -38
  67. package/js/src/coincheck.js +11 -0
  68. package/js/src/coinmate.d.ts +3 -1
  69. package/js/src/coinmate.js +114 -1
  70. package/js/src/coinspot.js +7 -0
  71. package/js/src/cryptocom.js +2 -2
  72. package/js/src/deribit.js +1 -1
  73. package/js/src/hitbtc.js +2 -0
  74. package/js/src/idex.d.ts +14 -0
  75. package/js/src/idex.js +60 -1
  76. package/js/src/latoken.js +3 -0
  77. package/js/src/mercado.js +3 -0
  78. package/js/src/oceanex.js +3 -0
  79. package/js/src/okx.js +1 -0
  80. package/js/src/pro/bitget.js +12 -8
  81. package/js/src/pro/bitmart.js +11 -11
  82. package/js/src/pro/bitmex.js +4 -4
  83. package/js/src/pro/cex.js +2 -2
  84. package/js/src/pro/gate.d.ts +4 -0
  85. package/js/src/pro/gate.js +76 -42
  86. package/js/src/pro/gemini.js +4 -3
  87. package/js/src/pro/hitbtc.js +1 -0
  88. package/js/src/probit.js +3 -3
  89. package/js/src/timex.d.ts +14 -0
  90. package/js/src/timex.js +65 -0
  91. package/package.json +1 -1
  92. package/skip-tests.json +4 -0
@@ -62,6 +62,7 @@ class coinmate extends coinmate$1 {
62
62
  'fetchPositionsRisk': false,
63
63
  'fetchPremiumIndexOHLCV': false,
64
64
  'fetchTicker': true,
65
+ 'fetchTickers': true,
65
66
  'fetchTrades': true,
66
67
  'fetchTradingFee': true,
67
68
  'fetchTradingFees': false,
@@ -96,6 +97,8 @@ class coinmate extends coinmate$1 {
96
97
  'get': [
97
98
  'orderBook',
98
99
  'ticker',
100
+ 'tickerAll',
101
+ 'products',
99
102
  'transactions',
100
103
  'tradingPairs',
101
104
  ],
@@ -144,6 +147,16 @@ class coinmate extends coinmate$1 {
144
147
  'unconfirmedEthereumDeposits',
145
148
  'unconfirmedLitecoinDeposits',
146
149
  'unconfirmedRippleDeposits',
150
+ 'cancelAllOpenOrders',
151
+ 'withdrawVirtualCurrency',
152
+ 'virtualCurrencyDepositAddresses',
153
+ 'unconfirmedVirtualCurrencyDeposits',
154
+ 'adaWithdrawal',
155
+ 'adaDepositAddresses',
156
+ 'unconfirmedAdaDeposits',
157
+ 'solWithdrawal',
158
+ 'solDepositAddresses',
159
+ 'unconfirmedSolDeposits',
147
160
  ],
148
161
  },
149
162
  },
@@ -188,6 +201,8 @@ class coinmate extends coinmate$1 {
188
201
  'XRP': 'privatePostRippleWithdrawal',
189
202
  'DASH': 'privatePostDashWithdrawal',
190
203
  'DAI': 'privatePostDaiWithdrawal',
204
+ 'ADA': 'privatePostAdaWithdrawal',
205
+ 'SOL': 'privatePostSolWithdrawal',
191
206
  },
192
207
  },
193
208
  },
@@ -212,6 +227,7 @@ class coinmate extends coinmate$1 {
212
227
  * @method
213
228
  * @name coinmate#fetchMarkets
214
229
  * @description retrieves data on all markets for coinmate
230
+ * @see https://coinmate.docs.apiary.io/#reference/trading-pairs/get-trading-pairs/get
215
231
  * @param {object} [params] extra parameters specific to the exchange API endpoint
216
232
  * @returns {object[]} an array of objects representing market data
217
233
  */
@@ -318,6 +334,7 @@ class coinmate extends coinmate$1 {
318
334
  * @method
319
335
  * @name coinmate#fetchBalance
320
336
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
337
+ * @see https://coinmate.docs.apiary.io/#reference/balance/get-balances/post
321
338
  * @param {object} [params] extra parameters specific to the exchange API endpoint
322
339
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
323
340
  */
@@ -330,6 +347,7 @@ class coinmate extends coinmate$1 {
330
347
  * @method
331
348
  * @name coinmate#fetchOrderBook
332
349
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
350
+ * @see https://coinmate.docs.apiary.io/#reference/order-book/get-order-book/get
333
351
  * @param {string} symbol unified symbol of the market to fetch the order book for
334
352
  * @param {int} [limit] the maximum amount of order book entries to return
335
353
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -351,6 +369,7 @@ class coinmate extends coinmate$1 {
351
369
  * @method
352
370
  * @name coinmate#fetchTicker
353
371
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
372
+ * @see https://coinmate.docs.apiary.io/#reference/ticker/get-ticker/get
354
373
  * @param {string} symbol unified symbol of the market to fetch the ticker for
355
374
  * @param {object} [params] extra parameters specific to the exchange API endpoint
356
375
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -361,7 +380,82 @@ class coinmate extends coinmate$1 {
361
380
  'currencyPair': market['id'],
362
381
  };
363
382
  const response = await this.publicGetTicker(this.extend(request, params));
364
- const ticker = this.safeValue(response, 'data');
383
+ //
384
+ // {
385
+ // "error": false,
386
+ // "errorMessage": null,
387
+ // "data": {
388
+ // "last": 0.55105,
389
+ // "high": 0.56439,
390
+ // "low": 0.54358,
391
+ // "amount": 37038.993381,
392
+ // "bid": 0.54595,
393
+ // "ask": 0.55324,
394
+ // "change": 3.03659243,
395
+ // "open": 0.53481,
396
+ // "timestamp": 1708074779
397
+ // }
398
+ // }
399
+ //
400
+ const data = this.safeValue(response, 'data');
401
+ return this.parseTicker(data, market);
402
+ }
403
+ async fetchTickers(symbols = undefined, params = {}) {
404
+ /**
405
+ * @method
406
+ * @name coinmate#fetchTickers
407
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
408
+ * @see https://coinmate.docs.apiary.io/#reference/ticker/get-ticker-all/get
409
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
410
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
411
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
412
+ */
413
+ await this.loadMarkets();
414
+ symbols = this.marketSymbols(symbols);
415
+ const response = await this.publicGetTickerAll(params);
416
+ //
417
+ // {
418
+ // "error": false,
419
+ // "errorMessage": null,
420
+ // "data": {
421
+ // "LTC_BTC": {
422
+ // "last": "0.001337",
423
+ // "high": "0.001348",
424
+ // "low": "0.001332",
425
+ // "amount": "34.75472959",
426
+ // "bid": "0.001348",
427
+ // "ask": "0.001356",
428
+ // "change": "-0.74239050",
429
+ // "open": "0.001347",
430
+ // "timestamp": "1708074485"
431
+ // }
432
+ // }
433
+ // }
434
+ //
435
+ const data = this.safeValue(response, 'data', {});
436
+ const keys = Object.keys(data);
437
+ const result = {};
438
+ for (let i = 0; i < keys.length; i++) {
439
+ const market = this.market(keys[i]);
440
+ const ticker = this.parseTicker(this.safeValue(data, keys[i]), market);
441
+ result[market['symbol']] = ticker;
442
+ }
443
+ return this.filterByArrayTickers(result, 'symbol', symbols);
444
+ }
445
+ parseTicker(ticker, market = undefined) {
446
+ //
447
+ // {
448
+ // "last": "0.001337",
449
+ // "high": "0.001348",
450
+ // "low": "0.001332",
451
+ // "amount": "34.75472959",
452
+ // "bid": "0.001348",
453
+ // "ask": "0.001356",
454
+ // "change": "-0.74239050",
455
+ // "open": "0.001347",
456
+ // "timestamp": "1708074485"
457
+ // }
458
+ //
365
459
  const timestamp = this.safeTimestamp(ticker, 'timestamp');
366
460
  const last = this.safeNumber(ticker, 'last');
367
461
  return this.safeTicker({
@@ -392,6 +486,7 @@ class coinmate extends coinmate$1 {
392
486
  * @method
393
487
  * @name coinmate#fetchDepositsWithdrawals
394
488
  * @description fetch history of deposits and withdrawals
489
+ * @see https://coinmate.docs.apiary.io/#reference/transfers/get-transfer-history/post
395
490
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
396
491
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
397
492
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -504,6 +599,12 @@ class coinmate extends coinmate$1 {
504
599
  * @method
505
600
  * @name coinmate#withdraw
506
601
  * @description make a withdrawal
602
+ * @see https://coinmate.docs.apiary.io/#reference/bitcoin-withdrawal-and-deposit/withdraw-bitcoins/post
603
+ * @see https://coinmate.docs.apiary.io/#reference/litecoin-withdrawal-and-deposit/withdraw-litecoins/post
604
+ * @see https://coinmate.docs.apiary.io/#reference/ethereum-withdrawal-and-deposit/withdraw-ethereum/post
605
+ * @see https://coinmate.docs.apiary.io/#reference/ripple-withdrawal-and-deposit/withdraw-ripple/post
606
+ * @see https://coinmate.docs.apiary.io/#reference/cardano-withdrawal-and-deposit/withdraw-cardano/post
607
+ * @see https://coinmate.docs.apiary.io/#reference/solana-withdrawal-and-deposit/withdraw-solana/post
507
608
  * @param {string} code unified currency code
508
609
  * @param {float} amount the amount to withdraw
509
610
  * @param {string} address the address to withdraw to
@@ -557,6 +658,7 @@ class coinmate extends coinmate$1 {
557
658
  * @method
558
659
  * @name coinmate#fetchMyTrades
559
660
  * @description fetch all trades made by the user
661
+ * @see https://coinmate.docs.apiary.io/#reference/trade-history/get-trade-history/post
560
662
  * @param {string} symbol unified market symbol
561
663
  * @param {int} [since] the earliest time in ms to fetch trades for
562
664
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -649,6 +751,7 @@ class coinmate extends coinmate$1 {
649
751
  * @method
650
752
  * @name coinmate#fetchTrades
651
753
  * @description get the list of most recent trades for a particular symbol
754
+ * @see https://coinmate.docs.apiary.io/#reference/transactions/transactions/get
652
755
  * @param {string} symbol unified symbol of the market to fetch trades for
653
756
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
654
757
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -686,6 +789,7 @@ class coinmate extends coinmate$1 {
686
789
  * @method
687
790
  * @name coinmate#fetchTradingFee
688
791
  * @description fetch the trading fees for a market
792
+ * @see https://coinmate.docs.apiary.io/#reference/trader-fees/get-trading-fees/post
689
793
  * @param {string} symbol unified market symbol
690
794
  * @param {object} [params] extra parameters specific to the exchange API endpoint
691
795
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -722,6 +826,7 @@ class coinmate extends coinmate$1 {
722
826
  * @method
723
827
  * @name coinmate#fetchOpenOrders
724
828
  * @description fetch all unfilled currently open orders
829
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-open-orders/post
725
830
  * @param {string} symbol unified market symbol
726
831
  * @param {int} [since] the earliest time in ms to fetch open orders for
727
832
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -737,6 +842,7 @@ class coinmate extends coinmate$1 {
737
842
  * @method
738
843
  * @name coinmate#fetchOrders
739
844
  * @description fetches information on multiple orders made by the user
845
+ * @see https://coinmate.docs.apiary.io/#reference/order/order-history/post
740
846
  * @param {string} symbol unified market symbol of the market orders were made in
741
847
  * @param {int} [since] the earliest time in ms to fetch orders for
742
848
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -860,6 +966,10 @@ class coinmate extends coinmate$1 {
860
966
  * @method
861
967
  * @name coinmate#createOrder
862
968
  * @description create a trade order
969
+ * @see https://coinmate.docs.apiary.io/#reference/order/buy-limit-order/post
970
+ * @see https://coinmate.docs.apiary.io/#reference/order/sell-limit-order/post
971
+ * @see https://coinmate.docs.apiary.io/#reference/order/buy-instant-order/post
972
+ * @see https://coinmate.docs.apiary.io/#reference/order/sell-instant-order/post
863
973
  * @param {string} symbol unified symbol of the market to create an order in
864
974
  * @param {string} type 'market' or 'limit'
865
975
  * @param {string} side 'buy' or 'sell'
@@ -900,6 +1010,8 @@ class coinmate extends coinmate$1 {
900
1010
  * @method
901
1011
  * @name coinmate#fetchOrder
902
1012
  * @description fetches information on an order made by the user
1013
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-order-by-orderid/post
1014
+ * @see https://coinmate.docs.apiary.io/#reference/order/get-order-by-clientorderid/post
903
1015
  * @param {string} symbol unified symbol of the market the order was made in
904
1016
  * @param {object} [params] extra parameters specific to the exchange API endpoint
905
1017
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -921,6 +1033,7 @@ class coinmate extends coinmate$1 {
921
1033
  * @method
922
1034
  * @name coinmate#cancelOrder
923
1035
  * @description cancels an open order
1036
+ * @see https://coinmate.docs.apiary.io/#reference/order/cancel-order/post
924
1037
  * @param {string} id order id
925
1038
  * @param {string} symbol not used by coinmate cancelOrder ()
926
1039
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -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');
@@ -1781,7 +1781,7 @@ class deribit extends deribit$1 {
1781
1781
  const amount = this.safeString(order, 'amount');
1782
1782
  let cost = Precise["default"].stringMul(filledString, averageString);
1783
1783
  if (market['inverse']) {
1784
- if (this.parseNumber(averageString) !== 0) {
1784
+ if (averageString !== '0') {
1785
1785
  cost = Precise["default"].stringDiv(amount, averageString);
1786
1786
  }
1787
1787
  }
@@ -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);