ccxt 4.5.0__py2.py3-none-any.whl → 4.5.2__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 (64) hide show
  1. ccxt/__init__.py +1 -5
  2. ccxt/ascendex.py +1 -1
  3. ccxt/async_support/__init__.py +1 -5
  4. ccxt/async_support/ascendex.py +1 -1
  5. ccxt/async_support/base/exchange.py +1 -1
  6. ccxt/async_support/binance.py +17 -12
  7. ccxt/async_support/bitget.py +1 -1
  8. ccxt/async_support/coinbase.py +46 -34
  9. ccxt/async_support/gate.py +31 -17
  10. ccxt/async_support/gemini.py +1 -1
  11. ccxt/async_support/hibachi.py +1 -1
  12. ccxt/async_support/hyperliquid.py +13 -2
  13. ccxt/async_support/indodax.py +11 -12
  14. ccxt/async_support/kraken.py +1 -8
  15. ccxt/async_support/krakenfutures.py +25 -25
  16. ccxt/async_support/mexc.py +2 -1
  17. ccxt/async_support/okx.py +2 -2
  18. ccxt/async_support/poloniex.py +1 -1
  19. ccxt/async_support/timex.py +35 -0
  20. ccxt/async_support/tradeogre.py +32 -0
  21. ccxt/async_support/wavesexchange.py +33 -0
  22. ccxt/async_support/zonda.py +12 -0
  23. ccxt/base/exchange.py +7 -1
  24. ccxt/binance.py +17 -12
  25. ccxt/bitget.py +1 -1
  26. ccxt/coinbase.py +46 -34
  27. ccxt/gate.py +31 -17
  28. ccxt/gemini.py +1 -1
  29. ccxt/hibachi.py +1 -1
  30. ccxt/hyperliquid.py +13 -2
  31. ccxt/indodax.py +11 -12
  32. ccxt/kraken.py +1 -8
  33. ccxt/krakenfutures.py +25 -25
  34. ccxt/mexc.py +2 -1
  35. ccxt/okx.py +2 -2
  36. ccxt/poloniex.py +1 -1
  37. ccxt/pro/__init__.py +1 -3
  38. ccxt/pro/bitget.py +328 -75
  39. ccxt/pro/bitmart.py +1 -1
  40. ccxt/pro/bybit.py +8 -10
  41. ccxt/pro/gate.py +8 -1
  42. ccxt/pro/gemini.py +6 -2
  43. ccxt/pro/hyperliquid.py +6 -0
  44. ccxt/pro/kraken.py +4 -6
  45. ccxt/pro/lbank.py +56 -2
  46. ccxt/pro/mexc.py +1 -1
  47. ccxt/test/tests_async.py +2 -25
  48. ccxt/test/tests_sync.py +2 -25
  49. ccxt/timex.py +35 -0
  50. ccxt/tradeogre.py +32 -0
  51. ccxt/wavesexchange.py +33 -0
  52. ccxt/zonda.py +12 -0
  53. {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/METADATA +111 -113
  54. {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/RECORD +57 -64
  55. ccxt/abstract/ellipx.py +0 -25
  56. ccxt/abstract/vertex.py +0 -19
  57. ccxt/async_support/ellipx.py +0 -2029
  58. ccxt/async_support/vertex.py +0 -3050
  59. ccxt/ellipx.py +0 -2029
  60. ccxt/pro/vertex.py +0 -948
  61. ccxt/vertex.py +0 -3050
  62. {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/LICENSE.txt +0 -0
  63. {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/WHEEL +0 -0
  64. {ccxt-4.5.0.dist-info → ccxt-4.5.2.dist-info}/top_level.txt +0 -0
ccxt/pro/bitmart.py CHANGED
@@ -215,7 +215,7 @@ class bitmart(ccxt.async_support.bitmart):
215
215
  # "fz_bal":"0.100000000000000000000000000000"
216
216
  # }
217
217
  # ],
218
- # "event_time":"1701632345415",
218
+ # "event_time":"1701632345416",
219
219
  # "event_type":"TRANSACTION_COMPLETED"
220
220
  # }
221
221
  # ],
ccxt/pro/bybit.py CHANGED
@@ -848,16 +848,14 @@ class bybit(ccxt.async_support.bybit):
848
848
  if market['option']:
849
849
  limit = 100
850
850
  else:
851
- if not market['spot']:
852
- if market['option']:
853
- if (limit != 25) and (limit != 100):
854
- raise BadRequest(self.id + ' watchOrderBookForSymbols() can only use limit 25 and 100 for option markets.')
855
- elif (limit != 1) and (limit != 50) and (limit != 200) and (limit != 500):
856
- # bybit only support limit 1, 50, 200, 500 for contract
857
- raise BadRequest(self.id + ' watchOrderBookForSymbols() can only use limit 1, 50, 200 and 500 for swap and future markets.')
858
- else:
859
- if (limit != 1) and (limit != 50) and (limit != 200):
860
- raise BadRequest(self.id + ' watchOrderBookForSymbols() can only use limit 1,50, and 200 for spot markets.')
851
+ limits = {
852
+ 'spot': [1, 50, 200, 1000],
853
+ 'option': [25, 100],
854
+ 'default': [1, 50, 200, 500, 1000],
855
+ }
856
+ selectedLimits = self.safe_list_2(limits, market['type'], 'default')
857
+ if not self.in_array(limit, selectedLimits):
858
+ raise BadRequest(self.id + ' watchOrderBookForSymbols(): for ' + market['type'] + ' markets limit can be one of: ' + self.json(selectedLimits))
861
859
  topics = []
862
860
  messageHashes = []
863
861
  for i in range(0, len(symbols)):
ccxt/pro/gate.py CHANGED
@@ -365,6 +365,13 @@ class gate(ccxt.async_support.gate):
365
365
  async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
366
366
  """
367
367
  watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
368
+
369
+ https://www.gate.com/docs/developers/apiv4/ws/en/#order-book-channel
370
+ https://www.gate.com/docs/developers/apiv4/ws/en/#order-book-v2-api
371
+ https://www.gate.com/docs/developers/futures/ws/en/#order-book-api
372
+ https://www.gate.com/docs/developers/futures/ws/en/#order-book-v2-api
373
+ https://www.gate.com/docs/developers/delivery/ws/en/#order-book-api
374
+
368
375
  :param str symbol: unified symbol of the market to fetch the order book for
369
376
  :param int [limit]: the maximum amount of order book entries to return
370
377
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -381,7 +388,7 @@ class gate(ccxt.async_support.gate):
381
388
  url = self.get_url_by_market(market)
382
389
  payload = [marketId, interval]
383
390
  if limit is None:
384
- limit = 100
391
+ limit = 100 # max 100 atm
385
392
  if market['contract']:
386
393
  stringLimit = str(limit)
387
394
  payload.append(stringLimit)
ccxt/pro/gemini.py CHANGED
@@ -471,11 +471,15 @@ class gemini(ccxt.async_support.gemini):
471
471
  currentBidAsk['timestamp'] = timestamp
472
472
  currentBidAsk['datetime'] = self.iso8601(timestamp)
473
473
  currentBidAsk['info'] = rawBidAskChanges
474
+ bidsAsksDict = {}
475
+ bidsAsksDict[symbol] = currentBidAsk
474
476
  self.bidsasks[symbol] = currentBidAsk
475
- client.resolve(currentBidAsk, messageHash)
477
+ client.resolve(bidsAsksDict, messageHash)
476
478
 
477
- async def helper_for_watch_multiple_construct(self, itemHashName: str, symbols: List[str], params={}):
479
+ async def helper_for_watch_multiple_construct(self, itemHashName: str, symbols: List[str] = None, params={}):
478
480
  await self.load_markets()
481
+ if symbols is None:
482
+ raise NotSupported(self.id + ' watchMultiple requires at least one symbol')
479
483
  symbols = self.market_symbols(symbols, None, False, True, True)
480
484
  firstMarket = self.market(symbols[0])
481
485
  if not firstMarket['spot'] and not firstMarket['linear']:
ccxt/pro/hyperliquid.py CHANGED
@@ -104,6 +104,10 @@ class hyperliquid(ccxt.async_support.hyperliquid):
104
104
  await self.load_markets()
105
105
  order, globalParams = self.parseCreateEditOrderArgs(None, symbol, type, side, amount, price, params)
106
106
  orders = await self.create_orders_ws([order], globalParams)
107
+ ordersLength = len(orders)
108
+ if ordersLength == 0:
109
+ # not sure why but it is happening sometimes
110
+ return self.safe_order({})
107
111
  parsedOrder = orders[0]
108
112
  return parsedOrder
109
113
 
@@ -905,6 +909,8 @@ class hyperliquid(ccxt.async_support.hyperliquid):
905
909
  return True
906
910
  data = self.safe_dict(message, 'data', {})
907
911
  id = self.safe_string(message, 'id')
912
+ if id is None:
913
+ id = self.safe_string(data, 'id')
908
914
  response = self.safe_dict(data, 'response', {})
909
915
  payload = self.safe_dict(response, 'payload', {})
910
916
  status = self.safe_string(payload, 'status')
ccxt/pro/kraken.py CHANGED
@@ -86,6 +86,7 @@ class kraken(ccxt.async_support.kraken):
86
86
  'broad': {
87
87
  'Already subscribed': BadRequest,
88
88
  'Currency pair not in ISO 4217-A3 format': BadSymbol,
89
+ 'Currency pair not supported': BadSymbol,
89
90
  'Malformed request': BadRequest,
90
91
  'Pair field must be an array': BadRequest,
91
92
  'Pair field unsupported for self subscription type': BadRequest,
@@ -1612,7 +1613,7 @@ class kraken(ccxt.async_support.kraken):
1612
1613
  #
1613
1614
  errorMessage = self.safe_string_2(message, 'errorMessage', 'error')
1614
1615
  if errorMessage is not None:
1615
- # requestId = self.safe_value_2(message, 'reqid', 'req_id')
1616
+ requestId = self.safe_string_2(message, 'reqid', 'req_id')
1616
1617
  broad = self.exceptions['ws']['broad']
1617
1618
  broadKey = self.find_broadly_matched_key(broad, errorMessage)
1618
1619
  exception = None
@@ -1620,11 +1621,8 @@ class kraken(ccxt.async_support.kraken):
1620
1621
  exception = ExchangeError(errorMessage) # c# requirement to convert the errorMessage to string
1621
1622
  else:
1622
1623
  exception = broad[broadKey](errorMessage)
1623
- # if requestId is not None:
1624
- # client.reject(exception, requestId)
1625
- # else:
1626
- client.reject(exception)
1627
- # }
1624
+ if requestId is not None:
1625
+ client.reject(exception, requestId)
1628
1626
  return False
1629
1627
  return True
1630
1628
 
ccxt/pro/lbank.py CHANGED
@@ -6,7 +6,7 @@
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
8
8
  import math
9
- from ccxt.base.types import Any, Int, Order, OrderBook, Str, Ticker, Trade
9
+ from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Str, Ticker, Trade
10
10
  from ccxt.async_support.base.ws.client import Client
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -22,7 +22,7 @@ class lbank(ccxt.async_support.lbank):
22
22
  'fetchOrderBookWs': True,
23
23
  'fetchTickerWs': True,
24
24
  'fetchTradesWs': True,
25
- 'watchBalance': False,
25
+ 'watchBalance': True,
26
26
  'watchTicker': True,
27
27
  'watchTickers': False,
28
28
  'watchTrades': True,
@@ -658,6 +658,59 @@ class lbank(ccxt.async_support.lbank):
658
658
  }
659
659
  return self.safe_string(statuses, status, status)
660
660
 
661
+ async def watch_balance(self, params={}) -> Balances:
662
+ """
663
+ watch balance and get the amount of funds available for trading or funds locked in orders
664
+
665
+ https://www.lbank.com/docs/index.html#update-subscribed-asset
666
+
667
+ :param dict [params]: extra parameters specific to the exchange API endpoint
668
+ :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
669
+ """
670
+ await self.load_markets()
671
+ key = await self.authenticate(params)
672
+ url = self.urls['api']['ws']
673
+ messageHash = 'balance'
674
+ message: dict = {
675
+ 'action': 'subscribe',
676
+ 'subscribe': 'assetUpdate',
677
+ 'subscribeKey': key,
678
+ }
679
+ request = self.deep_extend(message, params)
680
+ return await self.watch(url, messageHash, request, messageHash, request)
681
+
682
+ def handle_balance(self, client: Client, message):
683
+ #
684
+ # {
685
+ # "data": {
686
+ # "asset": "114548.31881315",
687
+ # "assetCode": "usdt",
688
+ # "free": "97430.6739041",
689
+ # "freeze": "17117.64490905",
690
+ # "time": 1627300043270,
691
+ # "type": "ORDER_CREATE"
692
+ # },
693
+ # "SERVER": "V2",
694
+ # "type": "assetUpdate",
695
+ # "TS": "2021-07-26T19:48:03.548"
696
+ # }
697
+ #
698
+ data = self.safe_dict(message, 'data', {})
699
+ timestamp = self.parse8601(self.safe_string(message, 'TS'))
700
+ datetime = self.iso8601(timestamp)
701
+ self.balance['info'] = data
702
+ self.balance['timestamp'] = timestamp
703
+ self.balance['datetime'] = datetime
704
+ currencyId = self.safe_string(data, 'assetCode')
705
+ code = self.safe_currency_code(currencyId)
706
+ account = self.account()
707
+ account['free'] = self.safe_string(data, 'free')
708
+ account['used'] = self.safe_string(data, 'freeze')
709
+ account['total'] = self.safe_string(data, 'asset')
710
+ self.balance[code] = account
711
+ self.balance = self.safe_balance(self.balance)
712
+ client.resolve(self.balance, 'balance')
713
+
661
714
  async def fetch_order_book_ws(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
662
715
  """
663
716
 
@@ -827,6 +880,7 @@ class lbank(ccxt.async_support.lbank):
827
880
  'trade': self.handle_trades,
828
881
  'tick': self.handle_ticker,
829
882
  'orderUpdate': self.handle_orders,
883
+ 'assetUpdate': self.handle_balance,
830
884
  }
831
885
  handler = self.safe_value(handlers, type)
832
886
  if handler is not None:
ccxt/pro/mexc.py CHANGED
@@ -1368,7 +1368,7 @@ class mexc(ccxt.async_support.mexc):
1368
1368
  }
1369
1369
  return self.safe_order({
1370
1370
  'id': self.safe_string(order, 'id'),
1371
- 'clientOrderId': self.safe_string(order, 'clientOrderId'),
1371
+ 'clientOrderId': self.safe_string(order, 'clientId'),
1372
1372
  'timestamp': timestamp,
1373
1373
  'datetime': self.iso8601(timestamp),
1374
1374
  'lastTradeTimestamp': None,
ccxt/test/tests_async.py CHANGED
@@ -1188,7 +1188,7 @@ class testMainClass:
1188
1188
  # -----------------------------------------------------------------------------
1189
1189
  # --- Init of brokerId tests functions-----------------------------------------
1190
1190
  # -----------------------------------------------------------------------------
1191
- promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.test_vertex(), self.test_paradex(), self.test_hashkey(), self.test_coincatch(), self.test_defx(), self.test_cryptomus(), self.test_derive(), self.test_mode_trade()]
1191
+ promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.test_paradex(), self.test_hashkey(), self.test_coincatch(), self.test_defx(), self.test_cryptomus(), self.test_derive(), self.test_mode_trade()]
1192
1192
  await asyncio.gather(*promises)
1193
1193
  success_message = '[' + self.lang + '][TEST_SUCCESS] brokerId tests passed.'
1194
1194
  dump('[INFO]' + success_message)
@@ -1253,7 +1253,7 @@ class testMainClass:
1253
1253
 
1254
1254
  async def test_okx(self):
1255
1255
  exchange = self.init_offline_exchange('okx')
1256
- id = 'e847386590ce4dBC'
1256
+ id = '6b9ad766b55dBCDE'
1257
1257
  spot_order_request = None
1258
1258
  try:
1259
1259
  await exchange.create_order('BTC/USDT', 'limit', 'buy', 1, 20000)
@@ -1604,29 +1604,6 @@ class testMainClass:
1604
1604
  await close(exchange)
1605
1605
  return True
1606
1606
 
1607
- async def test_vertex(self):
1608
- exchange = self.init_offline_exchange('vertex')
1609
- exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
1610
- exchange.privateKey = 'c33b1eb4b53108bf52e10f636d8c1236c04c33a712357ba3543ab45f48a5cb0b'
1611
- exchange.options['v1contracts'] = {
1612
- 'chain_id': '42161',
1613
- 'endpoint_addr': '0xbbee07b3e8121227afcfe1e2b82772246226128e',
1614
- 'book_addrs': ['0x0000000000000000000000000000000000000000', '0x70e5911371472e406f1291c621d1c8f207764d73', '0xf03f457a30e598d5020164a339727ef40f2b8fbc', '0x1c6281a78aa0ed88949c319cba5f0f0de2ce8353', '0xfe653438a1a4a7f56e727509c341d60a7b54fa91', '0xb6304e9a6ca241376a5fc9294daa8fca65ddcdcd', '0x01ec802ae0ab1b2cc4f028b9fe6eb954aef06ed1', '0x0000000000000000000000000000000000000000', '0x9c52d5c4df5a68955ad088a781b4ab364a861e9e', '0x0000000000000000000000000000000000000000', '0x2a3bcda1bb3ef649f3571c96c597c3d2b25edc79', '0x0000000000000000000000000000000000000000', '0x0492ff9807f82856781488015ef7aa5526c0edd6', '0x0000000000000000000000000000000000000000', '0xea884c82418ebc21cd080b8f40ecc4d06a6a6883', '0x0000000000000000000000000000000000000000', '0x5ecf68f983253a818ca8c17a56a4f2fb48d6ec6b', '0x0000000000000000000000000000000000000000', '0xba3f57a977f099905531f7c2f294aad7b56ed254', '0x0000000000000000000000000000000000000000', '0x0ac8c26d207d0c6aabb3644fea18f530c4d6fc8e', '0x0000000000000000000000000000000000000000', '0x8bd80ad7630b3864bed66cf28f548143ea43dc3b', '0x0000000000000000000000000000000000000000', '0x045391227fc4b2cdd27b95f066864225afc9314e', '0x0000000000000000000000000000000000000000', '0x7d512bef2e6cfd7e7f5f6b2f8027e3728eb7b6c3', '0x0000000000000000000000000000000000000000', '0x678a6c5003b56b5e9a81559e9a0df880407c796f', '0x0000000000000000000000000000000000000000', '0x14b5a17208fa98843cc602b3f74e31c95ded3567', '0xe442a89a07b3888ab10579fbb2824aeceff3a282', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xac28ac205275d7c2d6877bea8657cebe04fd9ae9', '0x0000000000000000000000000000000000000000', '0xed811409bfea901e75cb19ba347c08a154e860c9', '0x0000000000000000000000000000000000000000', '0x0f7afcb1612b305626cff84f84e4169ba2d0f12c', '0x0000000000000000000000000000000000000000', '0xe4b8d903db2ce2d3891ef04cfc3ac56330c1b0c3', '0x5f44362bad629846b7455ad9d36bbc3759a3ef62', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xa64e04ed4b223a71e524dc7ebb7f28e422ccfdde', '0x0000000000000000000000000000000000000000', '0x2ee573caab73c1d8cf0ca6bd3589b67de79628a4', '0x0000000000000000000000000000000000000000', '0x01bb96883a8a478d4410387d4aaf11067edc2c74', '0x0000000000000000000000000000000000000000', '0xe7ed0c559d905436a867cddf07e06921d572363c', '0x0000000000000000000000000000000000000000', '0xa94f9e3433c92a5cd1925494811a67b1943557d9', '0x0000000000000000000000000000000000000000', '0xa63de7f89ba1270b85f3dcc193ff1a1390a7c7c7', '0x0000000000000000000000000000000000000000', '0xc8b0b37dffe3a711a076dc86dd617cc203f36121', '0x0000000000000000000000000000000000000000', '0x646df48947ff785fe609969ff634e7be9d1c34cd', '0x0000000000000000000000000000000000000000', '0x42582b404b0bec4a266631a0e178840b107a0c69', '0x0000000000000000000000000000000000000000', '0x36a94bc3edb1b629d1413091e22dc65fa050f17f', '0x0000000000000000000000000000000000000000', '0xb398d00b5a336f0ad33cfb352fd7646171cec442', '0x0000000000000000000000000000000000000000', '0xb4bc3b00de98e1c0498699379f6607b1f00bd5a1', '0x0000000000000000000000000000000000000000', '0xfe8b7baf68952bac2c04f386223d2013c1b4c601', '0x0000000000000000000000000000000000000000', '0x9c8764ec71f175c97c6c2fd558eb6546fcdbea32', '0x0000000000000000000000000000000000000000', '0x94d31188982c8eccf243e555b22dc57de1dba4e1', '0x0000000000000000000000000000000000000000', '0x407c5e2fadd7555be927c028bc358daa907c797a', '0x0000000000000000000000000000000000000000', '0x7e97da2dbbbdd7fb313cf9dc0581ac7cec999c70', '0x0000000000000000000000000000000000000000', '0x7f8d2662f64dd468c423805f98a6579ad59b28fa', '0x0000000000000000000000000000000000000000', '0x3398adf63fed17cbadd6080a1fb771e6a2a55958', '0x0000000000000000000000000000000000000000', '0xba8910a1d7ab62129729047d453091a1e6356170', '0x0000000000000000000000000000000000000000', '0xdc054bce222fe725da0f17abcef38253bd8bb745', '0x0000000000000000000000000000000000000000', '0xca21693467d0a5ea9e10a5a7c5044b9b3837e694', '0x0000000000000000000000000000000000000000', '0xe0b02de2139256dbae55cf350094b882fbe629ea', '0x0000000000000000000000000000000000000000', '0x02c38368a6f53858aab5a3a8d91d73eb59edf9b9', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xfe8c4778843c3cb047ffe7c0c0154a724c05cab9', '0x0000000000000000000000000000000000000000', '0xe2e88862d9b7379e21c82fc4aec8d71bddbcdb4b', '0x0000000000000000000000000000000000000000', '0xbbaff9e73b30f9cea5c01481f12de75050947fd6', '0x0000000000000000000000000000000000000000', '0xa20f6f381fe0fec5a1035d37ebf8890726377ab9', '0x0000000000000000000000000000000000000000', '0xbad68032d012bf35d3a2a177b242e86684027ed0', '0x0000000000000000000000000000000000000000', '0x0e61ca37f0c67e8a8794e45e264970a2a23a513c', '0x0000000000000000000000000000000000000000', '0xa77b7048e378c5270b15918449ededf87c3a3db3', '0x0000000000000000000000000000000000000000', '0x15afca1e6f02b556fa6551021b3493a1e4a7f44f'],
1615
- }
1616
- id = 5930043274845996
1617
- await exchange.load_markets()
1618
- request = None
1619
- try:
1620
- await exchange.create_order('BTC/USDC:USDC', 'limit', 'buy', 1, 20000)
1621
- except Exception as e:
1622
- request = json_parse(exchange.last_request_body)
1623
- order = request['place_order']
1624
- broker_id = order['id']
1625
- assert broker_id == id, 'vertex - id: ' + str(id) + ' different from broker_id: ' + str(broker_id)
1626
- if not is_sync():
1627
- await close(exchange)
1628
- return True
1629
-
1630
1607
  async def test_paradex(self):
1631
1608
  exchange = self.init_offline_exchange('paradex')
1632
1609
  exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
ccxt/test/tests_sync.py CHANGED
@@ -1185,7 +1185,7 @@ class testMainClass:
1185
1185
  # -----------------------------------------------------------------------------
1186
1186
  # --- Init of brokerId tests functions-----------------------------------------
1187
1187
  # -----------------------------------------------------------------------------
1188
- promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.test_vertex(), self.test_paradex(), self.test_hashkey(), self.test_coincatch(), self.test_defx(), self.test_cryptomus(), self.test_derive(), self.test_mode_trade()]
1188
+ promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.test_paradex(), self.test_hashkey(), self.test_coincatch(), self.test_defx(), self.test_cryptomus(), self.test_derive(), self.test_mode_trade()]
1189
1189
  (promises)
1190
1190
  success_message = '[' + self.lang + '][TEST_SUCCESS] brokerId tests passed.'
1191
1191
  dump('[INFO]' + success_message)
@@ -1250,7 +1250,7 @@ class testMainClass:
1250
1250
 
1251
1251
  def test_okx(self):
1252
1252
  exchange = self.init_offline_exchange('okx')
1253
- id = 'e847386590ce4dBC'
1253
+ id = '6b9ad766b55dBCDE'
1254
1254
  spot_order_request = None
1255
1255
  try:
1256
1256
  exchange.create_order('BTC/USDT', 'limit', 'buy', 1, 20000)
@@ -1601,29 +1601,6 @@ class testMainClass:
1601
1601
  close(exchange)
1602
1602
  return True
1603
1603
 
1604
- def test_vertex(self):
1605
- exchange = self.init_offline_exchange('vertex')
1606
- exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
1607
- exchange.privateKey = 'c33b1eb4b53108bf52e10f636d8c1236c04c33a712357ba3543ab45f48a5cb0b'
1608
- exchange.options['v1contracts'] = {
1609
- 'chain_id': '42161',
1610
- 'endpoint_addr': '0xbbee07b3e8121227afcfe1e2b82772246226128e',
1611
- 'book_addrs': ['0x0000000000000000000000000000000000000000', '0x70e5911371472e406f1291c621d1c8f207764d73', '0xf03f457a30e598d5020164a339727ef40f2b8fbc', '0x1c6281a78aa0ed88949c319cba5f0f0de2ce8353', '0xfe653438a1a4a7f56e727509c341d60a7b54fa91', '0xb6304e9a6ca241376a5fc9294daa8fca65ddcdcd', '0x01ec802ae0ab1b2cc4f028b9fe6eb954aef06ed1', '0x0000000000000000000000000000000000000000', '0x9c52d5c4df5a68955ad088a781b4ab364a861e9e', '0x0000000000000000000000000000000000000000', '0x2a3bcda1bb3ef649f3571c96c597c3d2b25edc79', '0x0000000000000000000000000000000000000000', '0x0492ff9807f82856781488015ef7aa5526c0edd6', '0x0000000000000000000000000000000000000000', '0xea884c82418ebc21cd080b8f40ecc4d06a6a6883', '0x0000000000000000000000000000000000000000', '0x5ecf68f983253a818ca8c17a56a4f2fb48d6ec6b', '0x0000000000000000000000000000000000000000', '0xba3f57a977f099905531f7c2f294aad7b56ed254', '0x0000000000000000000000000000000000000000', '0x0ac8c26d207d0c6aabb3644fea18f530c4d6fc8e', '0x0000000000000000000000000000000000000000', '0x8bd80ad7630b3864bed66cf28f548143ea43dc3b', '0x0000000000000000000000000000000000000000', '0x045391227fc4b2cdd27b95f066864225afc9314e', '0x0000000000000000000000000000000000000000', '0x7d512bef2e6cfd7e7f5f6b2f8027e3728eb7b6c3', '0x0000000000000000000000000000000000000000', '0x678a6c5003b56b5e9a81559e9a0df880407c796f', '0x0000000000000000000000000000000000000000', '0x14b5a17208fa98843cc602b3f74e31c95ded3567', '0xe442a89a07b3888ab10579fbb2824aeceff3a282', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xac28ac205275d7c2d6877bea8657cebe04fd9ae9', '0x0000000000000000000000000000000000000000', '0xed811409bfea901e75cb19ba347c08a154e860c9', '0x0000000000000000000000000000000000000000', '0x0f7afcb1612b305626cff84f84e4169ba2d0f12c', '0x0000000000000000000000000000000000000000', '0xe4b8d903db2ce2d3891ef04cfc3ac56330c1b0c3', '0x5f44362bad629846b7455ad9d36bbc3759a3ef62', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xa64e04ed4b223a71e524dc7ebb7f28e422ccfdde', '0x0000000000000000000000000000000000000000', '0x2ee573caab73c1d8cf0ca6bd3589b67de79628a4', '0x0000000000000000000000000000000000000000', '0x01bb96883a8a478d4410387d4aaf11067edc2c74', '0x0000000000000000000000000000000000000000', '0xe7ed0c559d905436a867cddf07e06921d572363c', '0x0000000000000000000000000000000000000000', '0xa94f9e3433c92a5cd1925494811a67b1943557d9', '0x0000000000000000000000000000000000000000', '0xa63de7f89ba1270b85f3dcc193ff1a1390a7c7c7', '0x0000000000000000000000000000000000000000', '0xc8b0b37dffe3a711a076dc86dd617cc203f36121', '0x0000000000000000000000000000000000000000', '0x646df48947ff785fe609969ff634e7be9d1c34cd', '0x0000000000000000000000000000000000000000', '0x42582b404b0bec4a266631a0e178840b107a0c69', '0x0000000000000000000000000000000000000000', '0x36a94bc3edb1b629d1413091e22dc65fa050f17f', '0x0000000000000000000000000000000000000000', '0xb398d00b5a336f0ad33cfb352fd7646171cec442', '0x0000000000000000000000000000000000000000', '0xb4bc3b00de98e1c0498699379f6607b1f00bd5a1', '0x0000000000000000000000000000000000000000', '0xfe8b7baf68952bac2c04f386223d2013c1b4c601', '0x0000000000000000000000000000000000000000', '0x9c8764ec71f175c97c6c2fd558eb6546fcdbea32', '0x0000000000000000000000000000000000000000', '0x94d31188982c8eccf243e555b22dc57de1dba4e1', '0x0000000000000000000000000000000000000000', '0x407c5e2fadd7555be927c028bc358daa907c797a', '0x0000000000000000000000000000000000000000', '0x7e97da2dbbbdd7fb313cf9dc0581ac7cec999c70', '0x0000000000000000000000000000000000000000', '0x7f8d2662f64dd468c423805f98a6579ad59b28fa', '0x0000000000000000000000000000000000000000', '0x3398adf63fed17cbadd6080a1fb771e6a2a55958', '0x0000000000000000000000000000000000000000', '0xba8910a1d7ab62129729047d453091a1e6356170', '0x0000000000000000000000000000000000000000', '0xdc054bce222fe725da0f17abcef38253bd8bb745', '0x0000000000000000000000000000000000000000', '0xca21693467d0a5ea9e10a5a7c5044b9b3837e694', '0x0000000000000000000000000000000000000000', '0xe0b02de2139256dbae55cf350094b882fbe629ea', '0x0000000000000000000000000000000000000000', '0x02c38368a6f53858aab5a3a8d91d73eb59edf9b9', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xfe8c4778843c3cb047ffe7c0c0154a724c05cab9', '0x0000000000000000000000000000000000000000', '0xe2e88862d9b7379e21c82fc4aec8d71bddbcdb4b', '0x0000000000000000000000000000000000000000', '0xbbaff9e73b30f9cea5c01481f12de75050947fd6', '0x0000000000000000000000000000000000000000', '0xa20f6f381fe0fec5a1035d37ebf8890726377ab9', '0x0000000000000000000000000000000000000000', '0xbad68032d012bf35d3a2a177b242e86684027ed0', '0x0000000000000000000000000000000000000000', '0x0e61ca37f0c67e8a8794e45e264970a2a23a513c', '0x0000000000000000000000000000000000000000', '0xa77b7048e378c5270b15918449ededf87c3a3db3', '0x0000000000000000000000000000000000000000', '0x15afca1e6f02b556fa6551021b3493a1e4a7f44f'],
1612
- }
1613
- id = 5930043274845996
1614
- exchange.load_markets()
1615
- request = None
1616
- try:
1617
- exchange.create_order('BTC/USDC:USDC', 'limit', 'buy', 1, 20000)
1618
- except Exception as e:
1619
- request = json_parse(exchange.last_request_body)
1620
- order = request['place_order']
1621
- broker_id = order['id']
1622
- assert broker_id == id, 'vertex - id: ' + str(id) + ' different from broker_id: ' + str(broker_id)
1623
- if not is_sync():
1624
- close(exchange)
1625
- return True
1626
-
1627
1604
  def test_paradex(self):
1628
1605
  exchange = self.init_offline_exchange('paradex')
1629
1606
  exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
ccxt/timex.py CHANGED
@@ -39,17 +39,27 @@ class timex(Exchange, ImplicitAPI):
39
39
  'future': False,
40
40
  'option': False,
41
41
  'addMargin': False,
42
+ 'borrowCrossMargin': False,
43
+ 'borrowIsolatedMargin': False,
44
+ 'borrowMargin': False,
42
45
  'cancelOrder': True,
43
46
  'cancelOrders': True,
47
+ 'closeAllPositions': False,
48
+ 'closePosition': False,
44
49
  'createOrder': True,
45
50
  'createReduceOnlyOrder': False,
46
51
  'createStopLimitOrder': False,
47
52
  'createStopMarketOrder': False,
48
53
  'createStopOrder': False,
49
54
  'editOrder': True,
55
+ 'fetchAllGreeks': False,
50
56
  'fetchBalance': True,
57
+ 'fetchBorrowInterest': False,
58
+ 'fetchBorrowRate': False,
51
59
  'fetchBorrowRateHistories': False,
52
60
  'fetchBorrowRateHistory': False,
61
+ 'fetchBorrowRates': False,
62
+ 'fetchBorrowRatesPerSymbol': False,
53
63
  'fetchClosedOrders': True,
54
64
  'fetchCrossBorrowRate': False,
55
65
  'fetchCrossBorrowRates': False,
@@ -60,21 +70,40 @@ class timex(Exchange, ImplicitAPI):
60
70
  'fetchDepositAddressesByNetwork': False,
61
71
  'fetchDeposits': True,
62
72
  'fetchFundingHistory': False,
73
+ 'fetchFundingInterval': False,
74
+ 'fetchFundingIntervals': False,
63
75
  'fetchFundingRate': False,
64
76
  'fetchFundingRateHistory': False,
65
77
  'fetchFundingRates': False,
78
+ 'fetchGreeks': False,
66
79
  'fetchIndexOHLCV': False,
67
80
  'fetchIsolatedBorrowRate': False,
68
81
  'fetchIsolatedBorrowRates': False,
82
+ 'fetchIsolatedPositions': False,
69
83
  'fetchLeverage': False,
84
+ 'fetchLeverages': False,
70
85
  'fetchLeverageTiers': False,
86
+ 'fetchLiquidations': False,
87
+ 'fetchLongShortRatio': False,
88
+ 'fetchLongShortRatioHistory': False,
89
+ 'fetchMarginAdjustmentHistory': False,
71
90
  'fetchMarginMode': False,
91
+ 'fetchMarginModes': False,
92
+ 'fetchMarketLeverageTiers': False,
72
93
  'fetchMarkets': True,
73
94
  'fetchMarkOHLCV': False,
95
+ 'fetchMarkPrice': False,
96
+ 'fetchMarkPrices': False,
97
+ 'fetchMyLiquidations': False,
98
+ 'fetchMySettlementHistory': False,
74
99
  'fetchMyTrades': True,
75
100
  'fetchOHLCV': True,
101
+ 'fetchOpenInterest': False,
76
102
  'fetchOpenInterestHistory': False,
103
+ 'fetchOpenInterests': False,
77
104
  'fetchOpenOrders': True,
105
+ 'fetchOption': False,
106
+ 'fetchOptionChain': False,
78
107
  'fetchOrder': True,
79
108
  'fetchOrderBook': True,
80
109
  'fetchPosition': False,
@@ -85,15 +114,21 @@ class timex(Exchange, ImplicitAPI):
85
114
  'fetchPositionsHistory': False,
86
115
  'fetchPositionsRisk': False,
87
116
  'fetchPremiumIndexOHLCV': False,
117
+ 'fetchSettlementHistory': False,
88
118
  'fetchTicker': True,
89
119
  'fetchTickers': True,
90
120
  'fetchTime': True,
91
121
  'fetchTrades': True,
92
122
  'fetchTradingFee': True, # maker fee only
123
+ 'fetchUnderlyingAssets': False,
124
+ 'fetchVolatilityHistory': False,
93
125
  'fetchWithdrawal': False,
94
126
  'fetchWithdrawals': True,
95
127
  'reduceMargin': False,
128
+ 'repayCrossMargin': False,
129
+ 'repayIsolatedMargin': False,
96
130
  'setLeverage': False,
131
+ 'setMargin': False,
97
132
  'setMarginMode': False,
98
133
  'setPositionMode': False,
99
134
  },
ccxt/tradeogre.py CHANGED
@@ -33,6 +33,9 @@ class tradeogre(Exchange, ImplicitAPI):
33
33
  'future': False,
34
34
  'option': False,
35
35
  'addMargin': False,
36
+ 'borrowCrossMargin': False,
37
+ 'borrowIsolatedMargin': False,
38
+ 'borrowMargin': False,
36
39
  'cancelAllOrders': True,
37
40
  'cancelOrder': True,
38
41
  'cancelOrders': False,
@@ -48,9 +51,14 @@ class tradeogre(Exchange, ImplicitAPI):
48
51
  'createStopMarketOrder': False,
49
52
  'createStopOrder': False,
50
53
  'fetchAccounts': False,
54
+ 'fetchAllGreeks': False,
51
55
  'fetchBalance': True,
52
56
  'fetchBorrowInterest': False,
57
+ 'fetchBorrowRate': False,
58
+ 'fetchBorrowRateHistories': False,
53
59
  'fetchBorrowRateHistory': False,
60
+ 'fetchBorrowRates': False,
61
+ 'fetchBorrowRatesPerSymbol': False,
54
62
  'fetchClosedOrders': False,
55
63
  'fetchCrossBorrowRate': False,
56
64
  'fetchCrossBorrowRates': False,
@@ -61,23 +69,42 @@ class tradeogre(Exchange, ImplicitAPI):
61
69
  'fetchDeposits': False,
62
70
  'fetchDepositsWithdrawals': False,
63
71
  'fetchFundingHistory': False,
72
+ 'fetchFundingInterval': False,
73
+ 'fetchFundingIntervals': False,
64
74
  'fetchFundingRate': False,
65
75
  'fetchFundingRateHistory': False,
66
76
  'fetchFundingRates': False,
77
+ 'fetchGreeks': False,
67
78
  'fetchIndexOHLCV': False,
68
79
  'fetchIsolatedBorrowRate': False,
69
80
  'fetchIsolatedBorrowRates': False,
81
+ 'fetchIsolatedPositions': False,
70
82
  'fetchLedger': False,
71
83
  'fetchLedgerEntry': False,
84
+ 'fetchLeverage': False,
85
+ 'fetchLeverages': False,
72
86
  'fetchLeverageTiers': False,
87
+ 'fetchLiquidations': False,
88
+ 'fetchLongShortRatio': False,
89
+ 'fetchLongShortRatioHistory': False,
90
+ 'fetchMarginAdjustmentHistory': False,
91
+ 'fetchMarginMode': False,
92
+ 'fetchMarginModes': False,
73
93
  'fetchMarketLeverageTiers': False,
74
94
  'fetchMarkets': True,
75
95
  'fetchMarkOHLCV': False,
96
+ 'fetchMarkPrice': False,
97
+ 'fetchMarkPrices': False,
98
+ 'fetchMyLiquidations': False,
99
+ 'fetchMySettlementHistory': False,
76
100
  'fetchMyTrades': False,
77
101
  'fetchOHLCV': True,
78
102
  'fetchOpenInterest': False,
79
103
  'fetchOpenInterestHistory': False,
104
+ 'fetchOpenInterests': False,
80
105
  'fetchOpenOrders': True,
106
+ 'fetchOption': False,
107
+ 'fetchOptionChain': False,
81
108
  'fetchOrder': True,
82
109
  'fetchOrderBook': True,
83
110
  'fetchOrderBooks': False,
@@ -91,6 +118,7 @@ class tradeogre(Exchange, ImplicitAPI):
91
118
  'fetchPositionsHistory': False,
92
119
  'fetchPositionsRisk': False,
93
120
  'fetchPremiumIndexOHLCV': False,
121
+ 'fetchSettlementHistory': False,
94
122
  'fetchTicker': True,
95
123
  'fetchTickers': True,
96
124
  'fetchTrades': True,
@@ -99,10 +127,14 @@ class tradeogre(Exchange, ImplicitAPI):
99
127
  'fetchTransactionFees': False,
100
128
  'fetchTransactions': False,
101
129
  'fetchTransfers': False,
130
+ 'fetchUnderlyingAssets': False,
131
+ 'fetchVolatilityHistory': False,
102
132
  'fetchWithdrawAddresses': False,
103
133
  'fetchWithdrawal': False,
104
134
  'fetchWithdrawals': False,
105
135
  'reduceMargin': False,
136
+ 'repayCrossMargin': False,
137
+ 'repayIsolatedMargin': False,
106
138
  'setLeverage': False,
107
139
  'setMargin': False,
108
140
  'setMarginMode': False,
ccxt/wavesexchange.py CHANGED
@@ -41,6 +41,9 @@ class wavesexchange(Exchange, ImplicitAPI):
41
41
  'future': False,
42
42
  'option': False,
43
43
  'addMargin': False,
44
+ 'borrowCrossMargin': False,
45
+ 'borrowIsolatedMargin': False,
46
+ 'borrowMargin': False,
44
47
  'cancelOrder': True,
45
48
  'closeAllPositions': False,
46
49
  'closePosition': False,
@@ -50,9 +53,14 @@ class wavesexchange(Exchange, ImplicitAPI):
50
53
  'createStopLimitOrder': False,
51
54
  'createStopMarketOrder': False,
52
55
  'createStopOrder': False,
56
+ 'fetchAllGreeks': False,
53
57
  'fetchBalance': True,
58
+ 'fetchBorrowInterest': False,
59
+ 'fetchBorrowRate': False,
54
60
  'fetchBorrowRateHistories': False,
55
61
  'fetchBorrowRateHistory': False,
62
+ 'fetchBorrowRates': False,
63
+ 'fetchBorrowRatesPerSymbol': False,
56
64
  'fetchClosedOrders': True,
57
65
  'fetchCrossBorrowRate': False,
58
66
  'fetchCrossBorrowRates': False,
@@ -62,21 +70,40 @@ class wavesexchange(Exchange, ImplicitAPI):
62
70
  'fetchDepositWithdrawFee': 'emulated',
63
71
  'fetchDepositWithdrawFees': True,
64
72
  'fetchFundingHistory': False,
73
+ 'fetchFundingInterval': False,
74
+ 'fetchFundingIntervals': False,
65
75
  'fetchFundingRate': False,
66
76
  'fetchFundingRateHistory': False,
67
77
  'fetchFundingRates': False,
78
+ 'fetchGreeks': False,
68
79
  'fetchIndexOHLCV': False,
69
80
  'fetchIsolatedBorrowRate': False,
70
81
  'fetchIsolatedBorrowRates': False,
82
+ 'fetchIsolatedPositions': False,
71
83
  'fetchLeverage': False,
84
+ 'fetchLeverages': False,
72
85
  'fetchLeverageTiers': False,
86
+ 'fetchLiquidations': False,
87
+ 'fetchLongShortRatio': False,
88
+ 'fetchLongShortRatioHistory': False,
89
+ 'fetchMarginAdjustmentHistory': False,
73
90
  'fetchMarginMode': False,
91
+ 'fetchMarginModes': False,
92
+ 'fetchMarketLeverageTiers': False,
74
93
  'fetchMarkets': True,
75
94
  'fetchMarkOHLCV': False,
95
+ 'fetchMarkPrice': False,
96
+ 'fetchMarkPrices': False,
97
+ 'fetchMyLiquidations': False,
98
+ 'fetchMySettlementHistory': False,
76
99
  'fetchMyTrades': True,
77
100
  'fetchOHLCV': True,
101
+ 'fetchOpenInterest': False,
78
102
  'fetchOpenInterestHistory': False,
103
+ 'fetchOpenInterests': False,
79
104
  'fetchOpenOrders': True,
105
+ 'fetchOption': False,
106
+ 'fetchOptionChain': False,
80
107
  'fetchOrder': True,
81
108
  'fetchOrderBook': True,
82
109
  'fetchOrders': True,
@@ -88,14 +115,20 @@ class wavesexchange(Exchange, ImplicitAPI):
88
115
  'fetchPositionsHistory': False,
89
116
  'fetchPositionsRisk': False,
90
117
  'fetchPremiumIndexOHLCV': False,
118
+ 'fetchSettlementHistory': False,
91
119
  'fetchTicker': True,
92
120
  'fetchTickers': True,
93
121
  'fetchTrades': True,
94
122
  'fetchTransfer': False,
95
123
  'fetchTransfers': False,
124
+ 'fetchUnderlyingAssets': False,
125
+ 'fetchVolatilityHistory': False,
96
126
  'reduceMargin': False,
127
+ 'repayCrossMargin': False,
128
+ 'repayIsolatedMargin': False,
97
129
  'sandbox': True,
98
130
  'setLeverage': False,
131
+ 'setMargin': False,
99
132
  'setMarginMode': False,
100
133
  'setPositionMode': False,
101
134
  'signIn': True,