ccxt 4.4.70__py2.py3-none-any.whl → 4.4.72__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 -3
- ccxt/abstract/bingx.py +1 -0
- ccxt/abstract/bitmart.py +1 -0
- ccxt/abstract/poloniex.py +36 -0
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/binance.py +107 -102
- ccxt/async_support/bingx.py +65 -43
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex1.py +1 -1
- ccxt/async_support/bitget.py +0 -3
- ccxt/async_support/bitmart.py +12 -1
- ccxt/async_support/bitopro.py +1 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinbaseexchange.py +4 -2
- ccxt/async_support/coinbaseinternational.py +3 -2
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/deribit.py +3 -1
- ccxt/async_support/derive.py +11 -7
- ccxt/async_support/gate.py +3 -0
- ccxt/async_support/gemini.py +2 -1
- ccxt/async_support/hashkey.py +4 -2
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hyperliquid.py +38 -0
- ccxt/async_support/kraken.py +78 -6
- ccxt/async_support/krakenfutures.py +4 -0
- ccxt/async_support/kucoin.py +5 -3
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/mexc.py +9 -5
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +79 -76
- ccxt/async_support/paradex.py +65 -7
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/poloniex.py +1265 -86
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/whitebit.py +102 -4
- ccxt/async_support/woo.py +3 -1
- ccxt/async_support/woofipro.py +1 -1
- ccxt/async_support/yobit.py +2 -1
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +31 -4
- ccxt/base/types.py +28 -0
- ccxt/binance.py +107 -102
- ccxt/bingx.py +65 -43
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex1.py +1 -1
- ccxt/bitget.py +0 -3
- ccxt/bitmart.py +12 -1
- ccxt/bitopro.py +1 -0
- ccxt/bitrue.py +1 -0
- ccxt/bl3p.py +2 -2
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +3 -2
- ccxt/coinbaseexchange.py +4 -2
- ccxt/coinbaseinternational.py +3 -2
- ccxt/coinex.py +1 -1
- ccxt/deribit.py +3 -1
- ccxt/derive.py +11 -7
- ccxt/gate.py +3 -0
- ccxt/gemini.py +2 -1
- ccxt/hashkey.py +4 -2
- ccxt/hitbtc.py +1 -1
- ccxt/hyperliquid.py +38 -0
- ccxt/kraken.py +78 -6
- ccxt/krakenfutures.py +4 -0
- ccxt/kucoin.py +5 -3
- ccxt/kuna.py +1 -1
- ccxt/mexc.py +9 -5
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +79 -76
- ccxt/paradex.py +65 -7
- ccxt/paymium.py +1 -1
- ccxt/poloniex.py +1264 -86
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/binance.py +102 -102
- ccxt/pro/bingx.py +63 -52
- ccxt/pro/bitmart.py +15 -7
- ccxt/pro/derive.py +2 -2
- ccxt/pro/krakenfutures.py +1 -1
- ccxt/test/tests_async.py +1 -0
- ccxt/test/tests_sync.py +1 -0
- ccxt/upbit.py +1 -1
- ccxt/whitebit.py +102 -4
- ccxt/woo.py +3 -1
- ccxt/woofipro.py +1 -1
- ccxt/yobit.py +2 -1
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/METADATA +6 -9
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/RECORD +98 -99
- ccxt/abstract/poloniexfutures.py +0 -48
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/WHEEL +0 -0
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/top_level.txt +0 -0
ccxt/kraken.py
CHANGED
@@ -243,13 +243,13 @@ class kraken(Exchange, ImplicitAPI):
|
|
243
243
|
},
|
244
244
|
},
|
245
245
|
'commonCurrencies': {
|
246
|
+
# about X & Z prefixes and .S & .M suffixes, see comment under fetchCurrencies
|
246
247
|
'LUNA': 'LUNC',
|
247
248
|
'LUNA2': 'LUNA',
|
248
249
|
'REPV2': 'REP',
|
249
250
|
'REP': 'REPV1',
|
250
251
|
'UST': 'USTC',
|
251
252
|
'XBT': 'BTC',
|
252
|
-
'XBT.M': 'BTC.M', # https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-
|
253
253
|
'XDG': 'DOGE',
|
254
254
|
},
|
255
255
|
'options': {
|
@@ -780,9 +780,48 @@ class kraken(Exchange, ImplicitAPI):
|
|
780
780
|
# {
|
781
781
|
# "error": [],
|
782
782
|
# "result": {
|
783
|
-
# "
|
783
|
+
# "ATOM": {
|
784
784
|
# "aclass": "currency",
|
785
|
-
# "altname": "
|
785
|
+
# "altname": "ATOM",
|
786
|
+
# "collateral_value": "0.7",
|
787
|
+
# "decimals": 8,
|
788
|
+
# "display_decimals": 6,
|
789
|
+
# "margin_rate": 0.02,
|
790
|
+
# "status": "enabled",
|
791
|
+
# },
|
792
|
+
# "ATOM.S": {
|
793
|
+
# "aclass": "currency",
|
794
|
+
# "altname": "ATOM.S",
|
795
|
+
# "decimals": 8,
|
796
|
+
# "display_decimals": 6,
|
797
|
+
# "status": "enabled",
|
798
|
+
# },
|
799
|
+
# "XXBT": {
|
800
|
+
# "aclass": "currency",
|
801
|
+
# "altname": "XBT",
|
802
|
+
# "decimals": 10,
|
803
|
+
# "display_decimals": 5,
|
804
|
+
# "margin_rate": 0.01,
|
805
|
+
# "status": "enabled",
|
806
|
+
# },
|
807
|
+
# "XETH": {
|
808
|
+
# "aclass": "currency",
|
809
|
+
# "altname": "ETH",
|
810
|
+
# "decimals": 10,
|
811
|
+
# "display_decimals": 5
|
812
|
+
# "margin_rate": 0.02,
|
813
|
+
# "status": "enabled",
|
814
|
+
# },
|
815
|
+
# "XBT.M": {
|
816
|
+
# "aclass": "currency",
|
817
|
+
# "altname": "XBT.M",
|
818
|
+
# "decimals": 10,
|
819
|
+
# "display_decimals": 5
|
820
|
+
# "status": "enabled",
|
821
|
+
# },
|
822
|
+
# "ETH.M": {
|
823
|
+
# "aclass": "currency",
|
824
|
+
# "altname": "ETH.M",
|
786
825
|
# "decimals": 10,
|
787
826
|
# "display_decimals": 5
|
788
827
|
# "status": "enabled",
|
@@ -801,7 +840,27 @@ class kraken(Exchange, ImplicitAPI):
|
|
801
840
|
# see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
|
802
841
|
# to add support for multiple withdrawal/deposit methods and
|
803
842
|
# differentiated fees for each particular method
|
843
|
+
#
|
844
|
+
# Notes about abbreviations:
|
845
|
+
# Z and X prefixes: https://support.kraken.com/hc/en-us/articles/360001206766-Bitcoin-currency-code-XBT-vs-BTC
|
846
|
+
# S and M suffixes: https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-
|
847
|
+
#
|
804
848
|
code = self.safe_currency_code(id)
|
849
|
+
# the below can not be reliable done in `safeCurrencyCode`, so we have to do it here
|
850
|
+
if id.find('.') < 0:
|
851
|
+
altName = self.safe_string(currency, 'altname')
|
852
|
+
# handle cases like below:
|
853
|
+
#
|
854
|
+
# id | altname
|
855
|
+
# ---------------
|
856
|
+
# XXBT | XBT
|
857
|
+
# ZUSD | USD
|
858
|
+
if id != altName and (id.startswith('X') or id.startswith('Z')):
|
859
|
+
code = self.safe_currency_code(altName)
|
860
|
+
# also, add map in commonCurrencies:
|
861
|
+
self.commonCurrencies[id] = code
|
862
|
+
else:
|
863
|
+
code = self.safe_currency_code(id)
|
805
864
|
precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
|
806
865
|
# assumes all currencies are active except those listed above
|
807
866
|
active = self.safe_string(currency, 'status') == 'enabled'
|
@@ -829,6 +888,17 @@ class kraken(Exchange, ImplicitAPI):
|
|
829
888
|
}
|
830
889
|
return result
|
831
890
|
|
891
|
+
def safe_currency_code(self, currencyId: Str, currency: Currency = None) -> Str:
|
892
|
+
if currencyId is None:
|
893
|
+
return currencyId
|
894
|
+
if currencyId.find('.') > 0:
|
895
|
+
# if ID contains .M, .S or .F, then it can't contain X or Z prefix. in such case, ID equals to ALTNAME
|
896
|
+
parts = currencyId.split('.')
|
897
|
+
firstPart = self.safe_string(parts, 0)
|
898
|
+
secondPart = self.safe_string(parts, 1)
|
899
|
+
return super(kraken, self).safe_currency_code(firstPart, currency) + '.' + secondPart
|
900
|
+
return super(kraken, self).safe_currency_code(currencyId, currency)
|
901
|
+
|
832
902
|
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
833
903
|
"""
|
834
904
|
fetch the trading fees for a market
|
@@ -1492,8 +1562,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1492
1562
|
"""
|
1493
1563
|
self.load_markets()
|
1494
1564
|
# only buy orders are supported by the endpoint
|
1495
|
-
|
1496
|
-
|
1565
|
+
req = {
|
1566
|
+
'cost': cost,
|
1567
|
+
}
|
1568
|
+
return self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
1497
1569
|
|
1498
1570
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1499
1571
|
"""
|
@@ -2828,7 +2900,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2828
2900
|
data[dataLength - 1] = last
|
2829
2901
|
return data
|
2830
2902
|
|
2831
|
-
def create_deposit_address(self, code: str, params={}):
|
2903
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2832
2904
|
"""
|
2833
2905
|
create a currency deposit address
|
2834
2906
|
|
ccxt/krakenfutures.py
CHANGED
@@ -51,6 +51,10 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
51
51
|
'cancelOrders': True,
|
52
52
|
'createMarketOrder': False,
|
53
53
|
'createOrder': True,
|
54
|
+
'createPostOnlyOrder': True,
|
55
|
+
'createReduceOnlyOrder': True,
|
56
|
+
'createStopLimitOrder': True,
|
57
|
+
'createStopMarketOrder': True,
|
54
58
|
'createStopOrder': True,
|
55
59
|
'createTriggerOrder': True,
|
56
60
|
'editOrder': True,
|
ccxt/kucoin.py
CHANGED
@@ -1959,7 +1959,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1959
1959
|
data = self.safe_list(response, 'data', [])
|
1960
1960
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1961
1961
|
|
1962
|
-
def create_deposit_address(self, code: str, params={}):
|
1962
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1963
1963
|
"""
|
1964
1964
|
|
1965
1965
|
https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
|
@@ -2271,8 +2271,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2271
2271
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2272
2272
|
"""
|
2273
2273
|
self.load_markets()
|
2274
|
-
|
2275
|
-
|
2274
|
+
req = {
|
2275
|
+
'cost': cost,
|
2276
|
+
}
|
2277
|
+
return self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
2276
2278
|
|
2277
2279
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2278
2280
|
"""
|
ccxt/kuna.py
CHANGED
@@ -1572,7 +1572,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1572
1572
|
data = self.safe_dict(response, 'data', {})
|
1573
1573
|
return self.parse_transaction(data)
|
1574
1574
|
|
1575
|
-
def create_deposit_address(self, code: str, params={}):
|
1575
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1576
1576
|
"""
|
1577
1577
|
create a currency deposit address
|
1578
1578
|
|
ccxt/mexc.py
CHANGED
@@ -2195,8 +2195,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2195
2195
|
market = self.market(symbol)
|
2196
2196
|
if not market['spot']:
|
2197
2197
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2198
|
-
|
2199
|
-
|
2198
|
+
req = {
|
2199
|
+
'cost': cost,
|
2200
|
+
}
|
2201
|
+
return self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
2200
2202
|
|
2201
2203
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2202
2204
|
"""
|
@@ -2213,8 +2215,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2213
2215
|
market = self.market(symbol)
|
2214
2216
|
if not market['spot']:
|
2215
2217
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2216
|
-
|
2217
|
-
|
2218
|
+
req = {
|
2219
|
+
'cost': cost,
|
2220
|
+
}
|
2221
|
+
return self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
|
2218
2222
|
|
2219
2223
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2220
2224
|
"""
|
@@ -4533,7 +4537,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4533
4537
|
addressStructures = self.parse_deposit_addresses(response, None, False)
|
4534
4538
|
return self.index_by(addressStructures, 'network')
|
4535
4539
|
|
4536
|
-
def create_deposit_address(self, code: str, params={}):
|
4540
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
4537
4541
|
"""
|
4538
4542
|
create a currency deposit address
|
4539
4543
|
|
ccxt/ndax.py
CHANGED
@@ -2083,7 +2083,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
2083
2083
|
'tag': tag,
|
2084
2084
|
}
|
2085
2085
|
|
2086
|
-
def create_deposit_address(self, code: str, params={}):
|
2086
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2087
2087
|
"""
|
2088
2088
|
create a currency deposit address
|
2089
2089
|
:param str code: unified currency code of the currency for the deposit address
|
ccxt/okcoin.py
CHANGED
@@ -56,6 +56,10 @@ class okcoin(Exchange, ImplicitAPI):
|
|
56
56
|
'createMarketOrderWithCost': False,
|
57
57
|
'createMarketSellOrderWithCost': False,
|
58
58
|
'createOrder': True,
|
59
|
+
'createPostOnlyOrder': True,
|
60
|
+
'createReduceOnlyOrder': True,
|
61
|
+
'createStopLimitOrder': True,
|
62
|
+
'createStopMarketOrder': True,
|
59
63
|
'createStopOrder': True,
|
60
64
|
'createTriggerOrder': True,
|
61
65
|
'fetchBalance': True,
|
ccxt/okx.py
CHANGED
@@ -1012,71 +1012,64 @@ class okx(Exchange, ImplicitAPI):
|
|
1012
1012
|
'networks': {
|
1013
1013
|
'BTC': 'Bitcoin',
|
1014
1014
|
'BTCLN': 'Lightning',
|
1015
|
+
'BTCLIGHTNING': 'Lightning',
|
1015
1016
|
'BEP20': 'BSC',
|
1017
|
+
'BRC20': 'BRC20',
|
1016
1018
|
'ERC20': 'ERC20',
|
1017
1019
|
'TRC20': 'TRC20',
|
1018
1020
|
'CRC20': 'Crypto',
|
1019
|
-
# sorted
|
1020
1021
|
'ACA': 'Acala',
|
1021
1022
|
'ALGO': 'Algorand',
|
1022
|
-
'BHP': 'BHP',
|
1023
1023
|
'APT': 'Aptos',
|
1024
|
+
'SCROLL': 'Scroll',
|
1024
1025
|
'ARBONE': 'Arbitrum One',
|
1025
1026
|
'AVAXC': 'Avalanche C-Chain',
|
1026
1027
|
'AVAXX': 'Avalanche X-Chain',
|
1027
|
-
'
|
1028
|
+
'BASE': 'Base',
|
1029
|
+
'SUI': 'SUI',
|
1030
|
+
'ZKSYNCERA': 'zkSync Era',
|
1031
|
+
'LINEA': 'Linea',
|
1028
1032
|
'AR': 'Arweave',
|
1029
1033
|
'ASTR': 'Astar',
|
1030
1034
|
'BCH': 'BitcoinCash',
|
1031
1035
|
'BSV': 'Bitcoin SV',
|
1032
|
-
'BTM': 'Bytom',
|
1033
1036
|
'ADA': 'Cardano',
|
1034
1037
|
'CSPR': 'Casper',
|
1035
1038
|
'CELO': 'CELO',
|
1036
1039
|
'XCH': 'Chia',
|
1037
|
-
'CHZ': 'Chiliz',
|
1040
|
+
# 'CHZ': 'Chiliz', TBD: Chiliz 2.0 Chain vs Chiliz Chain
|
1038
1041
|
'ATOM': 'Cosmos',
|
1039
|
-
'TRUE': 'TrueChain',
|
1040
|
-
'DCR': 'Decred',
|
1041
1042
|
'DGB': 'Digibyte',
|
1042
1043
|
'DOGE': 'Dogecoin',
|
1043
|
-
'XEC': 'XEC',
|
1044
1044
|
'EGLD': 'Elrond',
|
1045
|
+
'CFX': 'Conflux', # CFX_EVM is different
|
1045
1046
|
'EOS': 'EOS',
|
1047
|
+
'CORE': 'CORE',
|
1046
1048
|
'ETC': 'Ethereum Classic',
|
1047
1049
|
'ETHW': 'EthereumPow',
|
1048
|
-
'FTM': 'Fantom',
|
1050
|
+
# 'FTM': 'Fantom', 'Sonic' TBD
|
1049
1051
|
'FIL': 'Filecoin',
|
1050
|
-
'FLOW': 'FLOW',
|
1051
|
-
'FSN': 'Fusion',
|
1052
1052
|
'ONE': 'Harmony',
|
1053
1053
|
'HBAR': 'Hedera',
|
1054
|
-
'HNT': 'Helium',
|
1055
|
-
'ZEN': 'Horizen',
|
1056
1054
|
'ICX': 'ICON',
|
1057
1055
|
'ICP': 'Dfinity',
|
1058
1056
|
'IOST': 'IOST',
|
1059
1057
|
'IOTA': 'MIOTA',
|
1060
|
-
'KDA': 'Kadena',
|
1061
|
-
'KAR': 'KAR',
|
1062
1058
|
'KLAY': 'Klaytn',
|
1063
1059
|
'KSM': 'Kusama',
|
1064
1060
|
'LSK': 'Lisk',
|
1065
1061
|
'LTC': 'Litecoin',
|
1066
1062
|
'METIS': 'Metis',
|
1067
1063
|
'MINA': 'Mina',
|
1068
|
-
'XMR': 'Monero',
|
1069
1064
|
'GLRM': 'Moonbeam',
|
1070
1065
|
'MOVR': 'Moonriver',
|
1071
1066
|
'NANO': 'Nano',
|
1072
1067
|
'NEAR': 'NEAR',
|
1073
|
-
'NAS': 'Nebulas',
|
1074
|
-
'NEM': 'New Economy Movement',
|
1075
1068
|
'NULS': 'NULS',
|
1076
1069
|
'OASYS': 'OASYS',
|
1077
|
-
'OKC': 'OKC',
|
1078
1070
|
'ONT': 'Ontology',
|
1079
1071
|
'OPTIMISM': 'Optimism',
|
1072
|
+
# 'OP': 'Optimism', or Optimism(V2), TBD
|
1080
1073
|
'LAT': 'PlatON',
|
1081
1074
|
'DOT': 'Polkadot',
|
1082
1075
|
'MATIC': 'Polygon',
|
@@ -1089,35 +1082,54 @@ class okx(Exchange, ImplicitAPI):
|
|
1089
1082
|
'XTZ': 'Tezos',
|
1090
1083
|
'TON': 'TON',
|
1091
1084
|
'THETA': 'Theta',
|
1092
|
-
'VSYS': 'VSYSTEMS',
|
1093
|
-
'WAVES': 'WAVES',
|
1094
1085
|
'WAX': 'Wax',
|
1095
|
-
'ZEC': 'Zcash',
|
1096
1086
|
'ZIL': 'Zilliqa',
|
1097
|
-
|
1098
|
-
|
1099
|
-
#
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
-
#
|
1103
|
-
#
|
1104
|
-
#
|
1105
|
-
#
|
1106
|
-
#
|
1107
|
-
#
|
1108
|
-
#
|
1109
|
-
#
|
1110
|
-
#
|
1111
|
-
#
|
1112
|
-
#
|
1113
|
-
#
|
1114
|
-
#
|
1115
|
-
#
|
1116
|
-
#
|
1117
|
-
#
|
1118
|
-
#
|
1119
|
-
#
|
1120
|
-
#
|
1087
|
+
# non-supported known network: CRP. KAVA, TAIKO, BOB, GNO, BLAST, RSK, SEI, MANTLE, HYPE, RUNE, OSMO, XIN, WEMIX, HT, FSN, NEO, TLOS, CANTO, SCRT, AURORA, XMR
|
1088
|
+
# others:
|
1089
|
+
# "OKTC",
|
1090
|
+
# "X Layer",
|
1091
|
+
# "Polygon(Bridged)",
|
1092
|
+
# "BTCK-OKTC",
|
1093
|
+
# "ETHK-OKTC",
|
1094
|
+
# "Starknet",
|
1095
|
+
# "LTCK-OKTC",
|
1096
|
+
# "XRPK-OKTC",
|
1097
|
+
# "BCHK-OKTC",
|
1098
|
+
# "ETCK-OKTC",
|
1099
|
+
# "Endurance Smart Chain",
|
1100
|
+
# "Berachain",
|
1101
|
+
# "CELO-TOKEN",
|
1102
|
+
# "CFX_EVM",
|
1103
|
+
# "Cortex",
|
1104
|
+
# "DAIK-OKTC",
|
1105
|
+
# "Dora Vota Mainnet",
|
1106
|
+
# "DOTK-OKTC",
|
1107
|
+
# "DYDX",
|
1108
|
+
# "AELF",
|
1109
|
+
# "Enjin Relay Chain",
|
1110
|
+
# "FEVM",
|
1111
|
+
# "FILK-OKTC",
|
1112
|
+
# "Flare",
|
1113
|
+
# "Gravity Alpha Mainnet",
|
1114
|
+
# "INJ",
|
1115
|
+
# "Story",
|
1116
|
+
# "LINKK-OKTC",
|
1117
|
+
# "Terra",
|
1118
|
+
# "Terra Classic",
|
1119
|
+
# "Terra Classic(USTC)",
|
1120
|
+
# "MERLIN Network",
|
1121
|
+
# "Layer 3",
|
1122
|
+
# "PI",
|
1123
|
+
# "Ronin",
|
1124
|
+
# "Quantum",
|
1125
|
+
# "SHIBK-OKTC",
|
1126
|
+
# "SUSHIK-OKTC",
|
1127
|
+
# "Celestia",
|
1128
|
+
# "TRXK-OKTC",
|
1129
|
+
# "UNIK-OKTC",
|
1130
|
+
# "Venom",
|
1131
|
+
# "WBTCK-OKTC",
|
1132
|
+
# "ZetaChain",
|
1121
1133
|
},
|
1122
1134
|
'fetchOpenInterestHistory': {
|
1123
1135
|
'timeframes': {
|
@@ -1611,11 +1623,12 @@ class okx(Exchange, ImplicitAPI):
|
|
1611
1623
|
optionType = None
|
1612
1624
|
if contract:
|
1613
1625
|
symbol = symbol + ':' + settle
|
1614
|
-
expiry = self.safe_integer(market, 'expTime')
|
1615
1626
|
if future:
|
1627
|
+
expiry = self.safe_integer(market, 'expTime')
|
1616
1628
|
ymd = self.yymmdd(expiry)
|
1617
1629
|
symbol = symbol + '-' + ymd
|
1618
1630
|
elif option:
|
1631
|
+
expiry = self.safe_integer(market, 'expTime')
|
1619
1632
|
strikePrice = self.safe_string(market, 'stk')
|
1620
1633
|
optionType = self.safe_string(market, 'optType')
|
1621
1634
|
ymd = self.yymmdd(expiry)
|
@@ -1806,38 +1819,24 @@ class okx(Exchange, ImplicitAPI):
|
|
1806
1819
|
code = currency['code']
|
1807
1820
|
chains = dataByCurrencyId[currencyId]
|
1808
1821
|
networks: dict = {}
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
maxPrecision = None
|
1813
|
-
for j in range(0, len(chains)):
|
1822
|
+
type = 'crypto'
|
1823
|
+
chainsLength = len(chains)
|
1824
|
+
for j in range(0, chainsLength):
|
1814
1825
|
chain = chains[j]
|
1815
|
-
|
1816
|
-
|
1817
|
-
canWithdraw = self.safe_bool(chain, 'canWd')
|
1818
|
-
withdrawEnabled = canWithdraw if (canWithdraw) else withdrawEnabled
|
1819
|
-
canInternal = self.safe_bool(chain, 'canInternal')
|
1820
|
-
active = True if (canDeposit and canWithdraw and canInternal) else False
|
1821
|
-
currencyActive = active if (active) else currencyActive
|
1822
|
-
networkId = self.safe_string(chain, 'chain')
|
1823
|
-
if (networkId is not None) and (networkId.find('-') >= 0):
|
1826
|
+
networkId = self.safe_string(chain, 'chain') # USDT-BEP20, USDT-Avalance-C, etc
|
1827
|
+
if networkId is not None:
|
1824
1828
|
idParts = networkId.split('-')
|
1825
1829
|
parts = self.array_slice(idParts, 1)
|
1826
1830
|
chainPart = '-'.join(parts)
|
1827
1831
|
networkCode = self.network_id_to_code(chainPart, currency['code'])
|
1828
|
-
precision = self.parse_precision(self.safe_string(chain, 'wdTickSz'))
|
1829
|
-
if maxPrecision is None:
|
1830
|
-
maxPrecision = precision
|
1831
|
-
else:
|
1832
|
-
maxPrecision = Precise.string_min(maxPrecision, precision)
|
1833
1832
|
networks[networkCode] = {
|
1834
1833
|
'id': networkId,
|
1835
1834
|
'network': networkCode,
|
1836
|
-
'active':
|
1837
|
-
'deposit':
|
1838
|
-
'withdraw':
|
1835
|
+
'active': None,
|
1836
|
+
'deposit': self.safe_bool(chain, 'canDep'),
|
1837
|
+
'withdraw': self.safe_bool(chain, 'canWd'),
|
1839
1838
|
'fee': self.safe_number(chain, 'fee'),
|
1840
|
-
'precision': self.parse_number(
|
1839
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'wdTickSz'))),
|
1841
1840
|
'limits': {
|
1842
1841
|
'withdraw': {
|
1843
1842
|
'min': self.safe_number(chain, 'minWd'),
|
@@ -1846,25 +1845,29 @@ class okx(Exchange, ImplicitAPI):
|
|
1846
1845
|
},
|
1847
1846
|
'info': chain,
|
1848
1847
|
}
|
1848
|
+
else:
|
1849
|
+
# only happens for FIAT currency
|
1850
|
+
type = 'fiat'
|
1849
1851
|
firstChain = self.safe_dict(chains, 0, {})
|
1850
|
-
result[code] = {
|
1852
|
+
result[code] = self.safe_currency_structure({
|
1851
1853
|
'info': chains,
|
1852
1854
|
'code': code,
|
1853
1855
|
'id': currencyId,
|
1854
1856
|
'name': self.safe_string(firstChain, 'name'),
|
1855
|
-
'active':
|
1856
|
-
'deposit':
|
1857
|
-
'withdraw':
|
1857
|
+
'active': None,
|
1858
|
+
'deposit': None,
|
1859
|
+
'withdraw': None,
|
1858
1860
|
'fee': None,
|
1859
|
-
'precision':
|
1861
|
+
'precision': None,
|
1860
1862
|
'limits': {
|
1861
1863
|
'amount': {
|
1862
1864
|
'min': None,
|
1863
1865
|
'max': None,
|
1864
1866
|
},
|
1865
1867
|
},
|
1868
|
+
'type': type,
|
1866
1869
|
'networks': networks,
|
1867
|
-
}
|
1870
|
+
})
|
1868
1871
|
return result
|
1869
1872
|
|
1870
1873
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
ccxt/paradex.py
CHANGED
@@ -496,6 +496,57 @@ class paradex(Exchange, ImplicitAPI):
|
|
496
496
|
# "max_tob_spread": "0.2"
|
497
497
|
# }
|
498
498
|
#
|
499
|
+
# {
|
500
|
+
# "symbol":"BTC-USD-96000-C",
|
501
|
+
# "base_currency":"BTC",
|
502
|
+
# "quote_currency":"USD",
|
503
|
+
# "settlement_currency":"USDC",
|
504
|
+
# "order_size_increment":"0.001",
|
505
|
+
# "price_tick_size":"0.01",
|
506
|
+
# "min_notional":"100",
|
507
|
+
# "open_at":"1736764200000",
|
508
|
+
# "expiry_at":"0",
|
509
|
+
# "asset_kind":"PERP_OPTION",
|
510
|
+
# "market_kind":"cross",
|
511
|
+
# "position_limit":"10",
|
512
|
+
# "price_bands_width":"0.05",
|
513
|
+
# "iv_bands_width":"0.05",
|
514
|
+
# "max_open_orders":"100",
|
515
|
+
# "max_funding_rate":"0.02",
|
516
|
+
# "option_cross_margin_params":{
|
517
|
+
# "imf":{
|
518
|
+
# "long_itm":"0.2",
|
519
|
+
# "short_itm":"0.15",
|
520
|
+
# "short_otm":"0.1",
|
521
|
+
# "short_put_cap":"0.5",
|
522
|
+
# "premium_multiplier":"1"
|
523
|
+
# },
|
524
|
+
# "mmf":{
|
525
|
+
# "long_itm":"0.1",
|
526
|
+
# "short_itm":"0.075",
|
527
|
+
# "short_otm":"0.05",
|
528
|
+
# "short_put_cap":"0.5",
|
529
|
+
# "premium_multiplier":"0.5"
|
530
|
+
# }
|
531
|
+
# },
|
532
|
+
# "price_feed_id":"GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU",
|
533
|
+
# "oracle_ewma_factor":"0.20000046249626113",
|
534
|
+
# "max_order_size":"2",
|
535
|
+
# "max_funding_rate_change":"0.02",
|
536
|
+
# "max_tob_spread":"0.2",
|
537
|
+
# "interest_rate":"0.0001",
|
538
|
+
# "clamp_rate":"0.02",
|
539
|
+
# "option_type":"CALL",
|
540
|
+
# "strike_price":"96000",
|
541
|
+
# "funding_period_hours":"24",
|
542
|
+
# "tags":[
|
543
|
+
# ]
|
544
|
+
# }
|
545
|
+
#
|
546
|
+
assetKind = self.safe_string(market, 'asset_kind')
|
547
|
+
isOption = (assetKind == 'PERP_OPTION')
|
548
|
+
type = 'option' if (isOption) else 'swap'
|
549
|
+
isSwap = (type == 'swap')
|
499
550
|
marketId = self.safe_string(market, 'symbol')
|
500
551
|
quoteId = self.safe_string(market, 'quote_currency')
|
501
552
|
baseId = self.safe_string(market, 'base_currency')
|
@@ -505,6 +556,13 @@ class paradex(Exchange, ImplicitAPI):
|
|
505
556
|
settle = self.safe_currency_code(settleId)
|
506
557
|
symbol = base + '/' + quote + ':' + settle
|
507
558
|
expiry = self.safe_integer(market, 'expiry_at')
|
559
|
+
optionType = self.safe_string(market, 'option_type')
|
560
|
+
strikePrice = self.safe_string(market, 'strike_price')
|
561
|
+
if isOption:
|
562
|
+
optionTypeSuffix = 'C' if (optionType == 'CALL') else 'P'
|
563
|
+
symbol = symbol + '-' + strikePrice + '-' + optionTypeSuffix
|
564
|
+
else:
|
565
|
+
expiry = None
|
508
566
|
takerFee = self.parse_number('0.0003')
|
509
567
|
makerFee = self.parse_number('-0.00005')
|
510
568
|
return self.safe_market_structure({
|
@@ -516,23 +574,23 @@ class paradex(Exchange, ImplicitAPI):
|
|
516
574
|
'baseId': baseId,
|
517
575
|
'quoteId': quoteId,
|
518
576
|
'settleId': settleId,
|
519
|
-
'type':
|
577
|
+
'type': type,
|
520
578
|
'spot': False,
|
521
579
|
'margin': None,
|
522
|
-
'swap':
|
580
|
+
'swap': isSwap,
|
523
581
|
'future': False,
|
524
|
-
'option':
|
582
|
+
'option': isOption,
|
525
583
|
'active': self.safe_bool(market, 'enableTrading'),
|
526
584
|
'contract': True,
|
527
585
|
'linear': True,
|
528
|
-
'inverse':
|
586
|
+
'inverse': False,
|
529
587
|
'taker': takerFee,
|
530
588
|
'maker': makerFee,
|
531
589
|
'contractSize': self.parse_number('1'),
|
532
|
-
'expiry':
|
590
|
+
'expiry': expiry,
|
533
591
|
'expiryDatetime': None if (expiry == 0) else self.iso8601(expiry),
|
534
|
-
'strike':
|
535
|
-
'optionType':
|
592
|
+
'strike': self.parse_number(strikePrice),
|
593
|
+
'optionType': self.safe_string_lower(market, 'option_type'),
|
536
594
|
'precision': {
|
537
595
|
'amount': self.safe_number(market, 'order_size_increment'),
|
538
596
|
'price': self.safe_number(market, 'price_tick_size'),
|
ccxt/paymium.py
CHANGED
@@ -333,7 +333,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
333
333
|
response = self.publicGetDataCurrencyTrades(self.extend(request, params))
|
334
334
|
return self.parse_trades(response, market, since, limit)
|
335
335
|
|
336
|
-
def create_deposit_address(self, code: str, params={}):
|
336
|
+
def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
337
337
|
"""
|
338
338
|
create a currency deposit address
|
339
339
|
|