ccxt 4.3.33__py2.py3-none-any.whl → 4.3.34__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.
Files changed (200) hide show
  1. ccxt/__init__.py +1 -1
  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/ace.py +2 -2
  7. ccxt/alpaca.py +1 -1
  8. ccxt/ascendex.py +2 -2
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +2 -2
  11. ccxt/async_support/alpaca.py +1 -1
  12. ccxt/async_support/ascendex.py +2 -2
  13. ccxt/async_support/base/exchange.py +17 -1
  14. ccxt/async_support/bigone.py +2 -2
  15. ccxt/async_support/binance.py +4 -3
  16. ccxt/async_support/bingx.py +2 -2
  17. ccxt/async_support/bit2c.py +1 -1
  18. ccxt/async_support/bitbank.py +1 -1
  19. ccxt/async_support/bitbns.py +1 -1
  20. ccxt/async_support/bitfinex.py +2 -2
  21. ccxt/async_support/bitfinex2.py +1 -1
  22. ccxt/async_support/bitflyer.py +1 -1
  23. ccxt/async_support/bitget.py +3 -3
  24. ccxt/async_support/bithumb.py +1 -1
  25. ccxt/async_support/bitmart.py +2 -2
  26. ccxt/async_support/bitmex.py +3 -3
  27. ccxt/async_support/bitopro.py +3 -3
  28. ccxt/async_support/bitrue.py +2 -2
  29. ccxt/async_support/bitso.py +2 -2
  30. ccxt/async_support/bitstamp.py +2 -2
  31. ccxt/async_support/bitteam.py +3 -3
  32. ccxt/async_support/bitvavo.py +2 -2
  33. ccxt/async_support/blockchaincom.py +1 -1
  34. ccxt/async_support/blofin.py +3 -3
  35. ccxt/async_support/btcalpha.py +3 -3
  36. ccxt/async_support/btcbox.py +1 -1
  37. ccxt/async_support/btcmarkets.py +3 -3
  38. ccxt/async_support/btcturk.py +1 -1
  39. ccxt/async_support/bybit.py +2 -2
  40. ccxt/async_support/cex.py +1 -1
  41. ccxt/async_support/coinbase.py +96 -55
  42. ccxt/async_support/coinbaseexchange.py +1 -1
  43. ccxt/async_support/coinbaseinternational.py +3 -3
  44. ccxt/async_support/coincheck.py +2 -2
  45. ccxt/async_support/coinex.py +2 -2
  46. ccxt/async_support/coinlist.py +2 -2
  47. ccxt/async_support/coinmate.py +2 -2
  48. ccxt/async_support/coinmetro.py +2 -2
  49. ccxt/async_support/coinone.py +1 -1
  50. ccxt/async_support/coinsph.py +2 -2
  51. ccxt/async_support/cryptocom.py +1 -1
  52. ccxt/async_support/currencycom.py +2 -2
  53. ccxt/async_support/delta.py +1 -1
  54. ccxt/async_support/deribit.py +2 -2
  55. ccxt/async_support/digifinex.py +2 -2
  56. ccxt/async_support/exmo.py +2 -2
  57. ccxt/async_support/gate.py +2 -2
  58. ccxt/async_support/gemini.py +2 -2
  59. ccxt/async_support/hitbtc.py +2 -2
  60. ccxt/async_support/hollaex.py +1 -1
  61. ccxt/async_support/htx.py +2 -2
  62. ccxt/async_support/huobijp.py +2 -2
  63. ccxt/async_support/hyperliquid.py +2 -2
  64. ccxt/async_support/idex.py +2 -2
  65. ccxt/async_support/indodax.py +2 -2
  66. ccxt/async_support/kraken.py +2 -2
  67. ccxt/async_support/krakenfutures.py +1 -1
  68. ccxt/async_support/kucoin.py +2 -2
  69. ccxt/async_support/kuna.py +2 -2
  70. ccxt/async_support/latoken.py +2 -2
  71. ccxt/async_support/lbank.py +1 -1
  72. ccxt/async_support/luno.py +1 -1
  73. ccxt/async_support/lykke.py +1 -1
  74. ccxt/async_support/mercado.py +1 -1
  75. ccxt/async_support/mexc.py +1 -1
  76. ccxt/async_support/ndax.py +2 -2
  77. ccxt/async_support/novadax.py +3 -3
  78. ccxt/async_support/oceanex.py +2 -2
  79. ccxt/async_support/okcoin.py +3 -3
  80. ccxt/async_support/okx.py +3 -3
  81. ccxt/async_support/onetrading.py +2 -2
  82. ccxt/async_support/p2b.py +2 -2
  83. ccxt/async_support/paymium.py +1 -1
  84. ccxt/async_support/phemex.py +4 -4
  85. ccxt/async_support/poloniex.py +3 -3
  86. ccxt/async_support/poloniexfutures.py +2 -2
  87. ccxt/async_support/probit.py +3 -3
  88. ccxt/async_support/timex.py +2 -2
  89. ccxt/async_support/tokocrypto.py +1 -1
  90. ccxt/async_support/tradeogre.py +1 -1
  91. ccxt/async_support/upbit.py +3 -3
  92. ccxt/async_support/wavesexchange.py +1 -1
  93. ccxt/async_support/wazirx.py +3 -3
  94. ccxt/async_support/whitebit.py +3 -3
  95. ccxt/async_support/woo.py +3 -3
  96. ccxt/async_support/woofipro.py +3 -3
  97. ccxt/async_support/yobit.py +1 -1
  98. ccxt/async_support/zaif.py +2 -2
  99. ccxt/async_support/zonda.py +1 -1
  100. ccxt/base/exchange.py +25 -3
  101. ccxt/base/types.py +0 -1
  102. ccxt/bigone.py +2 -2
  103. ccxt/binance.py +4 -3
  104. ccxt/bingx.py +2 -2
  105. ccxt/bit2c.py +1 -1
  106. ccxt/bitbank.py +1 -1
  107. ccxt/bitbns.py +1 -1
  108. ccxt/bitfinex.py +2 -2
  109. ccxt/bitfinex2.py +1 -1
  110. ccxt/bitflyer.py +1 -1
  111. ccxt/bitget.py +3 -3
  112. ccxt/bithumb.py +1 -1
  113. ccxt/bitmart.py +2 -2
  114. ccxt/bitmex.py +3 -3
  115. ccxt/bitopro.py +3 -3
  116. ccxt/bitrue.py +2 -2
  117. ccxt/bitso.py +2 -2
  118. ccxt/bitstamp.py +2 -2
  119. ccxt/bitteam.py +3 -3
  120. ccxt/bitvavo.py +2 -2
  121. ccxt/blockchaincom.py +1 -1
  122. ccxt/blofin.py +3 -3
  123. ccxt/btcalpha.py +3 -3
  124. ccxt/btcbox.py +1 -1
  125. ccxt/btcmarkets.py +3 -3
  126. ccxt/btcturk.py +1 -1
  127. ccxt/bybit.py +2 -2
  128. ccxt/cex.py +1 -1
  129. ccxt/coinbase.py +96 -55
  130. ccxt/coinbaseexchange.py +1 -1
  131. ccxt/coinbaseinternational.py +3 -3
  132. ccxt/coincheck.py +2 -2
  133. ccxt/coinex.py +2 -2
  134. ccxt/coinlist.py +2 -2
  135. ccxt/coinmate.py +2 -2
  136. ccxt/coinmetro.py +2 -2
  137. ccxt/coinone.py +1 -1
  138. ccxt/coinsph.py +2 -2
  139. ccxt/cryptocom.py +1 -1
  140. ccxt/currencycom.py +2 -2
  141. ccxt/delta.py +1 -1
  142. ccxt/deribit.py +2 -2
  143. ccxt/digifinex.py +2 -2
  144. ccxt/exmo.py +2 -2
  145. ccxt/gate.py +2 -2
  146. ccxt/gemini.py +2 -2
  147. ccxt/hitbtc.py +2 -2
  148. ccxt/hollaex.py +1 -1
  149. ccxt/htx.py +2 -2
  150. ccxt/huobijp.py +2 -2
  151. ccxt/hyperliquid.py +2 -2
  152. ccxt/idex.py +2 -2
  153. ccxt/indodax.py +2 -2
  154. ccxt/kraken.py +2 -2
  155. ccxt/krakenfutures.py +1 -1
  156. ccxt/kucoin.py +2 -2
  157. ccxt/kuna.py +2 -2
  158. ccxt/latoken.py +2 -2
  159. ccxt/lbank.py +1 -1
  160. ccxt/luno.py +1 -1
  161. ccxt/lykke.py +1 -1
  162. ccxt/mercado.py +1 -1
  163. ccxt/mexc.py +1 -1
  164. ccxt/ndax.py +2 -2
  165. ccxt/novadax.py +3 -3
  166. ccxt/oceanex.py +2 -2
  167. ccxt/okcoin.py +3 -3
  168. ccxt/okx.py +3 -3
  169. ccxt/onetrading.py +2 -2
  170. ccxt/p2b.py +2 -2
  171. ccxt/paymium.py +1 -1
  172. ccxt/phemex.py +4 -4
  173. ccxt/poloniex.py +3 -3
  174. ccxt/poloniexfutures.py +2 -2
  175. ccxt/pro/__init__.py +1 -1
  176. ccxt/pro/binance.py +331 -2
  177. ccxt/pro/bitmex.py +98 -1
  178. ccxt/pro/bybit.py +82 -1
  179. ccxt/pro/gate.py +173 -1
  180. ccxt/pro/kucoinfutures.py +4 -0
  181. ccxt/pro/okx.py +245 -2
  182. ccxt/probit.py +3 -3
  183. ccxt/test/base/__init__.py +1 -0
  184. ccxt/test/base/test_liquidation.py +50 -0
  185. ccxt/timex.py +2 -2
  186. ccxt/tokocrypto.py +1 -1
  187. ccxt/tradeogre.py +1 -1
  188. ccxt/upbit.py +3 -3
  189. ccxt/wavesexchange.py +1 -1
  190. ccxt/wazirx.py +3 -3
  191. ccxt/whitebit.py +3 -3
  192. ccxt/woo.py +3 -3
  193. ccxt/woofipro.py +3 -3
  194. ccxt/yobit.py +1 -1
  195. ccxt/zaif.py +2 -2
  196. ccxt/zonda.py +1 -1
  197. {ccxt-4.3.33.dist-info → ccxt-4.3.34.dist-info}/METADATA +4 -4
  198. {ccxt-4.3.33.dist-info → ccxt-4.3.34.dist-info}/RECORD +200 -199
  199. {ccxt-4.3.33.dist-info → ccxt-4.3.34.dist-info}/WHEEL +0 -0
  200. {ccxt-4.3.33.dist-info → ccxt-4.3.34.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.33'
25
+ __version__ = '4.3.34'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/binance.py CHANGED
@@ -4,6 +4,7 @@ from ccxt.base.types import Entry
4
4
  class ImplicitAPI:
5
5
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
6
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
+ sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
7
8
  sapi_get_margin_asset = sapiGetMarginAsset = Entry('margin/asset', 'sapi', 'GET', {'cost': 1})
8
9
  sapi_get_margin_pair = sapiGetMarginPair = Entry('margin/pair', 'sapi', 'GET', {'cost': 1})
9
10
  sapi_get_margin_allassets = sapiGetMarginAllAssets = Entry('margin/allAssets', 'sapi', 'GET', {'cost': 0.1})
@@ -4,6 +4,7 @@ from ccxt.base.types import Entry
4
4
  class ImplicitAPI:
5
5
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
6
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
+ sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
7
8
  sapi_get_margin_asset = sapiGetMarginAsset = Entry('margin/asset', 'sapi', 'GET', {'cost': 1})
8
9
  sapi_get_margin_pair = sapiGetMarginPair = Entry('margin/pair', 'sapi', 'GET', {'cost': 1})
9
10
  sapi_get_margin_allassets = sapiGetMarginAllAssets = Entry('margin/allAssets', 'sapi', 'GET', {'cost': 0.1})
@@ -4,6 +4,7 @@ from ccxt.base.types import Entry
4
4
  class ImplicitAPI:
5
5
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
6
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
+ sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
7
8
  sapi_get_margin_asset = sapiGetMarginAsset = Entry('margin/asset', 'sapi', 'GET', {'cost': 1})
8
9
  sapi_get_margin_pair = sapiGetMarginPair = Entry('margin/pair', 'sapi', 'GET', {'cost': 1})
9
10
  sapi_get_margin_allassets = sapiGetMarginAllAssets = Entry('margin/allAssets', 'sapi', 'GET', {'cost': 0.1})
@@ -4,6 +4,7 @@ from ccxt.base.types import Entry
4
4
  class ImplicitAPI:
5
5
  sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
6
6
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
7
+ sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
7
8
  sapi_get_margin_asset = sapiGetMarginAsset = Entry('margin/asset', 'sapi', 'GET', {'cost': 1})
8
9
  sapi_get_margin_pair = sapiGetMarginPair = Entry('margin/pair', 'sapi', 'GET', {'cost': 1})
9
10
  sapi_get_margin_allassets = sapiGetMarginAllAssets = Entry('margin/allAssets', 'sapi', 'GET', {'cost': 0.1})
ccxt/ace.py CHANGED
@@ -202,7 +202,7 @@ class ace(Exchange, ImplicitAPI):
202
202
  #
203
203
  return self.parse_markets(response)
204
204
 
205
- def parse_market(self, market) -> Market:
205
+ def parse_market(self, market: dict) -> Market:
206
206
  baseId = self.safe_string(market, 'base')
207
207
  base = self.safe_currency_code(baseId)
208
208
  quoteId = self.safe_string(market, 'quote')
@@ -1000,7 +1000,7 @@ class ace(Exchange, ImplicitAPI):
1000
1000
  url = self.urls['api'][api] + url
1001
1001
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1002
1002
 
1003
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1003
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1004
1004
  if response is None:
1005
1005
  return None # fallback to the default error handler
1006
1006
  feedback = self.id + ' ' + body
ccxt/alpaca.py CHANGED
@@ -1064,7 +1064,7 @@ class alpaca(Exchange, ImplicitAPI):
1064
1064
  url = url + endpoint
1065
1065
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1066
1066
 
1067
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1067
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1068
1068
  if response is None:
1069
1069
  return None # default error handler
1070
1070
  # {
ccxt/ascendex.py CHANGED
@@ -2440,7 +2440,7 @@ class ascendex(Exchange, ImplicitAPI):
2440
2440
  transactions = self.safe_list(data, 'data', [])
2441
2441
  return self.parse_transactions(transactions, currency, since, limit)
2442
2442
 
2443
- def parse_transaction_status(self, status):
2443
+ def parse_transaction_status(self, status: Str):
2444
2444
  statuses: dict = {
2445
2445
  'reviewing': 'pending',
2446
2446
  'pending': 'pending',
@@ -3309,7 +3309,7 @@ class ascendex(Exchange, ImplicitAPI):
3309
3309
  url = self.urls['api']['rest'] + url
3310
3310
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
3311
3311
 
3312
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
3312
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
3313
3313
  if response is None:
3314
3314
  return None # fallback to default error handler
3315
3315
  #
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.33'
7
+ __version__ = '4.3.34'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/async_support/ace.py CHANGED
@@ -202,7 +202,7 @@ class ace(Exchange, ImplicitAPI):
202
202
  #
203
203
  return self.parse_markets(response)
204
204
 
205
- def parse_market(self, market) -> Market:
205
+ def parse_market(self, market: dict) -> Market:
206
206
  baseId = self.safe_string(market, 'base')
207
207
  base = self.safe_currency_code(baseId)
208
208
  quoteId = self.safe_string(market, 'quote')
@@ -1000,7 +1000,7 @@ class ace(Exchange, ImplicitAPI):
1000
1000
  url = self.urls['api'][api] + url
1001
1001
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1002
1002
 
1003
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1003
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1004
1004
  if response is None:
1005
1005
  return None # fallback to the default error handler
1006
1006
  feedback = self.id + ' ' + body
@@ -1064,7 +1064,7 @@ class alpaca(Exchange, ImplicitAPI):
1064
1064
  url = url + endpoint
1065
1065
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1066
1066
 
1067
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1067
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1068
1068
  if response is None:
1069
1069
  return None # default error handler
1070
1070
  # {
@@ -2440,7 +2440,7 @@ class ascendex(Exchange, ImplicitAPI):
2440
2440
  transactions = self.safe_list(data, 'data', [])
2441
2441
  return self.parse_transactions(transactions, currency, since, limit)
2442
2442
 
2443
- def parse_transaction_status(self, status):
2443
+ def parse_transaction_status(self, status: Str):
2444
2444
  statuses: dict = {
2445
2445
  'reviewing': 'pending',
2446
2446
  'pending': 'pending',
@@ -3309,7 +3309,7 @@ class ascendex(Exchange, ImplicitAPI):
3309
3309
  url = self.urls['api']['rest'] + url
3310
3310
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
3311
3311
 
3312
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
3312
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
3313
3313
  if response is None:
3314
3314
  return None # fallback to default error handler
3315
3315
  #
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.33'
5
+ __version__ = '4.3.34'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -568,6 +568,22 @@ class Exchange(BaseExchange):
568
568
  async def fetch_trades_ws(self, symbol: str, since: Int = None, limit: Int = None, params={}):
569
569
  raise NotSupported(self.id + ' fetchTradesWs() is not supported yet')
570
570
 
571
+ async def watch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
572
+ if self.has['watchLiquidationsForSymbols']:
573
+ return self.watchLiquidationsForSymbols([symbol], since, limit, params)
574
+ raise NotSupported(self.id + ' watchLiquidations() is not supported yet')
575
+
576
+ async def watch_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}):
577
+ raise NotSupported(self.id + ' watchLiquidationsForSymbols() is not supported yet')
578
+
579
+ async def watch_my_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
580
+ if self.has['watchMyLiquidationsForSymbols']:
581
+ return self.watchMyLiquidationsForSymbols([symbol], since, limit, params)
582
+ raise NotSupported(self.id + ' watchMyLiquidations() is not supported yet')
583
+
584
+ async def watch_my_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}):
585
+ raise NotSupported(self.id + ' watchMyLiquidationsForSymbols() is not supported yet')
586
+
571
587
  async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}):
572
588
  raise NotSupported(self.id + ' watchTrades() is not supported yet')
573
589
 
@@ -1781,7 +1781,7 @@ class bigone(Exchange, ImplicitAPI):
1781
1781
  'info': response,
1782
1782
  }
1783
1783
 
1784
- def parse_transaction_status(self, status):
1784
+ def parse_transaction_status(self, status: Str):
1785
1785
  statuses: dict = {
1786
1786
  # what are other statuses here?
1787
1787
  'WITHHOLD': 'ok', # deposits
@@ -2095,7 +2095,7 @@ class bigone(Exchange, ImplicitAPI):
2095
2095
  data = self.safe_dict(response, 'data', {})
2096
2096
  return self.parse_transaction(data, currency)
2097
2097
 
2098
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
2098
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2099
2099
  if response is None:
2100
2100
  return None # fallback to default error handler
2101
2101
  #
@@ -263,6 +263,7 @@ class binance(Exchange, ImplicitAPI):
263
263
  'system/status': 0.1,
264
264
  # these endpoints require self.apiKey
265
265
  'accountSnapshot': 240, # Weight(IP): 2400 => cost = 0.1 * 2400 = 240
266
+ 'account/info': 0.1,
266
267
  'margin/asset': 1, # Weight(IP): 10 => cost = 0.1 * 10 = 1
267
268
  'margin/pair': 1,
268
269
  'margin/allAssets': 0.1,
@@ -3043,7 +3044,7 @@ class binance(Exchange, ImplicitAPI):
3043
3044
  result.append(self.parse_market(markets[i]))
3044
3045
  return result
3045
3046
 
3046
- def parse_market(self, market) -> Market:
3047
+ def parse_market(self, market: dict) -> Market:
3047
3048
  swap = False
3048
3049
  future = False
3049
3050
  option = False
@@ -10225,7 +10226,7 @@ class binance(Exchange, ImplicitAPI):
10225
10226
  url += '?' + self.urlencode(params)
10226
10227
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
10227
10228
 
10228
- def get_exceptions_by_url(self, url, exactOrBroad):
10229
+ def get_exceptions_by_url(self, url: str, exactOrBroad: str):
10229
10230
  marketType = None
10230
10231
  hostname = self.hostname if (self.hostname is not None) else 'binance.com'
10231
10232
  if url.startswith('https://api.' + hostname + '/'):
@@ -10243,7 +10244,7 @@ class binance(Exchange, ImplicitAPI):
10243
10244
  return self.safe_dict(exceptionsForMarketType, exactOrBroad, {})
10244
10245
  return {}
10245
10246
 
10246
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
10247
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
10247
10248
  if (code == 418) or (code == 429):
10248
10249
  raise DDoSProtection(self.id + ' ' + str(code) + ' ' + reason + ' ' + body)
10249
10250
  # error response in a form: {"code": -1013, "msg": "Invalid quantity."}
@@ -636,7 +636,7 @@ class bingx(Exchange, ImplicitAPI):
636
636
  markets = self.safe_list(response, 'data', [])
637
637
  return self.parse_markets(markets)
638
638
 
639
- def parse_market(self, market) -> Market:
639
+ def parse_market(self, market: dict) -> Market:
640
640
  id = self.safe_string(market, 'symbol')
641
641
  symbolParts = id.split('-')
642
642
  baseId = symbolParts[0]
@@ -4264,7 +4264,7 @@ class bingx(Exchange, ImplicitAPI):
4264
4264
  super(bingx, self).set_sandbox_mode(enable)
4265
4265
  self.options['sandboxMode'] = enable
4266
4266
 
4267
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
4267
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
4268
4268
  if response is None:
4269
4269
  return None # fallback to default error handler
4270
4270
  #
@@ -846,7 +846,7 @@ class bit2c(Exchange, ImplicitAPI):
846
846
  }
847
847
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
848
848
 
849
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
849
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
850
850
  if response is None:
851
851
  return None # fallback to default error handler
852
852
  #
@@ -881,7 +881,7 @@ class bitbank(Exchange, ImplicitAPI):
881
881
  }
882
882
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
883
883
 
884
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
884
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
885
885
  if response is None:
886
886
  return None
887
887
  success = self.safe_integer(response, 'success')
@@ -1135,7 +1135,7 @@ class bitbns(Exchange, ImplicitAPI):
1135
1135
  headers['Content-Type'] = 'application/x-www-form-urlencoded'
1136
1136
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1137
1137
 
1138
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1138
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1139
1139
  if response is None:
1140
1140
  return None # fallback to default error handler
1141
1141
  #
@@ -1477,7 +1477,7 @@ class bitfinex(Exchange, ImplicitAPI):
1477
1477
  },
1478
1478
  }
1479
1479
 
1480
- def parse_transaction_status(self, status):
1480
+ def parse_transaction_status(self, status: Str):
1481
1481
  statuses: dict = {
1482
1482
  'SENDING': 'pending',
1483
1483
  'CANCELED': 'canceled',
@@ -1594,7 +1594,7 @@ class bitfinex(Exchange, ImplicitAPI):
1594
1594
  }
1595
1595
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1596
1596
 
1597
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1597
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1598
1598
  if response is None:
1599
1599
  return None
1600
1600
  throwError = False
@@ -2146,7 +2146,7 @@ class bitfinex2(Exchange, ImplicitAPI):
2146
2146
  'info': response,
2147
2147
  }
2148
2148
 
2149
- def parse_transaction_status(self, status):
2149
+ def parse_transaction_status(self, status: Str):
2150
2150
  statuses: dict = {
2151
2151
  'SUCCESS': 'ok',
2152
2152
  'COMPLETED': 'ok',
@@ -982,7 +982,7 @@ class bitflyer(Exchange, ImplicitAPI):
982
982
  }
983
983
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
984
984
 
985
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
985
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
986
986
  if response is None:
987
987
  return None # fallback to the default error handler
988
988
  feedback = self.id + ' ' + body
@@ -1559,7 +1559,7 @@ class bitget(Exchange, ImplicitAPI):
1559
1559
  result = self.array_concat(result, promises[i])
1560
1560
  return result
1561
1561
 
1562
- def parse_market(self, market) -> Market:
1562
+ def parse_market(self, market: dict) -> Market:
1563
1563
  #
1564
1564
  # spot
1565
1565
  #
@@ -2378,7 +2378,7 @@ class bitget(Exchange, ImplicitAPI):
2378
2378
  'fee': fee,
2379
2379
  }
2380
2380
 
2381
- def parse_transaction_status(self, status):
2381
+ def parse_transaction_status(self, status: Str):
2382
2382
  statuses: dict = {
2383
2383
  'success': 'ok',
2384
2384
  'Pending': 'pending',
@@ -8182,7 +8182,7 @@ class bitget(Exchange, ImplicitAPI):
8182
8182
  }
8183
8183
  return result
8184
8184
 
8185
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
8185
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
8186
8186
  if not response:
8187
8187
  return None # fallback to default error handler
8188
8188
  #
@@ -1031,7 +1031,7 @@ class bithumb(Exchange, ImplicitAPI):
1031
1031
  }
1032
1032
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1033
1033
 
1034
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1034
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1035
1035
  if response is None:
1036
1036
  return None # fallback to default error handler
1037
1037
  if 'status' in response:
@@ -3282,7 +3282,7 @@ class bitmart(Exchange, ImplicitAPI):
3282
3282
  """
3283
3283
  return await self.fetch_transactions_by_type('withdraw', code, since, limit, params)
3284
3284
 
3285
- def parse_transaction_status(self, status):
3285
+ def parse_transaction_status(self, status: Str):
3286
3286
  statuses: dict = {
3287
3287
  '0': 'pending', # Create
3288
3288
  '1': 'pending', # Submitted, waiting for withdrawal
@@ -4297,7 +4297,7 @@ class bitmart(Exchange, ImplicitAPI):
4297
4297
  headers['X-BM-SIGN'] = signature
4298
4298
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
4299
4299
 
4300
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
4300
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
4301
4301
  if response is None:
4302
4302
  return None
4303
4303
  #
@@ -580,7 +580,7 @@ class bitmex(Exchange, ImplicitAPI):
580
580
  #
581
581
  return self.parse_markets(response)
582
582
 
583
- def parse_market(self, market) -> Market:
583
+ def parse_market(self, market: dict) -> Market:
584
584
  id = self.safe_string(market, 'symbol')
585
585
  baseId = self.safe_string(market, 'underlying')
586
586
  quoteId = self.safe_string(market, 'quoteCurrency')
@@ -1220,7 +1220,7 @@ class bitmex(Exchange, ImplicitAPI):
1220
1220
  transactions = self.filter_by_array(response, 'transactType', ['Withdrawal', 'Deposit'], False)
1221
1221
  return self.parse_transactions(transactions, currency, since, limit)
1222
1222
 
1223
- def parse_transaction_status(self, status):
1223
+ def parse_transaction_status(self, status: Str):
1224
1224
  statuses: dict = {
1225
1225
  'Confirmed': 'pending',
1226
1226
  'Canceled': 'canceled',
@@ -2705,7 +2705,7 @@ class bitmex(Exchange, ImplicitAPI):
2705
2705
  'datetime': None,
2706
2706
  })
2707
2707
 
2708
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2708
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2709
2709
  if response is None:
2710
2710
  return None
2711
2711
  if code == 429:
@@ -316,7 +316,7 @@ class bitopro(Exchange, ImplicitAPI):
316
316
  #
317
317
  return self.parse_markets(markets)
318
318
 
319
- def parse_market(self, market) -> Market:
319
+ def parse_market(self, market: dict) -> Market:
320
320
  active = not self.safe_value(market, 'maintain')
321
321
  id = self.safe_string(market, 'pair')
322
322
  uppercaseId = id.upper()
@@ -1259,7 +1259,7 @@ class bitopro(Exchange, ImplicitAPI):
1259
1259
  #
1260
1260
  return self.parse_trades(trades, market, since, limit)
1261
1261
 
1262
- def parse_transaction_status(self, status):
1262
+ def parse_transaction_status(self, status: Str):
1263
1263
  states: dict = {
1264
1264
  'COMPLETE': 'ok',
1265
1265
  'INVALID': 'failed',
@@ -1618,7 +1618,7 @@ class bitopro(Exchange, ImplicitAPI):
1618
1618
  url = self.urls['api']['rest'] + url
1619
1619
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1620
1620
 
1621
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1621
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1622
1622
  if response is None:
1623
1623
  return None # fallback to the default error handler
1624
1624
  if code >= 200 and code < 300:
@@ -810,7 +810,7 @@ class bitrue(Exchange, ImplicitAPI):
810
810
  await self.load_time_difference()
811
811
  return self.parse_markets(markets)
812
812
 
813
- def parse_market(self, market) -> Market:
813
+ def parse_market(self, market: dict) -> Market:
814
814
  id = self.safe_string(market, 'symbol')
815
815
  lowercaseId = self.safe_string_lower(market, 'symbol')
816
816
  side = self.safe_integer(market, 'side') # 1 linear, 0 inverse, None spot
@@ -2962,7 +2962,7 @@ class bitrue(Exchange, ImplicitAPI):
2962
2962
  url += '?' + self.urlencode(params)
2963
2963
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
2964
2964
 
2965
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2965
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2966
2966
  if (code == 418) or (code == 429):
2967
2967
  raise DDoSProtection(self.id + ' ' + str(code) + ' ' + reason + ' ' + body)
2968
2968
  # error response in a form: {"code": -1013, "msg": "Invalid quantity."}
@@ -1611,7 +1611,7 @@ class bitso(Exchange, ImplicitAPI):
1611
1611
  'info': transaction,
1612
1612
  }
1613
1613
 
1614
- def parse_transaction_status(self, status):
1614
+ def parse_transaction_status(self, status: Str):
1615
1615
  statuses: dict = {
1616
1616
  'pending': 'pending',
1617
1617
  'in_progress': 'pending',
@@ -1646,7 +1646,7 @@ class bitso(Exchange, ImplicitAPI):
1646
1646
  }
1647
1647
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1648
1648
 
1649
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1649
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1650
1650
  if response is None:
1651
1651
  return None # fallback to default error handler
1652
1652
  if 'success' in response:
@@ -1689,7 +1689,7 @@ class bitstamp(Exchange, ImplicitAPI):
1689
1689
  'fee': fee,
1690
1690
  }
1691
1691
 
1692
- def parse_transaction_status(self, status):
1692
+ def parse_transaction_status(self, status: Str):
1693
1693
  #
1694
1694
  # withdrawals:
1695
1695
  # 0(open), 1(in process), 2(finished), 3(canceled) or 4(failed).
@@ -2109,7 +2109,7 @@ class bitstamp(Exchange, ImplicitAPI):
2109
2109
  headers['X-Auth-Signature'] = signature
2110
2110
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
2111
2111
 
2112
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
2112
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2113
2113
  if response is None:
2114
2114
  return None
2115
2115
  #
@@ -349,7 +349,7 @@ class bitteam(Exchange, ImplicitAPI):
349
349
  markets = self.safe_value(result, 'pairs', [])
350
350
  return self.parse_markets(markets)
351
351
 
352
- def parse_market(self, market) -> Market:
352
+ def parse_market(self, market: dict) -> Market:
353
353
  id = self.safe_string(market, 'name')
354
354
  numericId = self.safe_integer(market, 'id')
355
355
  parts = id.split('_')
@@ -2190,7 +2190,7 @@ class bitteam(Exchange, ImplicitAPI):
2190
2190
  }
2191
2191
  return self.safe_string(types, type, type)
2192
2192
 
2193
- def parse_transaction_status(self, status):
2193
+ def parse_transaction_status(self, status: Str):
2194
2194
  statuses: dict = {
2195
2195
  'approving': 'pending',
2196
2196
  'success': 'ok',
@@ -2219,7 +2219,7 @@ class bitteam(Exchange, ImplicitAPI):
2219
2219
  url += '?' + query
2220
2220
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
2221
2221
 
2222
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2222
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2223
2223
  if response is None:
2224
2224
  return None
2225
2225
  if code != 200:
@@ -1751,7 +1751,7 @@ class bitvavo(Exchange, ImplicitAPI):
1751
1751
  #
1752
1752
  return self.parse_transactions(response, currency, since, limit, {'type': 'deposit'})
1753
1753
 
1754
- def parse_transaction_status(self, status):
1754
+ def parse_transaction_status(self, status: Str):
1755
1755
  statuses: dict = {
1756
1756
  'awaiting_processing': 'pending',
1757
1757
  'awaiting_email_confirmation': 'pending',
@@ -1945,7 +1945,7 @@ class bitvavo(Exchange, ImplicitAPI):
1945
1945
  url = self.urls['api'][api] + url
1946
1946
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1947
1947
 
1948
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1948
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1949
1949
  if response is None:
1950
1950
  return None # fallback to default error handler
1951
1951
  #
@@ -1083,7 +1083,7 @@ class blockchaincom(Exchange, ImplicitAPI):
1083
1083
  headers['Content-Type'] = 'application/json'
1084
1084
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1085
1085
 
1086
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1086
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1087
1087
  # {"timestamp":"2021-10-21T15:13:58.837+00:00","status":404,"error":"Not Found","message":"","path":"/orders/505050"
1088
1088
  if response is None:
1089
1089
  return None
@@ -368,7 +368,7 @@ class blofin(Exchange, ImplicitAPI):
368
368
  data = self.safe_list(response, 'data', [])
369
369
  return self.parse_markets(data)
370
370
 
371
- def parse_market(self, market) -> Market:
371
+ def parse_market(self, market: dict) -> Market:
372
372
  id = self.safe_string(market, 'instId')
373
373
  type = self.safe_string_lower(market, 'instType')
374
374
  spot = (type == 'spot')
@@ -1499,7 +1499,7 @@ class blofin(Exchange, ImplicitAPI):
1499
1499
  },
1500
1500
  }
1501
1501
 
1502
- def parse_transaction_status(self, status):
1502
+ def parse_transaction_status(self, status: Str):
1503
1503
  statuses: dict = {
1504
1504
  '0': 'pending',
1505
1505
  '1': 'ok',
@@ -2000,7 +2000,7 @@ class blofin(Exchange, ImplicitAPI):
2000
2000
  'marginMode': self.safe_string(marginMode, 'marginMode'),
2001
2001
  }
2002
2002
 
2003
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
2003
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2004
2004
  if response is None:
2005
2005
  return None # fallback to default error handler
2006
2006
  #
@@ -186,7 +186,7 @@ class btcalpha(Exchange, ImplicitAPI):
186
186
  #
187
187
  return self.parse_markets(response)
188
188
 
189
- def parse_market(self, market) -> Market:
189
+ def parse_market(self, market: dict) -> Market:
190
190
  id = self.safe_string(market, 'name')
191
191
  baseId = self.safe_string(market, 'currency1')
192
192
  quoteId = self.safe_string(market, 'currency2')
@@ -544,7 +544,7 @@ class btcalpha(Exchange, ImplicitAPI):
544
544
  'updated': None,
545
545
  }
546
546
 
547
- def parse_transaction_status(self, status):
547
+ def parse_transaction_status(self, status: Str):
548
548
  statuses: dict = {
549
549
  '10': 'pending', # New
550
550
  '20': 'pending', # Verified, waiting for approving
@@ -866,7 +866,7 @@ class btcalpha(Exchange, ImplicitAPI):
866
866
  headers['X-NONCE'] = str(self.nonce())
867
867
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
868
868
 
869
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
869
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
870
870
  if response is None:
871
871
  return None # fallback to default error handler
872
872
  #
@@ -519,7 +519,7 @@ class btcbox(Exchange, ImplicitAPI):
519
519
  }
520
520
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
521
521
 
522
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
522
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
523
523
  if response is None:
524
524
  return None # resort to defaultErrorHandler
525
525
  # typical error response: {"result":false,"code":"401"}