ccxt 4.2.38 → 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.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +1340 -407
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +28 -24
- package/dist/cjs/src/base/Exchange.js +28 -16
- package/dist/cjs/src/binance.js +528 -181
- package/dist/cjs/src/bingx.js +250 -23
- package/dist/cjs/src/bitget.js +14 -3
- package/dist/cjs/src/bitso.js +18 -2
- package/dist/cjs/src/bitstamp.js +24 -2
- package/dist/cjs/src/bl3p.js +6 -0
- package/dist/cjs/src/blockchaincom.js +21 -0
- package/dist/cjs/src/btcalpha.js +9 -0
- package/dist/cjs/src/btcbox.js +9 -0
- package/dist/cjs/src/btcmarkets.js +19 -0
- package/dist/cjs/src/bybit.js +3 -1
- package/dist/cjs/src/coinbase.js +21 -8
- package/dist/cjs/src/coinbasepro.js +1 -0
- package/dist/cjs/src/coinlist.js +9 -7
- package/dist/cjs/src/coinmetro.js +2 -1
- package/dist/cjs/src/krakenfutures.js +133 -16
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +43 -43
- package/dist/cjs/src/okx.js +11 -17
- package/dist/cjs/src/phemex.js +1 -0
- package/dist/cjs/src/poloniexfutures.js +11 -5
- package/dist/cjs/src/pro/bitmart.js +141 -48
- package/dist/cjs/src/pro/bybit.js +5 -5
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/wavesexchange.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +4 -0
- package/js/src/abstract/coinbase.d.ts +1 -0
- package/js/src/abstract/coinbasepro.d.ts +1 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +28 -24
- package/js/src/base/Exchange.d.ts +12 -8
- package/js/src/base/Exchange.js +28 -16
- package/js/src/base/types.d.ts +2 -0
- package/js/src/bigone.d.ts +2 -2
- package/js/src/binance.d.ts +9 -9
- package/js/src/binance.js +528 -181
- package/js/src/bingx.d.ts +6 -5
- package/js/src/bingx.js +250 -23
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex2.d.ts +2 -2
- package/js/src/bitget.d.ts +5 -5
- package/js/src/bitget.js +14 -3
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitmex.d.ts +2 -2
- package/js/src/bitrue.d.ts +2 -2
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +18 -2
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +24 -2
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bl3p.js +6 -0
- package/js/src/blockchaincom.js +21 -0
- package/js/src/blofin.d.ts +2 -2
- package/js/src/btcalpha.js +9 -0
- package/js/src/btcbox.js +9 -0
- package/js/src/btcmarkets.js +19 -0
- package/js/src/bybit.d.ts +7 -7
- package/js/src/bybit.js +3 -1
- package/js/src/cex.d.ts +1 -1
- package/js/src/coinbase.d.ts +2 -2
- package/js/src/coinbase.js +21 -8
- package/js/src/coinbasepro.js +1 -0
- package/js/src/coinex.d.ts +4 -4
- package/js/src/coinlist.d.ts +2 -2
- package/js/src/coinlist.js +9 -7
- package/js/src/coinmetro.js +2 -1
- package/js/src/coinone.d.ts +1 -1
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +3 -3
- package/js/src/digifinex.d.ts +3 -3
- package/js/src/exmo.d.ts +2 -2
- package/js/src/gate.d.ts +6 -6
- package/js/src/hitbtc.d.ts +2 -2
- package/js/src/hollaex.d.ts +1 -1
- package/js/src/htx.d.ts +3 -3
- package/js/src/huobijp.d.ts +1 -1
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +4 -2
- package/js/src/krakenfutures.js +133 -16
- package/js/src/kucoin.d.ts +5 -5
- package/js/src/kucoinfutures.d.ts +2 -2
- package/js/src/latoken.d.ts +1 -1
- package/js/src/lbank.d.ts +2 -2
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +4 -4
- package/js/src/mexc.js +43 -43
- package/js/src/ndax.d.ts +1 -1
- package/js/src/novadax.d.ts +1 -1
- package/js/src/okcoin.d.ts +2 -2
- package/js/src/okx.d.ts +7 -7
- package/js/src/okx.js +11 -17
- package/js/src/paymium.d.ts +2 -2
- package/js/src/phemex.d.ts +4 -4
- package/js/src/phemex.js +1 -0
- package/js/src/poloniex.d.ts +2 -2
- package/js/src/poloniexfutures.d.ts +2 -2
- package/js/src/poloniexfutures.js +11 -5
- package/js/src/pro/bitmart.d.ts +4 -0
- package/js/src/pro/bitmart.js +141 -48
- package/js/src/pro/bitvavo.d.ts +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/bybit.js +5 -5
- package/js/src/pro/cex.d.ts +2 -2
- package/js/src/pro/coinbase.d.ts +2 -2
- package/js/src/pro/coinex.d.ts +1 -1
- package/js/src/pro/lbank.d.ts +1 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/probit.d.ts +1 -1
- package/js/src/timex.d.ts +1 -1
- package/js/src/upbit.d.ts +1 -1
- package/js/src/wavesexchange.js +1 -1
- package/js/src/whitebit.d.ts +2 -2
- package/js/src/woo.d.ts +3 -3
- package/js/src/woo.js +1 -1
- package/js/src/zonda.d.ts +3 -3
- package/package.json +2 -2
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -822,7 +822,7 @@ class mexc extends mexc$1 {
|
|
|
822
822
|
async fetchStatus(params = {}) {
|
|
823
823
|
/**
|
|
824
824
|
* @method
|
|
825
|
-
* @name
|
|
825
|
+
* @name mexc#fetchStatus
|
|
826
826
|
* @description the latest known information on the availability of the exchange API
|
|
827
827
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
828
828
|
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
@@ -859,7 +859,7 @@ class mexc extends mexc$1 {
|
|
|
859
859
|
async fetchTime(params = {}) {
|
|
860
860
|
/**
|
|
861
861
|
* @method
|
|
862
|
-
* @name
|
|
862
|
+
* @name mexc#fetchTime
|
|
863
863
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
864
864
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
865
865
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
@@ -885,7 +885,7 @@ class mexc extends mexc$1 {
|
|
|
885
885
|
async fetchCurrencies(params = {}) {
|
|
886
886
|
/**
|
|
887
887
|
* @method
|
|
888
|
-
* @name
|
|
888
|
+
* @name mexc#fetchCurrencies
|
|
889
889
|
* @description fetches all available currencies on an exchange
|
|
890
890
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
891
891
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1050,8 +1050,8 @@ class mexc extends mexc$1 {
|
|
|
1050
1050
|
async fetchMarkets(params = {}) {
|
|
1051
1051
|
/**
|
|
1052
1052
|
* @method
|
|
1053
|
-
* @name
|
|
1054
|
-
* @description retrieves data on all markets for
|
|
1053
|
+
* @name mexc#fetchMarkets
|
|
1054
|
+
* @description retrieves data on all markets for mexc
|
|
1055
1055
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1056
1056
|
* @returns {object[]} an array of objects representing market data
|
|
1057
1057
|
*/
|
|
@@ -1291,7 +1291,7 @@ class mexc extends mexc$1 {
|
|
|
1291
1291
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
1292
1292
|
/**
|
|
1293
1293
|
* @method
|
|
1294
|
-
* @name
|
|
1294
|
+
* @name mexc#fetchOrderBook
|
|
1295
1295
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
|
|
1296
1296
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-s-depth-information
|
|
1297
1297
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
@@ -1368,7 +1368,7 @@ class mexc extends mexc$1 {
|
|
|
1368
1368
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
1369
1369
|
/**
|
|
1370
1370
|
* @method
|
|
1371
|
-
* @name
|
|
1371
|
+
* @name mexc#fetchTrades
|
|
1372
1372
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
|
|
1373
1373
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
|
|
1374
1374
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
|
|
@@ -1644,7 +1644,7 @@ class mexc extends mexc$1 {
|
|
|
1644
1644
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
1645
1645
|
/**
|
|
1646
1646
|
* @method
|
|
1647
|
-
* @name
|
|
1647
|
+
* @name mexc#fetchOHLCV
|
|
1648
1648
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
|
|
1649
1649
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
|
|
1650
1650
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
@@ -1766,7 +1766,7 @@ class mexc extends mexc$1 {
|
|
|
1766
1766
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
1767
1767
|
/**
|
|
1768
1768
|
* @method
|
|
1769
|
-
* @name
|
|
1769
|
+
* @name mexc#fetchTickers
|
|
1770
1770
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1771
1771
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1772
1772
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1854,7 +1854,7 @@ class mexc extends mexc$1 {
|
|
|
1854
1854
|
async fetchTicker(symbol, params = {}) {
|
|
1855
1855
|
/**
|
|
1856
1856
|
* @method
|
|
1857
|
-
* @name
|
|
1857
|
+
* @name mexc#fetchTicker
|
|
1858
1858
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1859
1859
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1860
1860
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2044,7 +2044,7 @@ class mexc extends mexc$1 {
|
|
|
2044
2044
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
2045
2045
|
/**
|
|
2046
2046
|
* @method
|
|
2047
|
-
* @name
|
|
2047
|
+
* @name mexc#fetchBidsAsks
|
|
2048
2048
|
* @description fetches the bid and ask price and volume for multiple markets
|
|
2049
2049
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
2050
2050
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2105,7 +2105,7 @@ class mexc extends mexc$1 {
|
|
|
2105
2105
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2106
2106
|
/**
|
|
2107
2107
|
* @method
|
|
2108
|
-
* @name
|
|
2108
|
+
* @name mexc#createOrder
|
|
2109
2109
|
* @description create a trade order
|
|
2110
2110
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2111
2111
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
|
@@ -2386,7 +2386,7 @@ class mexc extends mexc$1 {
|
|
|
2386
2386
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
2387
2387
|
/**
|
|
2388
2388
|
* @method
|
|
2389
|
-
* @name
|
|
2389
|
+
* @name mexc#fetchOrder
|
|
2390
2390
|
* @description fetches information on an order made by the user
|
|
2391
2391
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2392
2392
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2508,7 +2508,7 @@ class mexc extends mexc$1 {
|
|
|
2508
2508
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2509
2509
|
/**
|
|
2510
2510
|
* @method
|
|
2511
|
-
* @name
|
|
2511
|
+
* @name mexc#fetchOrders
|
|
2512
2512
|
* @description fetches information on multiple orders made by the user
|
|
2513
2513
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2514
2514
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -2740,7 +2740,7 @@ class mexc extends mexc$1 {
|
|
|
2740
2740
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2741
2741
|
/**
|
|
2742
2742
|
* @method
|
|
2743
|
-
* @name
|
|
2743
|
+
* @name mexc#fetchOpenOrders
|
|
2744
2744
|
* @description fetch all unfilled currently open orders
|
|
2745
2745
|
* @param {string} symbol unified market symbol
|
|
2746
2746
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
@@ -2831,7 +2831,7 @@ class mexc extends mexc$1 {
|
|
|
2831
2831
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2832
2832
|
/**
|
|
2833
2833
|
* @method
|
|
2834
|
-
* @name
|
|
2834
|
+
* @name mexc#fetchClosedOrders
|
|
2835
2835
|
* @description fetches information on multiple closed orders made by the user
|
|
2836
2836
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2837
2837
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -2844,7 +2844,7 @@ class mexc extends mexc$1 {
|
|
|
2844
2844
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2845
2845
|
/**
|
|
2846
2846
|
* @method
|
|
2847
|
-
* @name
|
|
2847
|
+
* @name mexc#fetchCanceledOrders
|
|
2848
2848
|
* @description fetches information on multiple canceled orders made by the user
|
|
2849
2849
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2850
2850
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
@@ -2873,7 +2873,7 @@ class mexc extends mexc$1 {
|
|
|
2873
2873
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
2874
2874
|
/**
|
|
2875
2875
|
* @method
|
|
2876
|
-
* @name
|
|
2876
|
+
* @name mexc#cancelOrder
|
|
2877
2877
|
* @description cancels an open order
|
|
2878
2878
|
* @param {string} id order id
|
|
2879
2879
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
@@ -2989,7 +2989,7 @@ class mexc extends mexc$1 {
|
|
|
2989
2989
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
2990
2990
|
/**
|
|
2991
2991
|
* @method
|
|
2992
|
-
* @name
|
|
2992
|
+
* @name mexc#cancelOrders
|
|
2993
2993
|
* @description cancel multiple orders
|
|
2994
2994
|
* @param {string[]} ids order ids
|
|
2995
2995
|
* @param {string} symbol unified market symbol, default is undefined
|
|
@@ -3024,7 +3024,7 @@ class mexc extends mexc$1 {
|
|
|
3024
3024
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
3025
3025
|
/**
|
|
3026
3026
|
* @method
|
|
3027
|
-
* @name
|
|
3027
|
+
* @name mexc#cancelAllOrders
|
|
3028
3028
|
* @description cancel all open orders
|
|
3029
3029
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
3030
3030
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3427,7 +3427,7 @@ class mexc extends mexc$1 {
|
|
|
3427
3427
|
async fetchAccounts(params = {}) {
|
|
3428
3428
|
/**
|
|
3429
3429
|
* @method
|
|
3430
|
-
* @name
|
|
3430
|
+
* @name mexc#fetchAccounts
|
|
3431
3431
|
* @description fetch all the accounts associated with a profile
|
|
3432
3432
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3433
3433
|
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
@@ -3454,7 +3454,7 @@ class mexc extends mexc$1 {
|
|
|
3454
3454
|
async fetchTradingFees(params = {}) {
|
|
3455
3455
|
/**
|
|
3456
3456
|
* @method
|
|
3457
|
-
* @name
|
|
3457
|
+
* @name mexc#fetchTradingFees
|
|
3458
3458
|
* @description fetch the trading fees for multiple markets
|
|
3459
3459
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3460
3460
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
@@ -3605,7 +3605,7 @@ class mexc extends mexc$1 {
|
|
|
3605
3605
|
async fetchBalance(params = {}) {
|
|
3606
3606
|
/**
|
|
3607
3607
|
* @method
|
|
3608
|
-
* @name
|
|
3608
|
+
* @name mexc#fetchBalance
|
|
3609
3609
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3610
3610
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3611
3611
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
@@ -3739,7 +3739,7 @@ class mexc extends mexc$1 {
|
|
|
3739
3739
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3740
3740
|
/**
|
|
3741
3741
|
* @method
|
|
3742
|
-
* @name
|
|
3742
|
+
* @name mexc#fetchMyTrades
|
|
3743
3743
|
* @description fetch all trades made by the user
|
|
3744
3744
|
* @param {string} symbol unified market symbol
|
|
3745
3745
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -3829,7 +3829,7 @@ class mexc extends mexc$1 {
|
|
|
3829
3829
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3830
3830
|
/**
|
|
3831
3831
|
* @method
|
|
3832
|
-
* @name
|
|
3832
|
+
* @name mexc#fetchOrderTrades
|
|
3833
3833
|
* @description fetch all the trades made from a single order
|
|
3834
3834
|
* @param {string} id order id
|
|
3835
3835
|
* @param {string} symbol unified market symbol
|
|
@@ -3927,7 +3927,7 @@ class mexc extends mexc$1 {
|
|
|
3927
3927
|
async reduceMargin(symbol, amount, params = {}) {
|
|
3928
3928
|
/**
|
|
3929
3929
|
* @method
|
|
3930
|
-
* @name
|
|
3930
|
+
* @name mexc#reduceMargin
|
|
3931
3931
|
* @description remove margin from a position
|
|
3932
3932
|
* @param {string} symbol unified market symbol
|
|
3933
3933
|
* @param {float} amount the amount of margin to remove
|
|
@@ -3939,7 +3939,7 @@ class mexc extends mexc$1 {
|
|
|
3939
3939
|
async addMargin(symbol, amount, params = {}) {
|
|
3940
3940
|
/**
|
|
3941
3941
|
* @method
|
|
3942
|
-
* @name
|
|
3942
|
+
* @name mexc#addMargin
|
|
3943
3943
|
* @description add margin
|
|
3944
3944
|
* @param {string} symbol unified market symbol
|
|
3945
3945
|
* @param {float} amount amount of margin to add
|
|
@@ -3951,7 +3951,7 @@ class mexc extends mexc$1 {
|
|
|
3951
3951
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
3952
3952
|
/**
|
|
3953
3953
|
* @method
|
|
3954
|
-
* @name
|
|
3954
|
+
* @name mexc#setLeverage
|
|
3955
3955
|
* @description set the level of leverage for a market
|
|
3956
3956
|
* @param {float} leverage the rate of leverage
|
|
3957
3957
|
* @param {string} symbol unified market symbol
|
|
@@ -3984,7 +3984,7 @@ class mexc extends mexc$1 {
|
|
|
3984
3984
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3985
3985
|
/**
|
|
3986
3986
|
* @method
|
|
3987
|
-
* @name
|
|
3987
|
+
* @name mexc#fetchFundingHistory
|
|
3988
3988
|
* @description fetch the history of funding payments paid and received on this account
|
|
3989
3989
|
* @param {string} symbol unified market symbol
|
|
3990
3990
|
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
@@ -4099,7 +4099,7 @@ class mexc extends mexc$1 {
|
|
|
4099
4099
|
async fetchFundingRate(symbol, params = {}) {
|
|
4100
4100
|
/**
|
|
4101
4101
|
* @method
|
|
4102
|
-
* @name
|
|
4102
|
+
* @name mexc#fetchFundingRate
|
|
4103
4103
|
* @description fetch the current funding rate
|
|
4104
4104
|
* @param {string} symbol unified market symbol
|
|
4105
4105
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -4200,7 +4200,7 @@ class mexc extends mexc$1 {
|
|
|
4200
4200
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
4201
4201
|
/**
|
|
4202
4202
|
* @method
|
|
4203
|
-
* @name
|
|
4203
|
+
* @name mexc#fetchLeverageTiers
|
|
4204
4204
|
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
4205
4205
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4206
4206
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -4313,7 +4313,7 @@ class mexc extends mexc$1 {
|
|
|
4313
4313
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
4314
4314
|
/**
|
|
4315
4315
|
* @method
|
|
4316
|
-
* @name
|
|
4316
|
+
* @name mexc#fetchDepositAddressesByNetwork
|
|
4317
4317
|
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
4318
4318
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
|
4319
4319
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
@@ -4353,7 +4353,7 @@ class mexc extends mexc$1 {
|
|
|
4353
4353
|
async createDepositAddress(code, params = {}) {
|
|
4354
4354
|
/**
|
|
4355
4355
|
* @method
|
|
4356
|
-
* @name
|
|
4356
|
+
* @name mexc#createDepositAddress
|
|
4357
4357
|
* @description create a currency deposit address
|
|
4358
4358
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
|
|
4359
4359
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
@@ -4393,7 +4393,7 @@ class mexc extends mexc$1 {
|
|
|
4393
4393
|
async fetchDepositAddress(code, params = {}) {
|
|
4394
4394
|
/**
|
|
4395
4395
|
* @method
|
|
4396
|
-
* @name
|
|
4396
|
+
* @name mexc#fetchDepositAddress
|
|
4397
4397
|
* @description fetch the deposit address for a currency associated with this account
|
|
4398
4398
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
|
4399
4399
|
* @param {string} code unified currency code
|
|
@@ -4421,7 +4421,7 @@ class mexc extends mexc$1 {
|
|
|
4421
4421
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4422
4422
|
/**
|
|
4423
4423
|
* @method
|
|
4424
|
-
* @name
|
|
4424
|
+
* @name mexc#fetchDeposits
|
|
4425
4425
|
* @description fetch all deposits made to an account
|
|
4426
4426
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
|
|
4427
4427
|
* @param {string} code unified currency code
|
|
@@ -4481,7 +4481,7 @@ class mexc extends mexc$1 {
|
|
|
4481
4481
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4482
4482
|
/**
|
|
4483
4483
|
* @method
|
|
4484
|
-
* @name
|
|
4484
|
+
* @name mexc#fetchWithdrawals
|
|
4485
4485
|
* @description fetch all withdrawals made from an account
|
|
4486
4486
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
|
|
4487
4487
|
* @param {string} code unified currency code
|
|
@@ -4658,7 +4658,7 @@ class mexc extends mexc$1 {
|
|
|
4658
4658
|
async fetchPosition(symbol, params = {}) {
|
|
4659
4659
|
/**
|
|
4660
4660
|
* @method
|
|
4661
|
-
* @name
|
|
4661
|
+
* @name mexc#fetchPosition
|
|
4662
4662
|
* @description fetch data on a single open contract trade position
|
|
4663
4663
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
4664
4664
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -4675,7 +4675,7 @@ class mexc extends mexc$1 {
|
|
|
4675
4675
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
4676
4676
|
/**
|
|
4677
4677
|
* @method
|
|
4678
|
-
* @name
|
|
4678
|
+
* @name mexc#fetchPositions
|
|
4679
4679
|
* @description fetch all open positions
|
|
4680
4680
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4681
4681
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -4815,7 +4815,7 @@ class mexc extends mexc$1 {
|
|
|
4815
4815
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4816
4816
|
/**
|
|
4817
4817
|
* @method
|
|
4818
|
-
* @name
|
|
4818
|
+
* @name mexc#fetchTransfers
|
|
4819
4819
|
* @description fetch a history of internal transfers made on an account
|
|
4820
4820
|
* @param {string} code unified currency code of the currency transferred
|
|
4821
4821
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
@@ -4902,7 +4902,7 @@ class mexc extends mexc$1 {
|
|
|
4902
4902
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
4903
4903
|
/**
|
|
4904
4904
|
* @method
|
|
4905
|
-
* @name
|
|
4905
|
+
* @name mexc#transfer
|
|
4906
4906
|
* @description transfer currency internally between wallets on the same account
|
|
4907
4907
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#user-universal-transfer
|
|
4908
4908
|
* @param {string} code unified currency code
|
|
@@ -5035,7 +5035,7 @@ class mexc extends mexc$1 {
|
|
|
5035
5035
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
5036
5036
|
/**
|
|
5037
5037
|
* @method
|
|
5038
|
-
* @name
|
|
5038
|
+
* @name mexc#withdraw
|
|
5039
5039
|
* @description make a withdrawal
|
|
5040
5040
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
|
|
5041
5041
|
* @param {string} code unified currency code
|
|
@@ -5103,7 +5103,7 @@ class mexc extends mexc$1 {
|
|
|
5103
5103
|
async fetchTransactionFees(codes = undefined, params = {}) {
|
|
5104
5104
|
/**
|
|
5105
5105
|
* @method
|
|
5106
|
-
* @name
|
|
5106
|
+
* @name mexc#fetchTransactionFees
|
|
5107
5107
|
* @description fetch deposit and withdrawal fees
|
|
5108
5108
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
5109
5109
|
* @param {string[]|undefined} codes returns fees for all currencies if undefined
|
|
@@ -5201,7 +5201,7 @@ class mexc extends mexc$1 {
|
|
|
5201
5201
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
5202
5202
|
/**
|
|
5203
5203
|
* @method
|
|
5204
|
-
* @name
|
|
5204
|
+
* @name mexc#fetchDepositWithdrawFees
|
|
5205
5205
|
* @description fetch deposit and withdrawal fees
|
|
5206
5206
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
5207
5207
|
* @param {string[]|undefined} codes returns fees for all currencies if undefined
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -281,6 +281,7 @@ class okx extends okx$1 {
|
|
|
281
281
|
'trade/easy-convert-history': 20,
|
|
282
282
|
'trade/one-click-repay-currency-list': 20,
|
|
283
283
|
'trade/one-click-repay-history': 20,
|
|
284
|
+
'trade/account-rate-limit': 1,
|
|
284
285
|
// asset
|
|
285
286
|
'asset/currencies': 5 / 3,
|
|
286
287
|
'asset/balances': 5 / 3,
|
|
@@ -1625,7 +1626,7 @@ class okx extends okx$1 {
|
|
|
1625
1626
|
if ((networkId !== undefined) && (networkId.indexOf('-') >= 0)) {
|
|
1626
1627
|
const parts = networkId.split('-');
|
|
1627
1628
|
const chainPart = this.safeString(parts, 1, networkId);
|
|
1628
|
-
const networkCode = this.
|
|
1629
|
+
const networkCode = this.networkIdToCode(chainPart, currency['code']);
|
|
1629
1630
|
const precision = this.parsePrecision(this.safeString(chain, 'wdTickSz'));
|
|
1630
1631
|
if (maxPrecision === undefined) {
|
|
1631
1632
|
maxPrecision = precision;
|
|
@@ -3644,7 +3645,6 @@ class okx extends okx$1 {
|
|
|
3644
3645
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
3645
3646
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
3646
3647
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3647
|
-
* @param {int} [params.till] Timestamp in ms of the latest time to retrieve orders for
|
|
3648
3648
|
* @param {bool} [params.stop] True if fetching trigger or conditional orders
|
|
3649
3649
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
3650
3650
|
* @param {string} [params.algoId] Algo ID "'433845797218942976'"
|
|
@@ -3689,12 +3689,8 @@ class okx extends okx$1 {
|
|
|
3689
3689
|
if (trailing) {
|
|
3690
3690
|
request['ordType'] = 'move_order_stop';
|
|
3691
3691
|
}
|
|
3692
|
-
else if (stop
|
|
3693
|
-
|
|
3694
|
-
if (ordType === undefined) {
|
|
3695
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
|
|
3696
|
-
}
|
|
3697
|
-
}
|
|
3692
|
+
else if (stop && (ordType === undefined)) {
|
|
3693
|
+
request['ordType'] = 'trigger';
|
|
3698
3694
|
}
|
|
3699
3695
|
const query = this.omit(params, ['method', 'stop', 'trigger', 'trailing']);
|
|
3700
3696
|
let response = undefined;
|
|
@@ -4001,7 +3997,7 @@ class okx extends okx$1 {
|
|
|
4001
3997
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4002
3998
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4003
3999
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4004
|
-
* @param {bool} [params.
|
|
4000
|
+
* @param {bool} [params.trigger] True if fetching trigger or conditional orders
|
|
4005
4001
|
* @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
|
4006
4002
|
* @param {string} [params.algoId] Algo ID "'433845797218942976'"
|
|
4007
4003
|
* @param {int} [params.until] timestamp in ms to fetch orders for
|
|
@@ -4039,12 +4035,12 @@ class okx extends okx$1 {
|
|
|
4039
4035
|
if (limit !== undefined) {
|
|
4040
4036
|
request['limit'] = limit; // default 100, max 100
|
|
4041
4037
|
}
|
|
4042
|
-
const options = this.
|
|
4043
|
-
const algoOrderTypes = this.
|
|
4038
|
+
const options = this.safeDict(this.options, 'fetchClosedOrders', {});
|
|
4039
|
+
const algoOrderTypes = this.safeDict(this.options, 'algoOrderTypes', {});
|
|
4044
4040
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
|
|
4045
4041
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4046
4042
|
const ordType = this.safeString(params, 'ordType');
|
|
4047
|
-
const stop = this.
|
|
4043
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
4048
4044
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4049
4045
|
if (trailing || stop || (ordType in algoOrderTypes)) {
|
|
4050
4046
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
@@ -4053,11 +4049,9 @@ class okx extends okx$1 {
|
|
|
4053
4049
|
if (trailing) {
|
|
4054
4050
|
request['ordType'] = 'move_order_stop';
|
|
4055
4051
|
}
|
|
4056
|
-
else if (stop
|
|
4057
|
-
if (
|
|
4058
|
-
|
|
4059
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"');
|
|
4060
|
-
}
|
|
4052
|
+
else if (stop) {
|
|
4053
|
+
if (ordType === undefined) {
|
|
4054
|
+
request['ordType'] = 'trigger';
|
|
4061
4055
|
}
|
|
4062
4056
|
}
|
|
4063
4057
|
else {
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -1702,13 +1702,13 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
1702
1702
|
const trades = this.safeValue(data, 'items', {});
|
|
1703
1703
|
return this.parseTrades(trades, market, since, limit);
|
|
1704
1704
|
}
|
|
1705
|
-
async setMarginMode(marginMode, symbol, params = {}) {
|
|
1705
|
+
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
1706
1706
|
/**
|
|
1707
1707
|
* @method
|
|
1708
1708
|
* @name poloniexfutures#setMarginMode
|
|
1709
1709
|
* @description set margin mode to 'cross' or 'isolated'
|
|
1710
1710
|
* @see https://futures-docs.poloniex.com/#change-margin-mode
|
|
1711
|
-
* @param {
|
|
1711
|
+
* @param {string} marginMode "0" (isolated) or "1" (cross)
|
|
1712
1712
|
* @param {string} symbol unified market symbol
|
|
1713
1713
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1714
1714
|
* @returns {object} response from the exchange
|
|
@@ -1716,14 +1716,20 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
1716
1716
|
if (symbol === undefined) {
|
|
1717
1717
|
throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
1718
1718
|
}
|
|
1719
|
-
if ((marginMode !== 0) && (marginMode !== 1)) {
|
|
1720
|
-
throw new errors.ArgumentsRequired(this.id + ' setMarginMode() marginMode must be 0
|
|
1719
|
+
if ((marginMode !== '0') && (marginMode !== '1') && (marginMode !== 'isolated') && (marginMode !== 'cross')) {
|
|
1720
|
+
throw new errors.ArgumentsRequired(this.id + ' setMarginMode() marginMode must be 0/isolated or 1/cross');
|
|
1721
1721
|
}
|
|
1722
1722
|
await this.loadMarkets();
|
|
1723
|
+
if (marginMode === 'isolated') {
|
|
1724
|
+
marginMode = '0';
|
|
1725
|
+
}
|
|
1726
|
+
if (marginMode === 'cross') {
|
|
1727
|
+
marginMode = '1';
|
|
1728
|
+
}
|
|
1723
1729
|
const market = this.market(symbol);
|
|
1724
1730
|
const request = {
|
|
1725
1731
|
'symbol': market['id'],
|
|
1726
|
-
'marginType': marginMode,
|
|
1732
|
+
'marginType': this.parseToInt(marginMode),
|
|
1727
1733
|
};
|
|
1728
1734
|
return await this.privatePostMarginTypeChange(request);
|
|
1729
1735
|
}
|