ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +2 -2
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bitbank.py +1 -0
- ccxt/abstract/coinbase.py +2 -0
- ccxt/abstract/htx.py +3 -0
- ccxt/abstract/huobi.py +3 -0
- ccxt/abstract/huobipro.py +3 -0
- ccxt/abstract/okex.py +3 -1
- ccxt/abstract/okex5.py +3 -1
- ccxt/abstract/okx.py +3 -1
- ccxt/ace.py +23 -23
- ccxt/alpaca.py +8 -8
- ccxt/ascendex.py +26 -26
- ccxt/async_support/__init__.py +2 -2
- ccxt/async_support/ace.py +23 -23
- ccxt/async_support/alpaca.py +8 -8
- ccxt/async_support/ascendex.py +26 -26
- ccxt/async_support/base/exchange.py +4 -2216
- ccxt/async_support/bigone.py +21 -24
- ccxt/async_support/binance.py +61 -54
- ccxt/async_support/bingx.py +28 -28
- ccxt/async_support/bit2c.py +9 -9
- ccxt/async_support/bitbank.py +11 -10
- ccxt/async_support/bitbns.py +11 -11
- ccxt/async_support/bitfinex.py +15 -15
- ccxt/async_support/bitfinex2.py +22 -22
- ccxt/async_support/bitflyer.py +13 -13
- ccxt/async_support/bitforex.py +10 -10
- ccxt/async_support/bitget.py +44 -44
- ccxt/async_support/bithumb.py +9 -9
- ccxt/async_support/bitmart.py +85 -104
- ccxt/async_support/bitmex.py +27 -27
- ccxt/async_support/bitopro.py +18 -18
- ccxt/async_support/bitpanda.py +18 -18
- ccxt/async_support/bitrue.py +14 -14
- ccxt/async_support/bitso.py +17 -17
- ccxt/async_support/bitstamp.py +17 -17
- ccxt/async_support/bittrex.py +22 -24
- ccxt/async_support/bitvavo.py +15 -15
- ccxt/async_support/bl3p.py +4 -4
- ccxt/async_support/blockchaincom.py +17 -17
- ccxt/async_support/btcalpha.py +14 -14
- ccxt/async_support/btcbox.py +9 -9
- ccxt/async_support/btcmarkets.py +17 -17
- ccxt/async_support/btcturk.py +9 -9
- ccxt/async_support/bybit.py +46 -46
- ccxt/async_support/cex.py +10 -10
- ccxt/async_support/coinbase.py +69 -25
- ccxt/async_support/coinbasepro.py +19 -19
- ccxt/async_support/coincheck.py +10 -10
- ccxt/async_support/coinex.py +57 -66
- ccxt/async_support/coinlist.py +22 -22
- ccxt/async_support/coinmate.py +10 -10
- ccxt/async_support/coinone.py +10 -10
- ccxt/async_support/coinsph.py +17 -17
- ccxt/async_support/coinspot.py +5 -5
- ccxt/async_support/cryptocom.py +27 -27
- ccxt/async_support/currencycom.py +18 -18
- ccxt/async_support/delta.py +21 -21
- ccxt/async_support/deribit.py +24 -24
- ccxt/async_support/digifinex.py +35 -35
- ccxt/async_support/exmo.py +19 -19
- ccxt/async_support/gate.py +38 -38
- ccxt/async_support/gemini.py +11 -11
- ccxt/async_support/hitbtc.py +27 -27
- ccxt/async_support/hollaex.py +19 -19
- ccxt/async_support/htx.py +47 -44
- ccxt/async_support/huobijp.py +22 -22
- ccxt/async_support/idex.py +20 -20
- ccxt/async_support/independentreserve.py +9 -9
- ccxt/async_support/indodax.py +10 -10
- ccxt/async_support/kraken.py +25 -25
- ccxt/async_support/krakenfutures.py +17 -17
- ccxt/async_support/kucoin.py +27 -27
- ccxt/async_support/kucoinfutures.py +20 -20
- ccxt/async_support/kuna.py +19 -19
- ccxt/async_support/latoken.py +14 -14
- ccxt/async_support/lbank.py +18 -18
- ccxt/async_support/luno.py +14 -14
- ccxt/async_support/lykke.py +12 -12
- ccxt/async_support/mercado.py +11 -11
- ccxt/async_support/mexc.py +36 -36
- ccxt/async_support/ndax.py +18 -18
- ccxt/async_support/novadax.py +17 -17
- ccxt/async_support/oceanex.py +12 -12
- ccxt/async_support/okcoin.py +19 -19
- ccxt/async_support/okx.py +48 -45
- ccxt/async_support/p2b.py +6 -6
- ccxt/async_support/paymium.py +6 -6
- ccxt/async_support/phemex.py +57 -57
- ccxt/async_support/poloniex.py +31 -30
- ccxt/async_support/poloniexfutures.py +16 -16
- ccxt/async_support/probit.py +22 -22
- ccxt/async_support/tidex.py +15 -15
- ccxt/async_support/timex.py +20 -20
- ccxt/async_support/tokocrypto.py +16 -16
- ccxt/async_support/upbit.py +15 -15
- ccxt/async_support/wavesexchange.py +12 -12
- ccxt/async_support/wazirx.py +13 -13
- ccxt/async_support/whitebit.py +26 -26
- ccxt/async_support/woo.py +47 -47
- ccxt/async_support/yobit.py +8 -8
- ccxt/async_support/zaif.py +10 -10
- ccxt/async_support/zonda.py +16 -16
- ccxt/base/errors.py +17 -16
- ccxt/base/exchange.py +57 -97
- ccxt/base/types.py +138 -139
- ccxt/bigone.py +21 -24
- ccxt/binance.py +61 -54
- ccxt/bingx.py +28 -28
- ccxt/bit2c.py +9 -9
- ccxt/bitbank.py +11 -10
- ccxt/bitbns.py +11 -11
- ccxt/bitfinex.py +15 -15
- ccxt/bitfinex2.py +22 -22
- ccxt/bitflyer.py +13 -13
- ccxt/bitforex.py +10 -10
- ccxt/bitget.py +44 -44
- ccxt/bithumb.py +9 -9
- ccxt/bitmart.py +85 -104
- ccxt/bitmex.py +27 -27
- ccxt/bitopro.py +18 -18
- ccxt/bitpanda.py +18 -18
- ccxt/bitrue.py +14 -14
- ccxt/bitso.py +17 -17
- ccxt/bitstamp.py +17 -17
- ccxt/bittrex.py +22 -24
- ccxt/bitvavo.py +15 -15
- ccxt/bl3p.py +4 -4
- ccxt/blockchaincom.py +17 -17
- ccxt/btcalpha.py +14 -14
- ccxt/btcbox.py +9 -9
- ccxt/btcmarkets.py +17 -17
- ccxt/btcturk.py +9 -9
- ccxt/bybit.py +46 -46
- ccxt/cex.py +10 -10
- ccxt/coinbase.py +69 -25
- ccxt/coinbasepro.py +19 -19
- ccxt/coincheck.py +10 -10
- ccxt/coinex.py +57 -66
- ccxt/coinlist.py +22 -22
- ccxt/coinmate.py +10 -10
- ccxt/coinone.py +10 -10
- ccxt/coinsph.py +17 -17
- ccxt/coinspot.py +5 -5
- ccxt/cryptocom.py +27 -27
- ccxt/currencycom.py +18 -18
- ccxt/delta.py +21 -21
- ccxt/deribit.py +24 -24
- ccxt/digifinex.py +35 -35
- ccxt/exmo.py +19 -19
- ccxt/gate.py +38 -38
- ccxt/gemini.py +11 -11
- ccxt/hitbtc.py +27 -27
- ccxt/hollaex.py +19 -19
- ccxt/htx.py +47 -44
- ccxt/huobijp.py +22 -22
- ccxt/idex.py +20 -20
- ccxt/independentreserve.py +9 -9
- ccxt/indodax.py +10 -10
- ccxt/kraken.py +25 -25
- ccxt/krakenfutures.py +17 -17
- ccxt/kucoin.py +27 -27
- ccxt/kucoinfutures.py +20 -20
- ccxt/kuna.py +19 -19
- ccxt/latoken.py +14 -14
- ccxt/lbank.py +18 -18
- ccxt/luno.py +14 -14
- ccxt/lykke.py +12 -12
- ccxt/mercado.py +11 -11
- ccxt/mexc.py +36 -36
- ccxt/ndax.py +18 -18
- ccxt/novadax.py +17 -17
- ccxt/oceanex.py +12 -12
- ccxt/okcoin.py +19 -19
- ccxt/okx.py +48 -45
- ccxt/p2b.py +6 -6
- ccxt/paymium.py +6 -6
- ccxt/phemex.py +57 -57
- ccxt/poloniex.py +31 -30
- ccxt/poloniexfutures.py +16 -16
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/binance.py +9 -9
- ccxt/pro/bingx.py +3 -3
- ccxt/pro/bitfinex.py +3 -3
- ccxt/pro/bitfinex2.py +3 -3
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +3 -3
- ccxt/pro/bitpanda.py +3 -3
- ccxt/pro/bitrue.py +2 -2
- ccxt/pro/bitstamp.py +2 -2
- ccxt/pro/bittrex.py +3 -3
- ccxt/pro/bitvavo.py +3 -3
- ccxt/pro/blockchaincom.py +2 -2
- ccxt/pro/bybit.py +4 -4
- ccxt/pro/cex.py +3 -3
- ccxt/pro/coinbasepro.py +3 -3
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/cryptocom.py +5 -5
- ccxt/pro/deribit.py +3 -3
- ccxt/pro/exmo.py +2 -2
- ccxt/pro/gate.py +3 -3
- ccxt/pro/gemini.py +2 -2
- ccxt/pro/hitbtc.py +4 -4
- ccxt/pro/hollaex.py +3 -3
- ccxt/pro/htx.py +3 -3
- ccxt/pro/idex.py +3 -3
- ccxt/pro/kraken.py +7 -7
- ccxt/pro/krakenfutures.py +4 -4
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/kucoinfutures.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +6 -6
- ccxt/pro/phemex.py +3 -3
- ccxt/pro/poloniex.py +3 -3
- ccxt/pro/poloniexfutures.py +3 -3
- ccxt/pro/probit.py +3 -3
- ccxt/pro/wazirx.py +3 -3
- ccxt/pro/whitebit.py +3 -3
- ccxt/pro/woo.py +2 -2
- ccxt/probit.py +22 -22
- ccxt/test/base/test_shared_methods.py +3 -3
- ccxt/test/test_async.py +543 -535
- ccxt/test/test_sync.py +542 -534
- ccxt/tidex.py +15 -15
- ccxt/timex.py +20 -20
- ccxt/tokocrypto.py +16 -16
- ccxt/upbit.py +15 -15
- ccxt/wavesexchange.py +12 -12
- ccxt/wazirx.py +13 -13
- ccxt/whitebit.py +26 -26
- ccxt/woo.py +47 -47
- ccxt/yobit.py +8 -8
- ccxt/zaif.py +10 -10
- ccxt/zonda.py +16 -16
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
- ccxt-4.1.56.dist-info/RECORD +449 -0
- ccxt/async_support/bitstamp1.py +0 -402
- ccxt/async_support/lbank2.py +0 -2620
- ccxt/bitstamp1.py +0 -402
- ccxt/lbank2.py +0 -2619
- ccxt-4.1.54.dist-info/RECORD +0 -453
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
ccxt/luno.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.luno import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderSide, OrderType,
|
8
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -342,7 +342,7 @@ class luno(Exchange, ImplicitAPI):
|
|
342
342
|
}
|
343
343
|
return self.safe_string(statuses, status, status)
|
344
344
|
|
345
|
-
def parse_order(self, order, market=None) -> Order:
|
345
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
346
346
|
#
|
347
347
|
# {
|
348
348
|
# "base": "string",
|
@@ -414,7 +414,7 @@ class luno(Exchange, ImplicitAPI):
|
|
414
414
|
'average': None,
|
415
415
|
}, market)
|
416
416
|
|
417
|
-
def fetch_order(self, id: str, symbol:
|
417
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
418
418
|
"""
|
419
419
|
fetches information on an order made by the user
|
420
420
|
:param str symbol: not used by luno fetchOrder
|
@@ -428,7 +428,7 @@ class luno(Exchange, ImplicitAPI):
|
|
428
428
|
response = self.privateGetOrdersId(self.extend(request, params))
|
429
429
|
return self.parse_order(response)
|
430
430
|
|
431
|
-
def fetch_orders_by_state(self, state=None, symbol:
|
431
|
+
def fetch_orders_by_state(self, state=None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
432
432
|
self.load_markets()
|
433
433
|
request = {}
|
434
434
|
market = None
|
@@ -441,7 +441,7 @@ class luno(Exchange, ImplicitAPI):
|
|
441
441
|
orders = self.safe_value(response, 'orders', [])
|
442
442
|
return self.parse_orders(orders, market, since, limit)
|
443
443
|
|
444
|
-
def fetch_orders(self, symbol:
|
444
|
+
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
445
445
|
"""
|
446
446
|
fetches information on multiple orders made by the user
|
447
447
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -452,7 +452,7 @@ class luno(Exchange, ImplicitAPI):
|
|
452
452
|
"""
|
453
453
|
return self.fetch_orders_by_state(None, symbol, since, limit, params)
|
454
454
|
|
455
|
-
def fetch_open_orders(self, symbol:
|
455
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
456
456
|
"""
|
457
457
|
fetch all unfilled currently open orders
|
458
458
|
:param str symbol: unified market symbol
|
@@ -463,7 +463,7 @@ class luno(Exchange, ImplicitAPI):
|
|
463
463
|
"""
|
464
464
|
return self.fetch_orders_by_state('PENDING', symbol, since, limit, params)
|
465
465
|
|
466
|
-
def fetch_closed_orders(self, symbol:
|
466
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
467
467
|
"""
|
468
468
|
fetches information on multiple closed orders made by the user
|
469
469
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -474,7 +474,7 @@ class luno(Exchange, ImplicitAPI):
|
|
474
474
|
"""
|
475
475
|
return self.fetch_orders_by_state('COMPLETE', symbol, since, limit, params)
|
476
476
|
|
477
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
477
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
478
478
|
# {
|
479
479
|
# "pair":"XBTAUD",
|
480
480
|
# "timestamp":1642201439301,
|
@@ -556,7 +556,7 @@ class luno(Exchange, ImplicitAPI):
|
|
556
556
|
# }
|
557
557
|
return self.parse_ticker(response, market)
|
558
558
|
|
559
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
559
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
560
560
|
#
|
561
561
|
# fetchTrades(public)
|
562
562
|
#
|
@@ -673,7 +673,7 @@ class luno(Exchange, ImplicitAPI):
|
|
673
673
|
trades = self.safe_value(response, 'trades', [])
|
674
674
|
return self.parse_trades(trades, market, since, limit)
|
675
675
|
|
676
|
-
def fetch_my_trades(self, symbol:
|
676
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
677
677
|
"""
|
678
678
|
fetch all trades made by the user
|
679
679
|
:param str symbol: unified market symbol
|
@@ -780,7 +780,7 @@ class luno(Exchange, ImplicitAPI):
|
|
780
780
|
'id': response['order_id'],
|
781
781
|
}, market)
|
782
782
|
|
783
|
-
def cancel_order(self, id: str, symbol:
|
783
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
784
784
|
"""
|
785
785
|
cancels an open order
|
786
786
|
:param str id: order id
|
@@ -794,7 +794,7 @@ class luno(Exchange, ImplicitAPI):
|
|
794
794
|
}
|
795
795
|
return self.privatePostStoporder(self.extend(request, params))
|
796
796
|
|
797
|
-
def fetch_ledger_by_entries(self, code:
|
797
|
+
def fetch_ledger_by_entries(self, code: Str = None, entry=None, limit=None, params={}):
|
798
798
|
# by default without entry number or limit number, return most recent entry
|
799
799
|
if entry is None:
|
800
800
|
entry = -1
|
@@ -807,7 +807,7 @@ class luno(Exchange, ImplicitAPI):
|
|
807
807
|
}
|
808
808
|
return self.fetch_ledger(code, since, limit, self.extend(request, params))
|
809
809
|
|
810
|
-
def fetch_ledger(self, code:
|
810
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
811
811
|
"""
|
812
812
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
813
813
|
:param str code: unified currency code, default is None
|
@@ -881,7 +881,7 @@ class luno(Exchange, ImplicitAPI):
|
|
881
881
|
'referenceId': referenceId,
|
882
882
|
}
|
883
883
|
|
884
|
-
def parse_ledger_entry(self, entry, currency=None):
|
884
|
+
def parse_ledger_entry(self, entry, currency: Currency = None):
|
885
885
|
# details = self.safe_value(entry, 'details', {})
|
886
886
|
id = self.safe_string(entry, 'row_index')
|
887
887
|
account_id = self.safe_string(entry, 'account_id')
|
ccxt/lykke.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.lykke import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderSide, OrderType,
|
8
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import BadRequest
|
@@ -348,7 +348,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
348
348
|
})
|
349
349
|
return result
|
350
350
|
|
351
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
351
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
352
352
|
#
|
353
353
|
# fetchTickers
|
354
354
|
#
|
@@ -540,7 +540,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
540
540
|
timestamp = self.safe_integer(orderbook, 'timestamp')
|
541
541
|
return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'p', 'v')
|
542
542
|
|
543
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
543
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
544
544
|
#
|
545
545
|
# public fetchTrades
|
546
546
|
#
|
@@ -694,7 +694,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
694
694
|
}
|
695
695
|
return self.safe_string(statuses, status, status)
|
696
696
|
|
697
|
-
def parse_order(self, order, market=None) -> Order:
|
697
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
698
698
|
#
|
699
699
|
# {
|
700
700
|
# "id":"1b367978-7e4f-454b-b870-64040d484443",
|
@@ -816,7 +816,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
816
816
|
'trades': None,
|
817
817
|
}, market)
|
818
818
|
|
819
|
-
def cancel_order(self, id: str, symbol:
|
819
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
820
820
|
"""
|
821
821
|
cancels an open order
|
822
822
|
:param str id: order id
|
@@ -835,7 +835,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
835
835
|
#
|
836
836
|
return self.privateDeleteOrdersOrderId(self.extend(request, params))
|
837
837
|
|
838
|
-
def cancel_all_orders(self, symbol:
|
838
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
839
839
|
"""
|
840
840
|
cancel all open orders
|
841
841
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
@@ -858,7 +858,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
858
858
|
#
|
859
859
|
return self.privateDeleteOrders(self.extend(request, params))
|
860
860
|
|
861
|
-
def fetch_order(self, id: str, symbol:
|
861
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
862
862
|
"""
|
863
863
|
fetches information on an order made by the user
|
864
864
|
:param str symbol: not used by lykke fetchOrder
|
@@ -892,7 +892,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
892
892
|
#
|
893
893
|
return self.parse_order(payload)
|
894
894
|
|
895
|
-
def fetch_open_orders(self, symbol:
|
895
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
896
896
|
"""
|
897
897
|
fetch all unfilled currently open orders
|
898
898
|
:param str symbol: unified market symbol
|
@@ -936,7 +936,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
936
936
|
#
|
937
937
|
return self.parse_orders(payload, market, since, limit)
|
938
938
|
|
939
|
-
def fetch_closed_orders(self, symbol:
|
939
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
940
940
|
"""
|
941
941
|
fetches information on multiple closed orders made by the user
|
942
942
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -980,7 +980,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
980
980
|
#
|
981
981
|
return self.parse_orders(payload, market, since, limit)
|
982
982
|
|
983
|
-
def fetch_my_trades(self, symbol:
|
983
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
984
984
|
"""
|
985
985
|
fetch all trades made by the user
|
986
986
|
:param str symbol: unified market symbol
|
@@ -1068,7 +1068,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
1068
1068
|
'info': response,
|
1069
1069
|
}
|
1070
1070
|
|
1071
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
1071
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1072
1072
|
#
|
1073
1073
|
# withdraw
|
1074
1074
|
# "3035b1ad-2005-4587-a986-1f7966be78e0"
|
@@ -1127,7 +1127,7 @@ class lykke(Exchange, ImplicitAPI):
|
|
1127
1127
|
'fee': fee,
|
1128
1128
|
}
|
1129
1129
|
|
1130
|
-
def fetch_deposits_withdrawals(self, code:
|
1130
|
+
def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1131
1131
|
"""
|
1132
1132
|
fetch history of deposits and withdrawals
|
1133
1133
|
:param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
|
ccxt/mercado.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.mercado import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderSide, OrderType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -259,7 +259,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
259
259
|
response = self.publicGetCoinOrderbook(self.extend(request, params))
|
260
260
|
return self.parse_order_book(response, market['symbol'])
|
261
261
|
|
262
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
262
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
263
263
|
#
|
264
264
|
# {
|
265
265
|
# "high":"103.96000000",
|
@@ -328,7 +328,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
328
328
|
#
|
329
329
|
return self.parse_ticker(ticker, market)
|
330
330
|
|
331
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
331
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
332
332
|
timestamp = self.safe_timestamp_2(trade, 'date', 'executed_timestamp')
|
333
333
|
market = self.safe_market(None, market)
|
334
334
|
id = self.safe_string_2(trade, 'tid', 'operation_id')
|
@@ -445,7 +445,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
445
445
|
'id': str(response['response_data']['order']['order_id']),
|
446
446
|
}, market)
|
447
447
|
|
448
|
-
def cancel_order(self, id: str, symbol:
|
448
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
449
449
|
"""
|
450
450
|
cancels an open order
|
451
451
|
:param str id: order id
|
@@ -496,7 +496,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
496
496
|
}
|
497
497
|
return self.safe_string(statuses, status, status)
|
498
498
|
|
499
|
-
def parse_order(self, order, market=None) -> Order:
|
499
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
500
500
|
#
|
501
501
|
# {
|
502
502
|
# "order_id": 4,
|
@@ -567,7 +567,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
567
567
|
'trades': rawTrades,
|
568
568
|
}, market)
|
569
569
|
|
570
|
-
def fetch_order(self, id: str, symbol:
|
570
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
571
571
|
"""
|
572
572
|
fetches information on an order made by the user
|
573
573
|
:param str symbol: unified symbol of the market the order was made in
|
@@ -643,7 +643,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
643
643
|
withdrawal = self.safe_value(responseData, 'withdrawal')
|
644
644
|
return self.parse_transaction(withdrawal, currency)
|
645
645
|
|
646
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
646
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
647
647
|
#
|
648
648
|
# {
|
649
649
|
# "id": 1,
|
@@ -681,7 +681,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
681
681
|
'info': transaction,
|
682
682
|
}
|
683
683
|
|
684
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
684
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
685
685
|
return [
|
686
686
|
self.safe_integer(ohlcv, 0),
|
687
687
|
self.safe_number(ohlcv, 1),
|
@@ -719,7 +719,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
719
719
|
candles = self.convert_trading_view_to_ohlcv(response, 't', 'o', 'h', 'l', 'c', 'v')
|
720
720
|
return self.parse_ohlcvs(candles, market, timeframe, since, limit)
|
721
721
|
|
722
|
-
def fetch_orders(self, symbol:
|
722
|
+
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
723
723
|
"""
|
724
724
|
fetches information on multiple orders made by the user
|
725
725
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -739,7 +739,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
739
739
|
orders = self.safe_value(responseData, 'orders', [])
|
740
740
|
return self.parse_orders(orders, market, since, limit)
|
741
741
|
|
742
|
-
def fetch_open_orders(self, symbol:
|
742
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
743
743
|
"""
|
744
744
|
fetch all unfilled currently open orders
|
745
745
|
:param str symbol: unified market symbol
|
@@ -760,7 +760,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
760
760
|
orders = self.safe_value(responseData, 'orders', [])
|
761
761
|
return self.parse_orders(orders, market, since, limit)
|
762
762
|
|
763
|
-
def fetch_my_trades(self, symbol:
|
763
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
764
764
|
"""
|
765
765
|
fetch all trades made by the user
|
766
766
|
:param str symbol: unified market symbol
|
ccxt/mexc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.mexc import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType, IndexType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, IndexType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -1422,7 +1422,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1422
1422
|
trades = self.safe_value(response, 'data')
|
1423
1423
|
return self.parse_trades(trades, market, since, limit)
|
1424
1424
|
|
1425
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
1425
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1426
1426
|
id = None
|
1427
1427
|
timestamp = None
|
1428
1428
|
orderId = None
|
@@ -1671,7 +1671,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1671
1671
|
candles = self.convert_trading_view_to_ohlcv(data, 'time', 'open', 'high', 'low', 'close', 'vol')
|
1672
1672
|
return self.parse_ohlcvs(candles, market, timeframe, since, limit)
|
1673
1673
|
|
1674
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
1674
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1675
1675
|
return [
|
1676
1676
|
self.safe_integer(ohlcv, 0),
|
1677
1677
|
self.safe_number(ohlcv, 1),
|
@@ -1831,7 +1831,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1831
1831
|
# when it's single symbol request, the returned structure is different(singular object) for both spot & swap, thus we need to wrap inside array
|
1832
1832
|
return self.parse_ticker(ticker, market)
|
1833
1833
|
|
1834
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
1834
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1835
1835
|
marketId = self.safe_string(ticker, 'symbol')
|
1836
1836
|
market = self.safe_market(marketId, market)
|
1837
1837
|
timestamp = None
|
@@ -2218,7 +2218,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2218
2218
|
#
|
2219
2219
|
return self.parse_orders(response)
|
2220
2220
|
|
2221
|
-
def fetch_order(self, id: str, symbol:
|
2221
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2222
2222
|
"""
|
2223
2223
|
fetches information on an order made by the user
|
2224
2224
|
:param str symbol: unified symbol of the market the order was made in
|
@@ -2329,7 +2329,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2329
2329
|
data = self.safe_value(response, 'data')
|
2330
2330
|
return self.parse_order(data, market)
|
2331
2331
|
|
2332
|
-
def fetch_orders(self, symbol:
|
2332
|
+
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2333
2333
|
"""
|
2334
2334
|
fetches information on multiple orders made by the user
|
2335
2335
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -2491,7 +2491,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2491
2491
|
merged = self.array_concat(ordersOfTrigger, ordersOfRegular)
|
2492
2492
|
return self.parse_orders(merged, market, since, limit, params)
|
2493
2493
|
|
2494
|
-
def fetch_orders_by_ids(self, ids, symbol:
|
2494
|
+
def fetch_orders_by_ids(self, ids, symbol: Str = None, params={}):
|
2495
2495
|
self.load_markets()
|
2496
2496
|
request = {}
|
2497
2497
|
market = None
|
@@ -2541,7 +2541,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2541
2541
|
data = self.safe_value(response, 'data')
|
2542
2542
|
return self.parse_orders(data, market)
|
2543
2543
|
|
2544
|
-
def fetch_open_orders(self, symbol:
|
2544
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2545
2545
|
"""
|
2546
2546
|
fetch all unfilled currently open orders
|
2547
2547
|
:param str symbol: unified market symbol
|
@@ -2622,7 +2622,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2622
2622
|
# TO_DO: another possible way is through: open_orders/{symbol}, but have same ratelimits, and less granularity, i think historical orders are more convenient, supports more params(however, theoretically, open-orders endpoint might be sligthly fast)
|
2623
2623
|
return self.fetch_orders_by_state(2, symbol, since, limit, params)
|
2624
2624
|
|
2625
|
-
def fetch_closed_orders(self, symbol:
|
2625
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2626
2626
|
"""
|
2627
2627
|
fetches information on multiple closed orders made by the user
|
2628
2628
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -2633,7 +2633,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2633
2633
|
"""
|
2634
2634
|
return self.fetch_orders_by_state(3, symbol, since, limit, params)
|
2635
2635
|
|
2636
|
-
def fetch_canceled_orders(self, symbol:
|
2636
|
+
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2637
2637
|
"""
|
2638
2638
|
fetches information on multiple canceled orders made by the user
|
2639
2639
|
:param str symbol: unified market symbol of the market orders were made in
|
@@ -2644,7 +2644,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2644
2644
|
"""
|
2645
2645
|
return self.fetch_orders_by_state(4, symbol, since, limit, params)
|
2646
2646
|
|
2647
|
-
def fetch_orders_by_state(self, state, symbol:
|
2647
|
+
def fetch_orders_by_state(self, state, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2648
2648
|
self.load_markets()
|
2649
2649
|
request = {}
|
2650
2650
|
market = None
|
@@ -2657,7 +2657,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2657
2657
|
request['states'] = state
|
2658
2658
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
2659
2659
|
|
2660
|
-
def cancel_order(self, id: str, symbol:
|
2660
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2661
2661
|
"""
|
2662
2662
|
cancels an open order
|
2663
2663
|
:param str id: order id
|
@@ -2753,7 +2753,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2753
2753
|
raise InvalidOrder(self.id + ' cancelOrder() the order with id ' + id + ' cannot be cancelled: ' + errorMsg)
|
2754
2754
|
return self.parse_order(data, market)
|
2755
2755
|
|
2756
|
-
def cancel_orders(self, ids, symbol:
|
2756
|
+
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
2757
2757
|
"""
|
2758
2758
|
cancel multiple orders
|
2759
2759
|
:param str[] ids: order ids
|
@@ -2784,7 +2784,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2784
2784
|
data = self.safe_value(response, 'data')
|
2785
2785
|
return self.parse_orders(data, market)
|
2786
2786
|
|
2787
|
-
def cancel_all_orders(self, symbol:
|
2787
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
2788
2788
|
"""
|
2789
2789
|
cancel all open orders
|
2790
2790
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
@@ -2862,7 +2862,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2862
2862
|
data = self.safe_value(response, 'data', [])
|
2863
2863
|
return self.parse_orders(data, market)
|
2864
2864
|
|
2865
|
-
def parse_order(self, order, market=None) -> Order:
|
2865
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
2866
2866
|
#
|
2867
2867
|
# spot: createOrder
|
2868
2868
|
#
|
@@ -3451,7 +3451,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3451
3451
|
#
|
3452
3452
|
return self.custom_parse_balance(response, marketType)
|
3453
3453
|
|
3454
|
-
def fetch_my_trades(self, symbol:
|
3454
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3455
3455
|
"""
|
3456
3456
|
fetch all trades made by the user
|
3457
3457
|
:param str symbol: unified market symbol
|
@@ -3530,7 +3530,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3530
3530
|
trades = self.safe_value(response, 'data')
|
3531
3531
|
return self.parse_trades(trades, market, since, limit)
|
3532
3532
|
|
3533
|
-
def fetch_order_trades(self, id: str, symbol:
|
3533
|
+
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3534
3534
|
"""
|
3535
3535
|
fetch all the trades made from a single order
|
3536
3536
|
:param str id: order id
|
@@ -3641,7 +3641,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3641
3641
|
"""
|
3642
3642
|
return self.modify_margin_helper(symbol, amount, 'ADD', params)
|
3643
3643
|
|
3644
|
-
def set_leverage(self, leverage, symbol:
|
3644
|
+
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
3645
3645
|
"""
|
3646
3646
|
set the level of leverage for a market
|
3647
3647
|
:param float leverage: the rate of leverage
|
@@ -3668,7 +3668,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3668
3668
|
request['positionId'] = positionId
|
3669
3669
|
return self.contractPrivatePostPositionChangeLeverage(self.extend(request, params))
|
3670
3670
|
|
3671
|
-
def fetch_funding_history(self, symbol:
|
3671
|
+
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3672
3672
|
"""
|
3673
3673
|
fetch the history of funding payments paid and received on self account
|
3674
3674
|
:param str symbol: unified market symbol
|
@@ -3740,7 +3740,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3740
3740
|
})
|
3741
3741
|
return result
|
3742
3742
|
|
3743
|
-
def parse_funding_rate(self, contract, market=None):
|
3743
|
+
def parse_funding_rate(self, contract, market: Market = None):
|
3744
3744
|
#
|
3745
3745
|
# {
|
3746
3746
|
# "symbol": "BTC_USDT",
|
@@ -3809,7 +3809,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3809
3809
|
result = self.safe_value(response, 'data', {})
|
3810
3810
|
return self.parse_funding_rate(result, market)
|
3811
3811
|
|
3812
|
-
def fetch_funding_rate_history(self, symbol:
|
3812
|
+
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3813
3813
|
"""
|
3814
3814
|
fetches historical funding rate prices
|
3815
3815
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
@@ -3929,7 +3929,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3929
3929
|
data = self.safe_value(response, 'data')
|
3930
3930
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
3931
3931
|
|
3932
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
3932
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
3933
3933
|
"""
|
3934
3934
|
@param info {object} Exchange response for 1 market
|
3935
3935
|
@param market {object} CCXT market
|
@@ -3959,7 +3959,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3959
3959
|
floor = cap
|
3960
3960
|
return tiers
|
3961
3961
|
|
3962
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
3962
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
3963
3963
|
#
|
3964
3964
|
# {"chain":"ERC-20","address":"0x55cbd73db24eafcca97369e3f2db74b2490586e6"},
|
3965
3965
|
# {"chain":"MATIC","address":"0x05aa3236f1970eae0f8feb17ec19435b39574d74"},
|
@@ -4075,7 +4075,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4075
4075
|
raise InvalidAddress(self.id + ' fetchDepositAddress() cannot find a deposit address for ' + code + ', consider creating one using the MEXC platform')
|
4076
4076
|
return result
|
4077
4077
|
|
4078
|
-
def fetch_deposits(self, code:
|
4078
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4079
4079
|
"""
|
4080
4080
|
fetch all deposits made to an account
|
4081
4081
|
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
|
@@ -4128,7 +4128,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4128
4128
|
#
|
4129
4129
|
return self.parse_transactions(response, currency, since, limit)
|
4130
4130
|
|
4131
|
-
def fetch_withdrawals(self, code:
|
4131
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4132
4132
|
"""
|
4133
4133
|
fetch all withdrawals made from an account
|
4134
4134
|
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
|
@@ -4178,7 +4178,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4178
4178
|
#
|
4179
4179
|
return self.parse_transactions(response, currency, since, limit)
|
4180
4180
|
|
4181
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
4181
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
4182
4182
|
#
|
4183
4183
|
# fetchDeposits
|
4184
4184
|
#
|
@@ -4352,7 +4352,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4352
4352
|
data = self.safe_value(response, 'data', [])
|
4353
4353
|
return self.parse_positions(data, symbols)
|
4354
4354
|
|
4355
|
-
def parse_position(self, position, market=None):
|
4355
|
+
def parse_position(self, position, market: Market = None):
|
4356
4356
|
#
|
4357
4357
|
# {
|
4358
4358
|
# "positionId": 1394650,
|
@@ -4446,7 +4446,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4446
4446
|
raise BadRequest(self.id + ' fetchTransfer() is not supported for ' + marketType)
|
4447
4447
|
return None
|
4448
4448
|
|
4449
|
-
def fetch_transfers(self, code:
|
4449
|
+
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
4450
4450
|
"""
|
4451
4451
|
fetch a history of internal transfers made on an account
|
4452
4452
|
:param str code: unified currency code of the currency transferred
|
@@ -4577,7 +4577,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4577
4577
|
'toAccount': toAccount,
|
4578
4578
|
})
|
4579
4579
|
|
4580
|
-
def parse_transfer(self, transfer, currency=None):
|
4580
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
4581
4581
|
#
|
4582
4582
|
# spot: fetchTransfer
|
4583
4583
|
#
|
@@ -4685,7 +4685,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4685
4685
|
#
|
4686
4686
|
return self.parse_transaction(response, currency)
|
4687
4687
|
|
4688
|
-
def set_position_mode(self, hedged, symbol:
|
4688
|
+
def set_position_mode(self, hedged, symbol: Str = None, params={}):
|
4689
4689
|
request = {
|
4690
4690
|
'positionMode': 1 if hedged else 2, # 1 Hedge, 2 One-way, before changing position mode make sure that there are no active orders, planned orders, or open positions, the risk limit level will be reset to 1
|
4691
4691
|
}
|
@@ -4698,7 +4698,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4698
4698
|
#
|
4699
4699
|
return response
|
4700
4700
|
|
4701
|
-
def fetch_position_mode(self, symbol:
|
4701
|
+
def fetch_position_mode(self, symbol: Str = None, params={}):
|
4702
4702
|
response = self.contractPrivateGetPositionPositionMode(params)
|
4703
4703
|
#
|
4704
4704
|
# {
|
@@ -4713,7 +4713,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4713
4713
|
'hedged': (positionMode == 1),
|
4714
4714
|
}
|
4715
4715
|
|
4716
|
-
def borrow_margin(self, code: str, amount, symbol:
|
4716
|
+
def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
|
4717
4717
|
"""
|
4718
4718
|
create a loan to borrow margin
|
4719
4719
|
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#loan
|
@@ -4744,7 +4744,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4744
4744
|
'symbol': symbol,
|
4745
4745
|
})
|
4746
4746
|
|
4747
|
-
def repay_margin(self, code: str, amount, symbol:
|
4747
|
+
def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
|
4748
4748
|
"""
|
4749
4749
|
repay borrowed margin and interest
|
4750
4750
|
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#repayment
|
@@ -4836,7 +4836,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4836
4836
|
'info': response,
|
4837
4837
|
}
|
4838
4838
|
|
4839
|
-
def parse_transaction_fee(self, transaction, currency=None):
|
4839
|
+
def parse_transaction_fee(self, transaction, currency: Currency = None):
|
4840
4840
|
#
|
4841
4841
|
# {
|
4842
4842
|
# "coin": "AGLD",
|
@@ -4914,7 +4914,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4914
4914
|
#
|
4915
4915
|
return self.parse_deposit_withdraw_fees(response, codes, 'coin')
|
4916
4916
|
|
4917
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
4917
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
4918
4918
|
#
|
4919
4919
|
# {
|
4920
4920
|
# "coin": "AGLD",
|
@@ -4959,7 +4959,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4959
4959
|
}
|
4960
4960
|
return self.assign_default_deposit_withdraw_fees(result)
|
4961
4961
|
|
4962
|
-
def parse_margin_loan(self, info, currency=None):
|
4962
|
+
def parse_margin_loan(self, info, currency: Currency = None):
|
4963
4963
|
#
|
4964
4964
|
# {
|
4965
4965
|
# "tranId": "762407666453712896"
|