ccxt 4.3.85__py2.py3-none-any.whl → 4.3.87__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 (49) hide show
  1. ccxt/__init__.py +4 -1
  2. ccxt/abstract/hashkey.py +67 -0
  3. ccxt/async_support/__init__.py +4 -1
  4. ccxt/async_support/base/exchange.py +2 -2
  5. ccxt/async_support/binance.py +4 -2
  6. ccxt/async_support/bingx.py +5 -1
  7. ccxt/async_support/bitfinex.py +2 -2
  8. ccxt/async_support/hashkey.py +4061 -0
  9. ccxt/async_support/hyperliquid.py +80 -62
  10. ccxt/async_support/indodax.py +29 -8
  11. ccxt/async_support/kraken.py +32 -5
  12. ccxt/async_support/krakenfutures.py +10 -9
  13. ccxt/async_support/upbit.py +1 -1
  14. ccxt/base/errors.py +7 -1
  15. ccxt/base/exchange.py +2 -2
  16. ccxt/binance.py +4 -2
  17. ccxt/bingx.py +5 -1
  18. ccxt/bitfinex.py +2 -2
  19. ccxt/hashkey.py +4061 -0
  20. ccxt/hyperliquid.py +80 -62
  21. ccxt/indodax.py +29 -8
  22. ccxt/kraken.py +32 -5
  23. ccxt/krakenfutures.py +10 -9
  24. ccxt/pro/__init__.py +3 -1
  25. ccxt/pro/ascendex.py +41 -5
  26. ccxt/pro/bingx.py +13 -12
  27. ccxt/pro/bitget.py +143 -16
  28. ccxt/pro/hashkey.py +783 -0
  29. ccxt/pro/hyperliquid.py +118 -1
  30. ccxt/pro/mexc.py +13 -7
  31. ccxt/pro/p2b.py +30 -7
  32. ccxt/pro/poloniex.py +32 -3
  33. ccxt/pro/poloniexfutures.py +1 -0
  34. ccxt/pro/probit.py +2 -0
  35. ccxt/pro/upbit.py +44 -3
  36. ccxt/pro/vertex.py +1 -0
  37. ccxt/pro/wazirx.py +3 -0
  38. ccxt/pro/whitebit.py +9 -0
  39. ccxt/pro/woo.py +1 -0
  40. ccxt/pro/woofipro.py +1 -0
  41. ccxt/pro/xt.py +1 -0
  42. ccxt/test/tests_async.py +31 -31
  43. ccxt/test/tests_sync.py +31 -31
  44. ccxt/upbit.py +1 -1
  45. {ccxt-4.3.85.dist-info → ccxt-4.3.87.dist-info}/METADATA +9 -6
  46. {ccxt-4.3.85.dist-info → ccxt-4.3.87.dist-info}/RECORD +49 -45
  47. {ccxt-4.3.85.dist-info → ccxt-4.3.87.dist-info}/LICENSE.txt +0 -0
  48. {ccxt-4.3.85.dist-info → ccxt-4.3.87.dist-info}/WHEEL +0 -0
  49. {ccxt-4.3.85.dist-info → ccxt-4.3.87.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.85'
25
+ __version__ = '4.3.87'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -80,6 +80,7 @@ from ccxt.base.errors import RequestTimeout # noqa: F4
80
80
  from ccxt.base.errors import BadResponse # noqa: F401
81
81
  from ccxt.base.errors import NullResponse # noqa: F401
82
82
  from ccxt.base.errors import CancelPending # noqa: F401
83
+ from ccxt.base.errors import UnsubscribeError # noqa: F401
83
84
  from ccxt.base.errors import error_hierarchy # noqa: F401
84
85
 
85
86
  from ccxt.ace import ace # noqa: F401
@@ -142,6 +143,7 @@ from ccxt.fmfwio import fmfwio # noqa: F4
142
143
  from ccxt.gate import gate # noqa: F401
143
144
  from ccxt.gateio import gateio # noqa: F401
144
145
  from ccxt.gemini import gemini # noqa: F401
146
+ from ccxt.hashkey import hashkey # noqa: F401
145
147
  from ccxt.hitbtc import hitbtc # noqa: F401
146
148
  from ccxt.hitbtc3 import hitbtc3 # noqa: F401
147
149
  from ccxt.hollaex import hollaex # noqa: F401
@@ -253,6 +255,7 @@ exchanges = [
253
255
  'gate',
254
256
  'gateio',
255
257
  'gemini',
258
+ 'hashkey',
256
259
  'hitbtc',
257
260
  'hitbtc3',
258
261
  'hollaex',
@@ -0,0 +1,67 @@
1
+ from ccxt.base.types import Entry
2
+
3
+
4
+ class ImplicitAPI:
5
+ public_get_api_v1_exchangeinfo = publicGetApiV1ExchangeInfo = Entry('api/v1/exchangeInfo', 'public', 'GET', {'cost': 5})
6
+ public_get_quote_v1_depth = publicGetQuoteV1Depth = Entry('quote/v1/depth', 'public', 'GET', {'cost': 1})
7
+ public_get_quote_v1_trades = publicGetQuoteV1Trades = Entry('quote/v1/trades', 'public', 'GET', {'cost': 1})
8
+ public_get_quote_v1_klines = publicGetQuoteV1Klines = Entry('quote/v1/klines', 'public', 'GET', {'cost': 1})
9
+ public_get_quote_v1_ticker_24hr = publicGetQuoteV1Ticker24hr = Entry('quote/v1/ticker/24hr', 'public', 'GET', {'cost': 1})
10
+ public_get_quote_v1_ticker_price = publicGetQuoteV1TickerPrice = Entry('quote/v1/ticker/price', 'public', 'GET', {'cost': 1})
11
+ public_get_quote_v1_ticker_bookticker = publicGetQuoteV1TickerBookTicker = Entry('quote/v1/ticker/bookTicker', 'public', 'GET', {'cost': 1})
12
+ public_get_quote_v1_depth_merged = publicGetQuoteV1DepthMerged = Entry('quote/v1/depth/merged', 'public', 'GET', {'cost': 1})
13
+ public_get_quote_v1_markprice = publicGetQuoteV1MarkPrice = Entry('quote/v1/markPrice', 'public', 'GET', {'cost': 1})
14
+ public_get_quote_v1_index = publicGetQuoteV1Index = Entry('quote/v1/index', 'public', 'GET', {'cost': 1})
15
+ public_get_api_v1_futures_fundingrate = publicGetApiV1FuturesFundingRate = Entry('api/v1/futures/fundingRate', 'public', 'GET', {'cost': 1})
16
+ public_get_api_v1_futures_historyfundingrate = publicGetApiV1FuturesHistoryFundingRate = Entry('api/v1/futures/historyFundingRate', 'public', 'GET', {'cost': 1})
17
+ public_get_api_v1_ping = publicGetApiV1Ping = Entry('api/v1/ping', 'public', 'GET', {'cost': 1})
18
+ public_get_api_v1_time = publicGetApiV1Time = Entry('api/v1/time', 'public', 'GET', {'cost': 1})
19
+ private_get_api_v1_spot_order = privateGetApiV1SpotOrder = Entry('api/v1/spot/order', 'private', 'GET', {'cost': 1})
20
+ private_get_api_v1_spot_openorders = privateGetApiV1SpotOpenOrders = Entry('api/v1/spot/openOrders', 'private', 'GET', {'cost': 1})
21
+ private_get_api_v1_spot_tradeorders = privateGetApiV1SpotTradeOrders = Entry('api/v1/spot/tradeOrders', 'private', 'GET', {'cost': 5})
22
+ private_get_api_v1_futures_leverage = privateGetApiV1FuturesLeverage = Entry('api/v1/futures/leverage', 'private', 'GET', {'cost': 1})
23
+ private_get_api_v1_futures_order = privateGetApiV1FuturesOrder = Entry('api/v1/futures/order', 'private', 'GET', {'cost': 1})
24
+ private_get_api_v1_futures_openorders = privateGetApiV1FuturesOpenOrders = Entry('api/v1/futures/openOrders', 'private', 'GET', {'cost': 1})
25
+ private_get_api_v1_futures_usertrades = privateGetApiV1FuturesUserTrades = Entry('api/v1/futures/userTrades', 'private', 'GET', {'cost': 1})
26
+ private_get_api_v1_futures_positions = privateGetApiV1FuturesPositions = Entry('api/v1/futures/positions', 'private', 'GET', {'cost': 1})
27
+ private_get_api_v1_futures_historyorders = privateGetApiV1FuturesHistoryOrders = Entry('api/v1/futures/historyOrders', 'private', 'GET', {'cost': 1})
28
+ private_get_api_v1_futures_balance = privateGetApiV1FuturesBalance = Entry('api/v1/futures/balance', 'private', 'GET', {'cost': 1})
29
+ private_get_api_v1_futures_liquidationassignstatus = privateGetApiV1FuturesLiquidationAssignStatus = Entry('api/v1/futures/liquidationAssignStatus', 'private', 'GET', {'cost': 1})
30
+ private_get_api_v1_futures_risklimit = privateGetApiV1FuturesRiskLimit = Entry('api/v1/futures/riskLimit', 'private', 'GET', {'cost': 1})
31
+ private_get_api_v1_futures_commissionrate = privateGetApiV1FuturesCommissionRate = Entry('api/v1/futures/commissionRate', 'private', 'GET', {'cost': 1})
32
+ private_get_api_v1_futures_getbestorder = privateGetApiV1FuturesGetBestOrder = Entry('api/v1/futures/getBestOrder', 'private', 'GET', {'cost': 1})
33
+ private_get_api_v1_account_vipinfo = privateGetApiV1AccountVipInfo = Entry('api/v1/account/vipInfo', 'private', 'GET', {'cost': 1})
34
+ private_get_api_v1_account = privateGetApiV1Account = Entry('api/v1/account', 'private', 'GET', {'cost': 1})
35
+ private_get_api_v1_account_trades = privateGetApiV1AccountTrades = Entry('api/v1/account/trades', 'private', 'GET', {'cost': 5})
36
+ private_get_api_v1_account_type = privateGetApiV1AccountType = Entry('api/v1/account/type', 'private', 'GET', {'cost': 5})
37
+ private_get_api_v1_account_checkapikey = privateGetApiV1AccountCheckApiKey = Entry('api/v1/account/checkApiKey', 'private', 'GET', {'cost': 1})
38
+ private_get_api_v1_account_balanceflow = privateGetApiV1AccountBalanceFlow = Entry('api/v1/account/balanceFlow', 'private', 'GET', {'cost': 5})
39
+ private_get_api_v1_spot_subaccount_openorders = privateGetApiV1SpotSubAccountOpenOrders = Entry('api/v1/spot/subAccount/openOrders', 'private', 'GET', {'cost': 1})
40
+ private_get_api_v1_spot_subaccount_tradeorders = privateGetApiV1SpotSubAccountTradeOrders = Entry('api/v1/spot/subAccount/tradeOrders', 'private', 'GET', {'cost': 1})
41
+ private_get_api_v1_subaccount_trades = privateGetApiV1SubAccountTrades = Entry('api/v1/subAccount/trades', 'private', 'GET', {'cost': 1})
42
+ private_get_api_v1_futures_subaccount_openorders = privateGetApiV1FuturesSubAccountOpenOrders = Entry('api/v1/futures/subAccount/openOrders', 'private', 'GET', {'cost': 1})
43
+ private_get_api_v1_futures_subaccount_historyorders = privateGetApiV1FuturesSubAccountHistoryOrders = Entry('api/v1/futures/subAccount/historyOrders', 'private', 'GET', {'cost': 1})
44
+ private_get_api_v1_futures_subaccount_usertrades = privateGetApiV1FuturesSubAccountUserTrades = Entry('api/v1/futures/subAccount/userTrades', 'private', 'GET', {'cost': 1})
45
+ private_get_api_v1_account_deposit_address = privateGetApiV1AccountDepositAddress = Entry('api/v1/account/deposit/address', 'private', 'GET', {'cost': 1})
46
+ private_get_api_v1_account_depositorders = privateGetApiV1AccountDepositOrders = Entry('api/v1/account/depositOrders', 'private', 'GET', {'cost': 1})
47
+ private_get_api_v1_account_withdraworders = privateGetApiV1AccountWithdrawOrders = Entry('api/v1/account/withdrawOrders', 'private', 'GET', {'cost': 1})
48
+ private_post_api_v1_userdatastream = privatePostApiV1UserDataStream = Entry('api/v1/userDataStream', 'private', 'POST', {'cost': 1})
49
+ private_post_api_v1_spot_ordertest = privatePostApiV1SpotOrderTest = Entry('api/v1/spot/orderTest', 'private', 'POST', {'cost': 1})
50
+ private_post_api_v1_spot_order = privatePostApiV1SpotOrder = Entry('api/v1/spot/order', 'private', 'POST', {'cost': 1})
51
+ private_post_api_v1_1_spot_order = privatePostApiV11SpotOrder = Entry('api/v1.1/spot/order', 'private', 'POST', {'cost': 1})
52
+ private_post_api_v1_spot_batchorders = privatePostApiV1SpotBatchOrders = Entry('api/v1/spot/batchOrders', 'private', 'POST', {'cost': 5})
53
+ private_post_api_v1_futures_leverage = privatePostApiV1FuturesLeverage = Entry('api/v1/futures/leverage', 'private', 'POST', {'cost': 1})
54
+ private_post_api_v1_futures_order = privatePostApiV1FuturesOrder = Entry('api/v1/futures/order', 'private', 'POST', {'cost': 1})
55
+ private_post_api_v1_futures_position_trading_stop = privatePostApiV1FuturesPositionTradingStop = Entry('api/v1/futures/position/trading-stop', 'private', 'POST', {'cost': 3})
56
+ private_post_api_v1_futures_batchorders = privatePostApiV1FuturesBatchOrders = Entry('api/v1/futures/batchOrders', 'private', 'POST', {'cost': 5})
57
+ private_post_api_v1_account_assettransfer = privatePostApiV1AccountAssetTransfer = Entry('api/v1/account/assetTransfer', 'private', 'POST', {'cost': 1})
58
+ private_post_api_v1_account_authaddress = privatePostApiV1AccountAuthAddress = Entry('api/v1/account/authAddress', 'private', 'POST', {'cost': 1})
59
+ private_post_api_v1_account_withdraw = privatePostApiV1AccountWithdraw = Entry('api/v1/account/withdraw', 'private', 'POST', {'cost': 1})
60
+ private_put_api_v1_userdatastream = privatePutApiV1UserDataStream = Entry('api/v1/userDataStream', 'private', 'PUT', {'cost': 1})
61
+ private_delete_api_v1_spot_order = privateDeleteApiV1SpotOrder = Entry('api/v1/spot/order', 'private', 'DELETE', {'cost': 1})
62
+ private_delete_api_v1_spot_openorders = privateDeleteApiV1SpotOpenOrders = Entry('api/v1/spot/openOrders', 'private', 'DELETE', {'cost': 5})
63
+ private_delete_api_v1_spot_cancelorderbyids = privateDeleteApiV1SpotCancelOrderByIds = Entry('api/v1/spot/cancelOrderByIds', 'private', 'DELETE', {'cost': 5})
64
+ private_delete_api_v1_futures_order = privateDeleteApiV1FuturesOrder = Entry('api/v1/futures/order', 'private', 'DELETE', {'cost': 1})
65
+ private_delete_api_v1_futures_batchorders = privateDeleteApiV1FuturesBatchOrders = Entry('api/v1/futures/batchOrders', 'private', 'DELETE', {'cost': 1})
66
+ private_delete_api_v1_futures_cancelorderbyids = privateDeleteApiV1FuturesCancelOrderByIds = Entry('api/v1/futures/cancelOrderByIds', 'private', 'DELETE', {'cost': 1})
67
+ private_delete_api_v1_userdatastream = privateDeleteApiV1UserDataStream = Entry('api/v1/userDataStream', 'private', 'DELETE', {'cost': 1})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.85'
7
+ __version__ = '4.3.87'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -59,6 +59,7 @@ from ccxt.base.errors import RequestTimeout # noqa: F4
59
59
  from ccxt.base.errors import BadResponse # noqa: F401
60
60
  from ccxt.base.errors import NullResponse # noqa: F401
61
61
  from ccxt.base.errors import CancelPending # noqa: F401
62
+ from ccxt.base.errors import UnsubscribeError # noqa: F401
62
63
  from ccxt.base.errors import error_hierarchy # noqa: F401
63
64
 
64
65
 
@@ -122,6 +123,7 @@ from ccxt.async_support.fmfwio import fmfwio
122
123
  from ccxt.async_support.gate import gate # noqa: F401
123
124
  from ccxt.async_support.gateio import gateio # noqa: F401
124
125
  from ccxt.async_support.gemini import gemini # noqa: F401
126
+ from ccxt.async_support.hashkey import hashkey # noqa: F401
125
127
  from ccxt.async_support.hitbtc import hitbtc # noqa: F401
126
128
  from ccxt.async_support.hitbtc3 import hitbtc3 # noqa: F401
127
129
  from ccxt.async_support.hollaex import hollaex # noqa: F401
@@ -233,6 +235,7 @@ exchanges = [
233
235
  'gate',
234
236
  'gateio',
235
237
  'gemini',
238
+ 'hashkey',
236
239
  'hitbtc',
237
240
  'hitbtc3',
238
241
  'hollaex',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.85'
5
+ __version__ = '4.3.87'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -1873,7 +1873,7 @@ class Exchange(BaseExchange):
1873
1873
  response = None
1874
1874
  if method == 'fetchAccounts':
1875
1875
  response = await getattr(self, method)(params)
1876
- elif method == 'getLeverageTiersPaginated':
1876
+ elif method == 'getLeverageTiersPaginated' or method == 'fetchPositions':
1877
1877
  response = await getattr(self, method)(symbol, params)
1878
1878
  else:
1879
1879
  response = await getattr(self, method)(symbol, since, maxEntriesPerRequest, params)
@@ -3761,12 +3761,14 @@ class binance(Exchange, ImplicitAPI):
3761
3761
  marketId = self.safe_string(ticker, 'symbol')
3762
3762
  symbol = self.safe_symbol(marketId, market, None, marketType)
3763
3763
  last = self.safe_string(ticker, 'lastPrice')
3764
+ wAvg = self.safe_string(ticker, 'weightedAvgPrice')
3764
3765
  isCoinm = ('baseVolume' in ticker)
3765
3766
  baseVolume = None
3766
3767
  quoteVolume = None
3767
3768
  if isCoinm:
3768
3769
  baseVolume = self.safe_string(ticker, 'baseVolume')
3769
- quoteVolume = self.safe_string(ticker, 'volume')
3770
+ # 'volume' field in inverse markets is not quoteVolume, but traded amount(per contracts)
3771
+ quoteVolume = Precise.string_mul(baseVolume, wAvg)
3770
3772
  else:
3771
3773
  baseVolume = self.safe_string(ticker, 'volume')
3772
3774
  quoteVolume = self.safe_string_2(ticker, 'quoteVolume', 'amount')
@@ -3780,7 +3782,7 @@ class binance(Exchange, ImplicitAPI):
3780
3782
  'bidVolume': self.safe_string(ticker, 'bidQty'),
3781
3783
  'ask': self.safe_string(ticker, 'askPrice'),
3782
3784
  'askVolume': self.safe_string(ticker, 'askQty'),
3783
- 'vwap': self.safe_string(ticker, 'weightedAvgPrice'),
3785
+ 'vwap': wAvg,
3784
3786
  'open': self.safe_string_2(ticker, 'openPrice', 'open'),
3785
3787
  'close': last,
3786
3788
  'last': last,
@@ -749,7 +749,11 @@ class bingx(Exchange, ImplicitAPI):
749
749
  symbol += ':' + settle
750
750
  fees = self.safe_dict(self.fees, type, {})
751
751
  contractSize = self.parse_number('1') if (swap) else None
752
- isActive = self.safe_string(market, 'status') == '1'
752
+ isActive = False
753
+ if (self.safe_string(market, 'apiStateOpen') == 'true') and (self.safe_string(market, 'apiStateClose') == 'true'):
754
+ isActive = True # swap active
755
+ elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy'):
756
+ isActive = True # spot active
753
757
  isInverse = None if (spot) else checkIsInverse
754
758
  isLinear = None if (spot) else checkIsLinear
755
759
  timeOnline = self.safe_integer(market, 'timeOnline')
@@ -832,7 +832,7 @@ class bitfinex(Exchange, ImplicitAPI):
832
832
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
833
833
  """
834
834
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
835
- :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
835
+ :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
836
836
  :param dict [params]: extra parameters specific to the exchange API endpoint
837
837
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
838
838
  """
@@ -841,7 +841,7 @@ class bitfinex(Exchange, ImplicitAPI):
841
841
  response = await self.publicGetTickers(params)
842
842
  result: dict = {}
843
843
  for i in range(0, len(response)):
844
- ticker = self.parse_ticker({'result': response[i]})
844
+ ticker = self.parse_ticker(response[i])
845
845
  symbol = ticker['symbol']
846
846
  result[symbol] = ticker
847
847
  return self.filter_by_array_tickers(result, 'symbol', symbols)