ccxt 4.4.30__py2.py3-none-any.whl → 4.4.31__py2.py3-none-any.whl
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.
- ccxt/__init__.py +1 -1
- ccxt/ace.py +36 -12
- ccxt/alpaca.py +62 -22
- ccxt/ascendex.py +65 -30
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +36 -12
- ccxt/async_support/alpaca.py +62 -22
- ccxt/async_support/ascendex.py +65 -30
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/bigone.py +71 -27
- ccxt/async_support/binance.py +555 -323
- ccxt/async_support/bingx.py +208 -108
- ccxt/async_support/bit2c.py +34 -12
- ccxt/async_support/bitbank.py +42 -14
- ccxt/async_support/bitbns.py +17 -9
- ccxt/async_support/bitfinex.py +68 -24
- ccxt/async_support/bitfinex2.py +116 -44
- ccxt/async_support/bitflyer.py +54 -18
- ccxt/async_support/bitget.py +277 -145
- ccxt/async_support/bithumb.py +39 -14
- ccxt/async_support/bitmart.py +145 -79
- ccxt/async_support/bitmex.py +90 -30
- ccxt/async_support/bitopro.py +66 -22
- ccxt/async_support/bitrue.py +109 -57
- ccxt/async_support/bitso.py +55 -19
- ccxt/async_support/bitstamp.py +84 -36
- ccxt/async_support/bitteam.py +51 -17
- ccxt/async_support/bitvavo.py +57 -19
- ccxt/async_support/bl3p.py +26 -10
- ccxt/async_support/blockchaincom.py +63 -21
- ccxt/async_support/blofin.py +95 -38
- ccxt/async_support/btcalpha.py +48 -16
- ccxt/async_support/btcbox.py +27 -9
- ccxt/async_support/btcmarkets.py +57 -19
- ccxt/async_support/btcturk.py +36 -12
- ccxt/async_support/bybit.py +251 -95
- ccxt/async_support/cex.py +65 -22
- ccxt/async_support/coinbase.py +138 -56
- ccxt/async_support/coinbaseexchange.py +76 -28
- ccxt/async_support/coinbaseinternational.py +75 -27
- ccxt/async_support/coincatch.py +191 -97
- ccxt/async_support/coincheck.py +33 -11
- ccxt/async_support/coinex.py +212 -101
- ccxt/async_support/coinlist.py +87 -30
- ccxt/async_support/coinmate.py +55 -24
- ccxt/async_support/coinmetro.py +52 -18
- ccxt/async_support/coinone.py +27 -10
- ccxt/async_support/coinsph.py +73 -27
- ccxt/async_support/coinspot.py +25 -9
- ccxt/async_support/cryptocom.py +103 -38
- ccxt/async_support/currencycom.py +70 -23
- ccxt/async_support/delta.py +90 -30
- ccxt/async_support/deribit.py +131 -50
- ccxt/async_support/digifinex.py +114 -51
- ccxt/async_support/exmo.py +104 -45
- ccxt/async_support/gate.py +298 -155
- ccxt/async_support/gemini.py +57 -20
- ccxt/async_support/hashkey.py +151 -66
- ccxt/async_support/hitbtc.py +156 -73
- ccxt/async_support/hollaex.py +76 -25
- ccxt/async_support/htx.py +297 -240
- ccxt/async_support/huobijp.py +1 -0
- ccxt/async_support/hyperliquid.py +94 -38
- ccxt/async_support/idex.py +73 -24
- ccxt/async_support/independentreserve.py +12 -5
- ccxt/async_support/indodax.py +53 -16
- ccxt/async_support/kraken.py +107 -35
- ccxt/async_support/krakenfutures.py +88 -34
- ccxt/async_support/kucoin.py +211 -109
- ccxt/async_support/kucoinfutures.py +119 -42
- ccxt/async_support/kuna.py +80 -39
- ccxt/async_support/latoken.py +70 -33
- ccxt/async_support/lbank.py +89 -38
- ccxt/async_support/luno.py +54 -19
- ccxt/async_support/lykke.py +54 -19
- ccxt/async_support/mercado.py +1 -0
- ccxt/async_support/mexc.py +226 -108
- ccxt/async_support/ndax.py +58 -19
- ccxt/async_support/novadax.py +67 -22
- ccxt/async_support/oceanex.py +58 -19
- ccxt/async_support/okcoin.py +81 -38
- ccxt/async_support/okx.py +270 -109
- ccxt/async_support/onetrading.py +3 -1
- ccxt/async_support/oxfun.py +95 -36
- ccxt/async_support/p2b.py +49 -23
- ccxt/async_support/paradex.py +75 -27
- ccxt/async_support/paymium.py +31 -11
- ccxt/async_support/phemex.py +91 -41
- ccxt/async_support/poloniex.py +80 -30
- ccxt/async_support/poloniexfutures.py +72 -30
- ccxt/async_support/probit.py +64 -22
- ccxt/async_support/timex.py +58 -19
- ccxt/async_support/tokocrypto.py +63 -22
- ccxt/async_support/tradeogre.py +7 -2
- ccxt/async_support/upbit.py +72 -25
- ccxt/async_support/vertex.py +74 -28
- ccxt/async_support/wavesexchange.py +29 -8
- ccxt/async_support/wazirx.py +51 -17
- ccxt/async_support/whitebit.py +105 -41
- ccxt/async_support/woo.py +162 -65
- ccxt/async_support/woofipro.py +118 -49
- ccxt/async_support/xt.py +150 -73
- ccxt/async_support/yobit.py +49 -16
- ccxt/async_support/zaif.py +30 -10
- ccxt/async_support/zonda.py +46 -16
- ccxt/base/exchange.py +34 -34
- ccxt/base/types.py +1 -0
- ccxt/bigone.py +71 -27
- ccxt/binance.py +555 -323
- ccxt/bingx.py +208 -108
- ccxt/bit2c.py +34 -12
- ccxt/bitbank.py +42 -14
- ccxt/bitbns.py +17 -9
- ccxt/bitfinex.py +68 -24
- ccxt/bitfinex2.py +116 -44
- ccxt/bitflyer.py +54 -18
- ccxt/bitget.py +277 -145
- ccxt/bithumb.py +39 -14
- ccxt/bitmart.py +145 -79
- ccxt/bitmex.py +90 -30
- ccxt/bitopro.py +66 -22
- ccxt/bitrue.py +109 -57
- ccxt/bitso.py +55 -19
- ccxt/bitstamp.py +84 -36
- ccxt/bitteam.py +51 -17
- ccxt/bitvavo.py +57 -19
- ccxt/bl3p.py +26 -10
- ccxt/blockchaincom.py +63 -21
- ccxt/blofin.py +95 -38
- ccxt/btcalpha.py +48 -16
- ccxt/btcbox.py +27 -9
- ccxt/btcmarkets.py +57 -19
- ccxt/btcturk.py +36 -12
- ccxt/bybit.py +251 -95
- ccxt/cex.py +65 -22
- ccxt/coinbase.py +138 -56
- ccxt/coinbaseexchange.py +76 -28
- ccxt/coinbaseinternational.py +75 -27
- ccxt/coincatch.py +191 -97
- ccxt/coincheck.py +33 -11
- ccxt/coinex.py +212 -101
- ccxt/coinlist.py +87 -30
- ccxt/coinmate.py +55 -24
- ccxt/coinmetro.py +52 -18
- ccxt/coinone.py +27 -10
- ccxt/coinsph.py +73 -27
- ccxt/coinspot.py +25 -9
- ccxt/cryptocom.py +103 -38
- ccxt/currencycom.py +70 -23
- ccxt/delta.py +90 -30
- ccxt/deribit.py +131 -50
- ccxt/digifinex.py +114 -51
- ccxt/exmo.py +104 -45
- ccxt/gate.py +298 -155
- ccxt/gemini.py +57 -20
- ccxt/hashkey.py +151 -66
- ccxt/hitbtc.py +156 -73
- ccxt/hollaex.py +76 -25
- ccxt/htx.py +297 -240
- ccxt/huobijp.py +1 -0
- ccxt/hyperliquid.py +94 -38
- ccxt/idex.py +73 -24
- ccxt/independentreserve.py +12 -5
- ccxt/indodax.py +53 -16
- ccxt/kraken.py +107 -35
- ccxt/krakenfutures.py +88 -34
- ccxt/kucoin.py +211 -109
- ccxt/kucoinfutures.py +119 -42
- ccxt/kuna.py +80 -39
- ccxt/latoken.py +70 -33
- ccxt/lbank.py +89 -38
- ccxt/luno.py +54 -19
- ccxt/lykke.py +54 -19
- ccxt/mercado.py +1 -0
- ccxt/mexc.py +226 -108
- ccxt/ndax.py +58 -19
- ccxt/novadax.py +67 -22
- ccxt/oceanex.py +58 -19
- ccxt/okcoin.py +81 -38
- ccxt/okx.py +270 -109
- ccxt/onetrading.py +3 -1
- ccxt/oxfun.py +95 -36
- ccxt/p2b.py +49 -23
- ccxt/paradex.py +75 -27
- ccxt/paymium.py +31 -11
- ccxt/phemex.py +91 -41
- ccxt/poloniex.py +80 -30
- ccxt/poloniexfutures.py +72 -30
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +15 -5
- ccxt/pro/ascendex.py +18 -6
- ccxt/pro/binance.py +200 -119
- ccxt/pro/bingx.py +44 -24
- ccxt/pro/bitfinex.py +13 -5
- ccxt/pro/bitget.py +75 -36
- ccxt/pro/bithumb.py +12 -4
- ccxt/pro/bitmart.py +44 -20
- ccxt/pro/bitmex.py +42 -14
- ccxt/pro/bitopro.py +15 -5
- ccxt/pro/bitrue.py +7 -3
- ccxt/pro/bitvavo.py +51 -17
- ccxt/pro/blockchaincom.py +18 -6
- ccxt/pro/blofin.py +36 -12
- ccxt/pro/bybit.py +100 -42
- ccxt/pro/cex.py +48 -16
- ccxt/pro/coinbase.py +32 -12
- ccxt/pro/coinbaseexchange.py +1 -1
- ccxt/pro/coinbaseinternational.py +34 -14
- ccxt/pro/coincatch.py +54 -19
- ccxt/pro/coincheck.py +6 -2
- ccxt/pro/coinex.py +40 -20
- ccxt/pro/coinone.py +9 -3
- ccxt/pro/cryptocom.py +70 -26
- ccxt/pro/deribit.py +36 -12
- ccxt/pro/exmo.py +10 -4
- ccxt/pro/gate.py +64 -30
- ccxt/pro/gemini.py +21 -7
- ccxt/pro/hashkey.py +26 -8
- ccxt/pro/hitbtc.py +61 -37
- ccxt/pro/hollaex.py +15 -5
- ccxt/pro/htx.py +39 -21
- ccxt/pro/hyperliquid.py +41 -14
- ccxt/pro/kraken.py +49 -17
- ccxt/pro/krakenfutures.py +47 -24
- ccxt/pro/kucoin.py +60 -31
- ccxt/pro/kucoinfutures.py +41 -19
- ccxt/pro/lbank.py +27 -9
- ccxt/pro/luno.py +3 -1
- ccxt/pro/mexc.py +35 -17
- ccxt/pro/ndax.py +12 -4
- ccxt/pro/okcoin.py +18 -6
- ccxt/pro/okx.py +76 -28
- ccxt/pro/onetrading.py +21 -7
- ccxt/pro/oxfun.py +54 -20
- ccxt/pro/p2b.py +23 -11
- ccxt/pro/paradex.py +12 -4
- ccxt/pro/phemex.py +31 -19
- ccxt/pro/poloniex.py +50 -22
- ccxt/pro/poloniexfutures.py +17 -7
- ccxt/pro/probit.py +18 -6
- ccxt/pro/upbit.py +25 -9
- ccxt/pro/vertex.py +20 -6
- ccxt/pro/wazirx.py +21 -7
- ccxt/pro/whitebit.py +25 -9
- ccxt/pro/woo.py +32 -12
- ccxt/pro/woofipro.py +35 -13
- ccxt/pro/xt.py +46 -26
- ccxt/probit.py +64 -22
- ccxt/timex.py +58 -19
- ccxt/tokocrypto.py +63 -22
- ccxt/tradeogre.py +7 -2
- ccxt/upbit.py +72 -25
- ccxt/vertex.py +74 -28
- ccxt/wavesexchange.py +29 -8
- ccxt/wazirx.py +51 -17
- ccxt/whitebit.py +105 -41
- ccxt/woo.py +162 -65
- ccxt/woofipro.py +118 -49
- ccxt/xt.py +150 -73
- ccxt/yobit.py +49 -16
- ccxt/zaif.py +30 -10
- ccxt/zonda.py +46 -16
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/METADATA +5 -5
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/RECORD +267 -267
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/WHEEL +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/top_level.txt +0 -0
ccxt/mexc.py
CHANGED
@@ -831,8 +831,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
831
831
|
def fetch_status(self, params={}):
|
832
832
|
"""
|
833
833
|
the latest known information on the availability of the exchange API
|
834
|
-
|
835
|
-
|
834
|
+
|
835
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
|
836
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
837
|
+
|
836
838
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
837
839
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
838
840
|
"""
|
@@ -866,8 +868,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
866
868
|
def fetch_time(self, params={}):
|
867
869
|
"""
|
868
870
|
fetches the current integer timestamp in milliseconds from the exchange server
|
869
|
-
|
870
|
-
|
871
|
+
|
872
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
|
873
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
874
|
+
|
871
875
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
872
876
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
873
877
|
"""
|
@@ -890,7 +894,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
890
894
|
def fetch_currencies(self, params={}) -> Currencies:
|
891
895
|
"""
|
892
896
|
fetches all available currencies on an exchange
|
893
|
-
|
897
|
+
|
898
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
899
|
+
|
894
900
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
895
901
|
:returns dict: an associative dictionary of currencies
|
896
902
|
"""
|
@@ -1024,8 +1030,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
1024
1030
|
def fetch_markets(self, params={}) -> List[Market]:
|
1025
1031
|
"""
|
1026
1032
|
retrieves data on all markets for mexc
|
1027
|
-
|
1028
|
-
|
1033
|
+
|
1034
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
1035
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
1036
|
+
|
1029
1037
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1030
1038
|
:returns dict[]: an array of objects representing market data
|
1031
1039
|
"""
|
@@ -1038,9 +1046,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
1038
1046
|
|
1039
1047
|
def fetch_spot_markets(self, params={}):
|
1040
1048
|
"""
|
1041
|
-
|
1049
|
+
@ignore
|
1042
1050
|
retrieves data on all spot markets for mexc
|
1043
|
-
|
1051
|
+
|
1052
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
1053
|
+
|
1044
1054
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1045
1055
|
:returns dict[]: an array of objects representing market data
|
1046
1056
|
"""
|
@@ -1160,9 +1170,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
1160
1170
|
|
1161
1171
|
def fetch_swap_markets(self, params={}):
|
1162
1172
|
"""
|
1163
|
-
|
1173
|
+
@ignore
|
1164
1174
|
retrieves data on all swap markets for mexc
|
1165
|
-
|
1175
|
+
|
1176
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
1177
|
+
|
1166
1178
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1167
1179
|
:returns dict[]: an array of objects representing market data
|
1168
1180
|
"""
|
@@ -1281,8 +1293,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
1281
1293
|
|
1282
1294
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
1283
1295
|
"""
|
1284
|
-
|
1285
|
-
|
1296
|
+
|
1297
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
|
1298
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-s-depth-information
|
1299
|
+
|
1286
1300
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
1287
1301
|
:param str symbol: unified symbol of the market to fetch the order book for
|
1288
1302
|
:param int [limit]: the maximum amount of order book entries to return
|
@@ -1352,9 +1366,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
1352
1366
|
|
1353
1367
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
1354
1368
|
"""
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1369
|
+
|
1370
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
|
1371
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
|
1372
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
|
1373
|
+
|
1358
1374
|
get the list of most recent trades for a particular symbol
|
1359
1375
|
:param str symbol: unified symbol of the market to fetch trades for
|
1360
1376
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
@@ -1600,8 +1616,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
1600
1616
|
|
1601
1617
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
1602
1618
|
"""
|
1603
|
-
|
1604
|
-
|
1619
|
+
|
1620
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
|
1621
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
|
1622
|
+
|
1605
1623
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1606
1624
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1607
1625
|
:param str timeframe: the length of time each candle represents
|
@@ -1708,8 +1726,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
1708
1726
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1709
1727
|
"""
|
1710
1728
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
1711
|
-
|
1712
|
-
|
1729
|
+
|
1730
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
|
1731
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
|
1732
|
+
|
1713
1733
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1714
1734
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1715
1735
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1791,8 +1811,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
1791
1811
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1792
1812
|
"""
|
1793
1813
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
1794
|
-
|
1795
|
-
|
1814
|
+
|
1815
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
|
1816
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
|
1817
|
+
|
1796
1818
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1797
1819
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1798
1820
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1975,7 +1997,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
1975
1997
|
def fetch_bids_asks(self, symbols: Strings = None, params={}):
|
1976
1998
|
"""
|
1977
1999
|
fetches the bid and ask price and volume for multiple markets
|
1978
|
-
|
2000
|
+
|
2001
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#symbol-order-book-ticker
|
2002
|
+
|
1979
2003
|
:param str[]|None symbols: unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
1980
2004
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1981
2005
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -2012,7 +2036,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
2012
2036
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2013
2037
|
"""
|
2014
2038
|
create a market buy order by providing the symbol and cost
|
2015
|
-
|
2039
|
+
|
2040
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
2041
|
+
|
2016
2042
|
:param str symbol: unified symbol of the market to create an order in
|
2017
2043
|
:param float cost: how much you want to trade in units of the quote currency
|
2018
2044
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2028,7 +2054,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
2028
2054
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2029
2055
|
"""
|
2030
2056
|
create a market sell order by providing the symbol and cost
|
2031
|
-
|
2057
|
+
|
2058
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
2059
|
+
|
2032
2060
|
:param str symbol: unified symbol of the market to create an order in
|
2033
2061
|
:param float cost: how much you want to trade in units of the quote currency
|
2034
2062
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2044,9 +2072,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2044
2072
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2045
2073
|
"""
|
2046
2074
|
create a trade order
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2075
|
+
|
2076
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
2077
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
2078
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
|
2079
|
+
|
2050
2080
|
:param str symbol: unified symbol of the market to create an order in
|
2051
2081
|
:param str type: 'market' or 'limit'
|
2052
2082
|
:param str side: 'buy' or 'sell'
|
@@ -2058,8 +2088,8 @@ class mexc(Exchange, ImplicitAPI):
|
|
2058
2088
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2059
2089
|
:param bool [params.reduceOnly]: *contract only* indicates if self order is to reduce the size of a position
|
2060
2090
|
:param bool [params.hedged]: *swap only* True for hedged mode, False for one way mode, default is False
|
2061
|
-
|
2062
|
-
|
2091
|
+
|
2092
|
+
EXCHANGE SPECIFIC PARAMETERS
|
2063
2093
|
:param int [params.leverage]: *contract only* leverage is necessary on isolated margin
|
2064
2094
|
:param long [params.positionId]: *contract only* it is recommended to hasattr(self, fill) parameter when closing a position
|
2065
2095
|
:param str [params.externalOid]: *contract only* external order ID
|
@@ -2117,16 +2147,18 @@ class mexc(Exchange, ImplicitAPI):
|
|
2117
2147
|
|
2118
2148
|
def create_spot_order(self, market, type, side, amount, price=None, marginMode=None, params={}):
|
2119
2149
|
"""
|
2120
|
-
|
2150
|
+
@ignore
|
2121
2151
|
create a trade order
|
2122
|
-
|
2123
|
-
|
2152
|
+
|
2153
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
2154
|
+
|
2155
|
+
:param str market: unified symbol of the market to create an order in
|
2124
2156
|
:param str type: 'market' or 'limit'
|
2125
2157
|
:param str side: 'buy' or 'sell'
|
2126
2158
|
:param float amount: how much of currency you want to trade in units of base currency
|
2127
2159
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
2160
|
+
:param str [marginMode]: only 'isolated' is supported for spot-margin trading
|
2128
2161
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2129
|
-
:param str [params.marginMode]: only 'isolated' is supported for spot-margin trading
|
2130
2162
|
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
2131
2163
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2132
2164
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2170,24 +2202,26 @@ class mexc(Exchange, ImplicitAPI):
|
|
2170
2202
|
|
2171
2203
|
def create_swap_order(self, market, type, side, amount, price=None, marginMode=None, params={}):
|
2172
2204
|
"""
|
2173
|
-
|
2205
|
+
@ignore
|
2174
2206
|
create a trade order
|
2175
|
-
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2207
|
+
|
2208
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
2209
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
2210
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
|
2211
|
+
|
2212
|
+
:param str market: unified symbol of the market to create an order in
|
2179
2213
|
:param str type: 'market' or 'limit'
|
2180
2214
|
:param str side: 'buy' or 'sell'
|
2181
2215
|
:param float amount: how much of currency you want to trade in units of base currency
|
2182
2216
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
2217
|
+
:param str [marginMode]: only 'isolated' is supported for spot-margin trading
|
2183
2218
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2184
|
-
:param str [params.marginMode]: only 'isolated' is supported for spot-margin trading
|
2185
2219
|
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
2186
2220
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2187
2221
|
:param bool [params.reduceOnly]: indicates if self order is to reduce the size of a position
|
2188
2222
|
:param bool [params.hedged]: *swap only* True for hedged mode, False for one way mode, default is False
|
2189
|
-
|
2190
|
-
|
2223
|
+
|
2224
|
+
EXCHANGE SPECIFIC PARAMETERS
|
2191
2225
|
:param int [params.leverage]: leverage is necessary on isolated margin
|
2192
2226
|
:param long [params.positionId]: it is recommended to hasattr(self, fill) parameter when closing a position
|
2193
2227
|
:param str [params.externalOid]: external order ID
|
@@ -2295,7 +2329,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
2295
2329
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
2296
2330
|
"""
|
2297
2331
|
*spot only* *all orders must have the same symbol* create a list of trade orders
|
2298
|
-
|
2332
|
+
|
2333
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
|
2334
|
+
|
2299
2335
|
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
2300
2336
|
:param dict [params]: extra parameters specific to api endpoint
|
2301
2337
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2352,8 +2388,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2352
2388
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2353
2389
|
"""
|
2354
2390
|
fetches information on an order made by the user
|
2355
|
-
|
2356
|
-
|
2391
|
+
|
2392
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-order
|
2393
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
2394
|
+
|
2395
|
+
:param str id: order id
|
2357
2396
|
:param str symbol: unified symbol of the market the order was made in
|
2358
2397
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2359
2398
|
:param str [params.marginMode]: only 'isolated' is supported, for spot-margin trading
|
@@ -2466,9 +2505,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2466
2505
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2467
2506
|
"""
|
2468
2507
|
fetches information on multiple orders made by the user
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2508
|
+
|
2509
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
2510
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
2511
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
2512
|
+
|
2472
2513
|
:param str symbol: unified market symbol of the market orders were made in
|
2473
2514
|
:param int [since]: the earliest time in ms to fetch orders for
|
2474
2515
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -2695,9 +2736,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2695
2736
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2696
2737
|
"""
|
2697
2738
|
fetch all unfilled currently open orders
|
2698
|
-
|
2699
|
-
|
2700
|
-
|
2739
|
+
|
2740
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#current-open-orders
|
2741
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
2742
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
2743
|
+
|
2701
2744
|
:param str symbol: unified market symbol
|
2702
2745
|
:param int [since]: the earliest time in ms to fetch open orders for
|
2703
2746
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -2780,9 +2823,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2780
2823
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2781
2824
|
"""
|
2782
2825
|
fetches information on multiple closed orders made by the user
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2826
|
+
|
2827
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
2828
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
2829
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
2830
|
+
|
2786
2831
|
:param str symbol: unified market symbol of the market orders were made in
|
2787
2832
|
:param int [since]: the earliest time in ms to fetch orders for
|
2788
2833
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -2794,9 +2839,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2794
2839
|
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2795
2840
|
"""
|
2796
2841
|
fetches information on multiple canceled orders made by the user
|
2797
|
-
|
2798
|
-
|
2799
|
-
|
2842
|
+
|
2843
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
2844
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
2845
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
2846
|
+
|
2800
2847
|
:param str symbol: unified market symbol of the market orders were made in
|
2801
2848
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
2802
2849
|
:param int [limit]: max number of orders to return, default is None
|
@@ -2821,9 +2868,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2821
2868
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2822
2869
|
"""
|
2823
2870
|
cancels an open order
|
2824
|
-
|
2825
|
-
|
2826
|
-
|
2871
|
+
|
2872
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
|
2873
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
2874
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
|
2875
|
+
|
2827
2876
|
:param str id: order id
|
2828
2877
|
:param str symbol: unified symbol of the market the order was made in
|
2829
2878
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2926,7 +2975,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
2926
2975
|
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
2927
2976
|
"""
|
2928
2977
|
cancel multiple orders
|
2929
|
-
|
2978
|
+
|
2979
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
2980
|
+
|
2930
2981
|
:param str[] ids: order ids
|
2931
2982
|
:param str symbol: unified market symbol, default is None
|
2932
2983
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2958,9 +3009,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
2958
3009
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
2959
3010
|
"""
|
2960
3011
|
cancel all open orders
|
2961
|
-
|
2962
|
-
|
2963
|
-
|
3012
|
+
|
3013
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-all-open-orders-on-a-symbol
|
3014
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-orders-under-a-contract-under-maintenance
|
3015
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-trigger-orders-under-maintenance
|
3016
|
+
|
2964
3017
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
2965
3018
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2966
3019
|
:param str [params.marginMode]: only 'isolated' is supported for spot-margin trading
|
@@ -3347,8 +3400,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
3347
3400
|
def fetch_accounts(self, params={}) -> List[Account]:
|
3348
3401
|
"""
|
3349
3402
|
fetch all the accounts associated with a profile
|
3350
|
-
|
3351
|
-
|
3403
|
+
|
3404
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
3405
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
3406
|
+
|
3352
3407
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3353
3408
|
:returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
|
3354
3409
|
"""
|
@@ -3373,8 +3428,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
3373
3428
|
def fetch_trading_fees(self, params={}) -> TradingFees:
|
3374
3429
|
"""
|
3375
3430
|
fetch the trading fees for multiple markets
|
3376
|
-
|
3377
|
-
|
3431
|
+
|
3432
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
3433
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
3434
|
+
|
3378
3435
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3379
3436
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
3380
3437
|
"""
|
@@ -3514,9 +3571,11 @@ class mexc(Exchange, ImplicitAPI):
|
|
3514
3571
|
def fetch_balance(self, params={}) -> Balances:
|
3515
3572
|
"""
|
3516
3573
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3517
|
-
|
3518
|
-
|
3519
|
-
|
3574
|
+
|
3575
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
3576
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
3577
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#isolated-account
|
3578
|
+
|
3520
3579
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3521
3580
|
:param str [params.symbols]: # required for margin, market id's separated by commas
|
3522
3581
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
@@ -3639,8 +3698,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
3639
3698
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3640
3699
|
"""
|
3641
3700
|
fetch all trades made by the user
|
3642
|
-
|
3643
|
-
|
3701
|
+
|
3702
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
3703
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order
|
3704
|
+
|
3644
3705
|
:param str symbol: unified market symbol
|
3645
3706
|
:param int [since]: the earliest time in ms to fetch trades for
|
3646
3707
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -3727,8 +3788,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
3727
3788
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3728
3789
|
"""
|
3729
3790
|
fetch all the trades made from a single order
|
3730
|
-
|
3731
|
-
|
3791
|
+
|
3792
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
3793
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
3794
|
+
|
3732
3795
|
:param str id: order id
|
3733
3796
|
:param str symbol: unified market symbol
|
3734
3797
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -3820,7 +3883,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3820
3883
|
def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3821
3884
|
"""
|
3822
3885
|
remove margin from a position
|
3823
|
-
|
3886
|
+
|
3887
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
3888
|
+
|
3824
3889
|
:param str symbol: unified market symbol
|
3825
3890
|
:param float amount: the amount of margin to remove
|
3826
3891
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3831,7 +3896,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3831
3896
|
def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3832
3897
|
"""
|
3833
3898
|
add margin
|
3834
|
-
|
3899
|
+
|
3900
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
3901
|
+
|
3835
3902
|
:param str symbol: unified market symbol
|
3836
3903
|
:param float amount: amount of margin to add
|
3837
3904
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3842,7 +3909,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3842
3909
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
3843
3910
|
"""
|
3844
3911
|
set the level of leverage for a market
|
3845
|
-
|
3912
|
+
|
3913
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
3914
|
+
|
3846
3915
|
:param float leverage: the rate of leverage
|
3847
3916
|
:param str symbol: unified market symbol
|
3848
3917
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -3870,7 +3939,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3870
3939
|
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3871
3940
|
"""
|
3872
3941
|
fetch the history of funding payments paid and received on self account
|
3873
|
-
|
3942
|
+
|
3943
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate
|
3944
|
+
|
3874
3945
|
:param str symbol: unified market symbol
|
3875
3946
|
:param int [since]: the earliest time in ms to fetch funding history for
|
3876
3947
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
@@ -3985,7 +4056,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3985
4056
|
def fetch_funding_interval(self, symbol: str, params={}) -> FundingRate:
|
3986
4057
|
"""
|
3987
4058
|
fetch the current funding rate interval
|
3988
|
-
|
4059
|
+
|
4060
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
4061
|
+
|
3989
4062
|
:param str symbol: unified market symbol
|
3990
4063
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3991
4064
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -3995,7 +4068,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
3995
4068
|
def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
3996
4069
|
"""
|
3997
4070
|
fetch the current funding rate
|
3998
|
-
|
4071
|
+
|
4072
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
4073
|
+
|
3999
4074
|
:param str symbol: unified market symbol
|
4000
4075
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4001
4076
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -4027,7 +4102,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4027
4102
|
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4028
4103
|
"""
|
4029
4104
|
fetches historical funding rate prices
|
4030
|
-
|
4105
|
+
|
4106
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate-history
|
4107
|
+
|
4031
4108
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
4032
4109
|
:param int [since]: not used by mexc, but filtered internally by ccxt
|
4033
4110
|
:param int [limit]: mexc limit is page_size default 20, maximum is 100
|
@@ -4091,7 +4168,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4091
4168
|
def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
4092
4169
|
"""
|
4093
4170
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes, if a market has a leverage tier of 0, then the leverage tiers cannot be obtained for self market
|
4094
|
-
|
4171
|
+
|
4172
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
4173
|
+
|
4095
4174
|
:param str[] [symbols]: list of unified market symbols
|
4096
4175
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4097
4176
|
:returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
|
@@ -4186,6 +4265,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4186
4265
|
# "isHidden": False
|
4187
4266
|
# }
|
4188
4267
|
#
|
4268
|
+
marketId = self.safe_string(info, 'symbol')
|
4189
4269
|
maintenanceMarginRate = self.safe_string(info, 'maintenanceMarginRate')
|
4190
4270
|
initialMarginRate = self.safe_string(info, 'initialMarginRate')
|
4191
4271
|
maxVol = self.safe_string(info, 'maxVol')
|
@@ -4199,6 +4279,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4199
4279
|
return [
|
4200
4280
|
{
|
4201
4281
|
'tier': 0,
|
4282
|
+
'symbol': self.safe_symbol(marketId, market, None, 'contract'),
|
4202
4283
|
'currency': self.safe_currency_code(quoteId),
|
4203
4284
|
'minNotional': None,
|
4204
4285
|
'maxNotional': None,
|
@@ -4211,6 +4292,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4211
4292
|
cap = Precise.string_add(floor, riskIncrVol)
|
4212
4293
|
tiers.append({
|
4213
4294
|
'tier': self.parse_number(Precise.string_div(cap, riskIncrVol)),
|
4295
|
+
'symbol': self.safe_symbol(marketId, market, None, 'contract'),
|
4214
4296
|
'currency': self.safe_currency_code(quoteId),
|
4215
4297
|
'minNotional': self.parse_number(floor),
|
4216
4298
|
'maxNotional': self.parse_number(cap),
|
@@ -4247,7 +4329,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4247
4329
|
def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
|
4248
4330
|
"""
|
4249
4331
|
fetch a dictionary of addresses for a currency, indexed by network
|
4250
|
-
|
4332
|
+
|
4333
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
4334
|
+
|
4251
4335
|
:param str code: unified currency code of the currency for the deposit address
|
4252
4336
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4253
4337
|
:returns dict: a dictionary of `address structures <https://docs.ccxt.com/#/?id=address-structure>` indexed by the network
|
@@ -4290,7 +4374,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4290
4374
|
def create_deposit_address(self, code: str, params={}):
|
4291
4375
|
"""
|
4292
4376
|
create a currency deposit address
|
4293
|
-
|
4377
|
+
|
4378
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
|
4379
|
+
|
4294
4380
|
:param str code: unified currency code of the currency for the deposit address
|
4295
4381
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4296
4382
|
:param str [params.network]: the blockchain network name
|
@@ -4329,7 +4415,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4329
4415
|
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
4330
4416
|
"""
|
4331
4417
|
fetch the deposit address for a currency associated with self account
|
4332
|
-
|
4418
|
+
|
4419
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
4420
|
+
|
4333
4421
|
:param str code: unified currency code
|
4334
4422
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4335
4423
|
:param str [params.network]: the chain of currency, self only apply for multi-chain currency, and there is no need for single chain currency
|
@@ -4356,7 +4444,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4356
4444
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4357
4445
|
"""
|
4358
4446
|
fetch all deposits made to an account
|
4359
|
-
|
4447
|
+
|
4448
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
|
4449
|
+
|
4360
4450
|
:param str code: unified currency code
|
4361
4451
|
:param int [since]: the earliest time in ms to fetch deposits for
|
4362
4452
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -4409,7 +4499,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4409
4499
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4410
4500
|
"""
|
4411
4501
|
fetch all withdrawals made from an account
|
4412
|
-
|
4502
|
+
|
4503
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
|
4504
|
+
|
4413
4505
|
:param str code: unified currency code
|
4414
4506
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
4415
4507
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -4576,7 +4668,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4576
4668
|
def fetch_position(self, symbol: str, params={}):
|
4577
4669
|
"""
|
4578
4670
|
fetch data on a single open contract trade position
|
4579
|
-
|
4671
|
+
|
4672
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
4673
|
+
|
4580
4674
|
:param str symbol: unified market symbol of the market the position is held in, default is None
|
4581
4675
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4582
4676
|
:returns dict: a `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -4592,7 +4686,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4592
4686
|
def fetch_positions(self, symbols: Strings = None, params={}):
|
4593
4687
|
"""
|
4594
4688
|
fetch all open positions
|
4595
|
-
|
4689
|
+
|
4690
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
4691
|
+
|
4596
4692
|
:param str[]|None symbols: list of unified market symbols
|
4597
4693
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4598
4694
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -4738,7 +4834,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4738
4834
|
def fetch_transfer(self, id: str, code: Str = None, params={}) -> TransferEntry:
|
4739
4835
|
"""
|
4740
4836
|
fetches a transfer
|
4741
|
-
|
4837
|
+
|
4838
|
+
https://mexcdevelop.github.io/apidocs/spot_v2_en/#internal-assets-transfer-order-inquiry
|
4839
|
+
|
4742
4840
|
:param str id: transfer id
|
4743
4841
|
:param str [code]: not used by mexc fetchTransfer
|
4744
4842
|
:param dict params: extra parameters specific to the exchange api endpoint
|
@@ -4773,8 +4871,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
4773
4871
|
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
4774
4872
|
"""
|
4775
4873
|
fetch a history of internal transfers made on an account
|
4776
|
-
|
4777
|
-
|
4874
|
+
|
4875
|
+
https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
4876
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
4877
|
+
|
4778
4878
|
:param str code: unified currency code of the currency transferred
|
4779
4879
|
:param int [since]: the earliest time in ms to fetch transfers for
|
4780
4880
|
:param int [limit]: the maximum number of transfers structures to retrieve
|
@@ -4853,7 +4953,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4853
4953
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
4854
4954
|
"""
|
4855
4955
|
transfer currency internally between wallets on the same account
|
4856
|
-
|
4956
|
+
|
4957
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#user-universal-transfer
|
4958
|
+
|
4857
4959
|
:param str code: unified currency code
|
4858
4960
|
:param float amount: amount to transfer
|
4859
4961
|
:param str fromAccount: account to transfer from
|
@@ -4978,7 +5080,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
4978
5080
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
4979
5081
|
"""
|
4980
5082
|
make a withdrawal
|
4981
|
-
|
5083
|
+
|
5084
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
|
5085
|
+
|
4982
5086
|
:param str code: unified currency code
|
4983
5087
|
:param float amount: the amount to withdraw
|
4984
5088
|
:param str address: the address to withdraw to
|
@@ -5015,7 +5119,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
5015
5119
|
def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
5016
5120
|
"""
|
5017
5121
|
set hedged to True or False for a market
|
5018
|
-
|
5122
|
+
|
5123
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#change-position-mode
|
5124
|
+
|
5019
5125
|
:param bool hedged: set to True to use dualSidePosition
|
5020
5126
|
:param str symbol: not used by mexc setPositionMode()
|
5021
5127
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -5036,7 +5142,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
5036
5142
|
def fetch_position_mode(self, symbol: Str = None, params={}):
|
5037
5143
|
"""
|
5038
5144
|
fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
5039
|
-
|
5145
|
+
|
5146
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode
|
5147
|
+
|
5040
5148
|
:param str symbol: not used by mexc fetchPositionMode
|
5041
5149
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5042
5150
|
:returns dict: an object detailing whether the market is in hedged or one-way mode
|
@@ -5058,7 +5166,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
5058
5166
|
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
5059
5167
|
"""
|
5060
5168
|
fetch deposit and withdrawal fees
|
5061
|
-
|
5169
|
+
|
5170
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
5171
|
+
|
5062
5172
|
:param str[]|None codes: returns fees for all currencies if None
|
5063
5173
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5064
5174
|
:returns dict[]: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -5151,7 +5261,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
5151
5261
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
5152
5262
|
"""
|
5153
5263
|
fetch deposit and withdrawal fees
|
5154
|
-
|
5264
|
+
|
5265
|
+
https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
5266
|
+
|
5155
5267
|
:param str[]|None codes: returns fees for all currencies if None
|
5156
5268
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5157
5269
|
:returns dict[]: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -5237,7 +5349,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
5237
5349
|
def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
5238
5350
|
"""
|
5239
5351
|
fetch the set leverage for a market
|
5240
|
-
|
5352
|
+
|
5353
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-leverage
|
5354
|
+
|
5241
5355
|
:param str symbol: unified market symbol
|
5242
5356
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5243
5357
|
:returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
|
@@ -5304,7 +5418,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
5304
5418
|
|
5305
5419
|
def handle_margin_mode_and_params(self, methodName, params={}, defaultValue=None):
|
5306
5420
|
"""
|
5307
|
-
|
5421
|
+
@ignore
|
5308
5422
|
marginMode specified by params["marginMode"], self.options["marginMode"], self.options["defaultMarginMode"], params["margin"] = True or self.options["defaultType"] = 'margin'
|
5309
5423
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5310
5424
|
:param bool [params.margin]: True for trading spot-margin
|
@@ -5321,15 +5435,17 @@ class mexc(Exchange, ImplicitAPI):
|
|
5321
5435
|
def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
|
5322
5436
|
"""
|
5323
5437
|
fetches historical positions
|
5324
|
-
|
5438
|
+
|
5439
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
5440
|
+
|
5325
5441
|
:param str[] [symbols]: unified contract symbols
|
5326
5442
|
:param int [since]: not used by mexc fetchPositionsHistory
|
5327
5443
|
:param int [limit]: the maximum amount of candles to fetch, default=1000
|
5328
|
-
:param dict params: extra parameters specific to the exchange api endpoint
|
5329
|
-
|
5330
|
-
|
5331
|
-
:param int type: position type,1: long, 2: short
|
5332
|
-
:param int page_num: current page number, default is 1
|
5444
|
+
:param dict [params]: extra parameters specific to the exchange api endpoint
|
5445
|
+
|
5446
|
+
EXCHANGE SPECIFIC PARAMETERS
|
5447
|
+
:param int [params.type]: position type,1: long, 2: short
|
5448
|
+
:param int [params.page_num]: current page number, default is 1
|
5333
5449
|
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
5334
5450
|
"""
|
5335
5451
|
self.load_markets()
|
@@ -5389,7 +5505,9 @@ class mexc(Exchange, ImplicitAPI):
|
|
5389
5505
|
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
5390
5506
|
"""
|
5391
5507
|
set margin mode to 'cross' or 'isolated'
|
5392
|
-
|
5508
|
+
|
5509
|
+
https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
5510
|
+
|
5393
5511
|
:param str marginMode: 'cross' or 'isolated'
|
5394
5512
|
:param str [symbol]: required when there is no position, else provide params["positionId"]
|
5395
5513
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|