ccxt 4.2.39 → 4.2.40

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/dist/ccxt.browser.js +923 -310
  3. package/dist/ccxt.browser.min.js +2 -2
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ascendex.js +28 -24
  6. package/dist/cjs/src/base/Exchange.js +14 -14
  7. package/dist/cjs/src/binance.js +372 -146
  8. package/dist/cjs/src/bingx.js +250 -23
  9. package/dist/cjs/src/bitget.js +13 -2
  10. package/dist/cjs/src/bybit.js +3 -1
  11. package/dist/cjs/src/coinbase.js +8 -6
  12. package/dist/cjs/src/coinbasepro.js +1 -0
  13. package/dist/cjs/src/coinlist.js +9 -7
  14. package/dist/cjs/src/coinmetro.js +2 -1
  15. package/dist/cjs/src/krakenfutures.js +126 -2
  16. package/dist/cjs/src/mexc.js +43 -43
  17. package/dist/cjs/src/okx.js +9 -15
  18. package/dist/cjs/src/phemex.js +1 -0
  19. package/dist/cjs/src/pro/bitmart.js +38 -20
  20. package/dist/cjs/src/pro/bybit.js +5 -5
  21. package/js/ccxt.d.ts +1 -1
  22. package/js/ccxt.js +1 -1
  23. package/js/src/abstract/bingx.d.ts +4 -0
  24. package/js/src/abstract/coinbasepro.d.ts +1 -0
  25. package/js/src/ascendex.js +28 -24
  26. package/js/src/base/Exchange.d.ts +8 -8
  27. package/js/src/base/Exchange.js +14 -14
  28. package/js/src/binance.d.ts +1 -1
  29. package/js/src/binance.js +372 -146
  30. package/js/src/bingx.d.ts +1 -0
  31. package/js/src/bingx.js +250 -23
  32. package/js/src/bitget.js +13 -2
  33. package/js/src/bybit.js +3 -1
  34. package/js/src/coinbase.js +8 -6
  35. package/js/src/coinbasepro.js +1 -0
  36. package/js/src/coinlist.js +9 -7
  37. package/js/src/coinmetro.js +2 -1
  38. package/js/src/krakenfutures.d.ts +2 -0
  39. package/js/src/krakenfutures.js +126 -2
  40. package/js/src/mexc.js +43 -43
  41. package/js/src/okx.js +9 -15
  42. package/js/src/phemex.js +1 -0
  43. package/js/src/pro/bitmart.d.ts +2 -0
  44. package/js/src/pro/bitmart.js +38 -20
  45. package/js/src/pro/bybit.d.ts +1 -1
  46. package/js/src/pro/bybit.js +5 -5
  47. package/package.json +1 -1
package/js/src/mexc.js CHANGED
@@ -825,7 +825,7 @@ export default class mexc extends Exchange {
825
825
  async fetchStatus(params = {}) {
826
826
  /**
827
827
  * @method
828
- * @name mexc3#fetchStatus
828
+ * @name mexc#fetchStatus
829
829
  * @description the latest known information on the availability of the exchange API
830
830
  * @param {object} [params] extra parameters specific to the exchange API endpoint
831
831
  * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
@@ -862,7 +862,7 @@ export default class mexc extends Exchange {
862
862
  async fetchTime(params = {}) {
863
863
  /**
864
864
  * @method
865
- * @name mexc3#fetchTime
865
+ * @name mexc#fetchTime
866
866
  * @description fetches the current integer timestamp in milliseconds from the exchange server
867
867
  * @param {object} [params] extra parameters specific to the exchange API endpoint
868
868
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
@@ -888,7 +888,7 @@ export default class mexc extends Exchange {
888
888
  async fetchCurrencies(params = {}) {
889
889
  /**
890
890
  * @method
891
- * @name mexc3#fetchCurrencies
891
+ * @name mexc#fetchCurrencies
892
892
  * @description fetches all available currencies on an exchange
893
893
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
894
894
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1053,8 +1053,8 @@ export default class mexc extends Exchange {
1053
1053
  async fetchMarkets(params = {}) {
1054
1054
  /**
1055
1055
  * @method
1056
- * @name mexc3#fetchMarkets
1057
- * @description retrieves data on all markets for mexc3
1056
+ * @name mexc#fetchMarkets
1057
+ * @description retrieves data on all markets for mexc
1058
1058
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1059
1059
  * @returns {object[]} an array of objects representing market data
1060
1060
  */
@@ -1294,7 +1294,7 @@ export default class mexc extends Exchange {
1294
1294
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
1295
1295
  /**
1296
1296
  * @method
1297
- * @name mexc3#fetchOrderBook
1297
+ * @name mexc#fetchOrderBook
1298
1298
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
1299
1299
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-s-depth-information
1300
1300
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
@@ -1371,7 +1371,7 @@ export default class mexc extends Exchange {
1371
1371
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
1372
1372
  /**
1373
1373
  * @method
1374
- * @name mexc3#fetchTrades
1374
+ * @name mexc#fetchTrades
1375
1375
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
1376
1376
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
1377
1377
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
@@ -1647,7 +1647,7 @@ export default class mexc extends Exchange {
1647
1647
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
1648
1648
  /**
1649
1649
  * @method
1650
- * @name mexc3#fetchOHLCV
1650
+ * @name mexc#fetchOHLCV
1651
1651
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
1652
1652
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
1653
1653
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
@@ -1769,7 +1769,7 @@ export default class mexc extends Exchange {
1769
1769
  async fetchTickers(symbols = undefined, params = {}) {
1770
1770
  /**
1771
1771
  * @method
1772
- * @name mexc3#fetchTickers
1772
+ * @name mexc#fetchTickers
1773
1773
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1774
1774
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1775
1775
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1857,7 +1857,7 @@ export default class mexc extends Exchange {
1857
1857
  async fetchTicker(symbol, params = {}) {
1858
1858
  /**
1859
1859
  * @method
1860
- * @name mexc3#fetchTicker
1860
+ * @name mexc#fetchTicker
1861
1861
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1862
1862
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1863
1863
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2047,7 +2047,7 @@ export default class mexc extends Exchange {
2047
2047
  async fetchBidsAsks(symbols = undefined, params = {}) {
2048
2048
  /**
2049
2049
  * @method
2050
- * @name mexc3#fetchBidsAsks
2050
+ * @name mexc#fetchBidsAsks
2051
2051
  * @description fetches the bid and ask price and volume for multiple markets
2052
2052
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
2053
2053
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2108,7 +2108,7 @@ export default class mexc extends Exchange {
2108
2108
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
2109
2109
  /**
2110
2110
  * @method
2111
- * @name mexc3#createOrder
2111
+ * @name mexc#createOrder
2112
2112
  * @description create a trade order
2113
2113
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
2114
2114
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
@@ -2389,7 +2389,7 @@ export default class mexc extends Exchange {
2389
2389
  async fetchOrder(id, symbol = undefined, params = {}) {
2390
2390
  /**
2391
2391
  * @method
2392
- * @name mexc3#fetchOrder
2392
+ * @name mexc#fetchOrder
2393
2393
  * @description fetches information on an order made by the user
2394
2394
  * @param {string} symbol unified symbol of the market the order was made in
2395
2395
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2511,7 +2511,7 @@ export default class mexc extends Exchange {
2511
2511
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2512
2512
  /**
2513
2513
  * @method
2514
- * @name mexc3#fetchOrders
2514
+ * @name mexc#fetchOrders
2515
2515
  * @description fetches information on multiple orders made by the user
2516
2516
  * @param {string} symbol unified market symbol of the market orders were made in
2517
2517
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -2743,7 +2743,7 @@ export default class mexc extends Exchange {
2743
2743
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2744
2744
  /**
2745
2745
  * @method
2746
- * @name mexc3#fetchOpenOrders
2746
+ * @name mexc#fetchOpenOrders
2747
2747
  * @description fetch all unfilled currently open orders
2748
2748
  * @param {string} symbol unified market symbol
2749
2749
  * @param {int} [since] the earliest time in ms to fetch open orders for
@@ -2834,7 +2834,7 @@ export default class mexc extends Exchange {
2834
2834
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2835
2835
  /**
2836
2836
  * @method
2837
- * @name mexc3#fetchClosedOrders
2837
+ * @name mexc#fetchClosedOrders
2838
2838
  * @description fetches information on multiple closed orders made by the user
2839
2839
  * @param {string} symbol unified market symbol of the market orders were made in
2840
2840
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -2847,7 +2847,7 @@ export default class mexc extends Exchange {
2847
2847
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2848
2848
  /**
2849
2849
  * @method
2850
- * @name mexc3#fetchCanceledOrders
2850
+ * @name mexc#fetchCanceledOrders
2851
2851
  * @description fetches information on multiple canceled orders made by the user
2852
2852
  * @param {string} symbol unified market symbol of the market orders were made in
2853
2853
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
@@ -2876,7 +2876,7 @@ export default class mexc extends Exchange {
2876
2876
  async cancelOrder(id, symbol = undefined, params = {}) {
2877
2877
  /**
2878
2878
  * @method
2879
- * @name mexc3#cancelOrder
2879
+ * @name mexc#cancelOrder
2880
2880
  * @description cancels an open order
2881
2881
  * @param {string} id order id
2882
2882
  * @param {string} symbol unified symbol of the market the order was made in
@@ -2993,7 +2993,7 @@ export default class mexc extends Exchange {
2993
2993
  async cancelOrders(ids, symbol = undefined, params = {}) {
2994
2994
  /**
2995
2995
  * @method
2996
- * @name mexc3#cancelOrders
2996
+ * @name mexc#cancelOrders
2997
2997
  * @description cancel multiple orders
2998
2998
  * @param {string[]} ids order ids
2999
2999
  * @param {string} symbol unified market symbol, default is undefined
@@ -3028,7 +3028,7 @@ export default class mexc extends Exchange {
3028
3028
  async cancelAllOrders(symbol = undefined, params = {}) {
3029
3029
  /**
3030
3030
  * @method
3031
- * @name mexc3#cancelAllOrders
3031
+ * @name mexc#cancelAllOrders
3032
3032
  * @description cancel all open orders
3033
3033
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
3034
3034
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -3431,7 +3431,7 @@ export default class mexc extends Exchange {
3431
3431
  async fetchAccounts(params = {}) {
3432
3432
  /**
3433
3433
  * @method
3434
- * @name mexc3#fetchAccounts
3434
+ * @name mexc#fetchAccounts
3435
3435
  * @description fetch all the accounts associated with a profile
3436
3436
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3437
3437
  * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
@@ -3458,7 +3458,7 @@ export default class mexc extends Exchange {
3458
3458
  async fetchTradingFees(params = {}) {
3459
3459
  /**
3460
3460
  * @method
3461
- * @name mexc3#fetchTradingFees
3461
+ * @name mexc#fetchTradingFees
3462
3462
  * @description fetch the trading fees for multiple markets
3463
3463
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3464
3464
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
@@ -3609,7 +3609,7 @@ export default class mexc extends Exchange {
3609
3609
  async fetchBalance(params = {}) {
3610
3610
  /**
3611
3611
  * @method
3612
- * @name mexc3#fetchBalance
3612
+ * @name mexc#fetchBalance
3613
3613
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
3614
3614
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
3615
3615
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
@@ -3743,7 +3743,7 @@ export default class mexc extends Exchange {
3743
3743
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3744
3744
  /**
3745
3745
  * @method
3746
- * @name mexc3#fetchMyTrades
3746
+ * @name mexc#fetchMyTrades
3747
3747
  * @description fetch all trades made by the user
3748
3748
  * @param {string} symbol unified market symbol
3749
3749
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -3833,7 +3833,7 @@ export default class mexc extends Exchange {
3833
3833
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
3834
3834
  /**
3835
3835
  * @method
3836
- * @name mexc3#fetchOrderTrades
3836
+ * @name mexc#fetchOrderTrades
3837
3837
  * @description fetch all the trades made from a single order
3838
3838
  * @param {string} id order id
3839
3839
  * @param {string} symbol unified market symbol
@@ -3931,7 +3931,7 @@ export default class mexc extends Exchange {
3931
3931
  async reduceMargin(symbol, amount, params = {}) {
3932
3932
  /**
3933
3933
  * @method
3934
- * @name mexc3#reduceMargin
3934
+ * @name mexc#reduceMargin
3935
3935
  * @description remove margin from a position
3936
3936
  * @param {string} symbol unified market symbol
3937
3937
  * @param {float} amount the amount of margin to remove
@@ -3943,7 +3943,7 @@ export default class mexc extends Exchange {
3943
3943
  async addMargin(symbol, amount, params = {}) {
3944
3944
  /**
3945
3945
  * @method
3946
- * @name mexc3#addMargin
3946
+ * @name mexc#addMargin
3947
3947
  * @description add margin
3948
3948
  * @param {string} symbol unified market symbol
3949
3949
  * @param {float} amount amount of margin to add
@@ -3955,7 +3955,7 @@ export default class mexc extends Exchange {
3955
3955
  async setLeverage(leverage, symbol = undefined, params = {}) {
3956
3956
  /**
3957
3957
  * @method
3958
- * @name mexc3#setLeverage
3958
+ * @name mexc#setLeverage
3959
3959
  * @description set the level of leverage for a market
3960
3960
  * @param {float} leverage the rate of leverage
3961
3961
  * @param {string} symbol unified market symbol
@@ -3988,7 +3988,7 @@ export default class mexc extends Exchange {
3988
3988
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3989
3989
  /**
3990
3990
  * @method
3991
- * @name mexc3#fetchFundingHistory
3991
+ * @name mexc#fetchFundingHistory
3992
3992
  * @description fetch the history of funding payments paid and received on this account
3993
3993
  * @param {string} symbol unified market symbol
3994
3994
  * @param {int} [since] the earliest time in ms to fetch funding history for
@@ -4103,7 +4103,7 @@ export default class mexc extends Exchange {
4103
4103
  async fetchFundingRate(symbol, params = {}) {
4104
4104
  /**
4105
4105
  * @method
4106
- * @name mexc3#fetchFundingRate
4106
+ * @name mexc#fetchFundingRate
4107
4107
  * @description fetch the current funding rate
4108
4108
  * @param {string} symbol unified market symbol
4109
4109
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4204,7 +4204,7 @@ export default class mexc extends Exchange {
4204
4204
  async fetchLeverageTiers(symbols = undefined, params = {}) {
4205
4205
  /**
4206
4206
  * @method
4207
- * @name mexc3#fetchLeverageTiers
4207
+ * @name mexc#fetchLeverageTiers
4208
4208
  * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
4209
4209
  * @param {string[]|undefined} symbols list of unified market symbols
4210
4210
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4317,7 +4317,7 @@ export default class mexc extends Exchange {
4317
4317
  async fetchDepositAddressesByNetwork(code, params = {}) {
4318
4318
  /**
4319
4319
  * @method
4320
- * @name mexc3#fetchDepositAddressesByNetwork
4320
+ * @name mexc#fetchDepositAddressesByNetwork
4321
4321
  * @description fetch a dictionary of addresses for a currency, indexed by network
4322
4322
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
4323
4323
  * @param {string} code unified currency code of the currency for the deposit address
@@ -4357,7 +4357,7 @@ export default class mexc extends Exchange {
4357
4357
  async createDepositAddress(code, params = {}) {
4358
4358
  /**
4359
4359
  * @method
4360
- * @name mexc3#createDepositAddress
4360
+ * @name mexc#createDepositAddress
4361
4361
  * @description create a currency deposit address
4362
4362
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
4363
4363
  * @param {string} code unified currency code of the currency for the deposit address
@@ -4397,7 +4397,7 @@ export default class mexc extends Exchange {
4397
4397
  async fetchDepositAddress(code, params = {}) {
4398
4398
  /**
4399
4399
  * @method
4400
- * @name mexc3#fetchDepositAddress
4400
+ * @name mexc#fetchDepositAddress
4401
4401
  * @description fetch the deposit address for a currency associated with this account
4402
4402
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
4403
4403
  * @param {string} code unified currency code
@@ -4425,7 +4425,7 @@ export default class mexc extends Exchange {
4425
4425
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
4426
4426
  /**
4427
4427
  * @method
4428
- * @name mexc3#fetchDeposits
4428
+ * @name mexc#fetchDeposits
4429
4429
  * @description fetch all deposits made to an account
4430
4430
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
4431
4431
  * @param {string} code unified currency code
@@ -4485,7 +4485,7 @@ export default class mexc extends Exchange {
4485
4485
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
4486
4486
  /**
4487
4487
  * @method
4488
- * @name mexc3#fetchWithdrawals
4488
+ * @name mexc#fetchWithdrawals
4489
4489
  * @description fetch all withdrawals made from an account
4490
4490
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
4491
4491
  * @param {string} code unified currency code
@@ -4662,7 +4662,7 @@ export default class mexc extends Exchange {
4662
4662
  async fetchPosition(symbol, params = {}) {
4663
4663
  /**
4664
4664
  * @method
4665
- * @name mexc3#fetchPosition
4665
+ * @name mexc#fetchPosition
4666
4666
  * @description fetch data on a single open contract trade position
4667
4667
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
4668
4668
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4679,7 +4679,7 @@ export default class mexc extends Exchange {
4679
4679
  async fetchPositions(symbols = undefined, params = {}) {
4680
4680
  /**
4681
4681
  * @method
4682
- * @name mexc3#fetchPositions
4682
+ * @name mexc#fetchPositions
4683
4683
  * @description fetch all open positions
4684
4684
  * @param {string[]|undefined} symbols list of unified market symbols
4685
4685
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4819,7 +4819,7 @@ export default class mexc extends Exchange {
4819
4819
  async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
4820
4820
  /**
4821
4821
  * @method
4822
- * @name mexc3#fetchTransfers
4822
+ * @name mexc#fetchTransfers
4823
4823
  * @description fetch a history of internal transfers made on an account
4824
4824
  * @param {string} code unified currency code of the currency transferred
4825
4825
  * @param {int} [since] the earliest time in ms to fetch transfers for
@@ -4906,7 +4906,7 @@ export default class mexc extends Exchange {
4906
4906
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
4907
4907
  /**
4908
4908
  * @method
4909
- * @name mexc3#transfer
4909
+ * @name mexc#transfer
4910
4910
  * @description transfer currency internally between wallets on the same account
4911
4911
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#user-universal-transfer
4912
4912
  * @param {string} code unified currency code
@@ -5039,7 +5039,7 @@ export default class mexc extends Exchange {
5039
5039
  async withdraw(code, amount, address, tag = undefined, params = {}) {
5040
5040
  /**
5041
5041
  * @method
5042
- * @name mexc3#withdraw
5042
+ * @name mexc#withdraw
5043
5043
  * @description make a withdrawal
5044
5044
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
5045
5045
  * @param {string} code unified currency code
@@ -5107,7 +5107,7 @@ export default class mexc extends Exchange {
5107
5107
  async fetchTransactionFees(codes = undefined, params = {}) {
5108
5108
  /**
5109
5109
  * @method
5110
- * @name mexc3#fetchTransactionFees
5110
+ * @name mexc#fetchTransactionFees
5111
5111
  * @description fetch deposit and withdrawal fees
5112
5112
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
5113
5113
  * @param {string[]|undefined} codes returns fees for all currencies if undefined
@@ -5205,7 +5205,7 @@ export default class mexc extends Exchange {
5205
5205
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
5206
5206
  /**
5207
5207
  * @method
5208
- * @name mexc3#fetchDepositWithdrawFees
5208
+ * @name mexc#fetchDepositWithdrawFees
5209
5209
  * @description fetch deposit and withdrawal fees
5210
5210
  * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
5211
5211
  * @param {string[]|undefined} codes returns fees for all currencies if undefined
package/js/src/okx.js CHANGED
@@ -3692,12 +3692,8 @@ export default class okx extends Exchange {
3692
3692
  if (trailing) {
3693
3693
  request['ordType'] = 'move_order_stop';
3694
3694
  }
3695
- else if (stop || (ordType in algoOrderTypes)) {
3696
- if (stop) {
3697
- if (ordType === undefined) {
3698
- throw new ArgumentsRequired(this.id + ' fetchOpenOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
3699
- }
3700
- }
3695
+ else if (stop && (ordType === undefined)) {
3696
+ request['ordType'] = 'trigger';
3701
3697
  }
3702
3698
  const query = this.omit(params, ['method', 'stop', 'trigger', 'trailing']);
3703
3699
  let response = undefined;
@@ -4004,7 +4000,7 @@ export default class okx extends Exchange {
4004
4000
  * @param {int} [since] the earliest time in ms to fetch orders for
4005
4001
  * @param {int} [limit] the maximum number of order structures to retrieve
4006
4002
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4007
- * @param {bool} [params.stop] True if fetching trigger or conditional orders
4003
+ * @param {bool} [params.trigger] True if fetching trigger or conditional orders
4008
4004
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
4009
4005
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
4010
4006
  * @param {int} [params.until] timestamp in ms to fetch orders for
@@ -4042,12 +4038,12 @@ export default class okx extends Exchange {
4042
4038
  if (limit !== undefined) {
4043
4039
  request['limit'] = limit; // default 100, max 100
4044
4040
  }
4045
- const options = this.safeValue(this.options, 'fetchClosedOrders', {});
4046
- const algoOrderTypes = this.safeValue(this.options, 'algoOrderTypes', {});
4041
+ const options = this.safeDict(this.options, 'fetchClosedOrders', {});
4042
+ const algoOrderTypes = this.safeDict(this.options, 'algoOrderTypes', {});
4047
4043
  const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
4048
4044
  let method = this.safeString(params, 'method', defaultMethod);
4049
4045
  const ordType = this.safeString(params, 'ordType');
4050
- const stop = this.safeValue2(params, 'stop', 'trigger');
4046
+ const stop = this.safeBool2(params, 'stop', 'trigger');
4051
4047
  const trailing = this.safeBool(params, 'trailing', false);
4052
4048
  if (trailing || stop || (ordType in algoOrderTypes)) {
4053
4049
  method = 'privateGetTradeOrdersAlgoHistory';
@@ -4056,11 +4052,9 @@ export default class okx extends Exchange {
4056
4052
  if (trailing) {
4057
4053
  request['ordType'] = 'move_order_stop';
4058
4054
  }
4059
- else if (stop || (ordType in algoOrderTypes)) {
4060
- if (stop) {
4061
- if (ordType === undefined) {
4062
- throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
4063
- }
4055
+ else if (stop) {
4056
+ if (ordType === undefined) {
4057
+ request['ordType'] = 'trigger';
4064
4058
  }
4065
4059
  }
4066
4060
  else {
package/js/src/phemex.js CHANGED
@@ -36,6 +36,7 @@ export default class phemex extends Exchange {
36
36
  'addMargin': false,
37
37
  'cancelAllOrders': true,
38
38
  'cancelOrder': true,
39
+ 'closePosition': false,
39
40
  'createOrder': true,
40
41
  'createReduceOnlyOrder': true,
41
42
  'createStopLimitOrder': true,
@@ -10,6 +10,8 @@ export default class bitmart extends bitmartRest {
10
10
  loadBalanceSnapshot(client: any, messageHash: any, type: any): Promise<void>;
11
11
  handleBalance(client: Client, message: any): void;
12
12
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
13
+ watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
14
+ getParamsForMultipleSub(methodName: string, symbols: string[], limit?: Int, params?: {}): any[];
13
15
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
14
16
  watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
15
17
  watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -30,6 +30,7 @@ export default class bitmart extends bitmartRest {
30
30
  'watchOrderBookForSymbols': true,
31
31
  'watchOrders': true,
32
32
  'watchTrades': true,
33
+ 'watchTradesForSymbols': true,
33
34
  'watchOHLCV': true,
34
35
  'watchPosition': 'emulated',
35
36
  'watchPositions': true,
@@ -274,17 +275,43 @@ export default class bitmart extends bitmartRest {
274
275
  * @param {object} [params] extra parameters specific to the exchange API endpoint
275
276
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
276
277
  */
278
+ return await this.watchTradesForSymbols([symbol], since, limit, params);
279
+ }
280
+ async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
281
+ /**
282
+ * @method
283
+ * @name bitmart#watchTradesForSymbols
284
+ * @see https://developer-pro.bitmart.com/en/spot/#public-trade-channel
285
+ * @description get the list of most recent trades for a list of symbols
286
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
287
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
288
+ * @param {int} [limit] the maximum amount of trades to fetch
289
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
290
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
291
+ */
277
292
  await this.loadMarkets();
278
- symbol = this.symbol(symbol);
279
- const market = this.market(symbol);
280
- let type = 'spot';
281
- [type, params] = this.handleMarketTypeAndParams('watchTrades', market, params);
282
- const trades = await this.subscribe('trade', symbol, type, params);
293
+ let marketType = undefined;
294
+ [symbols, marketType, params] = this.getParamsForMultipleSub('watchTradesForSymbols', symbols, limit, params);
295
+ const channelName = 'trade';
296
+ const trades = await this.subscribeMultiple(channelName, marketType, symbols, params);
283
297
  if (this.newUpdates) {
284
- limit = trades.getLimit(symbol, limit);
298
+ const first = this.safeDict(trades, 0);
299
+ const tradeSymbol = this.safeString(first, 'symbol');
300
+ limit = trades.getLimit(tradeSymbol, limit);
285
301
  }
286
302
  return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
287
303
  }
304
+ getParamsForMultipleSub(methodName, symbols, limit = undefined, params = {}) {
305
+ symbols = this.marketSymbols(symbols, undefined, false, true);
306
+ const length = symbols.length;
307
+ if (length > 20) {
308
+ throw new NotSupported(this.id + ' ' + methodName + '() accepts a maximum of 20 symbols in one request');
309
+ }
310
+ const market = this.market(symbols[0]);
311
+ let marketType = undefined;
312
+ [marketType, params] = this.handleMarketTypeAndParams(methodName, market, params);
313
+ return [symbols, marketType, params];
314
+ }
288
315
  async watchTicker(symbol, params = {}) {
289
316
  /**
290
317
  * @method
@@ -822,16 +849,15 @@ export default class bitmart extends bitmartRest {
822
849
  // ]
823
850
  // }
824
851
  //
825
- const channel = this.safeString2(message, 'table', 'group');
826
- const isSpot = (channel.indexOf('spot') >= 0);
827
852
  const data = this.safeValue(message, 'data');
828
853
  if (data === undefined) {
829
854
  return;
830
855
  }
831
856
  let stored = undefined;
857
+ let symbol = undefined;
832
858
  for (let i = 0; i < data.length; i++) {
833
859
  const trade = this.parseWsTrade(data[i]);
834
- const symbol = trade['symbol'];
860
+ symbol = trade['symbol'];
835
861
  const tradesLimit = this.safeInteger(this.options, 'tradesLimit', 1000);
836
862
  stored = this.safeValue(this.trades, symbol);
837
863
  if (stored === undefined) {
@@ -840,10 +866,7 @@ export default class bitmart extends bitmartRest {
840
866
  }
841
867
  stored.append(trade);
842
868
  }
843
- let messageHash = channel;
844
- if (isSpot) {
845
- messageHash += ':' + this.safeString(data[0], 'symbol');
846
- }
869
+ const messageHash = 'trade:' + symbol;
847
870
  client.resolve(stored, messageHash);
848
871
  }
849
872
  parseWsTrade(trade, market = undefined) {
@@ -1376,15 +1399,10 @@ export default class bitmart extends bitmartRest {
1376
1399
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
1377
1400
  */
1378
1401
  await this.loadMarkets();
1379
- symbols = this.marketSymbols(symbols, undefined, false, true);
1380
- if (symbols.length > 20) {
1381
- throw new NotSupported(this.id + ' watchOrderBookForSymbols() accepts a maximum of 20 symbols in one request');
1382
- }
1383
- const market = this.market(symbols[0]);
1402
+ let type = undefined;
1403
+ [symbols, type, params] = this.getParamsForMultipleSub('watchOrderBookForSymbols', symbols, limit, params);
1384
1404
  let channel = undefined;
1385
1405
  [channel, params] = this.handleOptionAndParams(params, 'watchOrderBookForSymbols', 'depth', 'depth/increase100');
1386
- let type = 'spot';
1387
- [type, params] = this.handleMarketTypeAndParams('watchOrderBookForSymbols', market, params);
1388
1406
  if (type === 'swap' && channel === 'depth/increase100') {
1389
1407
  channel = 'depth50';
1390
1408
  }
@@ -4,7 +4,7 @@ import Client from '../base/ws/Client.js';
4
4
  export default class bybit extends bybitRest {
5
5
  describe(): any;
6
6
  requestId(): any;
7
- getUrlByMarketType(symbol?: Str, isPrivate?: boolean, method?: any, params?: {}): any;
7
+ getUrlByMarketType(symbol?: Str, isPrivate?: boolean, method?: string, params?: {}): any;
8
8
  cleanParams(params: any): any;
9
9
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
10
10
  watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
@@ -187,7 +187,7 @@ export default class bybit extends bybitRest {
187
187
  const market = this.market(symbol);
188
188
  symbol = market['symbol'];
189
189
  const messageHash = 'ticker:' + symbol;
190
- const url = this.getUrlByMarketType(symbol, false, params);
190
+ const url = this.getUrlByMarketType(symbol, false, 'watchTicker', params);
191
191
  params = this.cleanParams(params);
192
192
  const options = this.safeValue(this.options, 'watchTicker', {});
193
193
  let topic = this.safeString(options, 'name', 'tickers');
@@ -212,7 +212,7 @@ export default class bybit extends bybitRest {
212
212
  await this.loadMarkets();
213
213
  symbols = this.marketSymbols(symbols, undefined, false);
214
214
  const messageHashes = [];
215
- const url = this.getUrlByMarketType(symbols[0], false, params);
215
+ const url = this.getUrlByMarketType(symbols[0], false, 'watchTickers', params);
216
216
  params = this.cleanParams(params);
217
217
  const options = this.safeValue(this.options, 'watchTickers', {});
218
218
  const topic = this.safeString(options, 'name', 'tickers');
@@ -379,7 +379,7 @@ export default class bybit extends bybitRest {
379
379
  await this.loadMarkets();
380
380
  const market = this.market(symbol);
381
381
  symbol = market['symbol'];
382
- const url = this.getUrlByMarketType(symbol, false, params);
382
+ const url = this.getUrlByMarketType(symbol, false, 'watchOHLCV', params);
383
383
  params = this.cleanParams(params);
384
384
  let ohlcv = undefined;
385
385
  const timeframeId = this.safeString(this.timeframes, timeframe, timeframe);
@@ -497,7 +497,7 @@ export default class bybit extends bybitRest {
497
497
  throw new ArgumentsRequired(this.id + ' watchOrderBookForSymbols() requires a non-empty array of symbols');
498
498
  }
499
499
  symbols = this.marketSymbols(symbols);
500
- const url = this.getUrlByMarketType(symbols[0], false, params);
500
+ const url = this.getUrlByMarketType(symbols[0], false, 'watchOrderBook', params);
501
501
  params = this.cleanParams(params);
502
502
  const market = this.market(symbols[0]);
503
503
  if (limit === undefined) {
@@ -629,7 +629,7 @@ export default class bybit extends bybitRest {
629
629
  throw new ArgumentsRequired(this.id + ' watchTradesForSymbols() requires a non-empty array of symbols');
630
630
  }
631
631
  params = this.cleanParams(params);
632
- const url = this.getUrlByMarketType(symbols[0], false, params);
632
+ const url = this.getUrlByMarketType(symbols[0], false, 'watchTrades', params);
633
633
  const topics = [];
634
634
  const messageHashes = [];
635
635
  for (let i = 0; i < symbols.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.39",
3
+ "version": "4.2.40",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",