ccxt 4.4.92__py2.py3-none-any.whl → 4.4.94__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 +1 -1
- ccxt/abstract/lbank.py +1 -1
- ccxt/ascendex.py +9 -8
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +9 -8
- ccxt/async_support/base/exchange.py +4 -1
- ccxt/async_support/base/ws/client.py +3 -0
- ccxt/async_support/binance.py +42 -1
- ccxt/async_support/bitmex.py +3 -3
- ccxt/async_support/bybit.py +83 -10
- ccxt/async_support/coinbase.py +4 -1
- ccxt/async_support/coinbaseexchange.py +53 -0
- ccxt/async_support/coincheck.py +45 -4
- ccxt/async_support/coinex.py +16 -12
- ccxt/async_support/coinmetro.py +15 -3
- ccxt/async_support/cryptomus.py +30 -52
- ccxt/async_support/deribit.py +6 -6
- ccxt/async_support/exmo.py +64 -52
- ccxt/async_support/htx.py +5 -1
- ccxt/async_support/hyperliquid.py +126 -33
- ccxt/async_support/kucoin.py +12 -14
- ccxt/async_support/latoken.py +19 -71
- ccxt/async_support/lbank.py +2 -2
- ccxt/async_support/okx.py +159 -3
- ccxt/async_support/paradex.py +54 -0
- ccxt/async_support/phemex.py +3 -3
- ccxt/async_support/wavesexchange.py +12 -2
- ccxt/base/exchange.py +96 -31
- ccxt/binance.py +42 -1
- ccxt/bitmex.py +3 -3
- ccxt/bybit.py +83 -10
- ccxt/coinbase.py +4 -1
- ccxt/coinbaseexchange.py +53 -0
- ccxt/coincheck.py +45 -4
- ccxt/coinex.py +16 -12
- ccxt/coinmetro.py +14 -3
- ccxt/cryptomus.py +30 -52
- ccxt/deribit.py +6 -6
- ccxt/exmo.py +64 -52
- ccxt/htx.py +5 -1
- ccxt/hyperliquid.py +126 -33
- ccxt/kucoin.py +12 -14
- ccxt/latoken.py +19 -71
- ccxt/lbank.py +2 -2
- ccxt/okx.py +159 -3
- ccxt/paradex.py +54 -0
- ccxt/phemex.py +3 -3
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitstamp.py +48 -16
- ccxt/pro/bybit.py +2 -1
- ccxt/test/tests_async.py +17 -15
- ccxt/test/tests_sync.py +17 -15
- ccxt/wavesexchange.py +12 -2
- {ccxt-4.4.92.dist-info → ccxt-4.4.94.dist-info}/METADATA +4 -4
- {ccxt-4.4.92.dist-info → ccxt-4.4.94.dist-info}/RECORD +58 -58
- {ccxt-4.4.92.dist-info → ccxt-4.4.94.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.92.dist-info → ccxt-4.4.94.dist-info}/WHEEL +0 -0
- {ccxt-4.4.92.dist-info → ccxt-4.4.94.dist-info}/top_level.txt +0 -0
ccxt/async_support/coincheck.py
CHANGED
@@ -10,6 +10,7 @@ from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, Or
|
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
13
|
+
from ccxt.base.errors import ArgumentsRequired
|
13
14
|
from ccxt.base.errors import BadSymbol
|
14
15
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
15
16
|
|
@@ -30,30 +31,59 @@ class coincheck(Exchange, ImplicitAPI):
|
|
30
31
|
'future': False,
|
31
32
|
'option': False,
|
32
33
|
'addMargin': False,
|
34
|
+
'borrowCrossMargin': False,
|
35
|
+
'borrowIsolatedMargin': False,
|
36
|
+
'borrowMargin': False,
|
33
37
|
'cancelOrder': True,
|
34
38
|
'closeAllPositions': False,
|
35
39
|
'closePosition': False,
|
36
40
|
'createOrder': True,
|
41
|
+
'createOrderWithTakeProfitAndStopLoss': False,
|
42
|
+
'createOrderWithTakeProfitAndStopLossWs': False,
|
43
|
+
'createPostOnlyOrder': False,
|
37
44
|
'createReduceOnlyOrder': False,
|
38
45
|
'fetchBalance': True,
|
46
|
+
'fetchBorrowInterest': False,
|
47
|
+
'fetchBorrowRate': False,
|
39
48
|
'fetchBorrowRateHistories': False,
|
40
49
|
'fetchBorrowRateHistory': False,
|
50
|
+
'fetchBorrowRates': False,
|
51
|
+
'fetchBorrowRatesPerSymbol': False,
|
41
52
|
'fetchCrossBorrowRate': False,
|
42
53
|
'fetchCrossBorrowRates': False,
|
43
54
|
'fetchDeposits': True,
|
44
55
|
'fetchFundingHistory': False,
|
56
|
+
'fetchFundingInterval': False,
|
57
|
+
'fetchFundingIntervals': False,
|
45
58
|
'fetchFundingRate': False,
|
46
59
|
'fetchFundingRateHistory': False,
|
47
60
|
'fetchFundingRates': False,
|
61
|
+
'fetchGreeks': False,
|
48
62
|
'fetchIndexOHLCV': False,
|
49
63
|
'fetchIsolatedBorrowRate': False,
|
50
64
|
'fetchIsolatedBorrowRates': False,
|
65
|
+
'fetchIsolatedPositions': False,
|
51
66
|
'fetchLeverage': False,
|
67
|
+
'fetchLeverages': False,
|
68
|
+
'fetchLeverageTiers': False,
|
69
|
+
'fetchLiquidations': False,
|
70
|
+
'fetchLongShortRatio': False,
|
71
|
+
'fetchLongShortRatioHistory': False,
|
72
|
+
'fetchMarginAdjustmentHistory': False,
|
52
73
|
'fetchMarginMode': False,
|
74
|
+
'fetchMarginModes': False,
|
75
|
+
'fetchMarketLeverageTiers': False,
|
53
76
|
'fetchMarkOHLCV': False,
|
77
|
+
'fetchMarkPrices': False,
|
78
|
+
'fetchMyLiquidations': False,
|
79
|
+
'fetchMySettlementHistory': False,
|
54
80
|
'fetchMyTrades': True,
|
81
|
+
'fetchOpenInterest': False,
|
55
82
|
'fetchOpenInterestHistory': False,
|
83
|
+
'fetchOpenInterests': False,
|
56
84
|
'fetchOpenOrders': True,
|
85
|
+
'fetchOption': False,
|
86
|
+
'fetchOptionChain': False,
|
57
87
|
'fetchOrderBook': True,
|
58
88
|
'fetchPosition': False,
|
59
89
|
'fetchPositionHistory': False,
|
@@ -63,13 +93,19 @@ class coincheck(Exchange, ImplicitAPI):
|
|
63
93
|
'fetchPositionsHistory': False,
|
64
94
|
'fetchPositionsRisk': False,
|
65
95
|
'fetchPremiumIndexOHLCV': False,
|
96
|
+
'fetchSettlementHistory': False,
|
66
97
|
'fetchTicker': True,
|
67
98
|
'fetchTrades': True,
|
68
99
|
'fetchTradingFee': False,
|
69
100
|
'fetchTradingFees': True,
|
101
|
+
'fetchVolatilityHistory': False,
|
70
102
|
'fetchWithdrawals': True,
|
71
103
|
'reduceMargin': False,
|
104
|
+
'repayCrossMargin': False,
|
105
|
+
'repayIsolatedMargin': False,
|
106
|
+
'repayMargin': False,
|
72
107
|
'setLeverage': False,
|
108
|
+
'setMargin': False,
|
73
109
|
'setMarginMode': False,
|
74
110
|
'setPositionMode': False,
|
75
111
|
'ws': True,
|
@@ -637,10 +673,15 @@ class coincheck(Exchange, ImplicitAPI):
|
|
637
673
|
'pair': market['id'],
|
638
674
|
}
|
639
675
|
if type == 'market':
|
640
|
-
order_type = type + '_' + side
|
641
|
-
|
642
|
-
|
643
|
-
|
676
|
+
request['order_type'] = type + '_' + side
|
677
|
+
if side == 'sell':
|
678
|
+
request['amount'] = amount
|
679
|
+
else:
|
680
|
+
cost = self.safe_number(params, 'cost')
|
681
|
+
params = self.omit(params, 'cost')
|
682
|
+
if cost is not None:
|
683
|
+
raise ArgumentsRequired(self.id + ' createOrder() : you should use "cost" parameter instead of "amount" argument to create market buy orders')
|
684
|
+
request['market_buy_amount'] = cost
|
644
685
|
else:
|
645
686
|
request['order_type'] = side
|
646
687
|
request['rate'] = price
|
ccxt/async_support/coinex.py
CHANGED
@@ -19,6 +19,7 @@ from ccxt.base.errors import InsufficientFunds
|
|
19
19
|
from ccxt.base.errors import InvalidOrder
|
20
20
|
from ccxt.base.errors import OrderNotFound
|
21
21
|
from ccxt.base.errors import NotSupported
|
22
|
+
from ccxt.base.errors import OperationFailed
|
22
23
|
from ccxt.base.errors import RateLimitExceeded
|
23
24
|
from ccxt.base.errors import ExchangeNotAvailable
|
24
25
|
from ccxt.base.errors import RequestTimeout
|
@@ -671,6 +672,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
671
672
|
'broad': {
|
672
673
|
'ip not allow visit': PermissionDenied,
|
673
674
|
'service too busy': ExchangeNotAvailable,
|
675
|
+
'Service is not available during funding fee settlement': OperationFailed,
|
674
676
|
},
|
675
677
|
},
|
676
678
|
})
|
@@ -795,7 +797,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
795
797
|
'max': None,
|
796
798
|
},
|
797
799
|
},
|
798
|
-
'networks':
|
800
|
+
'networks': networks,
|
799
801
|
'type': 'crypto',
|
800
802
|
'info': coin,
|
801
803
|
})
|
@@ -827,17 +829,19 @@ class coinex(Exchange, ImplicitAPI):
|
|
827
829
|
# "code": 0,
|
828
830
|
# "data": [
|
829
831
|
# {
|
830
|
-
# "
|
832
|
+
# "market": "BTCUSDT",
|
833
|
+
# "taker_fee_rate": "0.002",
|
834
|
+
# "maker_fee_rate": "0.002",
|
835
|
+
# "min_amount": "0.0005",
|
836
|
+
# "base_ccy": "BTC",
|
837
|
+
# "quote_ccy": "USDT",
|
831
838
|
# "base_ccy_precision": 8,
|
839
|
+
# "quote_ccy_precision": 2,
|
832
840
|
# "is_amm_available": True,
|
833
|
-
# "is_margin_available":
|
834
|
-
# "
|
835
|
-
# "
|
836
|
-
#
|
837
|
-
# "quote_ccy": "USDT",
|
838
|
-
# "quote_ccy_precision": 6,
|
839
|
-
# "taker_fee_rate": "0.003"
|
840
|
-
# },
|
841
|
+
# "is_margin_available": True,
|
842
|
+
# "is_pre_trading_available": True,
|
843
|
+
# "is_api_trading_available": True
|
844
|
+
# }
|
841
845
|
# ],
|
842
846
|
# "message": "OK"
|
843
847
|
# }
|
@@ -863,11 +867,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
863
867
|
'settleId': None,
|
864
868
|
'type': 'spot',
|
865
869
|
'spot': True,
|
866
|
-
'margin':
|
870
|
+
'margin': self.safe_bool(market, 'is_margin_available'),
|
867
871
|
'swap': False,
|
868
872
|
'future': False,
|
869
873
|
'option': False,
|
870
|
-
'active':
|
874
|
+
'active': self.safe_bool(market, 'is_api_trading_available'),
|
871
875
|
'contract': False,
|
872
876
|
'linear': None,
|
873
877
|
'inverse': None,
|
ccxt/async_support/coinmetro.py
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinmetro import ImplicitAPI
|
8
|
+
import asyncio
|
8
9
|
from ccxt.base.types import Any, Balances, Currencies, Currency, IndexType, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
9
10
|
from typing import List
|
10
11
|
from ccxt.base.errors import ExchangeError
|
@@ -220,6 +221,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
220
221
|
'options': {
|
221
222
|
'currenciesByIdForParseMarket': None,
|
222
223
|
'currencyIdsListForParseMarket': ['QRDO'],
|
224
|
+
'skippedMarkets': ['VXVUSDT'], # broken markets which do not have enough info in API
|
223
225
|
},
|
224
226
|
'features': {
|
225
227
|
'spot': {
|
@@ -439,9 +441,12 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
439
441
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
440
442
|
:returns dict[]: an array of objects representing market data
|
441
443
|
"""
|
442
|
-
|
444
|
+
promises = []
|
445
|
+
promises.append(self.publicGetMarkets(params))
|
443
446
|
if self.safe_value(self.options, 'currenciesByIdForParseMarket') is None:
|
444
|
-
|
447
|
+
promises.append(self.fetch_currencies())
|
448
|
+
responses = await asyncio.gather(*promises)
|
449
|
+
response = responses[0]
|
445
450
|
#
|
446
451
|
# [
|
447
452
|
# {
|
@@ -457,7 +462,14 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
457
462
|
# ...
|
458
463
|
# ]
|
459
464
|
#
|
460
|
-
|
465
|
+
skippedMarkets = self.safe_list(self.options, 'skippedMarkets', [])
|
466
|
+
result = []
|
467
|
+
for i in range(0, len(response)):
|
468
|
+
market = self.parse_market(response[i])
|
469
|
+
if self.in_array(market['id'], skippedMarkets):
|
470
|
+
continue
|
471
|
+
result.append(market)
|
472
|
+
return result
|
461
473
|
|
462
474
|
def parse_market(self, market: dict) -> Market:
|
463
475
|
id = self.safe_string(market, 'pair')
|
ccxt/async_support/cryptomus.py
CHANGED
@@ -367,66 +367,44 @@ class cryptomus(Exchange, ImplicitAPI):
|
|
367
367
|
# }
|
368
368
|
#
|
369
369
|
coins = self.safe_list(response, 'result')
|
370
|
+
groupedById = self.group_by(coins, 'currency_code')
|
371
|
+
keys = list(groupedById.keys())
|
370
372
|
result: dict = {}
|
371
|
-
for i in range(0, len(
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
'
|
382
|
-
'
|
383
|
-
'deposit': None,
|
384
|
-
'withdraw': None,
|
385
|
-
'fee': None,
|
373
|
+
for i in range(0, len(keys)):
|
374
|
+
id = keys[i]
|
375
|
+
code = self.safe_currency_code(id)
|
376
|
+
networks = {}
|
377
|
+
networkEntries = groupedById[id]
|
378
|
+
for j in range(0, len(networkEntries)):
|
379
|
+
networkEntry = networkEntries[j]
|
380
|
+
networkId = self.safe_string(networkEntry, 'network_code')
|
381
|
+
networkCode = self.network_id_to_code(networkId)
|
382
|
+
networks[networkCode] = {
|
383
|
+
'id': networkId,
|
384
|
+
'network': networkCode,
|
386
385
|
'limits': {
|
387
386
|
'withdraw': {
|
388
|
-
'min':
|
389
|
-
'max':
|
387
|
+
'min': self.safe_number(networkEntry, 'min_withdraw'),
|
388
|
+
'max': self.safe_number(networkEntry, 'max_withdraw'),
|
390
389
|
},
|
391
390
|
'deposit': {
|
392
|
-
'min':
|
393
|
-
'max':
|
391
|
+
'min': self.safe_number(networkEntry, 'min_deposit'),
|
392
|
+
'max': self.safe_number(networkEntry, 'max_deposit'),
|
394
393
|
},
|
395
394
|
},
|
396
|
-
'
|
397
|
-
'
|
395
|
+
'active': None,
|
396
|
+
'deposit': self.safe_bool(networkEntry, 'can_withdraw'),
|
397
|
+
'withdraw': self.safe_bool(networkEntry, 'can_deposit'),
|
398
|
+
'fee': None,
|
399
|
+
'precision': None,
|
400
|
+
'info': networkEntry,
|
398
401
|
}
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
'
|
403
|
-
'
|
404
|
-
|
405
|
-
'withdraw': {
|
406
|
-
'min': self.safe_number(networkEntry, 'min_withdraw'),
|
407
|
-
'max': self.safe_number(networkEntry, 'max_withdraw'),
|
408
|
-
},
|
409
|
-
'deposit': {
|
410
|
-
'min': self.safe_number(networkEntry, 'min_deposit'),
|
411
|
-
'max': self.safe_number(networkEntry, 'max_deposit'),
|
412
|
-
},
|
413
|
-
},
|
414
|
-
'active': None,
|
415
|
-
'deposit': self.safe_bool(networkEntry, 'can_withdraw'),
|
416
|
-
'withdraw': self.safe_bool(networkEntry, 'can_deposit'),
|
417
|
-
'fee': None,
|
418
|
-
'precision': None,
|
419
|
-
'info': networkEntry,
|
420
|
-
}
|
421
|
-
# add entry in info
|
422
|
-
info = self.safe_list(result[code], 'info', [])
|
423
|
-
info.append(networkEntry)
|
424
|
-
result[code]['info'] = info
|
425
|
-
# only after all entries are formed in currencies, restructure each entry
|
426
|
-
allKeys = list(result.keys())
|
427
|
-
for i in range(0, len(allKeys)):
|
428
|
-
code = allKeys[i]
|
429
|
-
result[code] = self.safe_currency_structure(result[code]) # self is needed after adding network entry
|
402
|
+
result[code] = self.safe_currency_structure({
|
403
|
+
'id': id,
|
404
|
+
'code': code,
|
405
|
+
'networks': networks,
|
406
|
+
'info': networkEntries,
|
407
|
+
})
|
430
408
|
return result
|
431
409
|
|
432
410
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
ccxt/async_support/deribit.py
CHANGED
@@ -2596,21 +2596,21 @@ class deribit(Exchange, ImplicitAPI):
|
|
2596
2596
|
unrealizedPnl = self.safe_string(position, 'floating_profit_loss')
|
2597
2597
|
initialMarginString = self.safe_string(position, 'initial_margin')
|
2598
2598
|
notionalString = self.safe_string(position, 'size_currency')
|
2599
|
+
notionalStringAbs = Precise.string_abs(notionalString)
|
2599
2600
|
maintenanceMarginString = self.safe_string(position, 'maintenance_margin')
|
2600
|
-
currentTime = self.milliseconds()
|
2601
2601
|
return self.safe_position({
|
2602
2602
|
'info': position,
|
2603
2603
|
'id': None,
|
2604
2604
|
'symbol': self.safe_string(market, 'symbol'),
|
2605
|
-
'timestamp':
|
2606
|
-
'datetime':
|
2605
|
+
'timestamp': None,
|
2606
|
+
'datetime': None,
|
2607
2607
|
'lastUpdateTimestamp': None,
|
2608
2608
|
'initialMargin': self.parse_number(initialMarginString),
|
2609
|
-
'initialMarginPercentage': self.parse_number(Precise.string_mul(Precise.string_div(initialMarginString,
|
2609
|
+
'initialMarginPercentage': self.parse_number(Precise.string_mul(Precise.string_div(initialMarginString, notionalStringAbs), '100')),
|
2610
2610
|
'maintenanceMargin': self.parse_number(maintenanceMarginString),
|
2611
|
-
'maintenanceMarginPercentage': self.parse_number(Precise.string_mul(Precise.string_div(maintenanceMarginString,
|
2611
|
+
'maintenanceMarginPercentage': self.parse_number(Precise.string_mul(Precise.string_div(maintenanceMarginString, notionalStringAbs), '100')),
|
2612
2612
|
'entryPrice': self.safe_number(position, 'average_price'),
|
2613
|
-
'notional': self.parse_number(
|
2613
|
+
'notional': self.parse_number(notionalStringAbs),
|
2614
2614
|
'leverage': self.safe_integer(position, 'leverage'),
|
2615
2615
|
'unrealizedPnl': self.parse_number(unrealizedPnl),
|
2616
2616
|
'contracts': None,
|
ccxt/async_support/exmo.py
CHANGED
@@ -710,73 +710,85 @@ class exmo(Exchange, ImplicitAPI):
|
|
710
710
|
for i in range(0, len(currencyList)):
|
711
711
|
currency = currencyList[i]
|
712
712
|
currencyId = self.safe_string(currency, 'name')
|
713
|
-
|
714
|
-
providers = self.safe_value(cryptoList, currencyId)
|
715
|
-
active = False
|
713
|
+
code = self.safe_currency_code(currencyId)
|
716
714
|
type = 'crypto'
|
717
|
-
|
718
|
-
|
719
|
-
'min': None,
|
720
|
-
'max': None,
|
721
|
-
},
|
722
|
-
'withdraw': {
|
723
|
-
'min': None,
|
724
|
-
'max': None,
|
725
|
-
},
|
726
|
-
}
|
727
|
-
fee = None
|
728
|
-
depositEnabled = None
|
729
|
-
withdrawEnabled = None
|
715
|
+
networks = {}
|
716
|
+
providers = self.safe_list(cryptoList, currencyId)
|
730
717
|
if providers is None:
|
731
|
-
active = True
|
732
718
|
type = 'fiat'
|
733
719
|
else:
|
734
720
|
for j in range(0, len(providers)):
|
735
721
|
provider = providers[j]
|
722
|
+
name = self.safe_string(provider, 'name')
|
723
|
+
# get network-id by removing extra things
|
724
|
+
networkId = name.replace(currencyId + ' ', '')
|
725
|
+
networkId = networkId.replace('(', '')
|
726
|
+
replaceChar = ')' # transpiler trick
|
727
|
+
networkId = networkId.replace(replaceChar, '')
|
728
|
+
networkCode = self.network_id_to_code(networkId)
|
729
|
+
if not (networkCode in networks):
|
730
|
+
networks[networkCode] = {
|
731
|
+
'id': networkId,
|
732
|
+
'network': networkCode,
|
733
|
+
'active': None,
|
734
|
+
'deposit': None,
|
735
|
+
'withdraw': None,
|
736
|
+
'fee': None,
|
737
|
+
'limits': {
|
738
|
+
'withdraw': {
|
739
|
+
'min': None,
|
740
|
+
'max': None,
|
741
|
+
},
|
742
|
+
'deposit': {
|
743
|
+
'min': None,
|
744
|
+
'max': None,
|
745
|
+
},
|
746
|
+
},
|
747
|
+
'info': [], # set, because of multiple network sub-entries
|
748
|
+
}
|
736
749
|
typeInner = self.safe_string(provider, 'type')
|
737
750
|
minValue = self.safe_string(provider, 'min')
|
738
751
|
maxValue = self.safe_string(provider, 'max')
|
739
|
-
|
740
|
-
|
741
|
-
activeProvider = self.safe_value(provider, 'enabled')
|
752
|
+
activeProvider = self.safe_bool(provider, 'enabled')
|
753
|
+
networkEntry = networks[networkCode]
|
742
754
|
if typeInner == 'deposit':
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
depositEnabled = False
|
755
|
+
networkEntry['deposit'] = activeProvider
|
756
|
+
networkEntry['limits']['deposit']['min'] = minValue
|
757
|
+
networkEntry['limits']['deposit']['max'] = maxValue
|
747
758
|
elif typeInner == 'withdraw':
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
limits[typeInner]['min'] = minValue
|
757
|
-
limits[typeInner]['max'] = maxValue
|
758
|
-
if typeInner == 'withdraw':
|
759
|
-
commissionDesc = self.safe_string(provider, 'commission_desc')
|
760
|
-
fee = self.parse_fixed_float_value(commissionDesc)
|
761
|
-
code = self.safe_currency_code(currencyId)
|
762
|
-
info = {
|
763
|
-
'currency': currency,
|
764
|
-
'providers': providers,
|
765
|
-
}
|
766
|
-
result[code] = {
|
759
|
+
networkEntry['withdraw'] = activeProvider
|
760
|
+
networkEntry['limits']['withdraw']['min'] = minValue
|
761
|
+
networkEntry['limits']['withdraw']['max'] = maxValue
|
762
|
+
info = self.safe_list(networkEntry, 'info')
|
763
|
+
info.append(provider)
|
764
|
+
networkEntry['info'] = info
|
765
|
+
networks[networkCode] = networkEntry
|
766
|
+
result[code] = self.safe_currency_structure({
|
767
767
|
'id': currencyId,
|
768
768
|
'code': code,
|
769
|
-
'name':
|
769
|
+
'name': self.safe_string(currency, 'description'),
|
770
770
|
'type': type,
|
771
|
-
'active':
|
772
|
-
'deposit':
|
773
|
-
'withdraw':
|
774
|
-
'fee':
|
771
|
+
'active': None,
|
772
|
+
'deposit': None,
|
773
|
+
'withdraw': None,
|
774
|
+
'fee': None,
|
775
775
|
'precision': self.parse_number('1e-8'),
|
776
|
-
'limits':
|
777
|
-
|
778
|
-
|
779
|
-
|
776
|
+
'limits': {
|
777
|
+
'withdraw': {
|
778
|
+
'min': None,
|
779
|
+
'max': None,
|
780
|
+
},
|
781
|
+
'deposit': {
|
782
|
+
'min': None,
|
783
|
+
'max': None,
|
784
|
+
},
|
785
|
+
},
|
786
|
+
'info': {
|
787
|
+
'currency': currency,
|
788
|
+
'providers': providers,
|
789
|
+
},
|
790
|
+
'networks': networks,
|
791
|
+
})
|
780
792
|
return result
|
781
793
|
|
782
794
|
async def fetch_markets(self, params={}) -> List[Market]:
|
ccxt/async_support/htx.py
CHANGED
@@ -6577,12 +6577,16 @@ class htx(Exchange, ImplicitAPI):
|
|
6577
6577
|
paginate = False
|
6578
6578
|
paginate, params = self.handle_option_and_params(params, 'fetchFundingRateHistory', 'paginate')
|
6579
6579
|
if paginate:
|
6580
|
-
return await self.fetch_paginated_call_cursor('fetchFundingRateHistory', symbol, since, limit, params, '
|
6580
|
+
return await self.fetch_paginated_call_cursor('fetchFundingRateHistory', symbol, since, limit, params, 'current_page', 'page_index', 1, 50)
|
6581
6581
|
await self.load_markets()
|
6582
6582
|
market = self.market(symbol)
|
6583
6583
|
request: dict = {
|
6584
6584
|
'contract_code': market['id'],
|
6585
6585
|
}
|
6586
|
+
if limit is not None:
|
6587
|
+
request['page_size'] = limit
|
6588
|
+
else:
|
6589
|
+
request['page_size'] = 50 # max
|
6586
6590
|
response = None
|
6587
6591
|
if market['inverse']:
|
6588
6592
|
response = await self.contractPublicGetSwapApiV1SwapHistoricalFundingRate(self.extend(request, params))
|