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/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.1.
|
7
|
+
__version__ = '4.1.56'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -30,7 +30,7 @@ from ccxt.base.decimal_to_precision import decimal_to_precision
|
|
30
30
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES, TICK_SIZE, NO_PADDING, TRUNCATE, ROUND, ROUND_UP, ROUND_DOWN, SIGNIFICANT_DIGITS
|
31
31
|
from ccxt.base.decimal_to_precision import number_to_string
|
32
32
|
from ccxt.base.precise import Precise
|
33
|
-
from ccxt.base.types import Balance, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest,
|
33
|
+
from ccxt.base.types import Balance, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, Str, Num
|
34
34
|
|
35
35
|
# -----------------------------------------------------------------------------
|
36
36
|
|
@@ -369,7 +369,7 @@ class Exchange(object):
|
|
369
369
|
minFundingAddressLength = 1 # used in check_address
|
370
370
|
substituteCommonCurrencyCodes = True
|
371
371
|
quoteJsonNumbers = True
|
372
|
-
number:
|
372
|
+
number: Num = float # or str (a pointer to a class)
|
373
373
|
handleContentTypeApplicationZip = False
|
374
374
|
# whether fees should be summed by currency code
|
375
375
|
reduceFees = True
|
@@ -1916,58 +1916,58 @@ class Exchange(object):
|
|
1916
1916
|
result.append(self.parseMarket(markets[i]))
|
1917
1917
|
return result
|
1918
1918
|
|
1919
|
-
def parse_ticker(self, ticker: object, market=None):
|
1919
|
+
def parse_ticker(self, ticker: object, market: Market = None):
|
1920
1920
|
raise NotSupported(self.id + ' parseTicker() is not supported yet')
|
1921
1921
|
|
1922
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
1922
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
1923
1923
|
raise NotSupported(self.id + ' parseDepositAddress() is not supported yet')
|
1924
1924
|
|
1925
|
-
def parse_trade(self, trade: object, market=None):
|
1925
|
+
def parse_trade(self, trade: object, market: Market = None):
|
1926
1926
|
raise NotSupported(self.id + ' parseTrade() is not supported yet')
|
1927
1927
|
|
1928
|
-
def parse_transaction(self, transaction, currency=None):
|
1928
|
+
def parse_transaction(self, transaction, currency: Currency = None):
|
1929
1929
|
raise NotSupported(self.id + ' parseTransaction() is not supported yet')
|
1930
1930
|
|
1931
|
-
def parse_transfer(self, transfer, currency=None):
|
1931
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
1932
1932
|
raise NotSupported(self.id + ' parseTransfer() is not supported yet')
|
1933
1933
|
|
1934
1934
|
def parse_account(self, account):
|
1935
1935
|
raise NotSupported(self.id + ' parseAccount() is not supported yet')
|
1936
1936
|
|
1937
|
-
def parse_ledger_entry(self, item, currency=None):
|
1937
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
1938
1938
|
raise NotSupported(self.id + ' parseLedgerEntry() is not supported yet')
|
1939
1939
|
|
1940
|
-
def parse_order(self, order, market=None):
|
1940
|
+
def parse_order(self, order, market: Market = None):
|
1941
1941
|
raise NotSupported(self.id + ' parseOrder() is not supported yet')
|
1942
1942
|
|
1943
1943
|
def fetch_borrow_rates(self, params={}):
|
1944
1944
|
raise NotSupported(self.id + ' fetchBorrowRates() is not supported yet')
|
1945
1945
|
|
1946
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
1946
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
1947
1947
|
raise NotSupported(self.id + ' parseMarketLeverageTiers() is not supported yet')
|
1948
1948
|
|
1949
1949
|
def fetch_leverage_tiers(self, symbols: List[str] = None, params={}):
|
1950
1950
|
raise NotSupported(self.id + ' fetchLeverageTiers() is not supported yet')
|
1951
1951
|
|
1952
|
-
def parse_position(self, position, market=None):
|
1952
|
+
def parse_position(self, position, market: Market = None):
|
1953
1953
|
raise NotSupported(self.id + ' parsePosition() is not supported yet')
|
1954
1954
|
|
1955
|
-
def parse_funding_rate_history(self, info, market=None):
|
1955
|
+
def parse_funding_rate_history(self, info, market: Market = None):
|
1956
1956
|
raise NotSupported(self.id + ' parseFundingRateHistory() is not supported yet')
|
1957
1957
|
|
1958
|
-
def parse_borrow_interest(self, info, market=None):
|
1958
|
+
def parse_borrow_interest(self, info, market: Market = None):
|
1959
1959
|
raise NotSupported(self.id + ' parseBorrowInterest() is not supported yet')
|
1960
1960
|
|
1961
|
-
def parse_ws_trade(self, trade, market=None):
|
1961
|
+
def parse_ws_trade(self, trade, market: Market = None):
|
1962
1962
|
raise NotSupported(self.id + ' parseWsTrade() is not supported yet')
|
1963
1963
|
|
1964
|
-
def parse_ws_order(self, order, market=None):
|
1964
|
+
def parse_ws_order(self, order, market: Market = None):
|
1965
1965
|
raise NotSupported(self.id + ' parseWsOrder() is not supported yet')
|
1966
1966
|
|
1967
|
-
def parse_ws_order_trade(self, trade, market=None):
|
1967
|
+
def parse_ws_order_trade(self, trade, market: Market = None):
|
1968
1968
|
raise NotSupported(self.id + ' parseWsOrderTrade() is not supported yet')
|
1969
1969
|
|
1970
|
-
def parse_ws_ohlcv(self, ohlcv, market=None):
|
1970
|
+
def parse_ws_ohlcv(self, ohlcv, market: Market = None):
|
1971
1971
|
return self.parse_ohlcv(ohlcv, market)
|
1972
1972
|
|
1973
1973
|
def fetch_funding_rates(self, symbols: List[str] = None, params={}):
|
@@ -2085,7 +2085,7 @@ class Exchange(object):
|
|
2085
2085
|
},
|
2086
2086
|
}, currency)
|
2087
2087
|
|
2088
|
-
def safe_market_structure(self, market
|
2088
|
+
def safe_market_structure(self, market=None):
|
2089
2089
|
cleanStructure = {
|
2090
2090
|
'id': None,
|
2091
2091
|
'lowercaseId': None,
|
@@ -2267,7 +2267,7 @@ class Exchange(object):
|
|
2267
2267
|
balance['debt'] = debtBalance
|
2268
2268
|
return balance
|
2269
2269
|
|
2270
|
-
def safe_order(self, order: object, market:
|
2270
|
+
def safe_order(self, order: object, market: Market = None):
|
2271
2271
|
# parses numbers
|
2272
2272
|
# * it is important pass the trades rawTrades
|
2273
2273
|
amount = self.omit_zero(self.safe_string(order, 'amount'))
|
@@ -2479,7 +2479,7 @@ class Exchange(object):
|
|
2479
2479
|
'fee': self.safe_value(order, 'fee'),
|
2480
2480
|
})
|
2481
2481
|
|
2482
|
-
def parse_orders(self, orders: object, market:
|
2482
|
+
def parse_orders(self, orders: object, market: Market = None, since: Int = None, limit: Int = None, params={}):
|
2483
2483
|
#
|
2484
2484
|
# the value of orders is either a dict or a list
|
2485
2485
|
#
|
@@ -2554,7 +2554,7 @@ class Exchange(object):
|
|
2554
2554
|
'cost': self.parse_number(cost),
|
2555
2555
|
}
|
2556
2556
|
|
2557
|
-
def safe_liquidation(self, liquidation: object, market:
|
2557
|
+
def safe_liquidation(self, liquidation: object, market: Market = None):
|
2558
2558
|
contracts = self.safe_string(liquidation, 'contracts')
|
2559
2559
|
contractSize = self.safe_string(market, 'contractSize')
|
2560
2560
|
price = self.safe_string(liquidation, 'price')
|
@@ -2571,7 +2571,7 @@ class Exchange(object):
|
|
2571
2571
|
liquidation['quoteValue'] = self.parse_number(quoteValue)
|
2572
2572
|
return liquidation
|
2573
2573
|
|
2574
|
-
def safe_trade(self, trade: object, market:
|
2574
|
+
def safe_trade(self, trade: object, market: Market = None):
|
2575
2575
|
amount = self.safe_string(trade, 'amount')
|
2576
2576
|
price = self.safe_string(trade, 'price')
|
2577
2577
|
cost = self.safe_string(trade, 'cost')
|
@@ -2702,7 +2702,7 @@ class Exchange(object):
|
|
2702
2702
|
result = self.array_concat(result, reducedFeeValues)
|
2703
2703
|
return result
|
2704
2704
|
|
2705
|
-
def safe_ticker(self, ticker: object, market=None):
|
2705
|
+
def safe_ticker(self, ticker: object, market: Market = None):
|
2706
2706
|
open = self.safe_value(ticker, 'open')
|
2707
2707
|
close = self.safe_value(ticker, 'close')
|
2708
2708
|
last = self.safe_value(ticker, 'last')
|
@@ -2907,7 +2907,7 @@ class Exchange(object):
|
|
2907
2907
|
result.append(objects[i])
|
2908
2908
|
return result
|
2909
2909
|
|
2910
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
2910
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
2911
2911
|
if isinstance(ohlcv, list):
|
2912
2912
|
return [
|
2913
2913
|
self.safe_integer(ohlcv, 0), # timestamp
|
@@ -3109,7 +3109,7 @@ class Exchange(object):
|
|
3109
3109
|
result.append(account)
|
3110
3110
|
return result
|
3111
3111
|
|
3112
|
-
def parse_trades(self, trades, market:
|
3112
|
+
def parse_trades(self, trades, market: Market = None, since: Int = None, limit: Int = None, params={}):
|
3113
3113
|
trades = self.to_array(trades)
|
3114
3114
|
result = []
|
3115
3115
|
for i in range(0, len(trades)):
|
@@ -3119,7 +3119,7 @@ class Exchange(object):
|
|
3119
3119
|
symbol = market['symbol'] if (market is not None) else None
|
3120
3120
|
return self.filter_by_symbol_since_limit(result, symbol, since, limit)
|
3121
3121
|
|
3122
|
-
def parse_transactions(self, transactions, currency:
|
3122
|
+
def parse_transactions(self, transactions, currency: Currency = None, since: Int = None, limit: Int = None, params={}):
|
3123
3123
|
transactions = self.to_array(transactions)
|
3124
3124
|
result = []
|
3125
3125
|
for i in range(0, len(transactions)):
|
@@ -3129,7 +3129,7 @@ class Exchange(object):
|
|
3129
3129
|
code = currency['code'] if (currency is not None) else None
|
3130
3130
|
return self.filter_by_currency_since_limit(result, code, since, limit)
|
3131
3131
|
|
3132
|
-
def parse_transfers(self, transfers, currency:
|
3132
|
+
def parse_transfers(self, transfers, currency: Currency = None, since: Int = None, limit: Int = None, params={}):
|
3133
3133
|
transfers = self.to_array(transfers)
|
3134
3134
|
result = []
|
3135
3135
|
for i in range(0, len(transfers)):
|
@@ -3139,7 +3139,7 @@ class Exchange(object):
|
|
3139
3139
|
code = currency['code'] if (currency is not None) else None
|
3140
3140
|
return self.filter_by_currency_since_limit(result, code, since, limit)
|
3141
3141
|
|
3142
|
-
def parse_ledger(self, data, currency:
|
3142
|
+
def parse_ledger(self, data, currency: Currency = None, since: Int = None, limit: Int = None, params={}):
|
3143
3143
|
result = []
|
3144
3144
|
arrayData = self.to_array(data)
|
3145
3145
|
for i in range(0, len(arrayData)):
|
@@ -3314,7 +3314,7 @@ class Exchange(object):
|
|
3314
3314
|
amount = self.safe_number(bidask, amountKey)
|
3315
3315
|
return [price, amount]
|
3316
3316
|
|
3317
|
-
def safe_currency(self, currencyId:
|
3317
|
+
def safe_currency(self, currencyId: Str, currency: Currency = None):
|
3318
3318
|
if (currencyId is None) and (currency is not None):
|
3319
3319
|
return currency
|
3320
3320
|
if (self.currencies_by_id is not None) and (currencyId in self.currencies_by_id) and (self.currencies_by_id[currencyId] is not None):
|
@@ -3325,53 +3325,14 @@ class Exchange(object):
|
|
3325
3325
|
return {
|
3326
3326
|
'id': currencyId,
|
3327
3327
|
'code': code,
|
3328
|
+
'precision': None,
|
3328
3329
|
}
|
3329
3330
|
|
3330
|
-
def safe_market(self, marketId:
|
3331
|
-
result = {
|
3332
|
-
'id': marketId,
|
3331
|
+
def safe_market(self, marketId: Str, market: Market = None, delimiter: Str = None, marketType: Str = None):
|
3332
|
+
result = self.safe_market_structure({
|
3333
3333
|
'symbol': marketId,
|
3334
|
-
'
|
3335
|
-
|
3336
|
-
'baseId': None,
|
3337
|
-
'quoteId': None,
|
3338
|
-
'active': None,
|
3339
|
-
'type': None,
|
3340
|
-
'linear': None,
|
3341
|
-
'inverse': None,
|
3342
|
-
'spot': False,
|
3343
|
-
'swap': False,
|
3344
|
-
'future': False,
|
3345
|
-
'option': False,
|
3346
|
-
'margin': False,
|
3347
|
-
'contract': False,
|
3348
|
-
'contractSize': None,
|
3349
|
-
'expiry': None,
|
3350
|
-
'expiryDatetime': None,
|
3351
|
-
'optionType': None,
|
3352
|
-
'strike': None,
|
3353
|
-
'settle': None,
|
3354
|
-
'settleId': None,
|
3355
|
-
'precision': {
|
3356
|
-
'amount': None,
|
3357
|
-
'price': None,
|
3358
|
-
},
|
3359
|
-
'limits': {
|
3360
|
-
'amount': {
|
3361
|
-
'min': None,
|
3362
|
-
'max': None,
|
3363
|
-
},
|
3364
|
-
'price': {
|
3365
|
-
'min': None,
|
3366
|
-
'max': None,
|
3367
|
-
},
|
3368
|
-
'cost': {
|
3369
|
-
'min': None,
|
3370
|
-
'max': None,
|
3371
|
-
},
|
3372
|
-
},
|
3373
|
-
'info': None,
|
3374
|
-
}
|
3334
|
+
'marketId': marketId,
|
3335
|
+
})
|
3375
3336
|
if marketId is not None:
|
3376
3337
|
if (self.markets_by_id is not None) and (marketId in self.markets_by_id):
|
3377
3338
|
markets = self.markets_by_id[marketId]
|
@@ -3722,7 +3683,7 @@ class Exchange(object):
|
|
3722
3683
|
def fetch_funding_history(self, symbol: str = None, since: Int = None, limit: Int = None, params={}):
|
3723
3684
|
raise NotSupported(self.id + ' fetchFundingHistory() is not supported yet')
|
3724
3685
|
|
3725
|
-
def parse_last_price(self, price, market=None):
|
3686
|
+
def parse_last_price(self, price, market: Market = None):
|
3726
3687
|
raise NotSupported(self.id + ' parseLastPrice() is not supported yet')
|
3727
3688
|
|
3728
3689
|
def fetch_deposit_address(self, code: str, params={}):
|
@@ -3761,17 +3722,16 @@ class Exchange(object):
|
|
3761
3722
|
def market(self, symbol: str):
|
3762
3723
|
if self.markets is None:
|
3763
3724
|
raise ExchangeError(self.id + ' markets not loaded')
|
3764
|
-
if
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
|
3774
|
-
return markets[0]
|
3725
|
+
if symbol in self.markets:
|
3726
|
+
return self.markets[symbol]
|
3727
|
+
elif symbol in self.markets_by_id:
|
3728
|
+
markets = self.markets_by_id[symbol]
|
3729
|
+
defaultType = self.safe_string_2(self.options, 'defaultType', 'defaultSubType', 'spot')
|
3730
|
+
for i in range(0, len(markets)):
|
3731
|
+
market = markets[i]
|
3732
|
+
if market[defaultType]:
|
3733
|
+
return market
|
3734
|
+
return markets[0]
|
3775
3735
|
raise BadSymbol(self.id + ' does not have market symbol ' + symbol)
|
3776
3736
|
|
3777
3737
|
def handle_withdraw_tag_and_params(self, tag, params):
|
@@ -3925,7 +3885,7 @@ class Exchange(object):
|
|
3925
3885
|
query = self.extend(params, {'stopPrice': stopPrice})
|
3926
3886
|
return self.create_order(symbol, 'market', side, amount, None, query)
|
3927
3887
|
|
3928
|
-
def safe_currency_code(self, currencyId:
|
3888
|
+
def safe_currency_code(self, currencyId: Str, currency: Currency = None):
|
3929
3889
|
currency = self.safe_currency(currencyId, currency)
|
3930
3890
|
return currency['code']
|
3931
3891
|
|
@@ -4022,7 +3982,7 @@ class Exchange(object):
|
|
4022
3982
|
return self.index_by(result, 'currency')
|
4023
3983
|
return result
|
4024
3984
|
|
4025
|
-
def parse_borrow_interests(self, response, market=None):
|
3985
|
+
def parse_borrow_interests(self, response, market: Market = None):
|
4026
3986
|
interests = []
|
4027
3987
|
for i in range(0, len(response)):
|
4028
3988
|
row = response[i]
|
@@ -4038,14 +3998,14 @@ class Exchange(object):
|
|
4038
3998
|
symbol = None if (market is None) else market['symbol']
|
4039
3999
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
4040
4000
|
|
4041
|
-
def safe_symbol(self, marketId, market=None, delimiter=None, marketType=None):
|
4001
|
+
def safe_symbol(self, marketId: Str, market: Market = None, delimiter: Str = None, marketType: Str = None):
|
4042
4002
|
market = self.safe_market(marketId, market, delimiter, marketType)
|
4043
4003
|
return market['symbol']
|
4044
4004
|
|
4045
|
-
def parse_funding_rate(self, contract: str, market=None):
|
4005
|
+
def parse_funding_rate(self, contract: str, market: Market = None):
|
4046
4006
|
raise NotSupported(self.id + ' parseFundingRate() is not supported yet')
|
4047
4007
|
|
4048
|
-
def parse_funding_rates(self, response, market=None):
|
4008
|
+
def parse_funding_rates(self, response, market: Market = None):
|
4049
4009
|
result = {}
|
4050
4010
|
for i in range(0, len(response)):
|
4051
4011
|
parsed = self.parse_funding_rate(response[i], market)
|
@@ -4120,7 +4080,7 @@ class Exchange(object):
|
|
4120
4080
|
raise NotSupported(self.id + ' fetchTradingFee() is not supported yet')
|
4121
4081
|
return self.fetch_trading_fees(params)
|
4122
4082
|
|
4123
|
-
def parse_open_interest(self, interest, market=None):
|
4083
|
+
def parse_open_interest(self, interest, market: Market = None):
|
4124
4084
|
raise NotSupported(self.id + ' parseOpenInterest() is not supported yet')
|
4125
4085
|
|
4126
4086
|
def parse_open_interests(self, response, market=None, since: Int = None, limit: Int = None):
|
@@ -4295,7 +4255,7 @@ class Exchange(object):
|
|
4295
4255
|
depositWithdrawFees[code] = self.parseDepositWithdrawFee(dictionary, currency)
|
4296
4256
|
return depositWithdrawFees
|
4297
4257
|
|
4298
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
4258
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
4299
4259
|
raise NotSupported(self.id + ' parseDepositWithdrawFee() is not supported yet')
|
4300
4260
|
|
4301
4261
|
def deposit_withdraw_fee(self, info):
|
@@ -4334,7 +4294,7 @@ class Exchange(object):
|
|
4334
4294
|
fee['deposit'] = fee['networks'][networkKeys[i]]['deposit']
|
4335
4295
|
return fee
|
4336
4296
|
|
4337
|
-
def parse_income(self, info, market=None):
|
4297
|
+
def parse_income(self, info, market: Market = None):
|
4338
4298
|
raise NotSupported(self.id + ' parseIncome() is not supported yet')
|
4339
4299
|
|
4340
4300
|
def parse_incomes(self, incomes, market=None, since: Int = None, limit: Int = None):
|
@@ -4642,7 +4602,7 @@ class Exchange(object):
|
|
4642
4602
|
params = self.omit(params, ['until', 'till'])
|
4643
4603
|
return [request, params]
|
4644
4604
|
|
4645
|
-
def safe_open_interest(self, interest, market=None):
|
4605
|
+
def safe_open_interest(self, interest, market: Market = None):
|
4646
4606
|
return self.extend(interest, {
|
4647
4607
|
'symbol': self.safe_string(market, 'symbol'),
|
4648
4608
|
'baseVolume': self.safe_number(interest, 'baseVolume'), # deprecated
|
@@ -4654,7 +4614,7 @@ class Exchange(object):
|
|
4654
4614
|
'info': self.safe_value(interest, 'info'),
|
4655
4615
|
})
|
4656
4616
|
|
4657
|
-
def parse_liquidation(self, liquidation, market=None):
|
4617
|
+
def parse_liquidation(self, liquidation, market: Market = None):
|
4658
4618
|
raise NotSupported(self.id + ' parseLiquidation() is not supported yet')
|
4659
4619
|
|
4660
4620
|
def parse_liquidations(self, liquidations, market=None, since: Int = None, limit: Int = None):
|
@@ -4676,5 +4636,5 @@ class Exchange(object):
|
|
4676
4636
|
symbol = self.safe_string(market, 'symbol')
|
4677
4637
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
4678
4638
|
|
4679
|
-
def parse_greeks(self, greeks, market=None):
|
4639
|
+
def parse_greeks(self, greeks, market: Market = None):
|
4680
4640
|
raise NotSupported(self.id + ' parseGreeks() is not supported yet')
|