ccxt 4.3.30__py2.py3-none-any.whl → 4.3.32__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/bigone.py +32 -32
  15. ccxt/async_support/binance.py +105 -96
  16. ccxt/async_support/bingx.py +21 -21
  17. ccxt/async_support/bit2c.py +13 -13
  18. ccxt/async_support/bitbank.py +19 -19
  19. ccxt/async_support/bitbns.py +17 -17
  20. ccxt/async_support/bitfinex.py +24 -24
  21. ccxt/async_support/bitfinex2.py +142 -109
  22. ccxt/async_support/bitflyer.py +23 -23
  23. ccxt/async_support/bitget.py +76 -76
  24. ccxt/async_support/bithumb.py +20 -20
  25. ccxt/async_support/bitmart.py +55 -55
  26. ccxt/async_support/bitmex.py +41 -41
  27. ccxt/async_support/bitopro.py +30 -30
  28. ccxt/async_support/bitrue.py +37 -37
  29. ccxt/async_support/bitso.py +30 -30
  30. ccxt/async_support/bitstamp.py +31 -31
  31. ccxt/async_support/bitteam.py +26 -26
  32. ccxt/async_support/bitvavo.py +27 -27
  33. ccxt/async_support/bl3p.py +8 -8
  34. ccxt/async_support/blockchaincom.py +24 -24
  35. ccxt/async_support/blofin.py +37 -37
  36. ccxt/async_support/btcalpha.py +19 -19
  37. ccxt/async_support/btcbox.py +11 -11
  38. ccxt/async_support/btcmarkets.py +22 -22
  39. ccxt/async_support/btcturk.py +13 -13
  40. ccxt/async_support/bybit.py +96 -96
  41. ccxt/async_support/cex.py +21 -21
  42. ccxt/async_support/coinbase.py +53 -53
  43. ccxt/async_support/coinbaseexchange.py +29 -29
  44. ccxt/async_support/coinbaseinternational.py +32 -32
  45. ccxt/async_support/coincheck.py +14 -14
  46. ccxt/async_support/coinex.py +208 -175
  47. ccxt/async_support/coinlist.py +35 -35
  48. ccxt/async_support/coinmate.py +22 -22
  49. ccxt/async_support/coinmetro.py +22 -22
  50. ccxt/async_support/coinone.py +18 -18
  51. ccxt/async_support/coinsph.py +32 -32
  52. ccxt/async_support/coinspot.py +8 -8
  53. ccxt/async_support/cryptocom.py +43 -43
  54. ccxt/async_support/currencycom.py +33 -33
  55. ccxt/async_support/delta.py +35 -35
  56. ccxt/async_support/deribit.py +54 -54
  57. ccxt/async_support/digifinex.py +56 -56
  58. ccxt/async_support/exmo.py +34 -34
  59. ccxt/async_support/gate.py +60 -60
  60. ccxt/async_support/gemini.py +24 -24
  61. ccxt/async_support/hitbtc.py +51 -51
  62. ccxt/async_support/hollaex.py +29 -29
  63. ccxt/async_support/htx.py +73 -73
  64. ccxt/async_support/huobijp.py +30 -30
  65. ccxt/async_support/hyperliquid.py +58 -58
  66. ccxt/async_support/idex.py +33 -33
  67. ccxt/async_support/independentreserve.py +12 -12
  68. ccxt/async_support/indodax.py +21 -21
  69. ccxt/async_support/kraken.py +46 -51
  70. ccxt/async_support/krakenfutures.py +29 -29
  71. ccxt/async_support/kucoin.py +51 -51
  72. ccxt/async_support/kucoinfutures.py +33 -33
  73. ccxt/async_support/kuna.py +27 -27
  74. ccxt/async_support/latoken.py +27 -27
  75. ccxt/async_support/lbank.py +35 -35
  76. ccxt/async_support/luno.py +19 -19
  77. ccxt/async_support/lykke.py +20 -20
  78. ccxt/async_support/mercado.py +17 -17
  79. ccxt/async_support/mexc.py +64 -64
  80. ccxt/async_support/ndax.py +38 -38
  81. ccxt/async_support/novadax.py +26 -26
  82. ccxt/async_support/oceanex.py +21 -21
  83. ccxt/async_support/okcoin.py +35 -35
  84. ccxt/async_support/okx.py +85 -85
  85. ccxt/async_support/onetrading.py +32 -32
  86. ccxt/async_support/p2b.py +14 -14
  87. ccxt/async_support/paymium.py +12 -12
  88. ccxt/async_support/phemex.py +50 -50
  89. ccxt/async_support/poloniex.py +35 -35
  90. ccxt/async_support/poloniexfutures.py +25 -21
  91. ccxt/async_support/probit.py +30 -30
  92. ccxt/async_support/timex.py +22 -22
  93. ccxt/async_support/tokocrypto.py +26 -26
  94. ccxt/async_support/tradeogre.py +12 -12
  95. ccxt/async_support/upbit.py +28 -28
  96. ccxt/async_support/wavesexchange.py +33 -33
  97. ccxt/async_support/wazirx.py +21 -21
  98. ccxt/async_support/whitebit.py +37 -37
  99. ccxt/async_support/woo.py +51 -51
  100. ccxt/async_support/woofipro.py +46 -46
  101. ccxt/async_support/yobit.py +20 -20
  102. ccxt/async_support/zaif.py +12 -12
  103. ccxt/async_support/zonda.py +22 -22
  104. ccxt/base/exchange.py +48 -36
  105. ccxt/base/types.py +13 -0
  106. ccxt/bigone.py +32 -32
  107. ccxt/binance.py +105 -96
  108. ccxt/bingx.py +21 -21
  109. ccxt/bit2c.py +13 -13
  110. ccxt/bitbank.py +19 -19
  111. ccxt/bitbns.py +17 -17
  112. ccxt/bitfinex.py +24 -24
  113. ccxt/bitfinex2.py +142 -109
  114. ccxt/bitflyer.py +23 -23
  115. ccxt/bitget.py +76 -76
  116. ccxt/bithumb.py +20 -20
  117. ccxt/bitmart.py +55 -55
  118. ccxt/bitmex.py +41 -41
  119. ccxt/bitopro.py +30 -30
  120. ccxt/bitrue.py +37 -37
  121. ccxt/bitso.py +30 -30
  122. ccxt/bitstamp.py +31 -31
  123. ccxt/bitteam.py +26 -26
  124. ccxt/bitvavo.py +27 -27
  125. ccxt/bl3p.py +8 -8
  126. ccxt/blockchaincom.py +24 -24
  127. ccxt/blofin.py +37 -37
  128. ccxt/btcalpha.py +19 -19
  129. ccxt/btcbox.py +11 -11
  130. ccxt/btcmarkets.py +22 -22
  131. ccxt/btcturk.py +13 -13
  132. ccxt/bybit.py +96 -96
  133. ccxt/cex.py +21 -21
  134. ccxt/coinbase.py +53 -53
  135. ccxt/coinbaseexchange.py +29 -29
  136. ccxt/coinbaseinternational.py +32 -32
  137. ccxt/coincheck.py +14 -14
  138. ccxt/coinex.py +208 -175
  139. ccxt/coinlist.py +35 -35
  140. ccxt/coinmate.py +22 -22
  141. ccxt/coinmetro.py +22 -22
  142. ccxt/coinone.py +18 -18
  143. ccxt/coinsph.py +32 -32
  144. ccxt/coinspot.py +8 -8
  145. ccxt/cryptocom.py +43 -43
  146. ccxt/currencycom.py +33 -33
  147. ccxt/delta.py +35 -35
  148. ccxt/deribit.py +54 -54
  149. ccxt/digifinex.py +56 -56
  150. ccxt/exmo.py +34 -34
  151. ccxt/gate.py +60 -60
  152. ccxt/gemini.py +24 -24
  153. ccxt/hitbtc.py +51 -51
  154. ccxt/hollaex.py +29 -29
  155. ccxt/htx.py +73 -73
  156. ccxt/huobijp.py +30 -30
  157. ccxt/hyperliquid.py +58 -58
  158. ccxt/idex.py +33 -33
  159. ccxt/independentreserve.py +12 -12
  160. ccxt/indodax.py +21 -21
  161. ccxt/kraken.py +46 -51
  162. ccxt/krakenfutures.py +29 -29
  163. ccxt/kucoin.py +51 -51
  164. ccxt/kucoinfutures.py +33 -33
  165. ccxt/kuna.py +27 -27
  166. ccxt/latoken.py +27 -27
  167. ccxt/lbank.py +35 -35
  168. ccxt/luno.py +19 -19
  169. ccxt/lykke.py +20 -20
  170. ccxt/mercado.py +17 -17
  171. ccxt/mexc.py +64 -64
  172. ccxt/ndax.py +38 -38
  173. ccxt/novadax.py +26 -26
  174. ccxt/oceanex.py +21 -21
  175. ccxt/okcoin.py +35 -35
  176. ccxt/okx.py +85 -85
  177. ccxt/onetrading.py +32 -32
  178. ccxt/p2b.py +14 -14
  179. ccxt/paymium.py +12 -12
  180. ccxt/phemex.py +50 -50
  181. ccxt/poloniex.py +35 -35
  182. ccxt/poloniexfutures.py +25 -21
  183. ccxt/pro/__init__.py +1 -1
  184. ccxt/pro/alpaca.py +8 -8
  185. ccxt/pro/ascendex.py +4 -4
  186. ccxt/pro/binance.py +56 -56
  187. ccxt/pro/bingx.py +5 -5
  188. ccxt/pro/bitfinex.py +6 -6
  189. ccxt/pro/bitfinex2.py +10 -10
  190. ccxt/pro/bitget.py +17 -17
  191. ccxt/pro/bithumb.py +6 -6
  192. ccxt/pro/bitmart.py +8 -8
  193. ccxt/pro/bitmex.py +16 -16
  194. ccxt/pro/bitopro.py +4 -4
  195. ccxt/pro/bitrue.py +8 -8
  196. ccxt/pro/bitstamp.py +5 -5
  197. ccxt/pro/bitvavo.py +14 -14
  198. ccxt/pro/blockchaincom.py +7 -7
  199. ccxt/pro/bybit.py +12 -12
  200. ccxt/pro/cex.py +20 -20
  201. ccxt/pro/coinbase.py +32 -2
  202. ccxt/pro/coinbaseexchange.py +10 -10
  203. ccxt/pro/coinbaseinternational.py +4 -4
  204. ccxt/pro/coincheck.py +2 -2
  205. ccxt/pro/coinex.py +15 -15
  206. ccxt/pro/coinone.py +4 -4
  207. ccxt/pro/cryptocom.py +11 -11
  208. ccxt/pro/currencycom.py +4 -4
  209. ccxt/pro/deribit.py +9 -9
  210. ccxt/pro/exmo.py +9 -9
  211. ccxt/pro/gate.py +12 -12
  212. ccxt/pro/gemini.py +11 -11
  213. ccxt/pro/hitbtc.py +13 -13
  214. ccxt/pro/hollaex.py +6 -6
  215. ccxt/pro/htx.py +15 -15
  216. ccxt/pro/huobijp.py +16 -16
  217. ccxt/pro/hyperliquid.py +9 -9
  218. ccxt/pro/idex.py +12 -12
  219. ccxt/pro/independentreserve.py +2 -2
  220. ccxt/pro/kraken.py +14 -14
  221. ccxt/pro/krakenfutures.py +12 -12
  222. ccxt/pro/kucoin.py +12 -12
  223. ccxt/pro/kucoinfutures.py +16 -16
  224. ccxt/pro/lbank.py +12 -12
  225. ccxt/pro/luno.py +4 -4
  226. ccxt/pro/mexc.py +14 -14
  227. ccxt/pro/ndax.py +12 -12
  228. ccxt/pro/okcoin.py +6 -6
  229. ccxt/pro/okx.py +30 -30
  230. ccxt/pro/onetrading.py +13 -13
  231. ccxt/pro/p2b.py +2 -2
  232. ccxt/pro/phemex.py +9 -9
  233. ccxt/pro/poloniex.py +9 -9
  234. ccxt/pro/poloniexfutures.py +10 -10
  235. ccxt/pro/probit.py +8 -8
  236. ccxt/pro/upbit.py +1 -1
  237. ccxt/pro/wazirx.py +10 -10
  238. ccxt/pro/whitebit.py +8 -8
  239. ccxt/pro/woo.py +14 -14
  240. ccxt/pro/woofipro.py +14 -14
  241. ccxt/probit.py +30 -30
  242. ccxt/test/base/test_shared_methods.py +1 -0
  243. ccxt/test/test_async.py +1 -1
  244. ccxt/test/test_sync.py +1 -1
  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 +37 -37
  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.30.dist-info → ccxt-4.3.32.dist-info}/METADATA +4 -4
  258. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/RECORD +260 -260
  259. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/WHEEL +0 -0
  260. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/top_level.txt +0 -0
ccxt/pro/bitvavo.py CHANGED
@@ -71,7 +71,7 @@ class bitvavo(ccxt.async_support.bitvavo):
71
71
  market = self.market(symbol)
72
72
  messageHash = name + '@' + market['id']
73
73
  url = self.urls['api']['ws']
74
- request = {
74
+ request: dict = {
75
75
  'action': 'subscribe',
76
76
  'channels': [
77
77
  {
@@ -189,7 +189,7 @@ class bitvavo(ccxt.async_support.bitvavo):
189
189
  interval = self.safe_string(self.timeframes, timeframe, timeframe)
190
190
  messageHash = name + '@' + marketId + '_' + interval
191
191
  url = self.urls['api']['ws']
192
- request = {
192
+ request: dict = {
193
193
  'action': 'subscribe',
194
194
  'channels': [
195
195
  {
@@ -274,7 +274,7 @@ class bitvavo(ccxt.async_support.bitvavo):
274
274
  name = 'book'
275
275
  messageHash = name + '@' + market['id']
276
276
  url = self.urls['api']['ws']
277
- request = {
277
+ request: dict = {
278
278
  'action': 'subscribe',
279
279
  'channels': [
280
280
  {
@@ -285,7 +285,7 @@ class bitvavo(ccxt.async_support.bitvavo):
285
285
  },
286
286
  ],
287
287
  }
288
- subscription = {
288
+ subscription: dict = {
289
289
  'messageHash': messageHash,
290
290
  'name': name,
291
291
  'symbol': symbol,
@@ -371,7 +371,7 @@ class bitvavo(ccxt.async_support.bitvavo):
371
371
  name = 'getBook'
372
372
  messageHash = name + '@' + marketId
373
373
  url = self.urls['api']['ws']
374
- request = {
374
+ request: dict = {
375
375
  'action': name,
376
376
  'market': marketId,
377
377
  }
@@ -455,7 +455,7 @@ class bitvavo(ccxt.async_support.bitvavo):
455
455
  url = self.urls['api']['ws']
456
456
  name = 'account'
457
457
  messageHash = 'order:' + symbol
458
- request = {
458
+ request: dict = {
459
459
  'action': 'subscribe',
460
460
  'channels': [
461
461
  {
@@ -488,7 +488,7 @@ class bitvavo(ccxt.async_support.bitvavo):
488
488
  url = self.urls['api']['ws']
489
489
  name = 'account'
490
490
  messageHash = 'myTrades:' + symbol
491
- request = {
491
+ request: dict = {
492
492
  'action': 'subscribe',
493
493
  'channels': [
494
494
  {
@@ -572,7 +572,7 @@ class bitvavo(ccxt.async_support.bitvavo):
572
572
  """
573
573
  await self.load_markets()
574
574
  await self.authenticate()
575
- request = {}
575
+ request: dict = {}
576
576
  market = None
577
577
  if symbol is not None:
578
578
  market = self.market(symbol)
@@ -611,7 +611,7 @@ class bitvavo(ccxt.async_support.bitvavo):
611
611
  await self.load_markets()
612
612
  await self.authenticate()
613
613
  market = self.market(symbol)
614
- request = {
614
+ request: dict = {
615
615
  'orderId': id,
616
616
  'market': market['id'],
617
617
  }
@@ -653,7 +653,7 @@ class bitvavo(ccxt.async_support.bitvavo):
653
653
  """
654
654
  await self.load_markets()
655
655
  await self.authenticate()
656
- request = {
656
+ request: dict = {
657
657
  # 'market': market['id'], # rate limit 25 without a market, 1 with market specified
658
658
  }
659
659
  market = None
@@ -1006,7 +1006,7 @@ class bitvavo(ccxt.async_support.bitvavo):
1006
1006
  client.resolve(markets, messageHash)
1007
1007
 
1008
1008
  def build_message_hash(self, action, params={}):
1009
- methods = {
1009
+ methods: dict = {
1010
1010
  'privateCreateOrder': self.action_and_market_message_hash,
1011
1011
  'privateUpdateOrder': self.action_and_order_id_message_hash,
1012
1012
  'privateCancelOrder': self.action_and_order_id_message_hash,
@@ -1110,7 +1110,7 @@ class bitvavo(ccxt.async_support.bitvavo):
1110
1110
  # }
1111
1111
  #
1112
1112
  subscriptions = self.safe_value(message, 'subscriptions', {})
1113
- methods = {
1113
+ methods: dict = {
1114
1114
  'book': self.handle_order_book_subscriptions,
1115
1115
  }
1116
1116
  names = list(subscriptions.keys())
@@ -1133,7 +1133,7 @@ class bitvavo(ccxt.async_support.bitvavo):
1133
1133
  auth = stringTimestamp + 'GET/' + self.version + '/websocket'
1134
1134
  signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
1135
1135
  action = 'authenticate'
1136
- request = {
1136
+ request: dict = {
1137
1137
  'action': action,
1138
1138
  'key': self.apiKey,
1139
1139
  'signature': signature,
@@ -1232,7 +1232,7 @@ class bitvavo(ccxt.async_support.bitvavo):
1232
1232
  error = self.safe_string(message, 'error')
1233
1233
  if error is not None:
1234
1234
  self.handle_error_message(client, message)
1235
- methods = {
1235
+ methods: dict = {
1236
1236
  'subscribed': self.handle_subscription_status,
1237
1237
  'book': self.handle_order_book,
1238
1238
  'getBook': self.handle_order_book_snapshot,
ccxt/pro/blockchaincom.py CHANGED
@@ -67,7 +67,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
67
67
  await self.authenticate(params)
68
68
  messageHash = 'balance'
69
69
  url = self.urls['api']['ws']
70
- subscribe = {
70
+ subscribe: dict = {
71
71
  'action': 'subscribe',
72
72
  'channel': 'balances',
73
73
  }
@@ -107,7 +107,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
107
107
  event = self.safe_string(message, 'event')
108
108
  if event == 'subscribed':
109
109
  return
110
- result = {'info': message}
110
+ result: dict = {'info': message}
111
111
  balances = self.safe_value(message, 'balances', [])
112
112
  for i in range(0, len(balances)):
113
113
  entry = balances[i]
@@ -406,7 +406,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
406
406
  market = self.market(symbol)
407
407
  symbol = market['symbol']
408
408
  url = self.urls['api']['ws']
409
- message = {
409
+ message: dict = {
410
410
  'action': 'subscribe',
411
411
  'channel': 'trading',
412
412
  }
@@ -582,7 +582,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
582
582
  }, market)
583
583
 
584
584
  def parse_ws_order_status(self, status):
585
- statuses = {
585
+ statuses: dict = {
586
586
  'pending': 'open',
587
587
  'open': 'open',
588
588
  'rejected': 'rejected',
@@ -609,7 +609,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
609
609
  type = self.safe_string(params, 'type', 'l2')
610
610
  params = self.omit(params, 'type')
611
611
  messageHash = 'orderbook:' + symbol + ':' + type
612
- subscribe = {
612
+ subscribe: dict = {
613
613
  'action': 'subscribe',
614
614
  'channel': type,
615
615
  'symbol': market['id'],
@@ -689,7 +689,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
689
689
 
690
690
  def handle_message(self, client: Client, message):
691
691
  channel = self.safe_string(message, 'channel')
692
- handlers = {
692
+ handlers: dict = {
693
693
  'ticker': self.handle_ticker,
694
694
  'trades': self.handle_trades,
695
695
  'prices': self.handle_ohlcv,
@@ -729,7 +729,7 @@ class blockchaincom(ccxt.async_support.blockchaincom):
729
729
  isAuthenticated = self.safe_value(client.subscriptions, messageHash)
730
730
  if isAuthenticated is None:
731
731
  self.check_required_credentials()
732
- request = {
732
+ request: dict = {
733
733
  'action': 'subscribe',
734
734
  'channel': 'auth',
735
735
  'token': self.secret,
ccxt/pro/bybit.py CHANGED
@@ -209,7 +209,7 @@ class bybit(ccxt.async_support.bybit):
209
209
  url = self.urls['api']['ws']['private']['trade']
210
210
  await self.authenticate(url)
211
211
  requestId = str(self.request_id())
212
- request = {
212
+ request: dict = {
213
213
  'op': 'order.create',
214
214
  'reqId': requestId,
215
215
  'args': [
@@ -251,7 +251,7 @@ class bybit(ccxt.async_support.bybit):
251
251
  url = self.urls['api']['ws']['private']['trade']
252
252
  await self.authenticate(url)
253
253
  requestId = str(self.request_id())
254
- request = {
254
+ request: dict = {
255
255
  'op': 'order.amend',
256
256
  'reqId': requestId,
257
257
  'args': [
@@ -283,7 +283,7 @@ class bybit(ccxt.async_support.bybit):
283
283
  requestId = str(self.request_id())
284
284
  if 'orderFilter' in orderRequest:
285
285
  del orderRequest['orderFilter']
286
- request = {
286
+ request: dict = {
287
287
  'op': 'order.cancel',
288
288
  'reqId': requestId,
289
289
  'args': [
@@ -343,7 +343,7 @@ class bybit(ccxt.async_support.bybit):
343
343
  messageHashes.append('ticker:' + symbols[i])
344
344
  ticker = await self.watch_topics(url, messageHashes, topics, params)
345
345
  if self.newUpdates:
346
- result = {}
346
+ result: dict = {}
347
347
  result[ticker['symbol']] = ticker
348
348
  return result
349
349
  return self.filter_by_array(self.tickers, 'symbol', symbols)
@@ -885,7 +885,7 @@ class bybit(ccxt.async_support.bybit):
885
885
  messageHash += ':' + symbol
886
886
  url = self.get_url_by_market_type(symbol, True, method, params)
887
887
  await self.authenticate(url)
888
- topicByMarket = {
888
+ topicByMarket: dict = {
889
889
  'spot': 'ticketInfo',
890
890
  'unified': 'execution',
891
891
  'usdc': 'user.openapi.perp.trade',
@@ -968,7 +968,7 @@ class bybit(ccxt.async_support.bybit):
968
968
  limit = self.safe_integer(self.options, 'tradesLimit', 1000)
969
969
  self.myTrades = ArrayCacheBySymbolById(limit)
970
970
  trades = self.myTrades
971
- symbols = {}
971
+ symbols: dict = {}
972
972
  for i in range(0, len(data)):
973
973
  rawTrade = data[i]
974
974
  parsed = None
@@ -1142,7 +1142,7 @@ class bybit(ccxt.async_support.bybit):
1142
1142
  messageHash += ':' + symbol
1143
1143
  url = self.get_url_by_market_type(symbol, True, method, params)
1144
1144
  await self.authenticate(url)
1145
- topicsByMarket = {
1145
+ topicsByMarket: dict = {
1146
1146
  'spot': ['order', 'stopOrder'],
1147
1147
  'unified': ['order'],
1148
1148
  'usdc': ['user.openapi.perp.order'],
@@ -1273,7 +1273,7 @@ class bybit(ccxt.async_support.bybit):
1273
1273
  isSpot = category == 'spot'
1274
1274
  if not isSpot:
1275
1275
  rawOrders = self.safe_value(rawOrders, 'result', rawOrders)
1276
- symbols = {}
1276
+ symbols: dict = {}
1277
1277
  for i in range(0, len(rawOrders)):
1278
1278
  parsed = None
1279
1279
  if isSpot:
@@ -1440,7 +1440,7 @@ class bybit(ccxt.async_support.bybit):
1440
1440
  isUnifiedAccount = self.safe_bool(unified, 1, False)
1441
1441
  url = self.get_url_by_market_type(None, True, method, params)
1442
1442
  await self.authenticate(url)
1443
- topicByMarket = {
1443
+ topicByMarket: dict = {
1444
1444
  'spot': 'outboundAccountInfo',
1445
1445
  'unified': 'wallet',
1446
1446
  }
@@ -1693,7 +1693,7 @@ class bybit(ccxt.async_support.bybit):
1693
1693
  self.balance[code] = account
1694
1694
 
1695
1695
  async def watch_topics(self, url, messageHashes, topics, params={}):
1696
- request = {
1696
+ request: dict = {
1697
1697
  'op': 'subscribe',
1698
1698
  'req_id': self.request_id(),
1699
1699
  'args': topics,
@@ -1713,7 +1713,7 @@ class bybit(ccxt.async_support.bybit):
1713
1713
  path = 'GET/realtime'
1714
1714
  auth = path + expires
1715
1715
  signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256, 'hex')
1716
- request = {
1716
+ request: dict = {
1717
1717
  'op': 'auth',
1718
1718
  'args': [
1719
1719
  self.apiKey, expires, signature,
@@ -1815,7 +1815,7 @@ class bybit(ccxt.async_support.bybit):
1815
1815
  self.handle_subscription_status(client, message)
1816
1816
  return
1817
1817
  topic = self.safe_string_2(message, 'topic', 'op')
1818
- methods = {
1818
+ methods: dict = {
1819
1819
  'orderbook': self.handle_order_book,
1820
1820
  'kline': self.handle_ohlcv,
1821
1821
  'order': self.handle_order,
ccxt/pro/cex.py CHANGED
@@ -68,7 +68,7 @@ class cex(ccxt.async_support.cex):
68
68
  await self.authenticate(params)
69
69
  messageHash = self.request_id()
70
70
  url = self.urls['api']['ws']
71
- subscribe = {
71
+ subscribe: dict = {
72
72
  'e': 'get-balance',
73
73
  'data': {},
74
74
  'oid': self.request_id(),
@@ -100,7 +100,7 @@ class cex(ccxt.async_support.cex):
100
100
  data = self.safe_value(message, 'data', {})
101
101
  freeBalance = self.safe_value(data, 'balance', {})
102
102
  usedBalance = self.safe_value(data, 'obalance', {})
103
- result = {
103
+ result: dict = {
104
104
  'info': data,
105
105
  }
106
106
  currencyIds = list(freeBalance.keys())
@@ -142,7 +142,7 @@ class cex(ccxt.async_support.cex):
142
142
  subscriptionKey = subscriptionKey[0:3]
143
143
  if subscriptionKey == 'old':
144
144
  raise ExchangeError(self.id + ' watchTrades() only supports watching one symbol at a time.')
145
- message = {
145
+ message: dict = {
146
146
  'e': 'subscribe',
147
147
  'rooms': ['pair-' + market['base'] + '-' + market['quote']],
148
148
  }
@@ -280,7 +280,7 @@ class cex(ccxt.async_support.cex):
280
280
  symbols = self.market_symbols(symbols)
281
281
  url = self.urls['api']['ws']
282
282
  messageHash = 'tickers'
283
- message = {
283
+ message: dict = {
284
284
  'e': 'subscribe',
285
285
  'rooms': [
286
286
  'tickers',
@@ -292,7 +292,7 @@ class cex(ccxt.async_support.cex):
292
292
  if symbols is not None and not self.in_array(tickerSymbol, symbols):
293
293
  return await self.watch_tickers(symbols, params)
294
294
  if self.newUpdates:
295
- result = {}
295
+ result: dict = {}
296
296
  result[tickerSymbol] = ticker
297
297
  return result
298
298
  return self.filter_by_array(self.tickers, 'symbol', symbols)
@@ -437,7 +437,7 @@ class cex(ccxt.async_support.cex):
437
437
  market = self.market(symbol)
438
438
  symbol = market['symbol']
439
439
  messageHash = 'orders:' + symbol
440
- message = {
440
+ message: dict = {
441
441
  'e': 'open-orders',
442
442
  'data': {
443
443
  'pair': [
@@ -471,7 +471,7 @@ class cex(ccxt.async_support.cex):
471
471
  market = self.market(symbol)
472
472
  messageHash = 'myTrades:' + market['symbol']
473
473
  subscriptionHash = 'orders:' + market['symbol']
474
- message = {
474
+ message: dict = {
475
475
  'e': 'open-orders',
476
476
  'data': {
477
477
  'pair': [
@@ -583,7 +583,7 @@ class cex(ccxt.async_support.cex):
583
583
  if side == 'sell':
584
584
  symbol = quote + '/' + base
585
585
  amount = Precise.string_div(amount, price) # due to rounding errors amount in not exact to trade
586
- parsedTrade = {
586
+ parsedTrade: dict = {
587
587
  'id': self.safe_string(trade, 'id'),
588
588
  'order': self.safe_string(trade, 'order'),
589
589
  'info': trade,
@@ -787,7 +787,7 @@ class cex(ccxt.async_support.cex):
787
787
  status = 'canceled'
788
788
  elif isTransaction:
789
789
  status = 'closed'
790
- parsedOrder = {
790
+ parsedOrder: dict = {
791
791
  'id': self.safe_string_2(order, 'id', 'order'),
792
792
  'clientOrderId': None,
793
793
  'info': order,
@@ -881,7 +881,7 @@ class cex(ccxt.async_support.cex):
881
881
  url = self.urls['api']['ws']
882
882
  messageHash = 'orderbook:' + symbol
883
883
  depth = 0 if (limit is None) else limit
884
- subscribe = {
884
+ subscribe: dict = {
885
885
  'e': 'order-book-subscribe',
886
886
  'data': {
887
887
  'pair': [
@@ -925,7 +925,7 @@ class cex(ccxt.async_support.cex):
925
925
  symbol = self.pair_to_symbol(pair)
926
926
  messageHash = 'orderbook:' + symbol
927
927
  timestamp = self.safe_integer_2(data, 'timestamp_ms', 'timestamp')
928
- incrementalId = self.safe_number(data, 'id')
928
+ incrementalId = self.safe_integer(data, 'id')
929
929
  orderbook = self.order_book({})
930
930
  snapshot = self.parse_order_book(data, symbol, timestamp, 'bids', 'asks')
931
931
  snapshot['nonce'] = incrementalId
@@ -1003,7 +1003,7 @@ class cex(ccxt.async_support.cex):
1003
1003
  symbol = market['symbol']
1004
1004
  messageHash = 'ohlcv:' + symbol
1005
1005
  url = self.urls['api']['ws']
1006
- request = {
1006
+ request: dict = {
1007
1007
  'e': 'init-ohlcv',
1008
1008
  'i': timeframe,
1009
1009
  'rooms': [
@@ -1143,7 +1143,7 @@ class cex(ccxt.async_support.cex):
1143
1143
  }, params)
1144
1144
  url = self.urls['api']['ws']
1145
1145
  messageHash = self.request_id()
1146
- request = {
1146
+ request: dict = {
1147
1147
  'e': 'get-order',
1148
1148
  'oid': messageHash,
1149
1149
  'data': data,
@@ -1171,7 +1171,7 @@ class cex(ccxt.async_support.cex):
1171
1171
  data = self.extend({
1172
1172
  'pair': [market['baseId'], market['quoteId']],
1173
1173
  }, params)
1174
- request = {
1174
+ request: dict = {
1175
1175
  'e': 'open-orders',
1176
1176
  'oid': messageHash,
1177
1177
  'data': data,
@@ -1205,7 +1205,7 @@ class cex(ccxt.async_support.cex):
1205
1205
  'price': price,
1206
1206
  'type': side,
1207
1207
  }, params)
1208
- request = {
1208
+ request: dict = {
1209
1209
  'e': 'place-order',
1210
1210
  'oid': messageHash,
1211
1211
  'data': data,
@@ -1242,7 +1242,7 @@ class cex(ccxt.async_support.cex):
1242
1242
  }, params)
1243
1243
  messageHash = self.request_id()
1244
1244
  url = self.urls['api']['ws']
1245
- request = {
1245
+ request: dict = {
1246
1246
  'e': 'cancel-replace-order',
1247
1247
  'oid': messageHash,
1248
1248
  'data': data,
@@ -1269,7 +1269,7 @@ class cex(ccxt.async_support.cex):
1269
1269
  }, params)
1270
1270
  messageHash = self.request_id()
1271
1271
  url = self.urls['api']['ws']
1272
- request = {
1272
+ request: dict = {
1273
1273
  'e': 'cancel-order',
1274
1274
  'oid': messageHash,
1275
1275
  'data': data,
@@ -1295,7 +1295,7 @@ class cex(ccxt.async_support.cex):
1295
1295
  'cancel-orders': ids,
1296
1296
  }, params)
1297
1297
  url = self.urls['api']['ws']
1298
- request = {
1298
+ request: dict = {
1299
1299
  'e': 'mass-cancel-place-orders',
1300
1300
  'oid': messageHash,
1301
1301
  'data': data,
@@ -1375,7 +1375,7 @@ class cex(ccxt.async_support.cex):
1375
1375
  self.handle_error_message(client, message)
1376
1376
  return
1377
1377
  event = self.safe_string(message, 'e')
1378
- handlers = {
1378
+ handlers: dict = {
1379
1379
  'auth': self.handle_authentication_message,
1380
1380
  'connected': self.handle_connected,
1381
1381
  'tick': self.handle_ticker,
@@ -1428,7 +1428,7 @@ class cex(ccxt.async_support.cex):
1428
1428
  nonce = str(self.seconds())
1429
1429
  auth = nonce + self.apiKey
1430
1430
  signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
1431
- request = {
1431
+ request: dict = {
1432
1432
  'e': 'auth',
1433
1433
  'auth': {
1434
1434
  'key': self.apiKey,
ccxt/pro/coinbase.py CHANGED
@@ -121,7 +121,7 @@ class coinbase(ccxt.async_support.coinbase):
121
121
  return await self.watch_multiple(url, messageHashes, subscribe, messageHashes)
122
122
 
123
123
  def create_ws_auth(self, name: str, productIds: List[str]):
124
- subscribe = {}
124
+ subscribe: dict = {}
125
125
  timestamp = self.number_to_string(self.seconds())
126
126
  self.check_required_credentials()
127
127
  isCloudAPiKey = (self.apiKey.find('organizations/') >= 0) or (self.secret.startswith('-----BEGIN'))
@@ -233,6 +233,34 @@ class coinbase(ccxt.async_support.coinbase):
233
233
  # ]
234
234
  # }
235
235
  #
236
+ # note! seems coinbase might also send empty data like:
237
+ #
238
+ # {
239
+ # "channel": "ticker_batch",
240
+ # "client_id": "",
241
+ # "timestamp": "2024-05-24T18:22:24.546809523Z",
242
+ # "sequence_num": 1,
243
+ # "events": [
244
+ # {
245
+ # "type": "snapshot",
246
+ # "tickers": [
247
+ # {
248
+ # "type": "ticker",
249
+ # "product_id": "",
250
+ # "price": "",
251
+ # "volume_24_h": "",
252
+ # "low_24_h": "",
253
+ # "high_24_h": "",
254
+ # "low_52_w": "",
255
+ # "high_52_w": "",
256
+ # "price_percent_chg_24_h": ""
257
+ # }
258
+ # ]
259
+ # }
260
+ # ]
261
+ # }
262
+ #
263
+ #
236
264
  channel = self.safe_string(message, 'channel')
237
265
  events = self.safe_value(message, 'events', [])
238
266
  datetime = self.safe_string(message, 'timestamp')
@@ -249,6 +277,8 @@ class coinbase(ccxt.async_support.coinbase):
249
277
  symbol = result['symbol']
250
278
  self.tickers[symbol] = result
251
279
  wsMarketId = self.safe_string(ticker, 'product_id')
280
+ if wsMarketId is None:
281
+ continue
252
282
  messageHash = channel + '::' + wsMarketId
253
283
  newTickers.append(result)
254
284
  client.resolve(result, messageHash)
@@ -632,7 +662,7 @@ class coinbase(ccxt.async_support.coinbase):
632
662
 
633
663
  def handle_message(self, client, message):
634
664
  channel = self.safe_string(message, 'channel')
635
- methods = {
665
+ methods: dict = {
636
666
  'subscriptions': self.handle_subscription_status,
637
667
  'ticker': self.handle_tickers,
638
668
  'ticker_batch': self.handle_tickers,
@@ -77,7 +77,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
77
77
  if 'signature' in params:
78
78
  # need to distinguish between public trades and user trades
79
79
  url = url + '?'
80
- subscribe = {
80
+ subscribe: dict = {
81
81
  'type': 'subscribe',
82
82
  'product_ids': productIds,
83
83
  'channels': [
@@ -102,7 +102,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
102
102
  if 'signature' in params:
103
103
  # need to distinguish between public trades and user trades
104
104
  url = url + '?'
105
- subscribe = {
105
+ subscribe: dict = {
106
106
  'type': 'subscribe',
107
107
  'product_ids': productIds,
108
108
  'channels': [
@@ -138,7 +138,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
138
138
  messageHash = 'ticker'
139
139
  ticker = await self.subscribe_multiple(channel, symbols, messageHash, params)
140
140
  if self.newUpdates:
141
- result = {}
141
+ result: dict = {}
142
142
  result[ticker['symbol']] = ticker
143
143
  return result
144
144
  return self.filter_by_array(self.tickers, 'symbol', symbols)
@@ -286,7 +286,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
286
286
  marketId = marketIds[i]
287
287
  messageHashes.append(name + ':' + marketId)
288
288
  url = self.urls['api']['ws']
289
- subscribe = {
289
+ subscribe: dict = {
290
290
  'type': 'subscribe',
291
291
  'product_ids': marketIds,
292
292
  'channels': [
@@ -294,7 +294,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
294
294
  ],
295
295
  }
296
296
  request = self.extend(subscribe, params)
297
- subscription = {
297
+ subscription: dict = {
298
298
  'messageHash': name,
299
299
  'symbols': symbols,
300
300
  'marketIds': marketIds,
@@ -318,7 +318,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
318
318
  symbol = market['symbol']
319
319
  messageHash = name + ':' + market['id']
320
320
  url = self.urls['api']['ws']
321
- subscribe = {
321
+ subscribe: dict = {
322
322
  'type': 'subscribe',
323
323
  'product_ids': [
324
324
  market['id'],
@@ -328,7 +328,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
328
328
  ],
329
329
  }
330
330
  request = self.extend(subscribe, params)
331
- subscription = {
331
+ subscription: dict = {
332
332
  'messageHash': messageHash,
333
333
  'symbol': symbol,
334
334
  'marketId': market['id'],
@@ -470,7 +470,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
470
470
  return parsed
471
471
 
472
472
  def parse_ws_order_status(self, status):
473
- statuses = {
473
+ statuses: dict = {
474
474
  'filled': 'closed',
475
475
  'canceled': 'canceled',
476
476
  }
@@ -811,7 +811,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
811
811
  orderbook = self.orderbooks[symbol]
812
812
  timestamp = self.parse8601(self.safe_string(message, 'time'))
813
813
  changes = self.safe_value(message, 'changes', [])
814
- sides = {
814
+ sides: dict = {
815
815
  'sell': 'asks',
816
816
  'buy': 'bids',
817
817
  }
@@ -870,7 +870,7 @@ class coinbaseexchange(ccxt.async_support.coinbaseexchange):
870
870
 
871
871
  def handle_message(self, client: Client, message):
872
872
  type = self.safe_string(message, 'type')
873
- methods = {
873
+ methods: dict = {
874
874
  'snapshot': self.handle_order_book,
875
875
  'l2update': self.handle_order_book,
876
876
  'subscribe': self.handle_subscription_status,
@@ -98,7 +98,7 @@ class coinbaseinternational(ccxt.async_support.coinbaseinternational):
98
98
  timestamp = str(self.nonce())
99
99
  auth = timestamp + self.apiKey + 'CBINTLMD' + self.password
100
100
  signature = self.hmac(self.encode(auth), self.base64_to_binary(self.secret), hashlib.sha256, 'base64')
101
- subscribe = {
101
+ subscribe: dict = {
102
102
  'type': 'SUBSCRIBE',
103
103
  'product_ids': productIds,
104
104
  'channels': [name],
@@ -137,7 +137,7 @@ class coinbaseinternational(ccxt.async_support.coinbaseinternational):
137
137
  timestamp = self.number_to_string(self.seconds())
138
138
  auth = timestamp + self.apiKey + 'CBINTLMD' + self.password
139
139
  signature = self.hmac(self.encode(auth), self.base64_to_binary(self.secret), hashlib.sha256, 'base64')
140
- subscribe = {
140
+ subscribe: dict = {
141
141
  'type': 'SUBSCRIBE',
142
142
  'time': timestamp,
143
143
  'product_ids': productIds,
@@ -169,7 +169,7 @@ class coinbaseinternational(ccxt.async_support.coinbaseinternational):
169
169
  fundingRate = await self.subscribe_multiple('RISK', symbols, params)
170
170
  symbol = self.safe_string(fundingRate, 'symbol')
171
171
  if self.newUpdates:
172
- result = {}
172
+ result: dict = {}
173
173
  result[symbol] = fundingRate
174
174
  return result
175
175
  return self.filter_by_array(self.fundingRates, 'symbol', symbols)
@@ -602,7 +602,7 @@ class coinbaseinternational(ccxt.async_support.coinbaseinternational):
602
602
  if self.handle_error_message(client, message):
603
603
  return
604
604
  channel = self.safe_string(message, 'channel')
605
- methods = {
605
+ methods: dict = {
606
606
  'SUBSCRIPTIONS': self.handle_subscription_status,
607
607
  'INSTRUMENTS': self.handle_instrument,
608
608
  'LEVEL1': self.handle_ticker,
ccxt/pro/coincheck.py CHANGED
@@ -60,7 +60,7 @@ class coincheck(ccxt.async_support.coincheck):
60
60
  market = self.market(symbol)
61
61
  messageHash = 'orderbook:' + market['symbol']
62
62
  url = self.urls['api']['ws']
63
- request = {
63
+ request: dict = {
64
64
  'type': 'subscribe',
65
65
  'channel': market['id'] + '-orderbook',
66
66
  }
@@ -118,7 +118,7 @@ class coincheck(ccxt.async_support.coincheck):
118
118
  symbol = market['symbol']
119
119
  messageHash = 'trade:' + market['symbol']
120
120
  url = self.urls['api']['ws']
121
- request = {
121
+ request: dict = {
122
122
  'type': 'subscribe',
123
123
  'channel': market['id'] + '-trades',
124
124
  }