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/bybit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bybit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Greeks, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import PermissionDenied
@@ -1832,7 +1832,7 @@ class bybit(Exchange, ImplicitAPI):
1832
1832
  })
1833
1833
  return result
1834
1834
 
1835
- def parse_ticker(self, ticker, market=None) -> Ticker:
1835
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
1836
1836
  #
1837
1837
  # spot
1838
1838
  #
@@ -2104,7 +2104,7 @@ class bybit(Exchange, ImplicitAPI):
2104
2104
  tickers[symbol] = ticker
2105
2105
  return self.filter_by_array_tickers(tickers, 'symbol', symbols)
2106
2106
 
2107
- def parse_ohlcv(self, ohlcv, market=None) -> list:
2107
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
2108
2108
  #
2109
2109
  # [
2110
2110
  # "1621162800",
@@ -2224,7 +2224,7 @@ class bybit(Exchange, ImplicitAPI):
2224
2224
  ohlcvs = self.safe_value(result, 'list', [])
2225
2225
  return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
2226
2226
 
2227
- def parse_funding_rate(self, ticker, market=None):
2227
+ def parse_funding_rate(self, ticker, market: Market = None):
2228
2228
  # {
2229
2229
  # "symbol": "BTCUSDT",
2230
2230
  # "bidPrice": "19255",
@@ -2351,7 +2351,7 @@ class bybit(Exchange, ImplicitAPI):
2351
2351
  fundingRates[symbol] = ticker
2352
2352
  return self.filter_by_array(fundingRates, 'symbol', symbols)
2353
2353
 
2354
- def fetch_funding_rate_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2354
+ def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2355
2355
  """
2356
2356
  fetches historical funding rate prices
2357
2357
  :see: https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
@@ -2433,7 +2433,7 @@ class bybit(Exchange, ImplicitAPI):
2433
2433
  sorted = self.sort_by(rates, 'timestamp')
2434
2434
  return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
2435
2435
 
2436
- def parse_trade(self, trade, market=None) -> Trade:
2436
+ def parse_trade(self, trade, market: Market = None) -> Trade:
2437
2437
  #
2438
2438
  # public https://bybit-exchange.github.io/docs/v5/market/recent-trade
2439
2439
  #
@@ -3048,7 +3048,7 @@ class bybit(Exchange, ImplicitAPI):
3048
3048
  }
3049
3049
  return self.safe_string(timeInForces, timeInForce, timeInForce)
3050
3050
 
3051
- def parse_order(self, order, market=None) -> Order:
3051
+ def parse_order(self, order, market: Market = None) -> Order:
3052
3052
  #
3053
3053
  # v1 for usdc normal account
3054
3054
  # {
@@ -3245,7 +3245,7 @@ class bybit(Exchange, ImplicitAPI):
3245
3245
  'trades': None,
3246
3246
  }, market)
3247
3247
 
3248
- def fetch_order(self, id: str, symbol: String = None, params={}):
3248
+ def fetch_order(self, id: str, symbol: Str = None, params={}):
3249
3249
  """
3250
3250
  fetches information on an order made by the user
3251
3251
  :see: https://bybit-exchange.github.io/docs/v5/order/order-list
@@ -3788,7 +3788,7 @@ class bybit(Exchange, ImplicitAPI):
3788
3788
  'id': self.safe_string(result, 'orderId'),
3789
3789
  })
3790
3790
 
3791
- def cancel_usdc_order(self, id, symbol: String = None, params={}):
3791
+ def cancel_usdc_order(self, id, symbol: Str = None, params={}):
3792
3792
  self.check_required_symbol('cancelUsdcOrder', symbol)
3793
3793
  self.load_markets()
3794
3794
  market = self.market(symbol)
@@ -3823,7 +3823,7 @@ class bybit(Exchange, ImplicitAPI):
3823
3823
  result = self.safe_value(response, 'result', {})
3824
3824
  return self.parse_order(result, market)
3825
3825
 
3826
- def cancel_order(self, id: str, symbol: String = None, params={}):
3826
+ def cancel_order(self, id: str, symbol: Str = None, params={}):
3827
3827
  """
3828
3828
  cancels an open order
3829
3829
  :see: https://bybit-exchange.github.io/docs/v5/order/cancel-order
@@ -3880,7 +3880,7 @@ class bybit(Exchange, ImplicitAPI):
3880
3880
  result = self.safe_value(response, 'result', {})
3881
3881
  return self.parse_order(result, market)
3882
3882
 
3883
- def cancel_all_usdc_orders(self, symbol: String = None, params={}):
3883
+ def cancel_all_usdc_orders(self, symbol: Str = None, params={}):
3884
3884
  self.check_required_symbol('cancelAllUsdcOrders', symbol)
3885
3885
  self.load_markets()
3886
3886
  market = self.market(symbol)
@@ -3920,7 +3920,7 @@ class bybit(Exchange, ImplicitAPI):
3920
3920
  return response
3921
3921
  return self.parse_orders(result, market)
3922
3922
 
3923
- def cancel_all_orders(self, symbol: String = None, params={}):
3923
+ def cancel_all_orders(self, symbol: Str = None, params={}):
3924
3924
  """
3925
3925
  cancel all open orders
3926
3926
  :see: https://bybit-exchange.github.io/docs/v5/order/cancel-all
@@ -3993,7 +3993,7 @@ class bybit(Exchange, ImplicitAPI):
3993
3993
  return response
3994
3994
  return self.parse_orders(orders, market)
3995
3995
 
3996
- def fetch_usdc_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3996
+ def fetch_usdc_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3997
3997
  self.load_markets()
3998
3998
  market = None
3999
3999
  request = {
@@ -4075,7 +4075,7 @@ class bybit(Exchange, ImplicitAPI):
4075
4075
  data = self.safe_value(result, 'dataList', [])
4076
4076
  return self.parse_orders(data, market, since, limit)
4077
4077
 
4078
- def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4078
+ def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4079
4079
  """
4080
4080
  fetches information on multiple orders made by the user
4081
4081
  :see: https://bybit-exchange.github.io/docs/v5/order/order-list
@@ -4180,7 +4180,7 @@ class bybit(Exchange, ImplicitAPI):
4180
4180
  data = self.add_pagination_cursor_to_result(response)
4181
4181
  return self.parse_orders(data, market, since, limit)
4182
4182
 
4183
- def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4183
+ def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4184
4184
  """
4185
4185
  fetches information on multiple closed orders made by the user
4186
4186
  :see: https://bybit-exchange.github.io/docs/v5/order/order-list
@@ -4196,7 +4196,7 @@ class bybit(Exchange, ImplicitAPI):
4196
4196
  }
4197
4197
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
4198
4198
 
4199
- def fetch_canceled_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
4199
+ def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
4200
4200
  """
4201
4201
  fetches information on multiple canceled orders made by the user
4202
4202
  :see: https://bybit-exchange.github.io/docs/v5/order/order-list
@@ -4215,7 +4215,7 @@ class bybit(Exchange, ImplicitAPI):
4215
4215
  }
4216
4216
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
4217
4217
 
4218
- def fetch_usdc_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
4218
+ def fetch_usdc_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
4219
4219
  self.load_markets()
4220
4220
  request = {}
4221
4221
  market = None
@@ -4256,7 +4256,7 @@ class bybit(Exchange, ImplicitAPI):
4256
4256
  #
4257
4257
  return self.parse_orders(orders, market, since, limit)
4258
4258
 
4259
- def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4259
+ def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
4260
4260
  """
4261
4261
  fetch all unfilled currently open orders
4262
4262
  :see: https://bybit-exchange.github.io/docs/v5/order/open-order
@@ -4356,7 +4356,7 @@ class bybit(Exchange, ImplicitAPI):
4356
4356
  data = self.add_pagination_cursor_to_result(response)
4357
4357
  return self.parse_orders(data, market, since, limit)
4358
4358
 
4359
- def fetch_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}):
4359
+ def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
4360
4360
  """
4361
4361
  fetch all the trades made from a single order
4362
4362
  :see: https://bybit-exchange.github.io/docs/v5/position/execution
@@ -4377,7 +4377,7 @@ class bybit(Exchange, ImplicitAPI):
4377
4377
  params = self.omit(params, ['clientOrderId', 'orderLinkId'])
4378
4378
  return self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
4379
4379
 
4380
- def fetch_my_usdc_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
4380
+ def fetch_my_usdc_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
4381
4381
  self.load_markets()
4382
4382
  market = None
4383
4383
  request = {}
@@ -4420,7 +4420,7 @@ class bybit(Exchange, ImplicitAPI):
4420
4420
  dataList = self.safe_value(result, 'dataList', [])
4421
4421
  return self.parse_trades(dataList, market, since, limit)
4422
4422
 
4423
- def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
4423
+ def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
4424
4424
  """
4425
4425
  fetch all trades made by the user
4426
4426
  :see: https://bybit-exchange.github.io/docs/v5/position/execution
@@ -4513,7 +4513,7 @@ class bybit(Exchange, ImplicitAPI):
4513
4513
  trades = self.add_pagination_cursor_to_result(response)
4514
4514
  return self.parse_trades(trades, market, since, limit)
4515
4515
 
4516
- def parse_deposit_address(self, depositAddress, currency=None):
4516
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
4517
4517
  #
4518
4518
  # {
4519
4519
  # "chainType": "ERC20",
@@ -4621,7 +4621,7 @@ class bybit(Exchange, ImplicitAPI):
4621
4621
  addressObject = self.safe_value(chainsIndexedById, selectedNetworkId, {})
4622
4622
  return self.parse_deposit_address(addressObject, currency)
4623
4623
 
4624
- def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4624
+ def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4625
4625
  """
4626
4626
  fetch all deposits made to an account
4627
4627
  :see: https://bybit-exchange.github.io/docs/v5/asset/deposit-record
@@ -4686,7 +4686,7 @@ class bybit(Exchange, ImplicitAPI):
4686
4686
  data = self.add_pagination_cursor_to_result(response)
4687
4687
  return self.parse_transactions(data, currency, since, limit)
4688
4688
 
4689
- def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4689
+ def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4690
4690
  """
4691
4691
  fetch all withdrawals made from an account
4692
4692
  :see: https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
@@ -4781,7 +4781,7 @@ class bybit(Exchange, ImplicitAPI):
4781
4781
  }
4782
4782
  return self.safe_string(statuses, status, status)
4783
4783
 
4784
- def parse_transaction(self, transaction, currency=None) -> Transaction:
4784
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
4785
4785
  #
4786
4786
  # fetchWithdrawals
4787
4787
  #
@@ -4859,7 +4859,7 @@ class bybit(Exchange, ImplicitAPI):
4859
4859
  'comment': None,
4860
4860
  }
4861
4861
 
4862
- def fetch_ledger(self, code: String = None, since: Int = None, limit: Int = None, params={}):
4862
+ def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
4863
4863
  """
4864
4864
  fetch the history of changes, actions done by the user or operations that altered balance of the user
4865
4865
  :see: https://bybit-exchange.github.io/docs/v5/account/transaction-log
@@ -5015,7 +5015,7 @@ class bybit(Exchange, ImplicitAPI):
5015
5015
  data = self.add_pagination_cursor_to_result(response)
5016
5016
  return self.parse_ledger(data, currency, since, limit)
5017
5017
 
5018
- def parse_ledger_entry(self, item, currency=None):
5018
+ def parse_ledger_entry(self, item, currency: Currency = None):
5019
5019
  #
5020
5020
  # {
5021
5021
  # "id": 234467,
@@ -5394,7 +5394,7 @@ class bybit(Exchange, ImplicitAPI):
5394
5394
  results.append(self.parse_position(rawPosition))
5395
5395
  return self.filter_by_array_positions(results, 'symbol', symbols, False)
5396
5396
 
5397
- def parse_position(self, position, market=None):
5397
+ def parse_position(self, position, market: Market = None):
5398
5398
  #
5399
5399
  # linear swap
5400
5400
  #
@@ -5592,7 +5592,7 @@ class bybit(Exchange, ImplicitAPI):
5592
5592
  'takeProfitPrice': self.safe_number_2(position, 'take_profit', 'takeProfit'),
5593
5593
  })
5594
5594
 
5595
- def set_margin_mode(self, marginMode, symbol: String = None, params={}):
5595
+ def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
5596
5596
  """
5597
5597
  set margin mode(account) or trade mode(symbol)
5598
5598
  :see: https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
@@ -5674,7 +5674,7 @@ class bybit(Exchange, ImplicitAPI):
5674
5674
  response = self.privatePostV5PositionSwitchIsolated(self.extend(request, params))
5675
5675
  return response
5676
5676
 
5677
- def set_leverage(self, leverage, symbol: String = None, params={}):
5677
+ def set_leverage(self, leverage, symbol: Str = None, params={}):
5678
5678
  """
5679
5679
  set the level of leverage for a market
5680
5680
  :see: https://bybit-exchange.github.io/docs/v5/position/leverage
@@ -5717,7 +5717,7 @@ class bybit(Exchange, ImplicitAPI):
5717
5717
  response = self.privatePostV5PositionSetLeverage(self.extend(request, params))
5718
5718
  return response
5719
5719
 
5720
- def set_position_mode(self, hedged, symbol: String = None, params={}):
5720
+ def set_position_mode(self, hedged, symbol: Str = None, params={}):
5721
5721
  """
5722
5722
  set hedged to True or False for a market
5723
5723
  :see: https://bybit-exchange.github.io/docs/v5/position/position-mode
@@ -5897,7 +5897,7 @@ class bybit(Exchange, ImplicitAPI):
5897
5897
  request['limit'] = limit
5898
5898
  return self.fetch_derivatives_open_interest_history(symbol, timeframe, since, limit, params)
5899
5899
 
5900
- def parse_open_interest(self, interest, market=None):
5900
+ def parse_open_interest(self, interest, market: Market = None):
5901
5901
  #
5902
5902
  # {
5903
5903
  # "openInterest": 64757.62400000,
@@ -5946,7 +5946,7 @@ class bybit(Exchange, ImplicitAPI):
5946
5946
  data = self.safe_value(response, 'result', {})
5947
5947
  return self.parse_borrow_rate(data, currency)
5948
5948
 
5949
- def parse_borrow_rate(self, info, currency=None):
5949
+ def parse_borrow_rate(self, info, currency: Currency = None):
5950
5950
  #
5951
5951
  # {
5952
5952
  # "coin": "USDT",
@@ -5966,7 +5966,7 @@ class bybit(Exchange, ImplicitAPI):
5966
5966
  'info': info,
5967
5967
  }
5968
5968
 
5969
- def fetch_borrow_interest(self, code: String = None, symbol: String = None, since: Int = None, limit: Int = None, params={}):
5969
+ def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5970
5970
  """
5971
5971
  fetch the interest owed by the user for borrowing currency for margin trading
5972
5972
  :see: https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
@@ -6010,7 +6010,7 @@ class bybit(Exchange, ImplicitAPI):
6010
6010
  interest = self.parse_borrow_interests(rows, None)
6011
6011
  return self.filter_by_currency_since_limit(interest, code, since, limit)
6012
6012
 
6013
- def parse_borrow_interest(self, info, market=None):
6013
+ def parse_borrow_interest(self, info, market: Market = None):
6014
6014
  #
6015
6015
  # {
6016
6016
  # "tokenId": "BTC",
@@ -6084,7 +6084,7 @@ class bybit(Exchange, ImplicitAPI):
6084
6084
  'status': status,
6085
6085
  })
6086
6086
 
6087
- def fetch_transfers(self, code: String = None, since: Int = None, limit: Int = None, params={}):
6087
+ def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
6088
6088
  """
6089
6089
  fetch a history of internal transfers made on an account
6090
6090
  :see: https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
@@ -6137,7 +6137,7 @@ class bybit(Exchange, ImplicitAPI):
6137
6137
  data = self.add_pagination_cursor_to_result(response)
6138
6138
  return self.parse_transfers(data, currency, since, limit)
6139
6139
 
6140
- def borrow_margin(self, code: str, amount, symbol: String = None, params={}):
6140
+ def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
6141
6141
  """
6142
6142
  create a loan to borrow margin
6143
6143
  :see: https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
@@ -6175,7 +6175,7 @@ class bybit(Exchange, ImplicitAPI):
6175
6175
  'amount': amount,
6176
6176
  })
6177
6177
 
6178
- def repay_margin(self, code: str, amount, symbol: String = None, params={}):
6178
+ def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
6179
6179
  """
6180
6180
  repay borrowed margin and interest
6181
6181
  :see: https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
@@ -6213,7 +6213,7 @@ class bybit(Exchange, ImplicitAPI):
6213
6213
  'amount': amount,
6214
6214
  })
6215
6215
 
6216
- def parse_margin_loan(self, info, currency=None):
6216
+ def parse_margin_loan(self, info, currency: Currency = None):
6217
6217
  #
6218
6218
  # borrowMargin
6219
6219
  #
@@ -6245,7 +6245,7 @@ class bybit(Exchange, ImplicitAPI):
6245
6245
  }
6246
6246
  return self.safe_string(statuses, status, status)
6247
6247
 
6248
- def parse_transfer(self, transfer, currency=None):
6248
+ def parse_transfer(self, transfer, currency: Currency = None):
6249
6249
  #
6250
6250
  # transfer
6251
6251
  #
@@ -6339,7 +6339,7 @@ class bybit(Exchange, ImplicitAPI):
6339
6339
  request['symbol'] = market['id']
6340
6340
  return self.fetch_derivatives_market_leverage_tiers(symbol, params)
6341
6341
 
6342
- def parse_market_leverage_tiers(self, info, market=None):
6342
+ def parse_market_leverage_tiers(self, info, market: Market = None):
6343
6343
  #
6344
6344
  # {
6345
6345
  # "id": 1,
@@ -6368,7 +6368,7 @@ class bybit(Exchange, ImplicitAPI):
6368
6368
  minNotional = maxNotional
6369
6369
  return tiers
6370
6370
 
6371
- def parse_trading_fee(self, fee, market=None):
6371
+ def parse_trading_fee(self, fee, market: Market = None):
6372
6372
  #
6373
6373
  # {
6374
6374
  # "symbol": "ETHUSDT",
@@ -6463,7 +6463,7 @@ class bybit(Exchange, ImplicitAPI):
6463
6463
  result[symbol] = fee
6464
6464
  return result
6465
6465
 
6466
- def parse_deposit_withdraw_fee(self, fee, currency=None):
6466
+ def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
6467
6467
  #
6468
6468
  # {
6469
6469
  # "name": "BTC",
@@ -6558,7 +6558,7 @@ class bybit(Exchange, ImplicitAPI):
6558
6558
  rows = self.safe_value(data, 'rows', [])
6559
6559
  return self.parse_deposit_withdraw_fees(rows, codes, 'coin')
6560
6560
 
6561
- def fetch_settlement_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6561
+ def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6562
6562
  """
6563
6563
  fetches historical settlement records
6564
6564
  :see: https://bybit-exchange.github.io/docs/v5/market/delivery-price
@@ -6609,7 +6609,7 @@ class bybit(Exchange, ImplicitAPI):
6609
6609
  sorted = self.sort_by(settlements, 'timestamp')
6610
6610
  return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
6611
6611
 
6612
- def fetch_my_settlement_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6612
+ def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6613
6613
  """
6614
6614
  fetches historical settlement records of the user
6615
6615
  :see: https://bybit-exchange.github.io/docs/v5/asset/delivery
@@ -6847,7 +6847,7 @@ class bybit(Exchange, ImplicitAPI):
6847
6847
  'datetime': self.iso8601(timestamp),
6848
6848
  })
6849
6849
 
6850
- def parse_greeks(self, greeks, market=None):
6850
+ def parse_greeks(self, greeks, market: Market = None):
6851
6851
  #
6852
6852
  # {
6853
6853
  # "symbol": "BTC-26JAN24-39000-C",
ccxt/cex.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.cex import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Int, Order, OrderBook, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade
10
+ from ccxt.base.types import Balances, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import ArgumentsRequired
@@ -491,7 +491,7 @@ class cex(Exchange, ImplicitAPI):
491
491
  timestamp = self.safe_timestamp(response, 'timestamp')
492
492
  return self.parse_order_book(response, market['symbol'], timestamp)
493
493
 
494
- def parse_ohlcv(self, ohlcv, market=None) -> list:
494
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
495
495
  #
496
496
  # [
497
497
  # 1591403940,
@@ -549,7 +549,7 @@ class cex(Exchange, ImplicitAPI):
549
549
  return []
550
550
  return None
551
551
 
552
- def parse_ticker(self, ticker, market=None) -> Ticker:
552
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
553
553
  timestamp = self.safe_timestamp(ticker, 'timestamp')
554
554
  volume = self.safe_string(ticker, 'volume')
555
555
  high = self.safe_string(ticker, 'high')
@@ -620,7 +620,7 @@ class cex(Exchange, ImplicitAPI):
620
620
  ticker = self.publicGetTickerPair(self.extend(request, params))
621
621
  return self.parse_ticker(ticker, market)
622
622
 
623
- def parse_trade(self, trade, market=None) -> Trade:
623
+ def parse_trade(self, trade, market: Market = None) -> Trade:
624
624
  #
625
625
  # fetchTrades(public)
626
626
  #
@@ -784,7 +784,7 @@ class cex(Exchange, ImplicitAPI):
784
784
  'trades': None,
785
785
  })
786
786
 
787
- def cancel_order(self, id: str, symbol: String = None, params={}):
787
+ def cancel_order(self, id: str, symbol: Str = None, params={}):
788
788
  """
789
789
  cancels an open order
790
790
  :param str id: order id
@@ -800,7 +800,7 @@ class cex(Exchange, ImplicitAPI):
800
800
  # 'true'
801
801
  return self.extend(self.parse_order({}), {'info': response, 'type': None, 'id': id, 'status': 'canceled'})
802
802
 
803
- def parse_order(self, order, market=None) -> Order:
803
+ def parse_order(self, order, market: Market = None) -> Order:
804
804
  # Depending on the call, 'time' can be a unix int, unix string or ISO string
805
805
  # Yes, really
806
806
  timestamp = self.safe_value(order, 'time')
@@ -1046,7 +1046,7 @@ class cex(Exchange, ImplicitAPI):
1046
1046
  'average': None,
1047
1047
  })
1048
1048
 
1049
- def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1049
+ def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1050
1050
  """
1051
1051
  fetch all unfilled currently open orders
1052
1052
  :param str symbol: unified market symbol
@@ -1068,7 +1068,7 @@ class cex(Exchange, ImplicitAPI):
1068
1068
  orders[i] = self.extend(orders[i], {'status': 'open'})
1069
1069
  return self.parse_orders(orders, market, since, limit)
1070
1070
 
1071
- def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1071
+ def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1072
1072
  """
1073
1073
  fetches information on multiple closed orders made by the user
1074
1074
  :param str symbol: unified market symbol of the market orders were made in
@@ -1085,7 +1085,7 @@ class cex(Exchange, ImplicitAPI):
1085
1085
  response = getattr(self, method)(self.extend(request, params))
1086
1086
  return self.parse_orders(response, market, since, limit)
1087
1087
 
1088
- def fetch_order(self, id: str, symbol: String = None, params={}):
1088
+ def fetch_order(self, id: str, symbol: Str = None, params={}):
1089
1089
  """
1090
1090
  fetches information on an order made by the user
1091
1091
  :param str symbol: not used by cex fetchOrder
@@ -1200,7 +1200,7 @@ class cex(Exchange, ImplicitAPI):
1200
1200
  #
1201
1201
  return self.parse_order(data)
1202
1202
 
1203
- def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1203
+ def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1204
1204
  """
1205
1205
  fetches information on multiple orders made by the user
1206
1206
  :param str symbol: unified market symbol of the market orders were made in