ccxt 4.3.29__py2.py3-none-any.whl → 4.3.31__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/ace.py +14 -14
  7. ccxt/alpaca.py +16 -16
  8. ccxt/ascendex.py +46 -46
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +14 -14
  11. ccxt/async_support/alpaca.py +16 -16
  12. ccxt/async_support/ascendex.py +46 -46
  13. ccxt/async_support/base/exchange.py +23 -23
  14. ccxt/async_support/base/ws/aiohttp_client.py +1 -0
  15. ccxt/async_support/base/ws/future.py +27 -29
  16. ccxt/async_support/bigone.py +32 -32
  17. ccxt/async_support/binance.py +105 -96
  18. ccxt/async_support/bingx.py +22 -22
  19. ccxt/async_support/bit2c.py +13 -13
  20. ccxt/async_support/bitbank.py +19 -19
  21. ccxt/async_support/bitbns.py +17 -17
  22. ccxt/async_support/bitfinex.py +24 -24
  23. ccxt/async_support/bitfinex2.py +142 -109
  24. ccxt/async_support/bitflyer.py +23 -23
  25. ccxt/async_support/bitget.py +76 -76
  26. ccxt/async_support/bithumb.py +20 -20
  27. ccxt/async_support/bitmart.py +55 -55
  28. ccxt/async_support/bitmex.py +41 -41
  29. ccxt/async_support/bitopro.py +30 -30
  30. ccxt/async_support/bitrue.py +37 -37
  31. ccxt/async_support/bitso.py +30 -30
  32. ccxt/async_support/bitstamp.py +31 -31
  33. ccxt/async_support/bitteam.py +26 -26
  34. ccxt/async_support/bitvavo.py +27 -27
  35. ccxt/async_support/bl3p.py +8 -8
  36. ccxt/async_support/blockchaincom.py +24 -24
  37. ccxt/async_support/blofin.py +37 -37
  38. ccxt/async_support/btcalpha.py +19 -19
  39. ccxt/async_support/btcbox.py +11 -11
  40. ccxt/async_support/btcmarkets.py +22 -22
  41. ccxt/async_support/btcturk.py +13 -13
  42. ccxt/async_support/bybit.py +96 -96
  43. ccxt/async_support/cex.py +21 -21
  44. ccxt/async_support/coinbase.py +53 -53
  45. ccxt/async_support/coinbaseexchange.py +29 -29
  46. ccxt/async_support/coinbaseinternational.py +32 -32
  47. ccxt/async_support/coincheck.py +14 -14
  48. ccxt/async_support/coinex.py +424 -448
  49. ccxt/async_support/coinlist.py +35 -35
  50. ccxt/async_support/coinmate.py +22 -22
  51. ccxt/async_support/coinmetro.py +22 -22
  52. ccxt/async_support/coinone.py +18 -18
  53. ccxt/async_support/coinsph.py +32 -32
  54. ccxt/async_support/coinspot.py +8 -8
  55. ccxt/async_support/cryptocom.py +43 -43
  56. ccxt/async_support/currencycom.py +33 -33
  57. ccxt/async_support/delta.py +35 -35
  58. ccxt/async_support/deribit.py +54 -54
  59. ccxt/async_support/digifinex.py +56 -56
  60. ccxt/async_support/exmo.py +34 -34
  61. ccxt/async_support/gate.py +60 -60
  62. ccxt/async_support/gemini.py +24 -24
  63. ccxt/async_support/hitbtc.py +51 -51
  64. ccxt/async_support/hollaex.py +29 -29
  65. ccxt/async_support/htx.py +73 -73
  66. ccxt/async_support/huobijp.py +30 -30
  67. ccxt/async_support/hyperliquid.py +58 -58
  68. ccxt/async_support/idex.py +33 -33
  69. ccxt/async_support/independentreserve.py +12 -12
  70. ccxt/async_support/indodax.py +21 -21
  71. ccxt/async_support/kraken.py +46 -51
  72. ccxt/async_support/krakenfutures.py +29 -29
  73. ccxt/async_support/kucoin.py +51 -51
  74. ccxt/async_support/kucoinfutures.py +33 -33
  75. ccxt/async_support/kuna.py +27 -27
  76. ccxt/async_support/latoken.py +27 -27
  77. ccxt/async_support/lbank.py +35 -35
  78. ccxt/async_support/luno.py +19 -19
  79. ccxt/async_support/lykke.py +20 -20
  80. ccxt/async_support/mercado.py +17 -17
  81. ccxt/async_support/mexc.py +64 -64
  82. ccxt/async_support/ndax.py +38 -38
  83. ccxt/async_support/novadax.py +26 -26
  84. ccxt/async_support/oceanex.py +21 -21
  85. ccxt/async_support/okcoin.py +35 -35
  86. ccxt/async_support/okx.py +85 -85
  87. ccxt/async_support/onetrading.py +32 -32
  88. ccxt/async_support/p2b.py +14 -14
  89. ccxt/async_support/paymium.py +12 -12
  90. ccxt/async_support/phemex.py +50 -50
  91. ccxt/async_support/poloniex.py +35 -35
  92. ccxt/async_support/poloniexfutures.py +25 -21
  93. ccxt/async_support/probit.py +30 -30
  94. ccxt/async_support/timex.py +22 -22
  95. ccxt/async_support/tokocrypto.py +26 -26
  96. ccxt/async_support/tradeogre.py +12 -12
  97. ccxt/async_support/upbit.py +28 -28
  98. ccxt/async_support/wavesexchange.py +33 -33
  99. ccxt/async_support/wazirx.py +21 -21
  100. ccxt/async_support/whitebit.py +80 -40
  101. ccxt/async_support/woo.py +51 -51
  102. ccxt/async_support/woofipro.py +46 -46
  103. ccxt/async_support/yobit.py +20 -20
  104. ccxt/async_support/zaif.py +12 -12
  105. ccxt/async_support/zonda.py +22 -22
  106. ccxt/base/exchange.py +39 -35
  107. ccxt/base/types.py +13 -0
  108. ccxt/bigone.py +32 -32
  109. ccxt/binance.py +105 -96
  110. ccxt/bingx.py +22 -22
  111. ccxt/bit2c.py +13 -13
  112. ccxt/bitbank.py +19 -19
  113. ccxt/bitbns.py +17 -17
  114. ccxt/bitfinex.py +24 -24
  115. ccxt/bitfinex2.py +142 -109
  116. ccxt/bitflyer.py +23 -23
  117. ccxt/bitget.py +76 -76
  118. ccxt/bithumb.py +20 -20
  119. ccxt/bitmart.py +55 -55
  120. ccxt/bitmex.py +41 -41
  121. ccxt/bitopro.py +30 -30
  122. ccxt/bitrue.py +37 -37
  123. ccxt/bitso.py +30 -30
  124. ccxt/bitstamp.py +31 -31
  125. ccxt/bitteam.py +26 -26
  126. ccxt/bitvavo.py +27 -27
  127. ccxt/bl3p.py +8 -8
  128. ccxt/blockchaincom.py +24 -24
  129. ccxt/blofin.py +37 -37
  130. ccxt/btcalpha.py +19 -19
  131. ccxt/btcbox.py +11 -11
  132. ccxt/btcmarkets.py +22 -22
  133. ccxt/btcturk.py +13 -13
  134. ccxt/bybit.py +96 -96
  135. ccxt/cex.py +21 -21
  136. ccxt/coinbase.py +53 -53
  137. ccxt/coinbaseexchange.py +29 -29
  138. ccxt/coinbaseinternational.py +32 -32
  139. ccxt/coincheck.py +14 -14
  140. ccxt/coinex.py +424 -448
  141. ccxt/coinlist.py +35 -35
  142. ccxt/coinmate.py +22 -22
  143. ccxt/coinmetro.py +22 -22
  144. ccxt/coinone.py +18 -18
  145. ccxt/coinsph.py +32 -32
  146. ccxt/coinspot.py +8 -8
  147. ccxt/cryptocom.py +43 -43
  148. ccxt/currencycom.py +33 -33
  149. ccxt/delta.py +35 -35
  150. ccxt/deribit.py +54 -54
  151. ccxt/digifinex.py +56 -56
  152. ccxt/exmo.py +34 -34
  153. ccxt/gate.py +60 -60
  154. ccxt/gemini.py +24 -24
  155. ccxt/hitbtc.py +51 -51
  156. ccxt/hollaex.py +29 -29
  157. ccxt/htx.py +73 -73
  158. ccxt/huobijp.py +30 -30
  159. ccxt/hyperliquid.py +58 -58
  160. ccxt/idex.py +33 -33
  161. ccxt/independentreserve.py +12 -12
  162. ccxt/indodax.py +21 -21
  163. ccxt/kraken.py +46 -51
  164. ccxt/krakenfutures.py +29 -29
  165. ccxt/kucoin.py +51 -51
  166. ccxt/kucoinfutures.py +33 -33
  167. ccxt/kuna.py +27 -27
  168. ccxt/latoken.py +27 -27
  169. ccxt/lbank.py +35 -35
  170. ccxt/luno.py +19 -19
  171. ccxt/lykke.py +20 -20
  172. ccxt/mercado.py +17 -17
  173. ccxt/mexc.py +64 -64
  174. ccxt/ndax.py +38 -38
  175. ccxt/novadax.py +26 -26
  176. ccxt/oceanex.py +21 -21
  177. ccxt/okcoin.py +35 -35
  178. ccxt/okx.py +85 -85
  179. ccxt/onetrading.py +32 -32
  180. ccxt/p2b.py +14 -14
  181. ccxt/paymium.py +12 -12
  182. ccxt/phemex.py +50 -50
  183. ccxt/poloniex.py +35 -35
  184. ccxt/poloniexfutures.py +25 -21
  185. ccxt/pro/__init__.py +1 -1
  186. ccxt/pro/alpaca.py +8 -8
  187. ccxt/pro/ascendex.py +4 -4
  188. ccxt/pro/binance.py +56 -56
  189. ccxt/pro/bingx.py +5 -5
  190. ccxt/pro/bitfinex.py +6 -6
  191. ccxt/pro/bitfinex2.py +10 -10
  192. ccxt/pro/bitget.py +17 -17
  193. ccxt/pro/bithumb.py +6 -6
  194. ccxt/pro/bitmart.py +8 -8
  195. ccxt/pro/bitmex.py +16 -16
  196. ccxt/pro/bitopro.py +4 -4
  197. ccxt/pro/bitrue.py +8 -8
  198. ccxt/pro/bitstamp.py +5 -5
  199. ccxt/pro/bitvavo.py +14 -14
  200. ccxt/pro/blockchaincom.py +7 -7
  201. ccxt/pro/bybit.py +12 -12
  202. ccxt/pro/cex.py +19 -19
  203. ccxt/pro/coinbase.py +2 -2
  204. ccxt/pro/coinbaseexchange.py +10 -10
  205. ccxt/pro/coinbaseinternational.py +4 -4
  206. ccxt/pro/coincheck.py +2 -2
  207. ccxt/pro/coinex.py +15 -15
  208. ccxt/pro/coinone.py +4 -4
  209. ccxt/pro/cryptocom.py +11 -11
  210. ccxt/pro/currencycom.py +4 -4
  211. ccxt/pro/deribit.py +9 -9
  212. ccxt/pro/exmo.py +9 -9
  213. ccxt/pro/gate.py +12 -12
  214. ccxt/pro/gemini.py +11 -11
  215. ccxt/pro/hitbtc.py +13 -13
  216. ccxt/pro/hollaex.py +6 -6
  217. ccxt/pro/htx.py +15 -15
  218. ccxt/pro/huobijp.py +16 -16
  219. ccxt/pro/hyperliquid.py +9 -9
  220. ccxt/pro/idex.py +12 -12
  221. ccxt/pro/independentreserve.py +2 -2
  222. ccxt/pro/kraken.py +14 -14
  223. ccxt/pro/krakenfutures.py +12 -12
  224. ccxt/pro/kucoin.py +12 -12
  225. ccxt/pro/kucoinfutures.py +16 -16
  226. ccxt/pro/lbank.py +12 -12
  227. ccxt/pro/luno.py +4 -4
  228. ccxt/pro/mexc.py +14 -14
  229. ccxt/pro/ndax.py +12 -12
  230. ccxt/pro/okcoin.py +6 -6
  231. ccxt/pro/okx.py +30 -30
  232. ccxt/pro/onetrading.py +13 -13
  233. ccxt/pro/p2b.py +2 -2
  234. ccxt/pro/phemex.py +9 -9
  235. ccxt/pro/poloniex.py +9 -9
  236. ccxt/pro/poloniexfutures.py +10 -10
  237. ccxt/pro/probit.py +8 -8
  238. ccxt/pro/upbit.py +1 -1
  239. ccxt/pro/wazirx.py +10 -10
  240. ccxt/pro/whitebit.py +8 -8
  241. ccxt/pro/woo.py +14 -14
  242. ccxt/pro/woofipro.py +14 -14
  243. ccxt/probit.py +30 -30
  244. ccxt/test/base/test_shared_methods.py +1 -0
  245. ccxt/timex.py +22 -22
  246. ccxt/tokocrypto.py +26 -26
  247. ccxt/tradeogre.py +12 -12
  248. ccxt/upbit.py +28 -28
  249. ccxt/wavesexchange.py +33 -33
  250. ccxt/wazirx.py +21 -21
  251. ccxt/whitebit.py +80 -40
  252. ccxt/woo.py +51 -51
  253. ccxt/woofipro.py +46 -46
  254. ccxt/yobit.py +20 -20
  255. ccxt/zaif.py +12 -12
  256. ccxt/zonda.py +22 -22
  257. {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
  258. {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/RECORD +260 -260
  259. {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
  260. {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.gate import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -1101,7 +1101,7 @@ class gate(Exchange, ImplicitAPI):
1101
1101
  futureSettlementCurrencies = self.get_settlement_currencies('future', 'fetchMarkets')
1102
1102
  for c in range(0, len(swapSettlementCurrencies)):
1103
1103
  settleId = swapSettlementCurrencies[c]
1104
- request = {
1104
+ request: dict = {
1105
1105
  'settle': settleId,
1106
1106
  }
1107
1107
  response = await self.publicFuturesGetSettleContracts(self.extend(request, params))
@@ -1110,7 +1110,7 @@ class gate(Exchange, ImplicitAPI):
1110
1110
  result.append(parsedMarket)
1111
1111
  for c in range(0, len(futureSettlementCurrencies)):
1112
1112
  settleId = futureSettlementCurrencies[c]
1113
- request = {
1113
+ request: dict = {
1114
1114
  'settle': settleId,
1115
1115
  }
1116
1116
  response = await self.publicDeliveryGetSettleContracts(self.extend(request, params))
@@ -1436,7 +1436,7 @@ class gate(Exchange, ImplicitAPI):
1436
1436
  :returns: the api request object, and the new params object with non-needed parameters removed
1437
1437
  """
1438
1438
  # * Do not call for multi spot order methods like cancelAllOrders and fetchOpenOrders. Use multiOrderSpotPrepareRequest instead
1439
- request = {}
1439
+ request: dict = {}
1440
1440
  if market is not None:
1441
1441
  if market['contract']:
1442
1442
  request['contract'] = market['id']
@@ -1464,7 +1464,7 @@ class gate(Exchange, ImplicitAPI):
1464
1464
  :returns: the api request object, and the new params object with non-needed parameters removed
1465
1465
  """
1466
1466
  marginMode, query = self.get_margin_mode(stop, params)
1467
- request = {}
1467
+ request: dict = {}
1468
1468
  if not stop:
1469
1469
  if market is None:
1470
1470
  raise ArgumentsRequired(self.id + ' spotOrderPrepareRequest() requires a market argument for non-stop orders')
@@ -1482,7 +1482,7 @@ class gate(Exchange, ImplicitAPI):
1482
1482
  :returns: the api request object, and the new params object with non-needed parameters removed
1483
1483
  """
1484
1484
  marginMode, query = self.get_margin_mode(stop, params)
1485
- request = {
1485
+ request: dict = {
1486
1486
  'account': marginMode,
1487
1487
  }
1488
1488
  if market is not None:
@@ -1556,7 +1556,7 @@ class gate(Exchange, ImplicitAPI):
1556
1556
  # "chain":"ETH"
1557
1557
  # }
1558
1558
  #
1559
- result = {}
1559
+ result: dict = {}
1560
1560
  for i in range(0, len(response)):
1561
1561
  entry = response[i]
1562
1562
  currencyId = self.safe_string(entry, 'currency')
@@ -1826,14 +1826,14 @@ class gate(Exchange, ImplicitAPI):
1826
1826
  async def fetch_network_deposit_address(self, code: str, params={}):
1827
1827
  await self.load_markets()
1828
1828
  currency = self.currency(code)
1829
- request = {
1829
+ request: dict = {
1830
1830
  'currency': currency['id'], # todo: currencies have network-junctions
1831
1831
  }
1832
1832
  response = await self.privateWalletGetDepositAddress(self.extend(request, params))
1833
1833
  addresses = self.safe_value(response, 'multichain_addresses')
1834
1834
  currencyId = self.safe_string(response, 'currency')
1835
1835
  code = self.safe_currency_code(currencyId)
1836
- result = {}
1836
+ result: dict = {}
1837
1837
  for i in range(0, len(addresses)):
1838
1838
  entry = addresses[i]
1839
1839
  #
@@ -1873,7 +1873,7 @@ class gate(Exchange, ImplicitAPI):
1873
1873
  currency = self.currency(code)
1874
1874
  rawNetwork = self.safe_string_upper(params, 'network')
1875
1875
  params = self.omit(params, 'network')
1876
- request = {
1876
+ request: dict = {
1877
1877
  'currency': currency['id'], # todo: currencies have network-junctions
1878
1878
  }
1879
1879
  response = await self.privateWalletGetDepositAddress(self.extend(request, params))
@@ -1942,7 +1942,7 @@ class gate(Exchange, ImplicitAPI):
1942
1942
  """
1943
1943
  await self.load_markets()
1944
1944
  market = self.market(symbol)
1945
- request = {
1945
+ request: dict = {
1946
1946
  'currency_pair': market['id'],
1947
1947
  }
1948
1948
  response = await self.privateWalletGetFee(self.extend(request, params))
@@ -1988,7 +1988,7 @@ class gate(Exchange, ImplicitAPI):
1988
1988
  return self.parse_trading_fees(response)
1989
1989
 
1990
1990
  def parse_trading_fees(self, response):
1991
- result = {}
1991
+ result: dict = {}
1992
1992
  for i in range(0, len(self.symbols)):
1993
1993
  symbol = self.symbols[i]
1994
1994
  market = self.market(symbol)
@@ -2025,7 +2025,7 @@ class gate(Exchange, ImplicitAPI):
2025
2025
  'tierBased': None,
2026
2026
  }
2027
2027
 
2028
- async def fetch_transaction_fees(self, codes: List[str] = None, params={}):
2028
+ async def fetch_transaction_fees(self, codes: Strings = None, params={}):
2029
2029
  """
2030
2030
  * @deprecated
2031
2031
  please use fetchDepositWithdrawFees instead
@@ -2053,7 +2053,7 @@ class gate(Exchange, ImplicitAPI):
2053
2053
  # }
2054
2054
  # }
2055
2055
  #
2056
- result = {}
2056
+ result: dict = {}
2057
2057
  withdrawFees = {}
2058
2058
  for i in range(0, len(response)):
2059
2059
  withdrawFees = {}
@@ -2127,7 +2127,7 @@ class gate(Exchange, ImplicitAPI):
2127
2127
  # }
2128
2128
  #
2129
2129
  withdrawFixOnChains = self.safe_value(fee, 'withdraw_fix_on_chains')
2130
- result = {
2130
+ result: dict = {
2131
2131
  'info': fee,
2132
2132
  'withdraw': {
2133
2133
  'fee': self.safe_number(fee, 'withdraw_fix'),
@@ -2248,7 +2248,7 @@ class gate(Exchange, ImplicitAPI):
2248
2248
  await self.load_markets()
2249
2249
  market = self.market(symbol)
2250
2250
  #
2251
- # request = {
2251
+ # request: Dict = {
2252
2252
  # 'currency_pair': market['id'],
2253
2253
  # 'interval': '0', # depth, 0 means no aggregation is applied, default to 0
2254
2254
  # 'limit': limit, # maximum number of order depth data in asks or bids
@@ -2720,7 +2720,7 @@ class gate(Exchange, ImplicitAPI):
2720
2720
  # "orders_limit": 10
2721
2721
  # }
2722
2722
  #
2723
- result = {
2723
+ result: dict = {
2724
2724
  'info': response,
2725
2725
  }
2726
2726
  isolated = marginMode == 'margin'
@@ -2746,7 +2746,7 @@ class gate(Exchange, ImplicitAPI):
2746
2746
  quote = self.safe_value(entry, 'quote', {})
2747
2747
  baseCode = self.safe_currency_code(self.safe_string(base, 'currency'))
2748
2748
  quoteCode = self.safe_currency_code(self.safe_string(quote, 'currency'))
2749
- subResult = {}
2749
+ subResult: dict = {}
2750
2750
  subResult[baseCode] = self.parse_balance_helper(base)
2751
2751
  subResult[quoteCode] = self.parse_balance_helper(quote)
2752
2752
  result[symbolInner] = self.safe_balance(subResult)
@@ -2782,7 +2782,7 @@ class gate(Exchange, ImplicitAPI):
2782
2782
  if market['option']:
2783
2783
  return await self.fetch_option_ohlcv(symbol, timeframe, since, limit, params)
2784
2784
  price = self.safe_string(params, 'price')
2785
- request = {}
2785
+ request: dict = {}
2786
2786
  request, params = self.prepare_request(market, None, params)
2787
2787
  request['interval'] = self.safe_string(self.timeframes, timeframe, timeframe)
2788
2788
  maxLimit = 1999 if market['contract'] else 1000
@@ -2826,7 +2826,7 @@ class gate(Exchange, ImplicitAPI):
2826
2826
  # separated option logic because the from, to and limit parameters weren't functioning
2827
2827
  await self.load_markets()
2828
2828
  market = self.market(symbol)
2829
- request = {}
2829
+ request: dict = {}
2830
2830
  request, params = self.prepare_request(market, None, params)
2831
2831
  request['interval'] = self.safe_string(self.timeframes, timeframe, timeframe)
2832
2832
  response = await self.publicOptionsGetCandlesticks(self.extend(request, params))
@@ -2941,7 +2941,7 @@ class gate(Exchange, ImplicitAPI):
2941
2941
  #
2942
2942
  # spot
2943
2943
  #
2944
- # request = {
2944
+ # request: Dict = {
2945
2945
  # 'currency_pair': market['id'],
2946
2946
  # 'limit': limit, # maximum number of records to be returned in a single list
2947
2947
  # 'last_id': 'id', # specify list staring point using the id of last record in previous list-query results
@@ -2950,7 +2950,7 @@ class gate(Exchange, ImplicitAPI):
2950
2950
  #
2951
2951
  # swap, future
2952
2952
  #
2953
- # request = {
2953
+ # request: Dict = {
2954
2954
  # 'settle': market['settleId'],
2955
2955
  # 'contract': market['id'],
2956
2956
  # 'limit': limit, # maximum number of records to be returned in a single list
@@ -3090,7 +3090,7 @@ class gate(Exchange, ImplicitAPI):
3090
3090
  return await self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
3091
3091
  type = None
3092
3092
  marginMode = None
3093
- request = {}
3093
+ request: dict = {}
3094
3094
  market = self.market(symbol) if (symbol is not None) else None
3095
3095
  until = self.safe_integer(params, 'until')
3096
3096
  params = self.omit(params, ['until'])
@@ -3188,7 +3188,7 @@ class gate(Exchange, ImplicitAPI):
3188
3188
  #
3189
3189
  return self.parse_trades(response, market, since, limit)
3190
3190
 
3191
- def parse_trade(self, trade, market: Market = None) -> Trade:
3191
+ def parse_trade(self, trade: dict, market: Market = None) -> Trade:
3192
3192
  #
3193
3193
  # public
3194
3194
  #
@@ -3347,7 +3347,7 @@ class gate(Exchange, ImplicitAPI):
3347
3347
  paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
3348
3348
  if paginate:
3349
3349
  return await self.fetch_paginated_call_dynamic('fetchDeposits', code, since, limit, params)
3350
- request = {}
3350
+ request: dict = {}
3351
3351
  currency = None
3352
3352
  if code is not None:
3353
3353
  currency = self.currency(code)
@@ -3379,7 +3379,7 @@ class gate(Exchange, ImplicitAPI):
3379
3379
  paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
3380
3380
  if paginate:
3381
3381
  return await self.fetch_paginated_call_dynamic('fetchWithdrawals', code, since, limit, params)
3382
- request = {}
3382
+ request: dict = {}
3383
3383
  currency = None
3384
3384
  if code is not None:
3385
3385
  currency = self.currency(code)
@@ -3409,7 +3409,7 @@ class gate(Exchange, ImplicitAPI):
3409
3409
  self.check_address(address)
3410
3410
  await self.load_markets()
3411
3411
  currency = self.currency(code)
3412
- request = {
3412
+ request: dict = {
3413
3413
  'currency': currency['id'], # todo: currencies have network-junctions
3414
3414
  'address': address,
3415
3415
  'amount': self.currency_to_precision(code, amount),
@@ -3437,7 +3437,7 @@ class gate(Exchange, ImplicitAPI):
3437
3437
  return self.parse_transaction(response, currency)
3438
3438
 
3439
3439
  def parse_transaction_status(self, status):
3440
- statuses = {
3440
+ statuses: dict = {
3441
3441
  'PEND': 'pending',
3442
3442
  'REQUEST': 'pending',
3443
3443
  'DMOVE': 'pending',
@@ -3455,13 +3455,13 @@ class gate(Exchange, ImplicitAPI):
3455
3455
  return self.safe_string(statuses, status, status)
3456
3456
 
3457
3457
  def parse_transaction_type(self, type):
3458
- types = {
3458
+ types: dict = {
3459
3459
  'd': 'deposit',
3460
3460
  'w': 'withdrawal',
3461
3461
  }
3462
3462
  return self.safe_string(types, type, type)
3463
3463
 
3464
- def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
3464
+ def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
3465
3465
  #
3466
3466
  # deposits
3467
3467
  #
@@ -3953,7 +3953,7 @@ class gate(Exchange, ImplicitAPI):
3953
3953
  if not isLimitOrder:
3954
3954
  # exchange doesn't have market orders for spot
3955
3955
  raise InvalidOrder(self.id + ' editOrder() does not support ' + type + ' orders for ' + marketType + ' markets')
3956
- request = {
3956
+ request: dict = {
3957
3957
  'order_id': id,
3958
3958
  'currency_pair': market['id'],
3959
3959
  'account': account,
@@ -4007,8 +4007,8 @@ class gate(Exchange, ImplicitAPI):
4007
4007
  #
4008
4008
  return self.parse_order(response, market)
4009
4009
 
4010
- def parse_order_status(self, status):
4011
- statuses = {
4010
+ def parse_order_status(self, status: Str):
4011
+ statuses: dict = {
4012
4012
  'open': 'open',
4013
4013
  '_new': 'open',
4014
4014
  'filled': 'closed',
@@ -4023,7 +4023,7 @@ class gate(Exchange, ImplicitAPI):
4023
4023
  }
4024
4024
  return self.safe_string(statuses, status, status)
4025
4025
 
4026
- def parse_order(self, order, market: Market = None) -> Order:
4026
+ def parse_order(self, order: dict, market: Market = None) -> Order:
4027
4027
  #
4028
4028
  # SPOT
4029
4029
  # createOrder/cancelOrder/fetchOrder/editOrder
@@ -4766,7 +4766,7 @@ class gate(Exchange, ImplicitAPI):
4766
4766
  fromId = self.convert_type_to_account(fromAccount)
4767
4767
  toId = self.convert_type_to_account(toAccount)
4768
4768
  truncated = self.currency_to_precision(code, amount)
4769
- request = {
4769
+ request: dict = {
4770
4770
  'currency': currency['id'], # todo: currencies have network-junctions
4771
4771
  'amount': truncated,
4772
4772
  }
@@ -4892,7 +4892,7 @@ class gate(Exchange, ImplicitAPI):
4892
4892
  #
4893
4893
  return response
4894
4894
 
4895
- def parse_position(self, position, market: Market = None):
4895
+ def parse_position(self, position: dict, market: Market = None):
4896
4896
  #
4897
4897
  # swap and future
4898
4898
  #
@@ -5041,7 +5041,7 @@ class gate(Exchange, ImplicitAPI):
5041
5041
  market = self.market(symbol)
5042
5042
  if not market['contract']:
5043
5043
  raise BadRequest(self.id + ' fetchPosition() supports contract markets only')
5044
- request = {}
5044
+ request: dict = {}
5045
5045
  request, params = self.prepare_request(market, market['type'], params)
5046
5046
  extendedRequest = self.extend(request, params)
5047
5047
  response = None
@@ -5129,7 +5129,7 @@ class gate(Exchange, ImplicitAPI):
5129
5129
  if symbolsLength > 0:
5130
5130
  market = self.market(symbols[0])
5131
5131
  type = None
5132
- request = {}
5132
+ request: dict = {}
5133
5133
  type, params = self.handle_market_type_and_params('fetchPositions', market, params)
5134
5134
  if (type is None) or (type == 'spot'):
5135
5135
  type = 'swap' # default to swap
@@ -5209,7 +5209,7 @@ class gate(Exchange, ImplicitAPI):
5209
5209
  #
5210
5210
  return self.parse_positions(response, symbols)
5211
5211
 
5212
- async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
5212
+ async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
5213
5213
  """
5214
5214
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
5215
5215
  :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
@@ -5324,7 +5324,7 @@ class gate(Exchange, ImplicitAPI):
5324
5324
  #
5325
5325
  return self.parse_leverage_tiers(response, symbols, 'name')
5326
5326
 
5327
- async def fetch_market_leverage_tiers(self, symbol: str, params={}):
5327
+ async def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
5328
5328
  """
5329
5329
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
5330
5330
  :see: https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
@@ -5378,7 +5378,7 @@ class gate(Exchange, ImplicitAPI):
5378
5378
  floor = cap
5379
5379
  return tiers
5380
5380
 
5381
- def parse_market_leverage_tiers(self, info, market: Market = None):
5381
+ def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
5382
5382
  #
5383
5383
  # [
5384
5384
  # {
@@ -5423,7 +5423,7 @@ class gate(Exchange, ImplicitAPI):
5423
5423
  """
5424
5424
  await self.load_markets()
5425
5425
  currency = self.currency(code)
5426
- request = {
5426
+ request: dict = {
5427
5427
  'currency': currency['id'].upper(), # todo: currencies have network-junctions
5428
5428
  'amount': self.currency_to_precision(code, amount),
5429
5429
  }
@@ -5450,7 +5450,7 @@ class gate(Exchange, ImplicitAPI):
5450
5450
  """
5451
5451
  await self.load_markets()
5452
5452
  currency = self.currency(code)
5453
- request = {
5453
+ request: dict = {
5454
5454
  'currency': currency['id'].upper(), # todo: currencies have network-junctions
5455
5455
  'amount': self.currency_to_precision(code, amount),
5456
5456
  }
@@ -5487,7 +5487,7 @@ class gate(Exchange, ImplicitAPI):
5487
5487
  """
5488
5488
  await self.load_markets()
5489
5489
  currency = self.currency(code)
5490
- request = {
5490
+ request: dict = {
5491
5491
  'currency': currency['id'].upper(), # todo: currencies have network-junctions
5492
5492
  'amount': self.currency_to_precision(code, amount),
5493
5493
  }
@@ -5530,7 +5530,7 @@ class gate(Exchange, ImplicitAPI):
5530
5530
  """
5531
5531
  await self.load_markets()
5532
5532
  currency = self.currency(code)
5533
- request = {
5533
+ request: dict = {
5534
5534
  'currency': currency['id'].upper(), # todo: currencies have network-junctions
5535
5535
  'amount': self.currency_to_precision(code, amount),
5536
5536
  }
@@ -5767,7 +5767,7 @@ class gate(Exchange, ImplicitAPI):
5767
5767
  market = self.market(symbol)
5768
5768
  if not market['swap']:
5769
5769
  raise BadRequest(self.id + ' fetchOpenInterest() supports swap markets only')
5770
- request = {
5770
+ request: dict = {
5771
5771
  'contract': market['id'],
5772
5772
  'settle': market['settleId'],
5773
5773
  'interval': self.safe_string(self.timeframes, timeframe, timeframe),
@@ -5849,7 +5849,7 @@ class gate(Exchange, ImplicitAPI):
5849
5849
  raise NotSupported(self.id + ' fetchSettlementHistory() supports option markets only')
5850
5850
  marketId = market['id']
5851
5851
  optionParts = marketId.split('-')
5852
- request = {
5852
+ request: dict = {
5853
5853
  'underlying': self.safe_string(optionParts, 0),
5854
5854
  }
5855
5855
  if since is not None:
@@ -5893,7 +5893,7 @@ class gate(Exchange, ImplicitAPI):
5893
5893
  raise NotSupported(self.id + ' fetchMySettlementHistory() supports option markets only')
5894
5894
  marketId = market['id']
5895
5895
  optionParts = marketId.split('-')
5896
- request = {
5896
+ request: dict = {
5897
5897
  'underlying': self.safe_string(optionParts, 0),
5898
5898
  'contract': marketId,
5899
5899
  }
@@ -6020,7 +6020,7 @@ class gate(Exchange, ImplicitAPI):
6020
6020
  type = None
6021
6021
  currency = None
6022
6022
  response = None
6023
- request = {}
6023
+ request: dict = {}
6024
6024
  type, params = self.handle_market_type_and_params('fetchLedger', None, params)
6025
6025
  if (type == 'spot') or (type == 'margin'):
6026
6026
  if code is not None:
@@ -6100,7 +6100,7 @@ class gate(Exchange, ImplicitAPI):
6100
6100
  #
6101
6101
  return self.parse_ledger(response, currency, since, limit)
6102
6102
 
6103
- def parse_ledger_entry(self, item, currency: Currency = None):
6103
+ def parse_ledger_entry(self, item: dict, currency: Currency = None):
6104
6104
  #
6105
6105
  # spot
6106
6106
  #
@@ -6182,7 +6182,7 @@ class gate(Exchange, ImplicitAPI):
6182
6182
  }
6183
6183
 
6184
6184
  def parse_ledger_entry_type(self, type):
6185
- ledgerType = {
6185
+ ledgerType: dict = {
6186
6186
  'deposit': 'deposit',
6187
6187
  'withdraw': 'withdrawal',
6188
6188
  'sub_account_transfer': 'transfer',
@@ -6287,7 +6287,7 @@ class gate(Exchange, ImplicitAPI):
6287
6287
  market = self.market(symbol)
6288
6288
  if not market['swap']:
6289
6289
  raise NotSupported(self.id + ' fetchLiquidations() supports swap markets only')
6290
- request = {
6290
+ request: dict = {
6291
6291
  'settle': market['settleId'],
6292
6292
  'contract': market['id'],
6293
6293
  }
@@ -6327,7 +6327,7 @@ class gate(Exchange, ImplicitAPI):
6327
6327
  raise ArgumentsRequired(self.id + ' fetchMyLiquidations() requires a symbol argument')
6328
6328
  await self.load_markets()
6329
6329
  market = self.market(symbol)
6330
- request = {
6330
+ request: dict = {
6331
6331
  'contract': market['id'],
6332
6332
  }
6333
6333
  response = None
@@ -6456,7 +6456,7 @@ class gate(Exchange, ImplicitAPI):
6456
6456
  """
6457
6457
  await self.load_markets()
6458
6458
  market = self.market(symbol)
6459
- request = {
6459
+ request: dict = {
6460
6460
  'underlying': market['info']['underlying'],
6461
6461
  }
6462
6462
  response = await self.publicOptionsGetTickers(self.extend(request, params))
@@ -6546,7 +6546,7 @@ class gate(Exchange, ImplicitAPI):
6546
6546
  :param dict [params]: extra parameters specific to the okx api endpoint
6547
6547
  :returns dict[]: `A list of position structures <https://docs.ccxt.com/#/?id=position-structure>`
6548
6548
  """
6549
- request = {
6549
+ request: dict = {
6550
6550
  'close': True,
6551
6551
  }
6552
6552
  params = self.extend(request, params)
@@ -6570,7 +6570,7 @@ class gate(Exchange, ImplicitAPI):
6570
6570
  if symbol is not None:
6571
6571
  # unified account does not require a symbol
6572
6572
  market = self.market(symbol)
6573
- request = {}
6573
+ request: dict = {}
6574
6574
  response = None
6575
6575
  isUnified = self.safe_bool(params, 'unified')
6576
6576
  params = self.omit(params, 'unified')
@@ -6656,7 +6656,7 @@ class gate(Exchange, ImplicitAPI):
6656
6656
  raise NotSupported(self.id + ' fetchLeverage() does not support ' + market['type'] + ' markets')
6657
6657
  return self.parse_leverage(response, market)
6658
6658
 
6659
- async def fetch_leverages(self, symbols: List[str] = None, params={}) -> Leverages:
6659
+ async def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
6660
6660
  """
6661
6661
  fetch the set leverage for all leverage markets, only spot margin is supported on gate
6662
6662
  :see: https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
@@ -6724,7 +6724,7 @@ class gate(Exchange, ImplicitAPI):
6724
6724
  """
6725
6725
  await self.load_markets()
6726
6726
  market = self.market(symbol)
6727
- request = {
6727
+ request: dict = {
6728
6728
  'contract': market['id'],
6729
6729
  }
6730
6730
  response = await self.publicOptionsGetContractsContract(self.extend(request, params))
@@ -6782,7 +6782,7 @@ class gate(Exchange, ImplicitAPI):
6782
6782
  """
6783
6783
  await self.load_markets()
6784
6784
  currency = self.currency(code)
6785
- request = {
6785
+ request: dict = {
6786
6786
  'underlying': currency['code'] + '_USDT', # todo: currency['id'].upper() & network junctions
6787
6787
  }
6788
6788
  response = await self.publicOptionsGetContracts(self.extend(request, params))
@@ -6921,7 +6921,7 @@ class gate(Exchange, ImplicitAPI):
6921
6921
  marketType, params = self.handle_market_type_and_params('fetchPositionsHistory', market, params, 'swap')
6922
6922
  until = self.safe_integer(params, 'until')
6923
6923
  params = self.omit(params, 'until')
6924
- request = {}
6924
+ request: dict = {}
6925
6925
  request, params = self.prepare_request(market, marketType, params)
6926
6926
  if limit is not None:
6927
6927
  request['limit'] = limit