ccxt 4.3.85__py2.py3-none-any.whl → 4.3.86__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.
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.3.85'
25
+ __version__ = '4.3.86'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -142,6 +142,7 @@ from ccxt.fmfwio import fmfwio # noqa: F4
142
142
  from ccxt.gate import gate # noqa: F401
143
143
  from ccxt.gateio import gateio # noqa: F401
144
144
  from ccxt.gemini import gemini # noqa: F401
145
+ from ccxt.hashkey import hashkey # noqa: F401
145
146
  from ccxt.hitbtc import hitbtc # noqa: F401
146
147
  from ccxt.hitbtc3 import hitbtc3 # noqa: F401
147
148
  from ccxt.hollaex import hollaex # noqa: F401
@@ -253,6 +254,7 @@ exchanges = [
253
254
  'gate',
254
255
  'gateio',
255
256
  'gemini',
257
+ 'hashkey',
256
258
  'hitbtc',
257
259
  'hitbtc3',
258
260
  '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.86'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -122,6 +122,7 @@ from ccxt.async_support.fmfwio import fmfwio
122
122
  from ccxt.async_support.gate import gate # noqa: F401
123
123
  from ccxt.async_support.gateio import gateio # noqa: F401
124
124
  from ccxt.async_support.gemini import gemini # noqa: F401
125
+ from ccxt.async_support.hashkey import hashkey # noqa: F401
125
126
  from ccxt.async_support.hitbtc import hitbtc # noqa: F401
126
127
  from ccxt.async_support.hitbtc3 import hitbtc3 # noqa: F401
127
128
  from ccxt.async_support.hollaex import hollaex # noqa: F401
@@ -233,6 +234,7 @@ exchanges = [
233
234
  'gate',
234
235
  'gateio',
235
236
  'gemini',
237
+ 'hashkey',
236
238
  'hitbtc',
237
239
  'hitbtc3',
238
240
  'hollaex',
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.3.85'
5
+ __version__ = '4.3.86'
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,
@@ -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)