ccxt 4.4.92__py2.py3-none-any.whl → 4.4.93__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 +81 -8
- ccxt/async_support/coinbaseexchange.py +53 -0
- ccxt/async_support/coincheck.py +45 -4
- ccxt/async_support/coinex.py +16 -12
- ccxt/async_support/cryptomus.py +30 -52
- ccxt/async_support/deribit.py +6 -6
- ccxt/async_support/exmo.py +64 -52
- ccxt/async_support/hyperliquid.py +2 -1
- 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 +149 -0
- ccxt/async_support/paradex.py +54 -0
- ccxt/async_support/phemex.py +3 -3
- ccxt/base/exchange.py +55 -12
- ccxt/binance.py +42 -1
- ccxt/bitmex.py +3 -3
- ccxt/bybit.py +81 -8
- ccxt/coinbaseexchange.py +53 -0
- ccxt/coincheck.py +45 -4
- ccxt/coinex.py +16 -12
- ccxt/cryptomus.py +30 -52
- ccxt/deribit.py +6 -6
- ccxt/exmo.py +64 -52
- ccxt/hyperliquid.py +2 -1
- ccxt/kucoin.py +12 -14
- ccxt/latoken.py +19 -71
- ccxt/lbank.py +2 -2
- ccxt/okx.py +149 -0
- 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-4.4.92.dist-info → ccxt-4.4.93.dist-info}/METADATA +4 -4
- {ccxt-4.4.92.dist-info → ccxt-4.4.93.dist-info}/RECORD +48 -48
- {ccxt-4.4.92.dist-info → ccxt-4.4.93.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.92.dist-info → ccxt-4.4.93.dist-info}/WHEEL +0 -0
- {ccxt-4.4.92.dist-info → ccxt-4.4.93.dist-info}/top_level.txt +0 -0
ccxt/coinbaseexchange.py
CHANGED
@@ -39,31 +39,73 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
39
39
|
'swap': False,
|
40
40
|
'future': False,
|
41
41
|
'option': False,
|
42
|
+
'addMargin': False,
|
43
|
+
'borrowCrossMargin': False,
|
44
|
+
'borrowIsolatedMargin': False,
|
45
|
+
'borrowMargin': False,
|
42
46
|
'cancelAllOrders': True,
|
43
47
|
'cancelOrder': True,
|
48
|
+
'closeAllPositions': False,
|
49
|
+
'closePosition': False,
|
44
50
|
'createDepositAddress': True,
|
45
51
|
'createOrder': True,
|
52
|
+
'createOrderWithTakeProfitAndStopLoss': False,
|
53
|
+
'createOrderWithTakeProfitAndStopLossWs': False,
|
54
|
+
'createPostOnlyOrder': False,
|
46
55
|
'createReduceOnlyOrder': False,
|
47
56
|
'createStopLimitOrder': True,
|
48
57
|
'createStopMarketOrder': True,
|
49
58
|
'createStopOrder': True,
|
50
59
|
'fetchAccounts': True,
|
51
60
|
'fetchBalance': True,
|
61
|
+
'fetchBorrowInterest': False,
|
62
|
+
'fetchBorrowRate': False,
|
63
|
+
'fetchBorrowRateHistories': False,
|
64
|
+
'fetchBorrowRateHistory': False,
|
65
|
+
'fetchBorrowRates': False,
|
66
|
+
'fetchBorrowRatesPerSymbol': False,
|
52
67
|
'fetchClosedOrders': True,
|
68
|
+
'fetchCrossBorrowRate': False,
|
69
|
+
'fetchCrossBorrowRates': False,
|
53
70
|
'fetchCurrencies': True,
|
54
71
|
'fetchDepositAddress': False, # the exchange does not have self method, only createDepositAddress, see https://github.com/ccxt/ccxt/pull/7405
|
55
72
|
'fetchDeposits': True,
|
56
73
|
'fetchDepositsWithdrawals': True,
|
57
74
|
'fetchFundingHistory': False,
|
75
|
+
'fetchFundingInterval': False,
|
76
|
+
'fetchFundingIntervals': False,
|
58
77
|
'fetchFundingRate': False,
|
59
78
|
'fetchFundingRateHistory': False,
|
60
79
|
'fetchFundingRates': False,
|
80
|
+
'fetchGreeks': False,
|
81
|
+
'fetchIndexOHLCV': False,
|
82
|
+
'fetchIsolatedBorrowRate': False,
|
83
|
+
'fetchIsolatedBorrowRates': False,
|
84
|
+
'fetchIsolatedPositions': False,
|
61
85
|
'fetchLedger': True,
|
86
|
+
'fetchLeverage': False,
|
87
|
+
'fetchLeverages': False,
|
88
|
+
'fetchLeverageTiers': False,
|
89
|
+
'fetchLiquidations': False,
|
90
|
+
'fetchLongShortRatio': False,
|
91
|
+
'fetchLongShortRatioHistory': False,
|
92
|
+
'fetchMarginAdjustmentHistory': False,
|
62
93
|
'fetchMarginMode': False,
|
94
|
+
'fetchMarginModes': False,
|
95
|
+
'fetchMarketLeverageTiers': False,
|
63
96
|
'fetchMarkets': True,
|
97
|
+
'fetchMarkOHLCV': False,
|
98
|
+
'fetchMarkPrices': False,
|
99
|
+
'fetchMyLiquidations': False,
|
100
|
+
'fetchMySettlementHistory': False,
|
64
101
|
'fetchMyTrades': True,
|
65
102
|
'fetchOHLCV': True,
|
103
|
+
'fetchOpenInterest': False,
|
104
|
+
'fetchOpenInterestHistory': False,
|
105
|
+
'fetchOpenInterests': False,
|
66
106
|
'fetchOpenOrders': True,
|
107
|
+
'fetchOption': False,
|
108
|
+
'fetchOptionChain': False,
|
67
109
|
'fetchOrder': True,
|
68
110
|
'fetchOrderBook': True,
|
69
111
|
'fetchOrders': True,
|
@@ -75,6 +117,8 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
75
117
|
'fetchPositionsForSymbol': False,
|
76
118
|
'fetchPositionsHistory': False,
|
77
119
|
'fetchPositionsRisk': False,
|
120
|
+
'fetchPremiumIndexOHLCV': False,
|
121
|
+
'fetchSettlementHistory': False,
|
78
122
|
'fetchTicker': True,
|
79
123
|
'fetchTickers': True,
|
80
124
|
'fetchTime': True,
|
@@ -82,7 +126,16 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
82
126
|
'fetchTradingFee': False,
|
83
127
|
'fetchTradingFees': True,
|
84
128
|
'fetchTransactions': 'emulated',
|
129
|
+
'fetchVolatilityHistory': False,
|
85
130
|
'fetchWithdrawals': True,
|
131
|
+
'reduceMargin': False,
|
132
|
+
'repayCrossMargin': False,
|
133
|
+
'repayIsolatedMargin': False,
|
134
|
+
'repayMargin': False,
|
135
|
+
'setLeverage': False,
|
136
|
+
'setMargin': False,
|
137
|
+
'setMarginMode': False,
|
138
|
+
'setPositionMode': False,
|
86
139
|
'withdraw': True,
|
87
140
|
},
|
88
141
|
'timeframes': {
|
ccxt/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/coinex.py
CHANGED
@@ -18,6 +18,7 @@ from ccxt.base.errors import InsufficientFunds
|
|
18
18
|
from ccxt.base.errors import InvalidOrder
|
19
19
|
from ccxt.base.errors import OrderNotFound
|
20
20
|
from ccxt.base.errors import NotSupported
|
21
|
+
from ccxt.base.errors import OperationFailed
|
21
22
|
from ccxt.base.errors import RateLimitExceeded
|
22
23
|
from ccxt.base.errors import ExchangeNotAvailable
|
23
24
|
from ccxt.base.errors import RequestTimeout
|
@@ -670,6 +671,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
670
671
|
'broad': {
|
671
672
|
'ip not allow visit': PermissionDenied,
|
672
673
|
'service too busy': ExchangeNotAvailable,
|
674
|
+
'Service is not available during funding fee settlement': OperationFailed,
|
673
675
|
},
|
674
676
|
},
|
675
677
|
})
|
@@ -794,7 +796,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
794
796
|
'max': None,
|
795
797
|
},
|
796
798
|
},
|
797
|
-
'networks':
|
799
|
+
'networks': networks,
|
798
800
|
'type': 'crypto',
|
799
801
|
'info': coin,
|
800
802
|
})
|
@@ -826,17 +828,19 @@ class coinex(Exchange, ImplicitAPI):
|
|
826
828
|
# "code": 0,
|
827
829
|
# "data": [
|
828
830
|
# {
|
829
|
-
# "
|
831
|
+
# "market": "BTCUSDT",
|
832
|
+
# "taker_fee_rate": "0.002",
|
833
|
+
# "maker_fee_rate": "0.002",
|
834
|
+
# "min_amount": "0.0005",
|
835
|
+
# "base_ccy": "BTC",
|
836
|
+
# "quote_ccy": "USDT",
|
830
837
|
# "base_ccy_precision": 8,
|
838
|
+
# "quote_ccy_precision": 2,
|
831
839
|
# "is_amm_available": True,
|
832
|
-
# "is_margin_available":
|
833
|
-
# "
|
834
|
-
# "
|
835
|
-
#
|
836
|
-
# "quote_ccy": "USDT",
|
837
|
-
# "quote_ccy_precision": 6,
|
838
|
-
# "taker_fee_rate": "0.003"
|
839
|
-
# },
|
840
|
+
# "is_margin_available": True,
|
841
|
+
# "is_pre_trading_available": True,
|
842
|
+
# "is_api_trading_available": True
|
843
|
+
# }
|
840
844
|
# ],
|
841
845
|
# "message": "OK"
|
842
846
|
# }
|
@@ -862,11 +866,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
862
866
|
'settleId': None,
|
863
867
|
'type': 'spot',
|
864
868
|
'spot': True,
|
865
|
-
'margin':
|
869
|
+
'margin': self.safe_bool(market, 'is_margin_available'),
|
866
870
|
'swap': False,
|
867
871
|
'future': False,
|
868
872
|
'option': False,
|
869
|
-
'active':
|
873
|
+
'active': self.safe_bool(market, 'is_api_trading_available'),
|
870
874
|
'contract': False,
|
871
875
|
'linear': None,
|
872
876
|
'inverse': None,
|
ccxt/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
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
ccxt/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/exmo.py
CHANGED
@@ -709,73 +709,85 @@ class exmo(Exchange, ImplicitAPI):
|
|
709
709
|
for i in range(0, len(currencyList)):
|
710
710
|
currency = currencyList[i]
|
711
711
|
currencyId = self.safe_string(currency, 'name')
|
712
|
-
|
713
|
-
providers = self.safe_value(cryptoList, currencyId)
|
714
|
-
active = False
|
712
|
+
code = self.safe_currency_code(currencyId)
|
715
713
|
type = 'crypto'
|
716
|
-
|
717
|
-
|
718
|
-
'min': None,
|
719
|
-
'max': None,
|
720
|
-
},
|
721
|
-
'withdraw': {
|
722
|
-
'min': None,
|
723
|
-
'max': None,
|
724
|
-
},
|
725
|
-
}
|
726
|
-
fee = None
|
727
|
-
depositEnabled = None
|
728
|
-
withdrawEnabled = None
|
714
|
+
networks = {}
|
715
|
+
providers = self.safe_list(cryptoList, currencyId)
|
729
716
|
if providers is None:
|
730
|
-
active = True
|
731
717
|
type = 'fiat'
|
732
718
|
else:
|
733
719
|
for j in range(0, len(providers)):
|
734
720
|
provider = providers[j]
|
721
|
+
name = self.safe_string(provider, 'name')
|
722
|
+
# get network-id by removing extra things
|
723
|
+
networkId = name.replace(currencyId + ' ', '')
|
724
|
+
networkId = networkId.replace('(', '')
|
725
|
+
replaceChar = ')' # transpiler trick
|
726
|
+
networkId = networkId.replace(replaceChar, '')
|
727
|
+
networkCode = self.network_id_to_code(networkId)
|
728
|
+
if not (networkCode in networks):
|
729
|
+
networks[networkCode] = {
|
730
|
+
'id': networkId,
|
731
|
+
'network': networkCode,
|
732
|
+
'active': None,
|
733
|
+
'deposit': None,
|
734
|
+
'withdraw': None,
|
735
|
+
'fee': None,
|
736
|
+
'limits': {
|
737
|
+
'withdraw': {
|
738
|
+
'min': None,
|
739
|
+
'max': None,
|
740
|
+
},
|
741
|
+
'deposit': {
|
742
|
+
'min': None,
|
743
|
+
'max': None,
|
744
|
+
},
|
745
|
+
},
|
746
|
+
'info': [], # set, because of multiple network sub-entries
|
747
|
+
}
|
735
748
|
typeInner = self.safe_string(provider, 'type')
|
736
749
|
minValue = self.safe_string(provider, 'min')
|
737
750
|
maxValue = self.safe_string(provider, 'max')
|
738
|
-
|
739
|
-
|
740
|
-
activeProvider = self.safe_value(provider, 'enabled')
|
751
|
+
activeProvider = self.safe_bool(provider, 'enabled')
|
752
|
+
networkEntry = networks[networkCode]
|
741
753
|
if typeInner == 'deposit':
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
depositEnabled = False
|
754
|
+
networkEntry['deposit'] = activeProvider
|
755
|
+
networkEntry['limits']['deposit']['min'] = minValue
|
756
|
+
networkEntry['limits']['deposit']['max'] = maxValue
|
746
757
|
elif typeInner == 'withdraw':
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
limits[typeInner]['min'] = minValue
|
756
|
-
limits[typeInner]['max'] = maxValue
|
757
|
-
if typeInner == 'withdraw':
|
758
|
-
commissionDesc = self.safe_string(provider, 'commission_desc')
|
759
|
-
fee = self.parse_fixed_float_value(commissionDesc)
|
760
|
-
code = self.safe_currency_code(currencyId)
|
761
|
-
info = {
|
762
|
-
'currency': currency,
|
763
|
-
'providers': providers,
|
764
|
-
}
|
765
|
-
result[code] = {
|
758
|
+
networkEntry['withdraw'] = activeProvider
|
759
|
+
networkEntry['limits']['withdraw']['min'] = minValue
|
760
|
+
networkEntry['limits']['withdraw']['max'] = maxValue
|
761
|
+
info = self.safe_list(networkEntry, 'info')
|
762
|
+
info.append(provider)
|
763
|
+
networkEntry['info'] = info
|
764
|
+
networks[networkCode] = networkEntry
|
765
|
+
result[code] = self.safe_currency_structure({
|
766
766
|
'id': currencyId,
|
767
767
|
'code': code,
|
768
|
-
'name':
|
768
|
+
'name': self.safe_string(currency, 'description'),
|
769
769
|
'type': type,
|
770
|
-
'active':
|
771
|
-
'deposit':
|
772
|
-
'withdraw':
|
773
|
-
'fee':
|
770
|
+
'active': None,
|
771
|
+
'deposit': None,
|
772
|
+
'withdraw': None,
|
773
|
+
'fee': None,
|
774
774
|
'precision': self.parse_number('1e-8'),
|
775
|
-
'limits':
|
776
|
-
|
777
|
-
|
778
|
-
|
775
|
+
'limits': {
|
776
|
+
'withdraw': {
|
777
|
+
'min': None,
|
778
|
+
'max': None,
|
779
|
+
},
|
780
|
+
'deposit': {
|
781
|
+
'min': None,
|
782
|
+
'max': None,
|
783
|
+
},
|
784
|
+
},
|
785
|
+
'info': {
|
786
|
+
'currency': currency,
|
787
|
+
'providers': providers,
|
788
|
+
},
|
789
|
+
'networks': networks,
|
790
|
+
})
|
779
791
|
return result
|
780
792
|
|
781
793
|
def fetch_markets(self, params={}) -> List[Market]:
|
ccxt/hyperliquid.py
CHANGED
@@ -695,7 +695,8 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
695
695
|
# }
|
696
696
|
#
|
697
697
|
quoteId = 'USDC'
|
698
|
-
|
698
|
+
baseName = self.safe_string(market, 'name')
|
699
|
+
base = self.safe_currency_code(baseName)
|
699
700
|
quote = self.safe_currency_code(quoteId)
|
700
701
|
baseId = self.safe_string(market, 'baseId')
|
701
702
|
settleId = 'USDC'
|
ccxt/kucoin.py
CHANGED
@@ -1396,35 +1396,31 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1396
1396
|
# }
|
1397
1397
|
#
|
1398
1398
|
currenciesData = self.safe_list(response, 'data', [])
|
1399
|
+
brokenCurrencies = self.safe_list(self.options, 'brokenCurrencies', ['00', 'OPEN_ERROR', 'HUF', 'BDT'])
|
1400
|
+
otherFiats = self.safe_list(self.options, 'fiats', ['KWD', 'IRR', 'PKR'])
|
1399
1401
|
result: dict = {}
|
1400
1402
|
for i in range(0, len(currenciesData)):
|
1401
1403
|
entry = currenciesData[i]
|
1402
1404
|
id = self.safe_string(entry, 'currency')
|
1403
|
-
|
1405
|
+
if self.in_array(id, brokenCurrencies):
|
1406
|
+
continue # skip buggy entries: https://t.me/KuCoin_API/217798
|
1404
1407
|
code = self.safe_currency_code(id)
|
1405
1408
|
networks: dict = {}
|
1406
1409
|
chains = self.safe_list(entry, 'chains', [])
|
1407
|
-
rawPrecision = self.safe_string(entry, 'precision')
|
1408
|
-
precision = self.parse_number(self.parse_precision(rawPrecision))
|
1409
1410
|
chainsLength = len(chains)
|
1410
|
-
if not chainsLength:
|
1411
|
-
# one buggy coin, which doesn't contain info https://t.me/KuCoin_API/173118
|
1412
|
-
continue
|
1413
1411
|
for j in range(0, chainsLength):
|
1414
1412
|
chain = chains[j]
|
1415
1413
|
chainId = self.safe_string(chain, 'chainId')
|
1416
1414
|
networkCode = self.network_id_to_code(chainId, code)
|
1417
|
-
chainWithdrawEnabled = self.safe_bool(chain, 'isWithdrawEnabled', False)
|
1418
|
-
chainDepositEnabled = self.safe_bool(chain, 'isDepositEnabled', False)
|
1419
1415
|
networks[networkCode] = {
|
1420
1416
|
'info': chain,
|
1421
1417
|
'id': chainId,
|
1422
1418
|
'name': self.safe_string(chain, 'chainName'),
|
1423
1419
|
'code': networkCode,
|
1424
|
-
'active':
|
1420
|
+
'active': None,
|
1425
1421
|
'fee': self.safe_number(chain, 'withdrawalMinFee'),
|
1426
|
-
'deposit':
|
1427
|
-
'withdraw':
|
1422
|
+
'deposit': self.safe_bool(chain, 'isDepositEnabled'),
|
1423
|
+
'withdraw': self.safe_bool(chain, 'isWithdrawEnabled'),
|
1428
1424
|
'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'withdrawPrecision'))),
|
1429
1425
|
'limits': {
|
1430
1426
|
'withdraw': {
|
@@ -1438,10 +1434,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1438
1434
|
},
|
1439
1435
|
}
|
1440
1436
|
# kucoin has determined 'fiat' currencies with below logic
|
1441
|
-
|
1437
|
+
rawPrecision = self.safe_string(entry, 'precision')
|
1438
|
+
precision = self.parse_number(self.parse_precision(rawPrecision))
|
1439
|
+
isFiat = self.in_array(id, otherFiats) or ((rawPrecision == '2') and (chainsLength == 0))
|
1442
1440
|
result[code] = self.safe_currency_structure({
|
1443
1441
|
'id': id,
|
1444
|
-
'name':
|
1442
|
+
'name': self.safe_string(entry, 'fullName'),
|
1445
1443
|
'code': code,
|
1446
1444
|
'type': 'fiat' if isFiat else 'crypto',
|
1447
1445
|
'precision': precision,
|
@@ -2627,7 +2625,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2627
2625
|
"""
|
2628
2626
|
self.load_markets()
|
2629
2627
|
request: dict = {}
|
2630
|
-
trigger = self.
|
2628
|
+
trigger = self.safe_bool_2(params, 'trigger', 'stop', False)
|
2631
2629
|
hf = None
|
2632
2630
|
hf, params = self.handle_hf_and_params(params)
|
2633
2631
|
params = self.omit(params, 'stop')
|