ccxt 4.4.33__py2.py3-none-any.whl → 4.4.35__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 (100) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/bingx.py +17 -0
  3. ccxt/abstract/bitbank.py +5 -0
  4. ccxt/abstract/bitfinex2.py +1 -0
  5. ccxt/abstract/bitpanda.py +0 -12
  6. ccxt/abstract/bitrue.py +3 -3
  7. ccxt/abstract/ellipx.py +25 -0
  8. ccxt/abstract/okx.py +1 -0
  9. ccxt/abstract/onetrading.py +0 -12
  10. ccxt/abstract/xt.py +5 -5
  11. ccxt/alpaca.py +2 -0
  12. ccxt/async_support/__init__.py +3 -1
  13. ccxt/async_support/alpaca.py +2 -0
  14. ccxt/async_support/base/exchange.py +1 -1
  15. ccxt/async_support/binance.py +19 -15
  16. ccxt/async_support/bingx.py +479 -146
  17. ccxt/async_support/bitbank.py +5 -0
  18. ccxt/async_support/bitbns.py +2 -0
  19. ccxt/async_support/bitfinex2.py +1 -0
  20. ccxt/async_support/bitget.py +174 -40
  21. ccxt/async_support/bitmex.py +3 -1
  22. ccxt/async_support/bitopro.py +3 -0
  23. ccxt/async_support/bitrue.py +3 -2
  24. ccxt/async_support/btcmarkets.py +5 -3
  25. ccxt/async_support/btcturk.py +19 -19
  26. ccxt/async_support/bybit.py +13 -10
  27. ccxt/async_support/cex.py +13 -4
  28. ccxt/async_support/coinbase.py +3 -2
  29. ccxt/async_support/coinex.py +1 -0
  30. ccxt/async_support/coinone.py +7 -7
  31. ccxt/async_support/coinsph.py +7 -7
  32. ccxt/async_support/coinspot.py +39 -39
  33. ccxt/async_support/cryptocom.py +36 -34
  34. ccxt/async_support/ellipx.py +1828 -0
  35. ccxt/async_support/gate.py +143 -39
  36. ccxt/async_support/hyperliquid.py +70 -11
  37. ccxt/async_support/idex.py +3 -4
  38. ccxt/async_support/kraken.py +58 -49
  39. ccxt/async_support/krakenfutures.py +3 -1
  40. ccxt/async_support/kucoin.py +1 -1
  41. ccxt/async_support/okcoin.py +2 -0
  42. ccxt/async_support/okx.py +15 -10
  43. ccxt/async_support/onetrading.py +67 -370
  44. ccxt/async_support/paradex.py +2 -0
  45. ccxt/async_support/phemex.py +16 -0
  46. ccxt/async_support/poloniex.py +3 -1
  47. ccxt/async_support/poloniexfutures.py +3 -1
  48. ccxt/async_support/vertex.py +2 -0
  49. ccxt/async_support/woo.py +69 -69
  50. ccxt/async_support/xt.py +10 -10
  51. ccxt/base/exchange.py +28 -7
  52. ccxt/binance.py +19 -15
  53. ccxt/bingx.py +479 -146
  54. ccxt/bitbank.py +5 -0
  55. ccxt/bitbns.py +2 -0
  56. ccxt/bitfinex2.py +1 -0
  57. ccxt/bitget.py +174 -40
  58. ccxt/bitmex.py +3 -1
  59. ccxt/bitopro.py +3 -0
  60. ccxt/bitrue.py +3 -2
  61. ccxt/btcmarkets.py +5 -3
  62. ccxt/btcturk.py +19 -19
  63. ccxt/bybit.py +13 -10
  64. ccxt/cex.py +13 -4
  65. ccxt/coinbase.py +3 -2
  66. ccxt/coinex.py +1 -0
  67. ccxt/coinone.py +7 -7
  68. ccxt/coinsph.py +7 -7
  69. ccxt/coinspot.py +39 -39
  70. ccxt/cryptocom.py +36 -34
  71. ccxt/ellipx.py +1828 -0
  72. ccxt/gate.py +143 -39
  73. ccxt/hyperliquid.py +70 -11
  74. ccxt/idex.py +3 -4
  75. ccxt/kraken.py +58 -49
  76. ccxt/krakenfutures.py +3 -1
  77. ccxt/kucoin.py +1 -1
  78. ccxt/okcoin.py +2 -0
  79. ccxt/okx.py +15 -10
  80. ccxt/onetrading.py +67 -370
  81. ccxt/paradex.py +2 -0
  82. ccxt/phemex.py +16 -0
  83. ccxt/poloniex.py +3 -1
  84. ccxt/poloniexfutures.py +3 -1
  85. ccxt/pro/__init__.py +1 -1
  86. ccxt/pro/bitrue.py +13 -11
  87. ccxt/pro/idex.py +15 -0
  88. ccxt/pro/probit.py +58 -68
  89. ccxt/pro/woo.py +15 -15
  90. ccxt/test/tests_async.py +29 -2
  91. ccxt/test/tests_helpers.py +0 -2
  92. ccxt/test/tests_sync.py +29 -2
  93. ccxt/vertex.py +2 -0
  94. ccxt/woo.py +69 -69
  95. ccxt/xt.py +10 -10
  96. {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/METADATA +9 -8
  97. {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/RECORD +100 -97
  98. {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/LICENSE.txt +0 -0
  99. {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/WHEEL +0 -0
  100. {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/top_level.txt +0 -0
ccxt/poloniex.py CHANGED
@@ -51,6 +51,8 @@ class poloniex(Exchange, ImplicitAPI):
51
51
  'createMarketOrderWithCost': False,
52
52
  'createMarketSellOrderWithCost': False,
53
53
  'createOrder': True,
54
+ 'createStopOrder': True,
55
+ 'createTriggerOrder': True,
54
56
  'editOrder': True,
55
57
  'fetchBalance': True,
56
58
  'fetchClosedOrder': False,
@@ -1256,7 +1258,7 @@ class poloniex(Exchange, ImplicitAPI):
1256
1258
  :param float amount: how much of currency you want to trade in units of base currency
1257
1259
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1258
1260
  :param dict [params]: extra parameters specific to the exchange API endpoint
1259
- :param float [params.triggerPrice]: *spot only* The price at which a trigger order is triggered at
1261
+ :param float [params.triggerPrice]: the price at which a trigger order is triggered at
1260
1262
  :param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
1261
1263
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1262
1264
  """
ccxt/poloniexfutures.py CHANGED
@@ -42,6 +42,8 @@ class poloniexfutures(Exchange, ImplicitAPI):
42
42
  'future': False,
43
43
  'option': None,
44
44
  'createOrder': True,
45
+ 'createStopOrder': True,
46
+ 'createTriggerOrder': True,
45
47
  'fetchBalance': True,
46
48
  'fetchClosedOrders': True,
47
49
  'fetchCurrencies': False,
@@ -827,7 +829,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
827
829
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
828
830
  :param dict [params]: extra parameters specific to the exchange API endpoint
829
831
  :param float [params.leverage]: Leverage size of the order
830
- :param float [params.stopPrice]: The price at which a trigger order is triggered at
832
+ :param float [params.triggerPrice]: The price at which a trigger order is triggered at
831
833
  :param bool [params.reduceOnly]: A mark to reduce the position size only. Set to False by default. Need to set the position size when reduceOnly is True.
832
834
  :param str [params.timeInForce]: GTC, GTT, IOC, or FOK, default is GTC, limit orders only
833
835
  :param str [params.postOnly]: Post only flag, invalid when timeInForce is IOC or FOK
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.33'
7
+ __version__ = '4.4.35'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/bitrue.py CHANGED
@@ -36,15 +36,17 @@ class bitrue(ccxt.async_support.bitrue):
36
36
  },
37
37
  'api': {
38
38
  'open': {
39
- 'private': {
40
- 'post': {
41
- 'poseidon/api/v1/listenKey': 1,
42
- },
43
- 'put': {
44
- 'poseidon/api/v1/listenKey/{listenKey}': 1,
45
- },
46
- 'delete': {
47
- 'poseidon/api/v1/listenKey/{listenKey}': 1,
39
+ 'v1': {
40
+ 'private': {
41
+ 'post': {
42
+ 'poseidon/api/v1/listenKey': 1,
43
+ },
44
+ 'put': {
45
+ 'poseidon/api/v1/listenKey/{listenKey}': 1,
46
+ },
47
+ 'delete': {
48
+ 'poseidon/api/v1/listenKey/{listenKey}': 1,
49
+ },
48
50
  },
49
51
  },
50
52
  },
@@ -405,7 +407,7 @@ class bitrue(ccxt.async_support.bitrue):
405
407
  async def authenticate(self, params={}):
406
408
  listenKey = self.safe_value(self.options, 'listenKey')
407
409
  if listenKey is None:
408
- response = await self.openPrivatePostPoseidonApiV1ListenKey(params)
410
+ response = await self.openV1PrivatePostPoseidonApiV1ListenKey(params)
409
411
  #
410
412
  # {
411
413
  # "msg": "succ",
@@ -429,7 +431,7 @@ class bitrue(ccxt.async_support.bitrue):
429
431
  'listenKey': listenKey,
430
432
  }
431
433
  try:
432
- await self.openPrivatePutPoseidonApiV1ListenKeyListenKey(self.extend(request, params))
434
+ await self.openV1PrivatePutPoseidonApiV1ListenKeyListenKey(self.extend(request, params))
433
435
  #
434
436
  # ಠ_ಠ
435
437
  # {
ccxt/pro/idex.py CHANGED
@@ -72,6 +72,9 @@ class idex(ccxt.async_support.idex):
72
72
  async def watch_ticker(self, symbol: str, params={}) -> Ticker:
73
73
  """
74
74
  watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
75
+
76
+ https://api-docs-v4.idex.io/#tickers
77
+
75
78
  :param str symbol: unified symbol of the market to fetch the ticker for
76
79
  :param dict [params]: extra parameters specific to the exchange API endpoint
77
80
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -141,6 +144,9 @@ class idex(ccxt.async_support.idex):
141
144
  async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
142
145
  """
143
146
  get the list of most recent trades for a particular symbol
147
+
148
+ https://api-docs-v4.idex.io/#trades
149
+
144
150
  :param str symbol: unified symbol of the market to fetch trades for
145
151
  :param int [since]: timestamp in ms of the earliest trade to fetch
146
152
  :param int [limit]: the maximum amount of trades to fetch
@@ -231,6 +237,9 @@ class idex(ccxt.async_support.idex):
231
237
  async def watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
232
238
  """
233
239
  watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
240
+
241
+ https://api-docs-v4.idex.io/#candles
242
+
234
243
  :param str symbol: unified symbol of the market to fetch OHLCV data for
235
244
  :param str timeframe: the length of time each candle represents
236
245
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -383,6 +392,9 @@ class idex(ccxt.async_support.idex):
383
392
  async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
384
393
  """
385
394
  watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
395
+
396
+ https://api-docs-v4.idex.io/#l2-order-book
397
+
386
398
  :param str symbol: unified symbol of the market to fetch the order book for
387
399
  :param int [limit]: the maximum amount of order book entries to return
388
400
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -478,6 +490,9 @@ class idex(ccxt.async_support.idex):
478
490
  async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
479
491
  """
480
492
  watches information on multiple orders made by the user
493
+
494
+ https://api-docs-v4.idex.io/#orders
495
+
481
496
  :param str symbol: unified market symbol of the market orders were made in
482
497
  :param int [since]: the earliest time in ms to fetch orders for
483
498
  :param int [limit]: the maximum number of order structures to retrieve
ccxt/pro/probit.py CHANGED
@@ -41,15 +41,6 @@ class probit(ccxt.async_support.probit):
41
41
  'filter': 'order_books_l2',
42
42
  'interval': 100, # or 500
43
43
  },
44
- 'watchTrades': {
45
- 'filter': 'recent_trades',
46
- },
47
- 'watchTicker': {
48
- 'filter': 'ticker',
49
- },
50
- 'watchOrders': {
51
- 'channel': 'open_order',
52
- },
53
44
  },
54
45
  'streaming': {
55
46
  },
@@ -66,13 +57,7 @@ class probit(ccxt.async_support.probit):
66
57
  """
67
58
  await self.authenticate(params)
68
59
  messageHash = 'balance'
69
- url = self.urls['api']['ws']
70
- subscribe: dict = {
71
- 'type': 'subscribe',
72
- 'channel': 'balance',
73
- }
74
- request = self.extend(subscribe, params)
75
- return await self.watch(url, messageHash, request, messageHash)
60
+ return await self.subscribe_private(messageHash, 'balance', params)
76
61
 
77
62
  def handle_balance(self, client: Client, message):
78
63
  #
@@ -130,9 +115,8 @@ class probit(ccxt.async_support.probit):
130
115
  :param int [params.interval]: Unit time to synchronize market information(ms). Available units: 100, 500
131
116
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
132
117
  """
133
- filter = None
134
- filter, params = self.handle_option_and_params(params, 'watchTicker', 'filter', 'ticker')
135
- return await self.subscribe_order_book(symbol, 'ticker', filter, params)
118
+ channel = 'ticker'
119
+ return await self.subscribe_public('watchTicker', symbol, 'ticker', channel, params)
136
120
 
137
121
  def handle_ticker(self, client: Client, message):
138
122
  #
@@ -175,9 +159,8 @@ class probit(ccxt.async_support.probit):
175
159
  :param int [params.interval]: Unit time to synchronize market information(ms). Available units: 100, 500
176
160
  :returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
177
161
  """
178
- filter = None
179
- filter, params = self.handle_option_and_params(params, 'watchTrades', 'filter', 'recent_trades')
180
- trades = await self.subscribe_order_book(symbol, 'trades', filter, params)
162
+ channel = 'recent_trades'
163
+ trades = await self.subscribe_public('watchTrades', symbol, 'trades', channel, params)
181
164
  if self.newUpdates:
182
165
  limit = trades.getLimit(symbol, limit)
183
166
  return self.filter_by_symbol_since_limit(trades, symbol, since, limit, True)
@@ -207,10 +190,11 @@ class probit(ccxt.async_support.probit):
207
190
  symbol = self.safe_symbol(marketId)
208
191
  market = self.safe_market(marketId)
209
192
  trades = self.safe_value(message, 'recent_trades', [])
210
- reset = self.safe_bool(message, 'reset', False)
193
+ if self.safe_bool(message, 'reset', False):
194
+ return # see comment in handleMessage
211
195
  messageHash = 'trades:' + symbol
212
196
  stored = self.safe_value(self.trades, symbol)
213
- if stored is None or reset:
197
+ if stored is None:
214
198
  limit = self.safe_integer(self.options, 'tradesLimit', 1000)
215
199
  stored = ArrayCache(limit)
216
200
  self.trades[symbol] = stored
@@ -235,19 +219,11 @@ class probit(ccxt.async_support.probit):
235
219
  """
236
220
  await self.load_markets()
237
221
  await self.authenticate(params)
238
- messageHash = 'myTrades'
222
+ messageHash = 'trades'
239
223
  if symbol is not None:
240
- market = self.market(symbol)
241
- symbol = market['symbol']
224
+ symbol = self.safe_symbol(symbol)
242
225
  messageHash = messageHash + ':' + symbol
243
- url = self.urls['api']['ws']
244
- channel = 'trade_history'
245
- message: dict = {
246
- 'type': 'subscribe',
247
- 'channel': channel,
248
- }
249
- request = self.extend(message, params)
250
- trades = await self.watch(url, messageHash, request, channel)
226
+ trades = await self.subscribe_private(messageHash, 'trade_history', params)
251
227
  if self.newUpdates:
252
228
  limit = trades.getLimit(symbol, limit)
253
229
  return self.filter_by_symbol_since_limit(trades, symbol, since, limit, True)
@@ -276,10 +252,11 @@ class probit(ccxt.async_support.probit):
276
252
  length = len(rawTrades)
277
253
  if length == 0:
278
254
  return
279
- reset = self.safe_bool(message, 'reset', False)
280
- messageHash = 'myTrades'
255
+ if self.safe_bool(message, 'reset', False):
256
+ return # see comment in handleMessage
257
+ messageHash = 'trades'
281
258
  stored = self.myTrades
282
- if (stored is None) or reset:
259
+ if stored is None:
283
260
  limit = self.safe_integer(self.options, 'tradesLimit', 1000)
284
261
  stored = ArrayCacheBySymbolById(limit)
285
262
  self.myTrades = stored
@@ -287,9 +264,15 @@ class probit(ccxt.async_support.probit):
287
264
  tradeSymbols: dict = {}
288
265
  for j in range(0, len(trades)):
289
266
  trade = trades[j]
267
+ # don't include 'executed' state, because it's just blanket state of the trade, emited before actual trade event
268
+ if self.safe_string(trade['info'], 'status') == 'executed':
269
+ continue
290
270
  tradeSymbols[trade['symbol']] = True
291
271
  stored.append(trade)
292
272
  unique = list(tradeSymbols.keys())
273
+ uniqueLength = len(unique)
274
+ if uniqueLength == 0:
275
+ return
293
276
  for i in range(0, len(unique)):
294
277
  symbol = unique[i]
295
278
  symbolSpecificMessageHash = messageHash + ':' + symbol
@@ -310,20 +293,11 @@ class probit(ccxt.async_support.probit):
310
293
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
311
294
  """
312
295
  await self.authenticate(params)
313
- url = self.urls['api']['ws']
314
296
  messageHash = 'orders'
315
297
  if symbol is not None:
316
- market = self.market(symbol)
317
- symbol = market['symbol']
298
+ symbol = self.safe_symbol(symbol)
318
299
  messageHash = messageHash + ':' + symbol
319
- channel = None
320
- channel, params = self.handle_option_and_params(params, 'watchOrders', 'channel', 'open_order')
321
- subscribe: dict = {
322
- 'type': 'subscribe',
323
- 'channel': channel,
324
- }
325
- request = self.extend(subscribe, params)
326
- orders = await self.watch(url, messageHash, request, channel)
300
+ orders = await self.subscribe_private(messageHash, 'open_order', params)
327
301
  if self.newUpdates:
328
302
  limit = orders.getLimit(symbol, limit)
329
303
  return self.filter_by_symbol_since_limit(orders, symbol, since, limit, True)
@@ -388,39 +362,49 @@ class probit(ccxt.async_support.probit):
388
362
  :param dict [params]: extra parameters specific to the exchange API endpoint
389
363
  :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
390
364
  """
391
- filter = None
392
- filter, params = self.handle_option_and_params(params, 'watchOrderBook', 'filter', 'order_books')
393
- orderbook = await self.subscribe_order_book(symbol, 'orderbook', filter, params)
365
+ channel = None
366
+ channel, params = self.handle_option_and_params(params, 'watchOrderBook', 'filter', 'order_books')
367
+ orderbook = await self.subscribe_public('watchOrderBook', symbol, 'orderbook', channel, params)
394
368
  return orderbook.limit()
395
369
 
396
- async def subscribe_order_book(self, symbol: str, messageHash, filter, params={}):
370
+ async def subscribe_private(self, messageHash, channel, params):
371
+ url = self.urls['api']['ws']
372
+ subscribe: dict = {
373
+ 'type': 'subscribe',
374
+ 'channel': channel,
375
+ }
376
+ request = self.extend(subscribe, params)
377
+ subscribeHash = messageHash
378
+ return await self.watch(url, messageHash, request, subscribeHash)
379
+
380
+ async def subscribe_public(self, methodName: str, symbol: str, dataType, filter, params={}):
397
381
  await self.load_markets()
398
382
  market = self.market(symbol)
399
383
  symbol = market['symbol']
400
384
  url = self.urls['api']['ws']
401
385
  client = self.client(url)
402
- interval = None
403
- interval, params = self.handle_option_and_params(params, 'watchOrderBook', 'interval', 100)
404
- subscriptionHash = 'marketdata:' + symbol
405
- messageHash = messageHash + ':' + symbol
386
+ subscribeHash = 'marketdata:' + symbol
387
+ messageHash = dataType + ':' + symbol
406
388
  filters = {}
407
- if subscriptionHash in client.subscriptions:
389
+ if subscribeHash in client.subscriptions:
408
390
  # already subscribed
409
- filters = client.subscriptions[subscriptionHash]
391
+ filters = client.subscriptions[subscribeHash]
410
392
  if not (filter in filters):
411
393
  # resubscribe
412
- del client.subscriptions[subscriptionHash]
394
+ del client.subscriptions[subscribeHash]
413
395
  filters[filter] = True
414
396
  keys = list(filters.keys())
415
- message: dict = {
397
+ interval = None
398
+ interval, params = self.handle_option_and_params(params, methodName, 'interval', 100)
399
+ request: dict = {
400
+ 'type': 'subscribe',
416
401
  'channel': 'marketdata',
417
- 'interval': interval,
418
402
  'market_id': market['id'],
419
- 'type': 'subscribe',
420
403
  'filter': keys,
404
+ 'interval': interval,
421
405
  }
422
- request = self.extend(message, params)
423
- return await self.watch(url, messageHash, request, messageHash, filters)
406
+ request = self.extend(request, params)
407
+ return await self.watch(url, messageHash, request, subscribeHash, filters)
424
408
 
425
409
  def handle_order_book(self, client: Client, message, orderBook):
426
410
  #
@@ -493,7 +477,8 @@ class probit(ccxt.async_support.probit):
493
477
  result = self.safe_string(message, 'result')
494
478
  future = client.subscriptions['authenticated']
495
479
  if result == 'ok':
496
- future.resolve(True)
480
+ messageHash = 'authenticated'
481
+ client.resolve(message, messageHash)
497
482
  else:
498
483
  future.reject(message)
499
484
  del client.subscriptions['authenticated']
@@ -503,10 +488,12 @@ class probit(ccxt.async_support.probit):
503
488
  if ticker is not None:
504
489
  self.handle_ticker(client, message)
505
490
  trades = self.safe_value(message, 'recent_trades', [])
506
- if len(trades):
491
+ tradesLength = len(trades)
492
+ if tradesLength:
507
493
  self.handle_trades(client, message)
508
494
  orderBook = self.safe_value_n(message, ['order_books', 'order_books_l1', 'order_books_l2', 'order_books_l3', 'order_books_l4'], [])
509
- if len(orderBook):
495
+ orderBookLength = len(orderBook)
496
+ if orderBookLength:
510
497
  self.handle_order_book(client, message, orderBook)
511
498
 
512
499
  def handle_message(self, client: Client, message):
@@ -519,6 +506,9 @@ class probit(ccxt.async_support.probit):
519
506
  # }
520
507
  # }
521
508
  #
509
+ # Note about 'reset' field
510
+ # 'reset': True field - it happens once after initial subscription, which just returns old items by the moment of subscription(like "fetchMyTrades" does)
511
+ #
522
512
  errorCode = self.safe_string(message, 'errorCode')
523
513
  if errorCode is not None:
524
514
  self.handle_error_message(client, message)
ccxt/pro/woo.py CHANGED
@@ -35,14 +35,14 @@ class woo(ccxt.async_support.woo):
35
35
  'urls': {
36
36
  'api': {
37
37
  'ws': {
38
- 'public': 'wss://wss.woo.org/ws/stream',
39
- 'private': 'wss://wss.woo.org/v2/ws/private/stream',
38
+ 'public': 'wss://wss.woox.io/ws/stream',
39
+ 'private': 'wss://wss.woox.io/v2/ws/private/stream',
40
40
  },
41
41
  },
42
42
  'test': {
43
43
  'ws': {
44
- 'public': 'wss://wss.staging.woo.org/ws/stream',
45
- 'private': 'wss://wss.staging.woo.org/v2/ws/private/stream',
44
+ 'public': 'wss://wss.staging.woox.io/ws/stream',
45
+ 'private': 'wss://wss.staging.woox.io/v2/ws/private/stream',
46
46
  },
47
47
  },
48
48
  },
@@ -93,8 +93,8 @@ class woo(ccxt.async_support.woo):
93
93
  async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
94
94
  """
95
95
 
96
- https://docs.woo.org/#orderbookupdate
97
- https://docs.woo.org/#orderbook
96
+ https://docs.woox.io/#orderbookupdate
97
+ https://docs.woox.io/#orderbook
98
98
 
99
99
  watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
100
100
  :param str symbol: unified symbol of the market to fetch the order book for
@@ -327,7 +327,7 @@ class woo(ccxt.async_support.woo):
327
327
  async def watch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
328
328
  """
329
329
 
330
- https://docs.woo.org/#24h-tickers
330
+ https://docs.woox.io/#24h-tickers
331
331
 
332
332
  watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
333
333
  :param str[] symbols: unified symbol of the market to fetch the ticker for
@@ -461,7 +461,7 @@ class woo(ccxt.async_support.woo):
461
461
  """
462
462
  watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
463
463
 
464
- https://docs.woo.org/#k-line
464
+ https://docs.woox.io/#k-line
465
465
 
466
466
  :param str symbol: unified symbol of the market to fetch OHLCV data for
467
467
  :param str timeframe: the length of time each candle represents
@@ -534,7 +534,7 @@ class woo(ccxt.async_support.woo):
534
534
  """
535
535
  watches information on multiple trades made in a market
536
536
 
537
- https://docs.woo.org/#trade
537
+ https://docs.woox.io/#trade
538
538
 
539
539
  :param str symbol: unified market symbol of the market trades were made in
540
540
  :param int [since]: the earliest time in ms to fetch trades for
@@ -716,8 +716,8 @@ class woo(ccxt.async_support.woo):
716
716
  async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
717
717
  """
718
718
 
719
- https://docs.woo.org/#executionreport
720
- https://docs.woo.org/#algoexecutionreportv2
719
+ https://docs.woox.io/#executionreport
720
+ https://docs.woox.io/#algoexecutionreportv2
721
721
 
722
722
  watches information on multiple orders made by the user
723
723
  :param str symbol: unified market symbol of the market orders were made in
@@ -749,8 +749,8 @@ class woo(ccxt.async_support.woo):
749
749
  async def watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
750
750
  """
751
751
 
752
- https://docs.woo.org/#executionreport
753
- https://docs.woo.org/#algoexecutionreportv2
752
+ https://docs.woox.io/#executionreport
753
+ https://docs.woox.io/#algoexecutionreportv2
754
754
 
755
755
  watches information on multiple trades made by the user
756
756
  :param str symbol: unified market symbol of the market orders were made in
@@ -974,7 +974,7 @@ class woo(ccxt.async_support.woo):
974
974
  async def watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
975
975
  """
976
976
 
977
- https://docs.woo.org/#position-push
977
+ https://docs.woox.io/#position-push
978
978
 
979
979
  watch all open positions
980
980
  :param str[]|None symbols: list of unified market symbols
@@ -1080,7 +1080,7 @@ class woo(ccxt.async_support.woo):
1080
1080
  async def watch_balance(self, params={}) -> Balances:
1081
1081
  """
1082
1082
 
1083
- https://docs.woo.org/#balance
1083
+ https://docs.woox.io/#balance
1084
1084
 
1085
1085
  watch balance and get the amount of funds available for trading or funds locked in orders
1086
1086
  :param dict [params]: extra parameters specific to the exchange API endpoint
ccxt/test/tests_async.py CHANGED
@@ -714,7 +714,7 @@ class testMainClass:
714
714
  result[key] = value
715
715
  return result
716
716
 
717
- def assert_new_and_stored_output(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
717
+ def assert_new_and_stored_output_inner(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
718
718
  if is_null_value(new_output) and is_null_value(stored_output):
719
719
  return True
720
720
  if not new_output and not stored_output:
@@ -796,6 +796,25 @@ class testMainClass:
796
796
  self.assert_static_error(numeric_new_output == numeric_stored_output, message_error, stored_output, new_output, asserting_key)
797
797
  return True # c# requ
798
798
 
799
+ def assert_new_and_stored_output(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
800
+ try:
801
+ return self.assert_new_and_stored_output_inner(exchange, skip_keys, new_output, stored_output, strict_type_check, asserting_key)
802
+ except Exception as e:
803
+ if self.info:
804
+ error_message = self.var_to_string(new_output) + '(calculated)' + ' != ' + self.var_to_string(stored_output) + '(stored)'
805
+ dump('[TEST_FAILURE_DETAIL]' + error_message)
806
+ raise e
807
+
808
+ def var_to_string(self, obj=None):
809
+ new_string = None
810
+ if obj is None:
811
+ new_string = 'undefined'
812
+ elif is_null_value(obj):
813
+ new_string = 'null'
814
+ else:
815
+ new_string = json_stringify(obj)
816
+ return new_string
817
+
799
818
  def assert_static_request_output(self, exchange, type, skip_keys, stored_url, request_url, stored_output, new_output):
800
819
  if stored_url != request_url:
801
820
  # remove the host part from the url
@@ -1064,7 +1083,15 @@ class testMainClass:
1064
1083
  promises.append(self.test_exchange_request_statically(exchange_name, exchange_data, test_name))
1065
1084
  else:
1066
1085
  promises.append(self.test_exchange_response_statically(exchange_name, exchange_data, test_name))
1067
- await asyncio.gather(*promises)
1086
+ try:
1087
+ await asyncio.gather(*promises)
1088
+ except Exception as e:
1089
+ if type == 'request':
1090
+ self.request_tests_failed = True
1091
+ else:
1092
+ self.response_tests_failed = True
1093
+ error_message = '[' + self.lang + '][STATIC_REQUEST]' + '[' + exchange.id + ']' + str(e)
1094
+ dump('[TEST_FAILURE]' + error_message)
1068
1095
  if self.request_tests_failed or self.response_tests_failed:
1069
1096
  exit_script(1)
1070
1097
  else:
@@ -40,7 +40,6 @@ class Argv(object):
40
40
  ws_tests = False
41
41
  request_tests = False
42
42
  response_tests = False
43
- token_bucket = False
44
43
  sandbox = False
45
44
  privateOnly = False
46
45
  private = False
@@ -58,7 +57,6 @@ class Argv(object):
58
57
 
59
58
  argv = Argv()
60
59
  parser = argparse.ArgumentParser()
61
- parser.add_argument('--token_bucket', action='store_true', help='enable token bucket experimental test')
62
60
  parser.add_argument('--sandbox', action='store_true', help='enable sandbox mode')
63
61
  parser.add_argument('--privateOnly', action='store_true', help='run private tests only')
64
62
  parser.add_argument('--private', action='store_true', help='run private tests')
ccxt/test/tests_sync.py CHANGED
@@ -711,7 +711,7 @@ class testMainClass:
711
711
  result[key] = value
712
712
  return result
713
713
 
714
- def assert_new_and_stored_output(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
714
+ def assert_new_and_stored_output_inner(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
715
715
  if is_null_value(new_output) and is_null_value(stored_output):
716
716
  return True
717
717
  if not new_output and not stored_output:
@@ -793,6 +793,25 @@ class testMainClass:
793
793
  self.assert_static_error(numeric_new_output == numeric_stored_output, message_error, stored_output, new_output, asserting_key)
794
794
  return True # c# requ
795
795
 
796
+ def assert_new_and_stored_output(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
797
+ try:
798
+ return self.assert_new_and_stored_output_inner(exchange, skip_keys, new_output, stored_output, strict_type_check, asserting_key)
799
+ except Exception as e:
800
+ if self.info:
801
+ error_message = self.var_to_string(new_output) + '(calculated)' + ' != ' + self.var_to_string(stored_output) + '(stored)'
802
+ dump('[TEST_FAILURE_DETAIL]' + error_message)
803
+ raise e
804
+
805
+ def var_to_string(self, obj=None):
806
+ new_string = None
807
+ if obj is None:
808
+ new_string = 'undefined'
809
+ elif is_null_value(obj):
810
+ new_string = 'null'
811
+ else:
812
+ new_string = json_stringify(obj)
813
+ return new_string
814
+
796
815
  def assert_static_request_output(self, exchange, type, skip_keys, stored_url, request_url, stored_output, new_output):
797
816
  if stored_url != request_url:
798
817
  # remove the host part from the url
@@ -1061,7 +1080,15 @@ class testMainClass:
1061
1080
  promises.append(self.test_exchange_request_statically(exchange_name, exchange_data, test_name))
1062
1081
  else:
1063
1082
  promises.append(self.test_exchange_response_statically(exchange_name, exchange_data, test_name))
1064
- (promises)
1083
+ try:
1084
+ (promises)
1085
+ except Exception as e:
1086
+ if type == 'request':
1087
+ self.request_tests_failed = True
1088
+ else:
1089
+ self.response_tests_failed = True
1090
+ error_message = '[' + self.lang + '][STATIC_REQUEST]' + '[' + exchange.id + ']' + str(e)
1091
+ dump('[TEST_FAILURE]' + error_message)
1065
1092
  if self.request_tests_failed or self.response_tests_failed:
1066
1093
  exit_script(1)
1067
1094
  else:
ccxt/vertex.py CHANGED
@@ -55,6 +55,8 @@ class vertex(Exchange, ImplicitAPI):
55
55
  'createOrder': True,
56
56
  'createOrders': True,
57
57
  'createReduceOnlyOrder': True,
58
+ 'createStopOrder': True,
59
+ 'createTriggerOrder': True,
58
60
  'editOrder': False,
59
61
  'fetchAccounts': False,
60
62
  'fetchBalance': True,