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.

Files changed (251) hide show
  1. ccxt/__init__.py +2 -2
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/bitbank.py +1 -0
  7. ccxt/abstract/coinbase.py +2 -0
  8. ccxt/abstract/htx.py +3 -0
  9. ccxt/abstract/huobi.py +3 -0
  10. ccxt/abstract/huobipro.py +3 -0
  11. ccxt/abstract/okex.py +3 -1
  12. ccxt/abstract/okex5.py +3 -1
  13. ccxt/abstract/okx.py +3 -1
  14. ccxt/ace.py +23 -23
  15. ccxt/alpaca.py +8 -8
  16. ccxt/ascendex.py +26 -26
  17. ccxt/async_support/__init__.py +2 -2
  18. ccxt/async_support/ace.py +23 -23
  19. ccxt/async_support/alpaca.py +8 -8
  20. ccxt/async_support/ascendex.py +26 -26
  21. ccxt/async_support/base/exchange.py +4 -2216
  22. ccxt/async_support/bigone.py +21 -24
  23. ccxt/async_support/binance.py +61 -54
  24. ccxt/async_support/bingx.py +28 -28
  25. ccxt/async_support/bit2c.py +9 -9
  26. ccxt/async_support/bitbank.py +11 -10
  27. ccxt/async_support/bitbns.py +11 -11
  28. ccxt/async_support/bitfinex.py +15 -15
  29. ccxt/async_support/bitfinex2.py +22 -22
  30. ccxt/async_support/bitflyer.py +13 -13
  31. ccxt/async_support/bitforex.py +10 -10
  32. ccxt/async_support/bitget.py +44 -44
  33. ccxt/async_support/bithumb.py +9 -9
  34. ccxt/async_support/bitmart.py +85 -104
  35. ccxt/async_support/bitmex.py +27 -27
  36. ccxt/async_support/bitopro.py +18 -18
  37. ccxt/async_support/bitpanda.py +18 -18
  38. ccxt/async_support/bitrue.py +14 -14
  39. ccxt/async_support/bitso.py +17 -17
  40. ccxt/async_support/bitstamp.py +17 -17
  41. ccxt/async_support/bittrex.py +22 -24
  42. ccxt/async_support/bitvavo.py +15 -15
  43. ccxt/async_support/bl3p.py +4 -4
  44. ccxt/async_support/blockchaincom.py +17 -17
  45. ccxt/async_support/btcalpha.py +14 -14
  46. ccxt/async_support/btcbox.py +9 -9
  47. ccxt/async_support/btcmarkets.py +17 -17
  48. ccxt/async_support/btcturk.py +9 -9
  49. ccxt/async_support/bybit.py +46 -46
  50. ccxt/async_support/cex.py +10 -10
  51. ccxt/async_support/coinbase.py +69 -25
  52. ccxt/async_support/coinbasepro.py +19 -19
  53. ccxt/async_support/coincheck.py +10 -10
  54. ccxt/async_support/coinex.py +57 -66
  55. ccxt/async_support/coinlist.py +22 -22
  56. ccxt/async_support/coinmate.py +10 -10
  57. ccxt/async_support/coinone.py +10 -10
  58. ccxt/async_support/coinsph.py +17 -17
  59. ccxt/async_support/coinspot.py +5 -5
  60. ccxt/async_support/cryptocom.py +27 -27
  61. ccxt/async_support/currencycom.py +18 -18
  62. ccxt/async_support/delta.py +21 -21
  63. ccxt/async_support/deribit.py +24 -24
  64. ccxt/async_support/digifinex.py +35 -35
  65. ccxt/async_support/exmo.py +19 -19
  66. ccxt/async_support/gate.py +38 -38
  67. ccxt/async_support/gemini.py +11 -11
  68. ccxt/async_support/hitbtc.py +27 -27
  69. ccxt/async_support/hollaex.py +19 -19
  70. ccxt/async_support/htx.py +47 -44
  71. ccxt/async_support/huobijp.py +22 -22
  72. ccxt/async_support/idex.py +20 -20
  73. ccxt/async_support/independentreserve.py +9 -9
  74. ccxt/async_support/indodax.py +10 -10
  75. ccxt/async_support/kraken.py +25 -25
  76. ccxt/async_support/krakenfutures.py +17 -17
  77. ccxt/async_support/kucoin.py +27 -27
  78. ccxt/async_support/kucoinfutures.py +20 -20
  79. ccxt/async_support/kuna.py +19 -19
  80. ccxt/async_support/latoken.py +14 -14
  81. ccxt/async_support/lbank.py +18 -18
  82. ccxt/async_support/luno.py +14 -14
  83. ccxt/async_support/lykke.py +12 -12
  84. ccxt/async_support/mercado.py +11 -11
  85. ccxt/async_support/mexc.py +36 -36
  86. ccxt/async_support/ndax.py +18 -18
  87. ccxt/async_support/novadax.py +17 -17
  88. ccxt/async_support/oceanex.py +12 -12
  89. ccxt/async_support/okcoin.py +19 -19
  90. ccxt/async_support/okx.py +48 -45
  91. ccxt/async_support/p2b.py +6 -6
  92. ccxt/async_support/paymium.py +6 -6
  93. ccxt/async_support/phemex.py +57 -57
  94. ccxt/async_support/poloniex.py +31 -30
  95. ccxt/async_support/poloniexfutures.py +16 -16
  96. ccxt/async_support/probit.py +22 -22
  97. ccxt/async_support/tidex.py +15 -15
  98. ccxt/async_support/timex.py +20 -20
  99. ccxt/async_support/tokocrypto.py +16 -16
  100. ccxt/async_support/upbit.py +15 -15
  101. ccxt/async_support/wavesexchange.py +12 -12
  102. ccxt/async_support/wazirx.py +13 -13
  103. ccxt/async_support/whitebit.py +26 -26
  104. ccxt/async_support/woo.py +47 -47
  105. ccxt/async_support/yobit.py +8 -8
  106. ccxt/async_support/zaif.py +10 -10
  107. ccxt/async_support/zonda.py +16 -16
  108. ccxt/base/errors.py +17 -16
  109. ccxt/base/exchange.py +57 -97
  110. ccxt/base/types.py +138 -139
  111. ccxt/bigone.py +21 -24
  112. ccxt/binance.py +61 -54
  113. ccxt/bingx.py +28 -28
  114. ccxt/bit2c.py +9 -9
  115. ccxt/bitbank.py +11 -10
  116. ccxt/bitbns.py +11 -11
  117. ccxt/bitfinex.py +15 -15
  118. ccxt/bitfinex2.py +22 -22
  119. ccxt/bitflyer.py +13 -13
  120. ccxt/bitforex.py +10 -10
  121. ccxt/bitget.py +44 -44
  122. ccxt/bithumb.py +9 -9
  123. ccxt/bitmart.py +85 -104
  124. ccxt/bitmex.py +27 -27
  125. ccxt/bitopro.py +18 -18
  126. ccxt/bitpanda.py +18 -18
  127. ccxt/bitrue.py +14 -14
  128. ccxt/bitso.py +17 -17
  129. ccxt/bitstamp.py +17 -17
  130. ccxt/bittrex.py +22 -24
  131. ccxt/bitvavo.py +15 -15
  132. ccxt/bl3p.py +4 -4
  133. ccxt/blockchaincom.py +17 -17
  134. ccxt/btcalpha.py +14 -14
  135. ccxt/btcbox.py +9 -9
  136. ccxt/btcmarkets.py +17 -17
  137. ccxt/btcturk.py +9 -9
  138. ccxt/bybit.py +46 -46
  139. ccxt/cex.py +10 -10
  140. ccxt/coinbase.py +69 -25
  141. ccxt/coinbasepro.py +19 -19
  142. ccxt/coincheck.py +10 -10
  143. ccxt/coinex.py +57 -66
  144. ccxt/coinlist.py +22 -22
  145. ccxt/coinmate.py +10 -10
  146. ccxt/coinone.py +10 -10
  147. ccxt/coinsph.py +17 -17
  148. ccxt/coinspot.py +5 -5
  149. ccxt/cryptocom.py +27 -27
  150. ccxt/currencycom.py +18 -18
  151. ccxt/delta.py +21 -21
  152. ccxt/deribit.py +24 -24
  153. ccxt/digifinex.py +35 -35
  154. ccxt/exmo.py +19 -19
  155. ccxt/gate.py +38 -38
  156. ccxt/gemini.py +11 -11
  157. ccxt/hitbtc.py +27 -27
  158. ccxt/hollaex.py +19 -19
  159. ccxt/htx.py +47 -44
  160. ccxt/huobijp.py +22 -22
  161. ccxt/idex.py +20 -20
  162. ccxt/independentreserve.py +9 -9
  163. ccxt/indodax.py +10 -10
  164. ccxt/kraken.py +25 -25
  165. ccxt/krakenfutures.py +17 -17
  166. ccxt/kucoin.py +27 -27
  167. ccxt/kucoinfutures.py +20 -20
  168. ccxt/kuna.py +19 -19
  169. ccxt/latoken.py +14 -14
  170. ccxt/lbank.py +18 -18
  171. ccxt/luno.py +14 -14
  172. ccxt/lykke.py +12 -12
  173. ccxt/mercado.py +11 -11
  174. ccxt/mexc.py +36 -36
  175. ccxt/ndax.py +18 -18
  176. ccxt/novadax.py +17 -17
  177. ccxt/oceanex.py +12 -12
  178. ccxt/okcoin.py +19 -19
  179. ccxt/okx.py +48 -45
  180. ccxt/p2b.py +6 -6
  181. ccxt/paymium.py +6 -6
  182. ccxt/phemex.py +57 -57
  183. ccxt/poloniex.py +31 -30
  184. ccxt/poloniexfutures.py +16 -16
  185. ccxt/pro/__init__.py +1 -1
  186. ccxt/pro/alpaca.py +3 -3
  187. ccxt/pro/ascendex.py +2 -2
  188. ccxt/pro/binance.py +9 -9
  189. ccxt/pro/bingx.py +3 -3
  190. ccxt/pro/bitfinex.py +3 -3
  191. ccxt/pro/bitfinex2.py +3 -3
  192. ccxt/pro/bitget.py +3 -3
  193. ccxt/pro/bitmart.py +2 -2
  194. ccxt/pro/bitmex.py +3 -3
  195. ccxt/pro/bitpanda.py +3 -3
  196. ccxt/pro/bitrue.py +2 -2
  197. ccxt/pro/bitstamp.py +2 -2
  198. ccxt/pro/bittrex.py +3 -3
  199. ccxt/pro/bitvavo.py +3 -3
  200. ccxt/pro/blockchaincom.py +2 -2
  201. ccxt/pro/bybit.py +4 -4
  202. ccxt/pro/cex.py +3 -3
  203. ccxt/pro/coinbasepro.py +3 -3
  204. ccxt/pro/coinex.py +2 -2
  205. ccxt/pro/cryptocom.py +5 -5
  206. ccxt/pro/deribit.py +3 -3
  207. ccxt/pro/exmo.py +2 -2
  208. ccxt/pro/gate.py +3 -3
  209. ccxt/pro/gemini.py +2 -2
  210. ccxt/pro/hitbtc.py +4 -4
  211. ccxt/pro/hollaex.py +3 -3
  212. ccxt/pro/htx.py +3 -3
  213. ccxt/pro/idex.py +3 -3
  214. ccxt/pro/kraken.py +7 -7
  215. ccxt/pro/krakenfutures.py +4 -4
  216. ccxt/pro/kucoin.py +3 -3
  217. ccxt/pro/kucoinfutures.py +3 -3
  218. ccxt/pro/mexc.py +3 -3
  219. ccxt/pro/okcoin.py +2 -2
  220. ccxt/pro/okx.py +6 -6
  221. ccxt/pro/phemex.py +3 -3
  222. ccxt/pro/poloniex.py +3 -3
  223. ccxt/pro/poloniexfutures.py +3 -3
  224. ccxt/pro/probit.py +3 -3
  225. ccxt/pro/wazirx.py +3 -3
  226. ccxt/pro/whitebit.py +3 -3
  227. ccxt/pro/woo.py +2 -2
  228. ccxt/probit.py +22 -22
  229. ccxt/test/base/test_shared_methods.py +3 -3
  230. ccxt/test/test_async.py +543 -535
  231. ccxt/test/test_sync.py +542 -534
  232. ccxt/tidex.py +15 -15
  233. ccxt/timex.py +20 -20
  234. ccxt/tokocrypto.py +16 -16
  235. ccxt/upbit.py +15 -15
  236. ccxt/wavesexchange.py +12 -12
  237. ccxt/wazirx.py +13 -13
  238. ccxt/whitebit.py +26 -26
  239. ccxt/woo.py +47 -47
  240. ccxt/yobit.py +8 -8
  241. ccxt/zaif.py +10 -10
  242. ccxt/zonda.py +16 -16
  243. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
  244. ccxt-4.1.56.dist-info/RECORD +449 -0
  245. ccxt/async_support/bitstamp1.py +0 -402
  246. ccxt/async_support/lbank2.py +0 -2620
  247. ccxt/bitstamp1.py +0 -402
  248. ccxt/lbank2.py +0 -2619
  249. ccxt-4.1.54.dist-info/RECORD +0 -453
  250. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
  251. {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.54'
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, Numeric, Market, String
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: Numeric = float # or str (a pointer to a class)
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: object = None):
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: object = None):
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: object = None, since: Int = None, limit: Int = None, params={}):
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: object = None):
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: object = None):
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: object = None, since: Int = None, limit: Int = None, params={}):
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: object = None, since: Int = None, limit: Int = None, params={}):
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: object = None, since: Int = None, limit: Int = None, params={}):
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: object = None, since: Int = None, limit: Int = None, params={}):
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: String, currency: Currency = None):
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: String, market: Market = None, delimiter: String = None, marketType: String = None):
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
- 'base': None,
3335
- 'quote': None,
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 isinstance(symbol, str):
3765
- if symbol in self.markets:
3766
- return self.markets[symbol]
3767
- elif symbol in self.markets_by_id:
3768
- markets = self.markets_by_id[symbol]
3769
- defaultType = self.safe_string_2(self.options, 'defaultType', 'defaultSubType', 'spot')
3770
- for i in range(0, len(markets)):
3771
- market = markets[i]
3772
- if market[defaultType]:
3773
- return market
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: str, currency: Any = None):
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')