ccxt 4.2.30__py2.py3-none-any.whl → 4.2.34__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (244) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/coinbase.py +10 -0
  3. ccxt/abstract/okx.py +12 -1
  4. ccxt/ace.py +4 -3
  5. ccxt/alpaca.py +1 -1
  6. ccxt/ascendex.py +6 -6
  7. ccxt/async_support/__init__.py +1 -1
  8. ccxt/async_support/ace.py +4 -3
  9. ccxt/async_support/alpaca.py +1 -1
  10. ccxt/async_support/ascendex.py +6 -6
  11. ccxt/async_support/base/exchange.py +62 -39
  12. ccxt/async_support/bigone.py +25 -5
  13. ccxt/async_support/binance.py +17 -16
  14. ccxt/async_support/bingx.py +10 -9
  15. ccxt/async_support/bit2c.py +13 -1
  16. ccxt/async_support/bitbank.py +2 -2
  17. ccxt/async_support/bitbns.py +1 -1
  18. ccxt/async_support/bitfinex.py +5 -5
  19. ccxt/async_support/bitfinex2.py +386 -40
  20. ccxt/async_support/bitflyer.py +5 -5
  21. ccxt/async_support/bitforex.py +4 -1
  22. ccxt/async_support/bitget.py +11 -11
  23. ccxt/async_support/bithumb.py +2 -2
  24. ccxt/async_support/bitmart.py +9 -9
  25. ccxt/async_support/bitmex.py +3 -3
  26. ccxt/async_support/bitopro.py +2 -2
  27. ccxt/async_support/bitrue.py +8 -8
  28. ccxt/async_support/bitso.py +4 -4
  29. ccxt/async_support/bitstamp.py +2 -2
  30. ccxt/async_support/bitteam.py +1 -1
  31. ccxt/async_support/bitvavo.py +3 -3
  32. ccxt/async_support/bl3p.py +1 -1
  33. ccxt/async_support/blockchaincom.py +3 -3
  34. ccxt/async_support/btcalpha.py +1 -1
  35. ccxt/async_support/btcbox.py +1 -1
  36. ccxt/async_support/btcmarkets.py +2 -2
  37. ccxt/async_support/btcturk.py +1 -1
  38. ccxt/async_support/bybit.py +9 -9
  39. ccxt/async_support/cex.py +1 -1
  40. ccxt/async_support/coinbase.py +16 -6
  41. ccxt/async_support/coinbasepro.py +2 -2
  42. ccxt/async_support/coincheck.py +1 -1
  43. ccxt/async_support/coinex.py +9 -9
  44. ccxt/async_support/coinlist.py +4 -4
  45. ccxt/async_support/coinmate.py +2 -2
  46. ccxt/async_support/coinmetro.py +2 -2
  47. ccxt/async_support/coinone.py +1 -1
  48. ccxt/async_support/coinsph.py +2 -2
  49. ccxt/async_support/coinspot.py +1 -1
  50. ccxt/async_support/cryptocom.py +14 -14
  51. ccxt/async_support/currencycom.py +1 -1
  52. ccxt/async_support/delta.py +2 -2
  53. ccxt/async_support/deribit.py +5 -4
  54. ccxt/async_support/digifinex.py +6 -6
  55. ccxt/async_support/exmo.py +2 -2
  56. ccxt/async_support/gate.py +41 -37
  57. ccxt/async_support/gemini.py +2 -2
  58. ccxt/async_support/hitbtc.py +5 -5
  59. ccxt/async_support/hollaex.py +2 -2
  60. ccxt/async_support/htx.py +11 -11
  61. ccxt/async_support/huobijp.py +4 -4
  62. ccxt/async_support/idex.py +2 -2
  63. ccxt/async_support/independentreserve.py +2 -2
  64. ccxt/async_support/indodax.py +2 -2
  65. ccxt/async_support/kraken.py +45 -5
  66. ccxt/async_support/krakenfutures.py +8 -5
  67. ccxt/async_support/kucoin.py +8 -8
  68. ccxt/async_support/kucoinfutures.py +4 -4
  69. ccxt/async_support/kuna.py +2 -2
  70. ccxt/async_support/latoken.py +3 -3
  71. ccxt/async_support/lbank.py +5 -4
  72. ccxt/async_support/luno.py +1 -1
  73. ccxt/async_support/lykke.py +2 -2
  74. ccxt/async_support/mercado.py +2 -2
  75. ccxt/async_support/mexc.py +7 -6
  76. ccxt/async_support/ndax.py +2 -2
  77. ccxt/async_support/novadax.py +4 -4
  78. ccxt/async_support/oceanex.py +1 -1
  79. ccxt/async_support/okcoin.py +5 -5
  80. ccxt/async_support/okx.py +26 -12
  81. ccxt/async_support/onetrading.py +2 -2
  82. ccxt/async_support/p2b.py +1 -1
  83. ccxt/async_support/paymium.py +3 -3
  84. ccxt/async_support/phemex.py +13 -13
  85. ccxt/async_support/poloniex.py +4 -4
  86. ccxt/async_support/poloniexfutures.py +4 -1
  87. ccxt/async_support/probit.py +5 -5
  88. ccxt/async_support/timex.py +2 -2
  89. ccxt/async_support/tokocrypto.py +4 -4
  90. ccxt/async_support/upbit.py +2 -2
  91. ccxt/async_support/wavesexchange.py +4 -3
  92. ccxt/async_support/wazirx.py +1 -1
  93. ccxt/async_support/whitebit.py +6 -6
  94. ccxt/async_support/woo.py +6 -6
  95. ccxt/async_support/yobit.py +41 -2
  96. ccxt/async_support/zaif.py +2 -2
  97. ccxt/async_support/zonda.py +4 -4
  98. ccxt/base/exchange.py +77 -44
  99. ccxt/base/types.py +10 -0
  100. ccxt/bigone.py +25 -5
  101. ccxt/binance.py +17 -16
  102. ccxt/bingx.py +10 -9
  103. ccxt/bit2c.py +13 -1
  104. ccxt/bitbank.py +2 -2
  105. ccxt/bitbns.py +1 -1
  106. ccxt/bitfinex.py +5 -5
  107. ccxt/bitfinex2.py +386 -40
  108. ccxt/bitflyer.py +5 -5
  109. ccxt/bitforex.py +4 -1
  110. ccxt/bitget.py +11 -11
  111. ccxt/bithumb.py +2 -2
  112. ccxt/bitmart.py +9 -9
  113. ccxt/bitmex.py +3 -3
  114. ccxt/bitopro.py +2 -2
  115. ccxt/bitrue.py +8 -8
  116. ccxt/bitso.py +4 -4
  117. ccxt/bitstamp.py +2 -2
  118. ccxt/bitteam.py +1 -1
  119. ccxt/bitvavo.py +3 -3
  120. ccxt/bl3p.py +1 -1
  121. ccxt/blockchaincom.py +3 -3
  122. ccxt/btcalpha.py +1 -1
  123. ccxt/btcbox.py +1 -1
  124. ccxt/btcmarkets.py +2 -2
  125. ccxt/btcturk.py +1 -1
  126. ccxt/bybit.py +9 -9
  127. ccxt/cex.py +1 -1
  128. ccxt/coinbase.py +16 -6
  129. ccxt/coinbasepro.py +2 -2
  130. ccxt/coincheck.py +1 -1
  131. ccxt/coinex.py +9 -9
  132. ccxt/coinlist.py +4 -4
  133. ccxt/coinmate.py +2 -2
  134. ccxt/coinmetro.py +2 -2
  135. ccxt/coinone.py +1 -1
  136. ccxt/coinsph.py +2 -2
  137. ccxt/coinspot.py +1 -1
  138. ccxt/cryptocom.py +14 -14
  139. ccxt/currencycom.py +1 -1
  140. ccxt/delta.py +2 -2
  141. ccxt/deribit.py +5 -4
  142. ccxt/digifinex.py +6 -6
  143. ccxt/exmo.py +2 -2
  144. ccxt/gate.py +41 -37
  145. ccxt/gemini.py +2 -2
  146. ccxt/hitbtc.py +5 -5
  147. ccxt/hollaex.py +2 -2
  148. ccxt/htx.py +11 -11
  149. ccxt/huobijp.py +4 -4
  150. ccxt/idex.py +2 -2
  151. ccxt/independentreserve.py +2 -2
  152. ccxt/indodax.py +2 -2
  153. ccxt/kraken.py +45 -5
  154. ccxt/krakenfutures.py +8 -5
  155. ccxt/kucoin.py +8 -8
  156. ccxt/kucoinfutures.py +4 -4
  157. ccxt/kuna.py +2 -2
  158. ccxt/latoken.py +3 -3
  159. ccxt/lbank.py +5 -4
  160. ccxt/luno.py +1 -1
  161. ccxt/lykke.py +2 -2
  162. ccxt/mercado.py +2 -2
  163. ccxt/mexc.py +7 -6
  164. ccxt/ndax.py +2 -2
  165. ccxt/novadax.py +4 -4
  166. ccxt/oceanex.py +1 -1
  167. ccxt/okcoin.py +5 -5
  168. ccxt/okx.py +26 -12
  169. ccxt/onetrading.py +2 -2
  170. ccxt/p2b.py +1 -1
  171. ccxt/paymium.py +3 -3
  172. ccxt/phemex.py +13 -13
  173. ccxt/poloniex.py +4 -4
  174. ccxt/poloniexfutures.py +4 -1
  175. ccxt/pro/__init__.py +1 -1
  176. ccxt/pro/alpaca.py +8 -4
  177. ccxt/pro/ascendex.py +1 -2
  178. ccxt/pro/binance.py +14 -10
  179. ccxt/pro/bingx.py +1 -1
  180. ccxt/pro/bitfinex.py +21 -22
  181. ccxt/pro/bitfinex2.py +13 -15
  182. ccxt/pro/bitget.py +3 -1
  183. ccxt/pro/bitmart.py +3 -7
  184. ccxt/pro/bitmex.py +4 -6
  185. ccxt/pro/bitopro.py +2 -4
  186. ccxt/pro/bitrue.py +1 -1
  187. ccxt/pro/bitstamp.py +2 -3
  188. ccxt/pro/bitvavo.py +10 -5
  189. ccxt/pro/blockchaincom.py +22 -22
  190. ccxt/pro/bybit.py +5 -5
  191. ccxt/pro/cex.py +7 -7
  192. ccxt/pro/coinbase.py +3 -2
  193. ccxt/pro/coinbasepro.py +1 -1
  194. ccxt/pro/coinex.py +15 -13
  195. ccxt/pro/currencycom.py +5 -6
  196. ccxt/pro/deribit.py +4 -4
  197. ccxt/pro/exmo.py +15 -13
  198. ccxt/pro/gate.py +1 -1
  199. ccxt/pro/gemini.py +4 -2
  200. ccxt/pro/hitbtc.py +10 -9
  201. ccxt/pro/hollaex.py +2 -2
  202. ccxt/pro/htx.py +6 -6
  203. ccxt/pro/huobijp.py +3 -4
  204. ccxt/pro/idex.py +1 -1
  205. ccxt/pro/independentreserve.py +14 -13
  206. ccxt/pro/kraken.py +10 -14
  207. ccxt/pro/krakenfutures.py +10 -6
  208. ccxt/pro/kucoin.py +10 -10
  209. ccxt/pro/kucoinfutures.py +11 -10
  210. ccxt/pro/lbank.py +10 -10
  211. ccxt/pro/luno.py +12 -14
  212. ccxt/pro/mexc.py +3 -2
  213. ccxt/pro/ndax.py +7 -11
  214. ccxt/pro/okcoin.py +7 -10
  215. ccxt/pro/okx.py +6 -9
  216. ccxt/pro/onetrading.py +16 -15
  217. ccxt/pro/p2b.py +5 -3
  218. ccxt/pro/phemex.py +16 -11
  219. ccxt/pro/poloniex.py +6 -4
  220. ccxt/pro/poloniexfutures.py +13 -9
  221. ccxt/pro/probit.py +15 -12
  222. ccxt/pro/upbit.py +8 -8
  223. ccxt/pro/wazirx.py +6 -3
  224. ccxt/pro/woo.py +9 -7
  225. ccxt/probit.py +5 -5
  226. ccxt/test/base/test_order_book.py +7 -7
  227. ccxt/test/base/test_shared_methods.py +1 -1
  228. ccxt/test/test_async.py +86 -36
  229. ccxt/test/test_sync.py +86 -36
  230. ccxt/timex.py +2 -2
  231. ccxt/tokocrypto.py +4 -4
  232. ccxt/upbit.py +2 -2
  233. ccxt/wavesexchange.py +4 -3
  234. ccxt/wazirx.py +1 -1
  235. ccxt/whitebit.py +6 -6
  236. ccxt/woo.py +6 -6
  237. ccxt/yobit.py +41 -2
  238. ccxt/zaif.py +2 -2
  239. ccxt/zonda.py +4 -4
  240. {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/METADATA +10 -10
  241. ccxt-4.2.34.dist-info/RECORD +438 -0
  242. ccxt-4.2.30.dist-info/RECORD +0 -438
  243. {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
  244. {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/top_level.txt +0 -0
ccxt/pro/poloniex.py CHANGED
@@ -974,13 +974,15 @@ class poloniex(ccxt.async_support.poloniex):
974
974
  bid = self.safe_value(bids, j)
975
975
  price = self.safe_number(bid, 0)
976
976
  amount = self.safe_number(bid, 1)
977
- orderbook['bids'].store(price, amount)
977
+ bidsSide = orderbook['bids']
978
+ bidsSide.store(price, amount)
978
979
  if asks is not None:
979
980
  for j in range(0, len(asks)):
980
981
  ask = self.safe_value(asks, j)
981
982
  price = self.safe_number(ask, 0)
982
983
  amount = self.safe_number(ask, 1)
983
- orderbook['asks'].store(price, amount)
984
+ asksSide = orderbook['asks']
985
+ asksSide.store(price, amount)
984
986
  orderbook['symbol'] = symbol
985
987
  orderbook['timestamp'] = timestamp
986
988
  orderbook['datetime'] = self.iso8601(timestamp)
@@ -1104,12 +1106,12 @@ class poloniex(ccxt.async_support.poloniex):
1104
1106
  if orderId == '0':
1105
1107
  self.handle_error_message(client, item)
1106
1108
  else:
1107
- return self.handle_order_request(client, message)
1109
+ self.handle_order_request(client, message)
1108
1110
  else:
1109
1111
  data = self.safe_value(message, 'data', [])
1110
1112
  dataLength = len(data)
1111
1113
  if dataLength > 0:
1112
- return method(client, message)
1114
+ method(client, message)
1113
1115
 
1114
1116
  def handle_error_message(self, client: Client, message):
1115
1117
  #
@@ -68,17 +68,20 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
68
68
  },
69
69
  })
70
70
 
71
- def negotiate(self, privateChannel, params={}):
71
+ async def negotiate(self, privateChannel, params={}):
72
72
  connectId = 'private' if privateChannel else 'public'
73
73
  urls = self.safe_value(self.options, 'urls', {})
74
74
  if connectId in urls:
75
- return urls[connectId]
75
+ # return urls[connectId]
76
+ storedFuture = urls[connectId]
77
+ return await storedFuture
76
78
  # we store an awaitable to the url
77
79
  # so that multiple calls don't asynchronously
78
80
  # fetch different urls and overwrite each other
79
81
  urls[connectId] = self.spawn(self.negotiate_helper, privateChannel, params)
80
82
  self.options['urls'] = urls
81
- return urls[connectId]
83
+ future = urls[connectId]
84
+ return await future
82
85
 
83
86
  async def negotiate_helper(self, privateChannel, params={}):
84
87
  response = None
@@ -685,7 +688,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
685
688
  messageHash = self.safe_string(message, 'topic')
686
689
  subject = self.safe_string(message, 'subject')
687
690
  if subject == 'received':
688
- return message
691
+ return
689
692
  # At the time of writting self, there is no implementation to easily convert each order into the orderbook so raw messages are returned
690
693
  client.resolve(message, messageHash)
691
694
 
@@ -703,8 +706,9 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
703
706
  topic = self.safe_string(message, 'topic')
704
707
  isSnapshot = topic.find('Depth') >= 0
705
708
  if isSnapshot:
706
- return self.hande_l2_snapshot(client, message)
707
- return self.handle_l2_order_book(client, message)
709
+ self.hande_l2_snapshot(client, message)
710
+ return
711
+ self.handle_l2_order_book(client, message)
708
712
 
709
713
  def handle_l2_order_book(self, client: Client, message):
710
714
  #
@@ -740,7 +744,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
740
744
  snapshotDelay = self.handle_option('watchOrderBook', 'snapshotDelay', 5)
741
745
  if cacheLength == snapshotDelay:
742
746
  limit = 0
743
- self.spawn(self.load_order_book, client, messageHash, symbol, limit)
747
+ self.spawn(self.load_order_book, client, messageHash, symbol, limit, {})
744
748
  orderBook.cache.append(data)
745
749
  return
746
750
  try:
@@ -920,7 +924,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
920
924
  }
921
925
  method = self.safe_value(methods, subject)
922
926
  if method is not None:
923
- return method(client, message)
927
+ method(client, message)
924
928
 
925
929
  def ping(self, client: Client):
926
930
  id = str(self.request_id())
@@ -955,7 +959,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
955
959
  }
956
960
  method = self.safe_value(methods, type)
957
961
  if method is not None:
958
- return method(client, message)
962
+ method(client, message)
959
963
 
960
964
  def handle_authenticate(self, client, message):
961
965
  #
ccxt/pro/probit.py CHANGED
@@ -428,17 +428,17 @@ class probit(ccxt.async_support.probit):
428
428
  symbol = self.safe_symbol(marketId)
429
429
  dataBySide = self.group_by(orderBook, 'side')
430
430
  messageHash = 'orderbook:' + symbol
431
- storedOrderBook = self.safe_value(self.orderbooks, symbol)
432
- if storedOrderBook is None:
433
- storedOrderBook = self.order_book({})
434
- self.orderbooks[symbol] = storedOrderBook
431
+ orderbook = self.safe_value(self.orderbooks, symbol)
432
+ if orderbook is None:
433
+ orderbook = self.order_book({})
434
+ self.orderbooks[symbol] = orderbook
435
435
  reset = self.safe_bool(message, 'reset', False)
436
436
  if reset:
437
437
  snapshot = self.parse_order_book(dataBySide, symbol, None, 'buy', 'sell', 'price', 'quantity')
438
- storedOrderBook.reset(snapshot)
438
+ orderbook.reset(snapshot)
439
439
  else:
440
- self.handle_delta(storedOrderBook, dataBySide)
441
- client.resolve(storedOrderBook, messageHash)
440
+ self.handle_delta(orderbook, dataBySide)
441
+ client.resolve(orderbook, messageHash)
442
442
 
443
443
  def handle_bid_asks(self, bookSide, bidAsks):
444
444
  for i in range(0, len(bidAsks)):
@@ -505,10 +505,12 @@ class probit(ccxt.async_support.probit):
505
505
  #
506
506
  errorCode = self.safe_string(message, 'errorCode')
507
507
  if errorCode is not None:
508
- return self.handle_error_message(client, message)
508
+ self.handle_error_message(client, message)
509
+ return
509
510
  type = self.safe_string(message, 'type')
510
511
  if type == 'authorization':
511
- return self.handle_authenticate(client, message)
512
+ self.handle_authenticate(client, message)
513
+ return
512
514
  handlers = {
513
515
  'marketdata': self.handle_market_data,
514
516
  'balance': self.handle_balance,
@@ -519,7 +521,8 @@ class probit(ccxt.async_support.probit):
519
521
  channel = self.safe_string(message, 'channel')
520
522
  handler = self.safe_value(handlers, channel)
521
523
  if handler is not None:
522
- return handler(client, message)
524
+ handler(client, message)
525
+ return
523
526
  error = NotSupported(self.id + ' handleMessage: unknown message: ' + self.json(message))
524
527
  client.reject(error)
525
528
 
@@ -530,7 +533,7 @@ class probit(ccxt.async_support.probit):
530
533
  expires = self.safe_integer(self.options, 'expires', 0)
531
534
  future = self.safe_value(client.subscriptions, messageHash)
532
535
  if (future is None) or (self.milliseconds() > expires):
533
- response = await self.signIn()
536
+ response = await self.sign_in()
534
537
  #
535
538
  # {
536
539
  # "access_token": "0ttDv/2hTTn3bLi8GP1gKaneiEQ6+0hOBenPrxNQt2s=",
@@ -545,4 +548,4 @@ class probit(ccxt.async_support.probit):
545
548
  }
546
549
  future = self.watch(url, messageHash, self.extend(request, params))
547
550
  client.subscriptions[messageHash] = future
548
- return await future
551
+ return future
ccxt/pro/upbit.py CHANGED
@@ -161,15 +161,15 @@ class upbit(ccxt.async_support.upbit):
161
161
  limit = self.safe_integer(options, 'limit', 15)
162
162
  if type == 'SNAPSHOT':
163
163
  self.orderbooks[symbol] = self.order_book({}, limit)
164
- orderBook = self.orderbooks[symbol]
164
+ orderbook = self.orderbooks[symbol]
165
165
  # upbit always returns a snapshot of 15 topmost entries
166
166
  # the "REALTIME" deltas are not incremental
167
167
  # therefore we reset the orderbook on each update
168
168
  # and reinitialize it again with new bidasks
169
- orderBook.reset({})
170
- orderBook['symbol'] = symbol
171
- bids = orderBook['bids']
172
- asks = orderBook['asks']
169
+ orderbook.reset({})
170
+ orderbook['symbol'] = symbol
171
+ bids = orderbook['bids']
172
+ asks = orderbook['asks']
173
173
  data = self.safe_value(message, 'orderbook_units', [])
174
174
  for i in range(0, len(data)):
175
175
  entry = data[i]
@@ -181,10 +181,10 @@ class upbit(ccxt.async_support.upbit):
181
181
  bids.store(bid_price, bid_size)
182
182
  timestamp = self.safe_integer(message, 'timestamp')
183
183
  datetime = self.iso8601(timestamp)
184
- orderBook['timestamp'] = timestamp
185
- orderBook['datetime'] = datetime
184
+ orderbook['timestamp'] = timestamp
185
+ orderbook['datetime'] = datetime
186
186
  messageHash = 'orderbook:' + marketId
187
- client.resolve(orderBook, messageHash)
187
+ client.resolve(orderbook, messageHash)
188
188
 
189
189
  def handle_trades(self, client: Client, message):
190
190
  # {type: "trade",
ccxt/pro/wazirx.py CHANGED
@@ -698,7 +698,8 @@ class wazirx(ccxt.async_support.wazirx):
698
698
  def handle_message(self, client: Client, message):
699
699
  status = self.safe_string(message, 'status')
700
700
  if status == 'error':
701
- return self.handle_error(client, message)
701
+ self.handle_error(client, message)
702
+ return
702
703
  event = self.safe_string(message, 'event')
703
704
  eventHandlers = {
704
705
  'error': self.handle_error,
@@ -707,7 +708,8 @@ class wazirx(ccxt.async_support.wazirx):
707
708
  }
708
709
  eventHandler = self.safe_value(eventHandlers, event)
709
710
  if eventHandler is not None:
710
- return eventHandler(client, message)
711
+ eventHandler(client, message)
712
+ return
711
713
  stream = self.safe_string(message, 'stream', '')
712
714
  streamHandlers = {
713
715
  'ticker@arr': self.handle_ticker,
@@ -722,7 +724,8 @@ class wazirx(ccxt.async_support.wazirx):
722
724
  for i in range(0, len(streams)):
723
725
  if self.in_array(streams[i], stream):
724
726
  handler = streamHandlers[streams[i]]
725
- return handler(client, message)
727
+ handler(client, message)
728
+ return
726
729
  raise NotSupported(self.id + ' self message type is not supported yet. Message: ' + self.json(message))
727
730
 
728
731
  async def authenticate(self, params={}):
ccxt/pro/woo.py CHANGED
@@ -407,7 +407,7 @@ class woo(ccxt.async_support.woo):
407
407
  return False
408
408
  return True
409
409
 
410
- def authenticate(self, params={}):
410
+ async def authenticate(self, params={}):
411
411
  self.check_required_credentials()
412
412
  url = self.urls['api']['ws']['private'] + '/' + self.uid
413
413
  client = self.client(url)
@@ -786,28 +786,30 @@ class woo(ccxt.async_support.woo):
786
786
  event = self.safe_string(message, 'event')
787
787
  method = self.safe_value(methods, event)
788
788
  if method is not None:
789
- return method(client, message)
789
+ method(client, message)
790
+ return
790
791
  topic = self.safe_string(message, 'topic')
791
792
  if topic is not None:
792
793
  method = self.safe_value(methods, topic)
793
794
  if method is not None:
794
- return method(client, message)
795
+ method(client, message)
796
+ return
795
797
  splitTopic = topic.split('@')
796
798
  splitLength = len(splitTopic)
797
799
  if splitLength == 2:
798
800
  name = self.safe_string(splitTopic, 1)
799
801
  method = self.safe_value(methods, name)
800
802
  if method is not None:
801
- return method(client, message)
803
+ method(client, message)
804
+ return
802
805
  splitName = name.split('_')
803
806
  splitNameLength = len(splitTopic)
804
807
  if splitNameLength == 2:
805
808
  method = self.safe_value(methods, self.safe_string(splitName, 0))
806
809
  if method is not None:
807
- return method(client, message)
808
- return message
810
+ method(client, message)
809
811
 
810
- def ping(self, client):
812
+ def ping(self, client: Client):
811
813
  return {'event': 'ping'}
812
814
 
813
815
  def handle_ping(self, client: Client, message):
ccxt/probit.py CHANGED
@@ -433,8 +433,8 @@ class probit(Exchange, ImplicitAPI):
433
433
  networkList = {}
434
434
  for j in range(0, len(platformsByPriority)):
435
435
  network = platformsByPriority[j]
436
- networkId = self.safe_string(network, 'id')
437
- networkCode = self.network_id_to_code(networkId)
436
+ idInner = self.safe_string(network, 'id')
437
+ networkCode = self.network_id_to_code(idInner)
438
438
  currentDepositSuspended = self.safe_value(network, 'deposit_suspended')
439
439
  currentWithdrawalSuspended = self.safe_value(network, 'withdrawal_suspended')
440
440
  currentDeposit = not currentDepositSuspended
@@ -452,7 +452,7 @@ class probit(Exchange, ImplicitAPI):
452
452
  networkFee = withdrawPlatform
453
453
  break
454
454
  networkList[networkCode] = {
455
- 'id': networkId,
455
+ 'id': idInner,
456
456
  'network': networkCode,
457
457
  'active': currentActive,
458
458
  'deposit': currentDeposit,
@@ -1138,7 +1138,7 @@ class probit(Exchange, ImplicitAPI):
1138
1138
  def cost_to_precision(self, symbol, cost):
1139
1139
  return self.decimal_to_precision(cost, TRUNCATE, self.markets[symbol]['precision']['cost'], self.precisionMode)
1140
1140
 
1141
- def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
1141
+ def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1142
1142
  """
1143
1143
  create a trade order
1144
1144
  :see: https://docs-en.probit.com/reference/order-1
@@ -1331,7 +1331,7 @@ class probit(Exchange, ImplicitAPI):
1331
1331
  data = self.safe_value(response, 'data', [])
1332
1332
  return self.parse_deposit_addresses(data, codes)
1333
1333
 
1334
- def withdraw(self, code: str, amount, address, tag=None, params={}):
1334
+ def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1335
1335
  """
1336
1336
  :see: https://docs-en.probit.com/reference/withdrawal
1337
1337
  make a withdrawal
@@ -15,7 +15,7 @@ sys.path.append(root)
15
15
  from ccxt.base.precise import Precise # noqa E402
16
16
  from ccxt.test.base import test_shared_methods # noqa E402
17
17
 
18
- def test_order_book(exchange, skipped_properties, method, entry, symbol):
18
+ def test_order_book(exchange, skipped_properties, method, orderbook, symbol):
19
19
  format = {
20
20
  'symbol': 'ETH/BTC',
21
21
  'asks': [[exchange.parse_number('1.24'), exchange.parse_number('0.453')], [exchange.parse_number('1.25'), exchange.parse_number('0.157')]],
@@ -25,14 +25,14 @@ def test_order_book(exchange, skipped_properties, method, entry, symbol):
25
25
  'nonce': 134234234,
26
26
  }
27
27
  empty_allowed_for = ['symbol', 'nonce', 'datetime', 'timestamp'] # todo: make timestamp required
28
- test_shared_methods.assert_structure(exchange, skipped_properties, method, entry, format, empty_allowed_for)
29
- test_shared_methods.assert_timestamp_and_datetime(exchange, skipped_properties, method, entry)
30
- test_shared_methods.assert_symbol(exchange, skipped_properties, method, entry, 'symbol', symbol)
31
- log_text = test_shared_methods.log_template(exchange, method, entry)
28
+ test_shared_methods.assert_structure(exchange, skipped_properties, method, orderbook, format, empty_allowed_for)
29
+ test_shared_methods.assert_timestamp_and_datetime(exchange, skipped_properties, method, orderbook)
30
+ test_shared_methods.assert_symbol(exchange, skipped_properties, method, orderbook, 'symbol', symbol)
31
+ log_text = test_shared_methods.log_template(exchange, method, orderbook)
32
32
  #
33
33
  if ('bid' in skipped_properties) or ('ask' in skipped_properties):
34
34
  return
35
- bids = entry['bids']
35
+ bids = orderbook['bids']
36
36
  bids_length = len(bids)
37
37
  for i in range(0, bids_length):
38
38
  current_bid_string = exchange.safe_string(bids[i], 0)
@@ -43,7 +43,7 @@ def test_order_book(exchange, skipped_properties, method, entry, symbol):
43
43
  assert has_correct_order, 'current bid should be > than the next one: ' + current_bid_string + '>' + next_bid_string + log_text
44
44
  test_shared_methods.assert_greater(exchange, skipped_properties, method, bids[i], 0, '0')
45
45
  test_shared_methods.assert_greater(exchange, skipped_properties, method, bids[i], 1, '0')
46
- asks = entry['asks']
46
+ asks = orderbook['asks']
47
47
  asks_length = len(asks)
48
48
  for i in range(0, asks_length):
49
49
  current_ask_string = exchange.safe_string(asks[i], 0)
@@ -40,7 +40,7 @@ def string_value(value):
40
40
 
41
41
  def assert_type(exchange, skipped_properties, entry, key, format):
42
42
  if key in skipped_properties:
43
- return
43
+ return None
44
44
  # because "typeof" string is not transpilable without === 'name', we list them manually at this moment
45
45
  entry_key_val = exchange.safe_value(entry, key)
46
46
  format_key_val = exchange.safe_value(format, key)