ccxt 4.3.52__py2.py3-none-any.whl → 4.3.54__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 (44) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/vertex.py +19 -0
  3. ccxt/async_support/__init__.py +3 -1
  4. ccxt/async_support/base/exchange.py +1 -1
  5. ccxt/async_support/base/ws/cache.py +2 -2
  6. ccxt/async_support/binance.py +1 -1
  7. ccxt/async_support/bingx.py +1 -1
  8. ccxt/async_support/bitget.py +1 -1
  9. ccxt/async_support/bitmart.py +1 -1
  10. ccxt/async_support/coinex.py +1 -1
  11. ccxt/async_support/htx.py +1 -1
  12. ccxt/async_support/hyperliquid.py +27 -25
  13. ccxt/async_support/phemex.py +28 -1
  14. ccxt/async_support/poloniex.py +2 -1
  15. ccxt/async_support/probit.py +9 -5
  16. ccxt/async_support/vertex.py +2811 -0
  17. ccxt/async_support/woo.py +26 -18
  18. ccxt/base/exchange.py +2 -2
  19. ccxt/base/precise.py +10 -0
  20. ccxt/binance.py +1 -1
  21. ccxt/bingx.py +1 -1
  22. ccxt/bitget.py +1 -1
  23. ccxt/bitmart.py +1 -1
  24. ccxt/coinex.py +1 -1
  25. ccxt/htx.py +1 -1
  26. ccxt/hyperliquid.py +27 -25
  27. ccxt/phemex.py +28 -1
  28. ccxt/poloniex.py +2 -1
  29. ccxt/pro/__init__.py +3 -1
  30. ccxt/pro/binance.py +1 -1
  31. ccxt/pro/bybit.py +18 -12
  32. ccxt/pro/kucoin.py +63 -26
  33. ccxt/pro/probit.py +6 -4
  34. ccxt/pro/vertex.py +916 -0
  35. ccxt/probit.py +9 -5
  36. ccxt/test/test_async.py +37 -3
  37. ccxt/test/test_sync.py +37 -3
  38. ccxt/vertex.py +2811 -0
  39. ccxt/woo.py +26 -18
  40. {ccxt-4.3.52.dist-info → ccxt-4.3.54.dist-info}/METADATA +7 -6
  41. {ccxt-4.3.52.dist-info → ccxt-4.3.54.dist-info}/RECORD +44 -40
  42. {ccxt-4.3.52.dist-info → ccxt-4.3.54.dist-info}/LICENSE.txt +0 -0
  43. {ccxt-4.3.52.dist-info → ccxt-4.3.54.dist-info}/WHEEL +0 -0
  44. {ccxt-4.3.52.dist-info → ccxt-4.3.54.dist-info}/top_level.txt +0 -0
ccxt/pro/kucoin.py CHANGED
@@ -153,6 +153,7 @@ class kucoin(ccxt.async_support.kucoin):
153
153
  async def watch_ticker(self, symbol: str, params={}) -> Ticker:
154
154
  """
155
155
  watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
156
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/public-channels/market-snapshot
156
157
  :param str symbol: unified symbol of the market to fetch the ticker for
157
158
  :param dict [params]: extra parameters specific to the exchange API endpoint
158
159
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -367,6 +368,7 @@ class kucoin(ccxt.async_support.kucoin):
367
368
  async def watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
368
369
  """
369
370
  watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
371
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/public-channels/klines
370
372
  :param str symbol: unified symbol of the market to fetch OHLCV data for
371
373
  :param str timeframe: the length of time each candle represents
372
374
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -431,6 +433,7 @@ class kucoin(ccxt.async_support.kucoin):
431
433
  async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
432
434
  """
433
435
  get the list of most recent trades for a particular symbol
436
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/public-channels/match-execution-data
434
437
  :param str symbol: unified symbol of the market to fetch trades for
435
438
  :param int [since]: timestamp in ms of the earliest trade to fetch
436
439
  :param int [limit]: the maximum amount of trades to fetch
@@ -442,6 +445,7 @@ class kucoin(ccxt.async_support.kucoin):
442
445
  async def watch_trades_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Trade]:
443
446
  """
444
447
  get the list of most recent trades for a particular symbol
448
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/public-channels/match-execution-data
445
449
  :param str symbol: unified symbol of the market to fetch trades for
446
450
  :param int [since]: timestamp in ms of the earliest trade to fetch
447
451
  :param int [limit]: the maximum amount of trades to fetch
@@ -741,6 +745,8 @@ class kucoin(ccxt.async_support.kucoin):
741
745
  async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
742
746
  """
743
747
  watches information on multiple orders made by the user
748
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/private-channels/private-order-change
749
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/private-channels/stop-order-event
744
750
  :param str symbol: unified market symbol of the market orders were made in
745
751
  :param int [since]: the earliest time in ms to fetch orders for
746
752
  :param int [limit]: the maximum number of order structures to retrieve
@@ -874,6 +880,9 @@ class kucoin(ccxt.async_support.kucoin):
874
880
  #
875
881
  messageHash = 'orders'
876
882
  data = self.safe_value(message, 'data')
883
+ tradeId = self.safe_string(data, 'tradeId')
884
+ if tradeId is not None:
885
+ self.handle_my_trade(client, message)
877
886
  parsed = self.parse_ws_order(data)
878
887
  symbol = self.safe_string(parsed, 'symbol')
879
888
  orderId = self.safe_string(parsed, 'id')
@@ -898,6 +907,7 @@ class kucoin(ccxt.async_support.kucoin):
898
907
  async def watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
899
908
  """
900
909
  watches information on multiple trades made by the user
910
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/private-channels/private-order-change
901
911
  :param str symbol: unified market symbol of the market trades were made in
902
912
  :param int [since]: the earliest time in ms to fetch trades for
903
913
  :param int [limit]: the maximum number of trade structures to retrieve
@@ -906,7 +916,7 @@ class kucoin(ccxt.async_support.kucoin):
906
916
  """
907
917
  await self.load_markets()
908
918
  url = await self.negotiate(True)
909
- topic = '/spot/tradeFills'
919
+ topic = '/spotMarket/tradeOrders'
910
920
  request: dict = {
911
921
  'privateChannel': True,
912
922
  }
@@ -921,6 +931,34 @@ class kucoin(ccxt.async_support.kucoin):
921
931
  return self.filter_by_symbol_since_limit(trades, symbol, since, limit, True)
922
932
 
923
933
  def handle_my_trade(self, client: Client, message):
934
+ #
935
+ # {
936
+ # "type": "message",
937
+ # "topic": "/spotMarket/tradeOrders",
938
+ # "subject": "orderChange",
939
+ # "channelType": "private",
940
+ # "data": {
941
+ # "symbol": "KCS-USDT",
942
+ # "orderType": "limit",
943
+ # "side": "sell",
944
+ # "orderId": "5efab07953bdea00089965fa",
945
+ # "liquidity": "taker",
946
+ # "type": "match",
947
+ # "feeType": "takerFee",
948
+ # "orderTime": 1670329987026,
949
+ # "size": "0.1",
950
+ # "filledSize": "0.1",
951
+ # "price": "0.938",
952
+ # "matchPrice": "0.96738",
953
+ # "matchSize": "0.1",
954
+ # "tradeId": "5efab07a4ee4c7000a82d6d9",
955
+ # "clientOid": "1593487481000313",
956
+ # "remainSize": "0",
957
+ # "status": "match",
958
+ # "ts": 1670329987311000000
959
+ # }
960
+ # }
961
+ #
924
962
  if self.myTrades is None:
925
963
  limit = self.safe_integer(self.options, 'tradesLimit', 1000)
926
964
  self.myTrades = ArrayCacheBySymbolById(limit)
@@ -934,19 +972,26 @@ class kucoin(ccxt.async_support.kucoin):
934
972
 
935
973
  def parse_ws_trade(self, trade, market=None):
936
974
  #
937
- # {
938
- # "fee": 0.00262148,
939
- # "feeCurrency": "USDT",
940
- # "feeRate": 0.001,
941
- # "orderId": "62417436b29df8000183df2f",
942
- # "orderType": "market",
943
- # "price": 131.074,
944
- # "side": "sell",
945
- # "size": 0.02,
946
- # "symbol": "LTC-USDT",
947
- # "time": "1648456758734571745",
948
- # "tradeId": "624174362e113d2f467b3043"
949
- # }
975
+ # {
976
+ # "symbol": "KCS-USDT",
977
+ # "orderType": "limit",
978
+ # "side": "sell",
979
+ # "orderId": "5efab07953bdea00089965fa",
980
+ # "liquidity": "taker",
981
+ # "type": "match",
982
+ # "feeType": "takerFee",
983
+ # "orderTime": 1670329987026,
984
+ # "size": "0.1",
985
+ # "filledSize": "0.1",
986
+ # "price": "0.938",
987
+ # "matchPrice": "0.96738",
988
+ # "matchSize": "0.1",
989
+ # "tradeId": "5efab07a4ee4c7000a82d6d9",
990
+ # "clientOid": "1593487481000313",
991
+ # "remainSize": "0",
992
+ # "status": "match",
993
+ # "ts": 1670329987311000000
994
+ # }
950
995
  #
951
996
  marketId = self.safe_string(trade, 'symbol')
952
997
  market = self.safe_market(marketId, market, '-')
@@ -957,15 +1002,7 @@ class kucoin(ccxt.async_support.kucoin):
957
1002
  price = self.safe_string(trade, 'price')
958
1003
  amount = self.safe_string(trade, 'size')
959
1004
  order = self.safe_string(trade, 'orderId')
960
- timestamp = self.safe_integer_product(trade, 'time', 0.000001)
961
- feeCurrency = market['quote']
962
- feeRate = self.safe_string(trade, 'feeRate')
963
- feeCost = self.safe_string(trade, 'fee')
964
- fee = {
965
- 'cost': feeCost,
966
- 'rate': feeRate,
967
- 'currency': feeCurrency,
968
- }
1005
+ timestamp = self.safe_integer_product(trade, 'ts', 0.000001)
969
1006
  return self.safe_trade({
970
1007
  'info': trade,
971
1008
  'timestamp': timestamp,
@@ -974,17 +1011,18 @@ class kucoin(ccxt.async_support.kucoin):
974
1011
  'id': tradeId,
975
1012
  'order': order,
976
1013
  'type': type,
977
- 'takerOrMaker': None,
1014
+ 'takerOrMaker': self.safe_string(trade, 'liquidity'),
978
1015
  'side': side,
979
1016
  'price': price,
980
1017
  'amount': amount,
981
1018
  'cost': None,
982
- 'fee': fee,
1019
+ 'fee': None,
983
1020
  }, market)
984
1021
 
985
1022
  async def watch_balance(self, params={}) -> Balances:
986
1023
  """
987
1024
  watch balance and get the amount of funds available for trading or funds locked in orders
1025
+ :see: https://www.kucoin.com/docs/websocket/spot-trading/private-channels/account-balance-change
988
1026
  :param dict [params]: extra parameters specific to the exchange API endpoint
989
1027
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
990
1028
  """
@@ -1079,7 +1117,6 @@ class kucoin(ccxt.async_support.kucoin):
1079
1117
  'trade.l3match': self.handle_trade,
1080
1118
  'trade.candles.update': self.handle_ohlcv,
1081
1119
  'account.balance': self.handle_balance,
1082
- '/spot/tradeFills': self.handle_my_trade,
1083
1120
  'orderChange': self.handle_order,
1084
1121
  'stopOrder': self.handle_order,
1085
1122
  }
ccxt/pro/probit.py CHANGED
@@ -52,8 +52,6 @@ class probit(ccxt.async_support.probit):
52
52
  },
53
53
  'streaming': {
54
54
  },
55
- 'exceptions': {
56
- },
57
55
  })
58
56
 
59
57
  async def watch_balance(self, params={}) -> Balances:
@@ -467,8 +465,12 @@ class probit(ccxt.async_support.probit):
467
465
  code = self.safe_string(message, 'errorCode')
468
466
  errMessage = self.safe_string(message, 'message', '')
469
467
  details = self.safe_value(message, 'details')
470
- # todo - raise properly here
471
- raise ExchangeError(self.id + ' ' + code + ' ' + errMessage + ' ' + self.json(details))
468
+ feedback = self.id + ' ' + code + ' ' + errMessage + ' ' + self.json(details)
469
+ if 'exact' in self.exceptions:
470
+ self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
471
+ if 'broad' in self.exceptions:
472
+ self.throw_broadly_matched_exception(self.exceptions['broad'], errMessage, feedback)
473
+ raise ExchangeError(feedback)
472
474
 
473
475
  def handle_authenticate(self, client: Client, message):
474
476
  #