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/async_support/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
|
async 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
|
await self.load_markets()
|
1494
1564
|
# only buy orders are supported by the endpoint
|
1495
|
-
|
1496
|
-
|
1565
|
+
req = {
|
1566
|
+
'cost': cost,
|
1567
|
+
}
|
1568
|
+
return await self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
1497
1569
|
|
1498
1570
|
async 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
|
-
async def create_deposit_address(self, code: str, params={}):
|
2903
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2832
2904
|
"""
|
2833
2905
|
create a currency deposit address
|
2834
2906
|
|
@@ -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/async_support/kucoin.py
CHANGED
@@ -1960,7 +1960,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1960
1960
|
data = self.safe_list(response, 'data', [])
|
1961
1961
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1962
1962
|
|
1963
|
-
async def create_deposit_address(self, code: str, params={}):
|
1963
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1964
1964
|
"""
|
1965
1965
|
|
1966
1966
|
https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
|
@@ -2272,8 +2272,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2272
2272
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2273
2273
|
"""
|
2274
2274
|
await self.load_markets()
|
2275
|
-
|
2276
|
-
|
2275
|
+
req = {
|
2276
|
+
'cost': cost,
|
2277
|
+
}
|
2278
|
+
return await self.create_order(symbol, 'market', side, cost, None, self.extend(req, params))
|
2277
2279
|
|
2278
2280
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2279
2281
|
"""
|
ccxt/async_support/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
|
-
async def create_deposit_address(self, code: str, params={}):
|
1575
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1576
1576
|
"""
|
1577
1577
|
create a currency deposit address
|
1578
1578
|
|
ccxt/async_support/mexc.py
CHANGED
@@ -2196,8 +2196,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2196
2196
|
market = self.market(symbol)
|
2197
2197
|
if not market['spot']:
|
2198
2198
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2199
|
-
|
2200
|
-
|
2199
|
+
req = {
|
2200
|
+
'cost': cost,
|
2201
|
+
}
|
2202
|
+
return await self.create_order(symbol, 'market', 'buy', 0, None, self.extend(req, params))
|
2201
2203
|
|
2202
2204
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2203
2205
|
"""
|
@@ -2214,8 +2216,10 @@ class mexc(Exchange, ImplicitAPI):
|
|
2214
2216
|
market = self.market(symbol)
|
2215
2217
|
if not market['spot']:
|
2216
2218
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot orders only')
|
2217
|
-
|
2218
|
-
|
2219
|
+
req = {
|
2220
|
+
'cost': cost,
|
2221
|
+
}
|
2222
|
+
return await self.create_order(symbol, 'market', 'sell', 0, None, self.extend(req, params))
|
2219
2223
|
|
2220
2224
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2221
2225
|
"""
|
@@ -4534,7 +4538,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4534
4538
|
addressStructures = self.parse_deposit_addresses(response, None, False)
|
4535
4539
|
return self.index_by(addressStructures, 'network')
|
4536
4540
|
|
4537
|
-
async def create_deposit_address(self, code: str, params={}):
|
4541
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
4538
4542
|
"""
|
4539
4543
|
create a currency deposit address
|
4540
4544
|
|
ccxt/async_support/ndax.py
CHANGED
@@ -2083,7 +2083,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
2083
2083
|
'tag': tag,
|
2084
2084
|
}
|
2085
2085
|
|
2086
|
-
async def create_deposit_address(self, code: str, params={}):
|
2086
|
+
async 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/async_support/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/async_support/okx.py
CHANGED
@@ -1013,71 +1013,64 @@ class okx(Exchange, ImplicitAPI):
|
|
1013
1013
|
'networks': {
|
1014
1014
|
'BTC': 'Bitcoin',
|
1015
1015
|
'BTCLN': 'Lightning',
|
1016
|
+
'BTCLIGHTNING': 'Lightning',
|
1016
1017
|
'BEP20': 'BSC',
|
1018
|
+
'BRC20': 'BRC20',
|
1017
1019
|
'ERC20': 'ERC20',
|
1018
1020
|
'TRC20': 'TRC20',
|
1019
1021
|
'CRC20': 'Crypto',
|
1020
|
-
# sorted
|
1021
1022
|
'ACA': 'Acala',
|
1022
1023
|
'ALGO': 'Algorand',
|
1023
|
-
'BHP': 'BHP',
|
1024
1024
|
'APT': 'Aptos',
|
1025
|
+
'SCROLL': 'Scroll',
|
1025
1026
|
'ARBONE': 'Arbitrum One',
|
1026
1027
|
'AVAXC': 'Avalanche C-Chain',
|
1027
1028
|
'AVAXX': 'Avalanche X-Chain',
|
1028
|
-
'
|
1029
|
+
'BASE': 'Base',
|
1030
|
+
'SUI': 'SUI',
|
1031
|
+
'ZKSYNCERA': 'zkSync Era',
|
1032
|
+
'LINEA': 'Linea',
|
1029
1033
|
'AR': 'Arweave',
|
1030
1034
|
'ASTR': 'Astar',
|
1031
1035
|
'BCH': 'BitcoinCash',
|
1032
1036
|
'BSV': 'Bitcoin SV',
|
1033
|
-
'BTM': 'Bytom',
|
1034
1037
|
'ADA': 'Cardano',
|
1035
1038
|
'CSPR': 'Casper',
|
1036
1039
|
'CELO': 'CELO',
|
1037
1040
|
'XCH': 'Chia',
|
1038
|
-
'CHZ': 'Chiliz',
|
1041
|
+
# 'CHZ': 'Chiliz', TBD: Chiliz 2.0 Chain vs Chiliz Chain
|
1039
1042
|
'ATOM': 'Cosmos',
|
1040
|
-
'TRUE': 'TrueChain',
|
1041
|
-
'DCR': 'Decred',
|
1042
1043
|
'DGB': 'Digibyte',
|
1043
1044
|
'DOGE': 'Dogecoin',
|
1044
|
-
'XEC': 'XEC',
|
1045
1045
|
'EGLD': 'Elrond',
|
1046
|
+
'CFX': 'Conflux', # CFX_EVM is different
|
1046
1047
|
'EOS': 'EOS',
|
1048
|
+
'CORE': 'CORE',
|
1047
1049
|
'ETC': 'Ethereum Classic',
|
1048
1050
|
'ETHW': 'EthereumPow',
|
1049
|
-
'FTM': 'Fantom',
|
1051
|
+
# 'FTM': 'Fantom', 'Sonic' TBD
|
1050
1052
|
'FIL': 'Filecoin',
|
1051
|
-
'FLOW': 'FLOW',
|
1052
|
-
'FSN': 'Fusion',
|
1053
1053
|
'ONE': 'Harmony',
|
1054
1054
|
'HBAR': 'Hedera',
|
1055
|
-
'HNT': 'Helium',
|
1056
|
-
'ZEN': 'Horizen',
|
1057
1055
|
'ICX': 'ICON',
|
1058
1056
|
'ICP': 'Dfinity',
|
1059
1057
|
'IOST': 'IOST',
|
1060
1058
|
'IOTA': 'MIOTA',
|
1061
|
-
'KDA': 'Kadena',
|
1062
|
-
'KAR': 'KAR',
|
1063
1059
|
'KLAY': 'Klaytn',
|
1064
1060
|
'KSM': 'Kusama',
|
1065
1061
|
'LSK': 'Lisk',
|
1066
1062
|
'LTC': 'Litecoin',
|
1067
1063
|
'METIS': 'Metis',
|
1068
1064
|
'MINA': 'Mina',
|
1069
|
-
'XMR': 'Monero',
|
1070
1065
|
'GLRM': 'Moonbeam',
|
1071
1066
|
'MOVR': 'Moonriver',
|
1072
1067
|
'NANO': 'Nano',
|
1073
1068
|
'NEAR': 'NEAR',
|
1074
|
-
'NAS': 'Nebulas',
|
1075
|
-
'NEM': 'New Economy Movement',
|
1076
1069
|
'NULS': 'NULS',
|
1077
1070
|
'OASYS': 'OASYS',
|
1078
|
-
'OKC': 'OKC',
|
1079
1071
|
'ONT': 'Ontology',
|
1080
1072
|
'OPTIMISM': 'Optimism',
|
1073
|
+
# 'OP': 'Optimism', or Optimism(V2), TBD
|
1081
1074
|
'LAT': 'PlatON',
|
1082
1075
|
'DOT': 'Polkadot',
|
1083
1076
|
'MATIC': 'Polygon',
|
@@ -1090,35 +1083,54 @@ class okx(Exchange, ImplicitAPI):
|
|
1090
1083
|
'XTZ': 'Tezos',
|
1091
1084
|
'TON': 'TON',
|
1092
1085
|
'THETA': 'Theta',
|
1093
|
-
'VSYS': 'VSYSTEMS',
|
1094
|
-
'WAVES': 'WAVES',
|
1095
1086
|
'WAX': 'Wax',
|
1096
|
-
'ZEC': 'Zcash',
|
1097
1087
|
'ZIL': 'Zilliqa',
|
1098
|
-
|
1099
|
-
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
-
#
|
1103
|
-
#
|
1104
|
-
#
|
1105
|
-
#
|
1106
|
-
#
|
1107
|
-
#
|
1108
|
-
#
|
1109
|
-
#
|
1110
|
-
#
|
1111
|
-
#
|
1112
|
-
#
|
1113
|
-
#
|
1114
|
-
#
|
1115
|
-
#
|
1116
|
-
#
|
1117
|
-
#
|
1118
|
-
#
|
1119
|
-
#
|
1120
|
-
#
|
1121
|
-
#
|
1088
|
+
# 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
|
1089
|
+
# others:
|
1090
|
+
# "OKTC",
|
1091
|
+
# "X Layer",
|
1092
|
+
# "Polygon(Bridged)",
|
1093
|
+
# "BTCK-OKTC",
|
1094
|
+
# "ETHK-OKTC",
|
1095
|
+
# "Starknet",
|
1096
|
+
# "LTCK-OKTC",
|
1097
|
+
# "XRPK-OKTC",
|
1098
|
+
# "BCHK-OKTC",
|
1099
|
+
# "ETCK-OKTC",
|
1100
|
+
# "Endurance Smart Chain",
|
1101
|
+
# "Berachain",
|
1102
|
+
# "CELO-TOKEN",
|
1103
|
+
# "CFX_EVM",
|
1104
|
+
# "Cortex",
|
1105
|
+
# "DAIK-OKTC",
|
1106
|
+
# "Dora Vota Mainnet",
|
1107
|
+
# "DOTK-OKTC",
|
1108
|
+
# "DYDX",
|
1109
|
+
# "AELF",
|
1110
|
+
# "Enjin Relay Chain",
|
1111
|
+
# "FEVM",
|
1112
|
+
# "FILK-OKTC",
|
1113
|
+
# "Flare",
|
1114
|
+
# "Gravity Alpha Mainnet",
|
1115
|
+
# "INJ",
|
1116
|
+
# "Story",
|
1117
|
+
# "LINKK-OKTC",
|
1118
|
+
# "Terra",
|
1119
|
+
# "Terra Classic",
|
1120
|
+
# "Terra Classic(USTC)",
|
1121
|
+
# "MERLIN Network",
|
1122
|
+
# "Layer 3",
|
1123
|
+
# "PI",
|
1124
|
+
# "Ronin",
|
1125
|
+
# "Quantum",
|
1126
|
+
# "SHIBK-OKTC",
|
1127
|
+
# "SUSHIK-OKTC",
|
1128
|
+
# "Celestia",
|
1129
|
+
# "TRXK-OKTC",
|
1130
|
+
# "UNIK-OKTC",
|
1131
|
+
# "Venom",
|
1132
|
+
# "WBTCK-OKTC",
|
1133
|
+
# "ZetaChain",
|
1122
1134
|
},
|
1123
1135
|
'fetchOpenInterestHistory': {
|
1124
1136
|
'timeframes': {
|
@@ -1612,11 +1624,12 @@ class okx(Exchange, ImplicitAPI):
|
|
1612
1624
|
optionType = None
|
1613
1625
|
if contract:
|
1614
1626
|
symbol = symbol + ':' + settle
|
1615
|
-
expiry = self.safe_integer(market, 'expTime')
|
1616
1627
|
if future:
|
1628
|
+
expiry = self.safe_integer(market, 'expTime')
|
1617
1629
|
ymd = self.yymmdd(expiry)
|
1618
1630
|
symbol = symbol + '-' + ymd
|
1619
1631
|
elif option:
|
1632
|
+
expiry = self.safe_integer(market, 'expTime')
|
1620
1633
|
strikePrice = self.safe_string(market, 'stk')
|
1621
1634
|
optionType = self.safe_string(market, 'optType')
|
1622
1635
|
ymd = self.yymmdd(expiry)
|
@@ -1807,38 +1820,24 @@ class okx(Exchange, ImplicitAPI):
|
|
1807
1820
|
code = currency['code']
|
1808
1821
|
chains = dataByCurrencyId[currencyId]
|
1809
1822
|
networks: dict = {}
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
maxPrecision = None
|
1814
|
-
for j in range(0, len(chains)):
|
1823
|
+
type = 'crypto'
|
1824
|
+
chainsLength = len(chains)
|
1825
|
+
for j in range(0, chainsLength):
|
1815
1826
|
chain = chains[j]
|
1816
|
-
|
1817
|
-
|
1818
|
-
canWithdraw = self.safe_bool(chain, 'canWd')
|
1819
|
-
withdrawEnabled = canWithdraw if (canWithdraw) else withdrawEnabled
|
1820
|
-
canInternal = self.safe_bool(chain, 'canInternal')
|
1821
|
-
active = True if (canDeposit and canWithdraw and canInternal) else False
|
1822
|
-
currencyActive = active if (active) else currencyActive
|
1823
|
-
networkId = self.safe_string(chain, 'chain')
|
1824
|
-
if (networkId is not None) and (networkId.find('-') >= 0):
|
1827
|
+
networkId = self.safe_string(chain, 'chain') # USDT-BEP20, USDT-Avalance-C, etc
|
1828
|
+
if networkId is not None:
|
1825
1829
|
idParts = networkId.split('-')
|
1826
1830
|
parts = self.array_slice(idParts, 1)
|
1827
1831
|
chainPart = '-'.join(parts)
|
1828
1832
|
networkCode = self.network_id_to_code(chainPart, currency['code'])
|
1829
|
-
precision = self.parse_precision(self.safe_string(chain, 'wdTickSz'))
|
1830
|
-
if maxPrecision is None:
|
1831
|
-
maxPrecision = precision
|
1832
|
-
else:
|
1833
|
-
maxPrecision = Precise.string_min(maxPrecision, precision)
|
1834
1833
|
networks[networkCode] = {
|
1835
1834
|
'id': networkId,
|
1836
1835
|
'network': networkCode,
|
1837
|
-
'active':
|
1838
|
-
'deposit':
|
1839
|
-
'withdraw':
|
1836
|
+
'active': None,
|
1837
|
+
'deposit': self.safe_bool(chain, 'canDep'),
|
1838
|
+
'withdraw': self.safe_bool(chain, 'canWd'),
|
1840
1839
|
'fee': self.safe_number(chain, 'fee'),
|
1841
|
-
'precision': self.parse_number(
|
1840
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'wdTickSz'))),
|
1842
1841
|
'limits': {
|
1843
1842
|
'withdraw': {
|
1844
1843
|
'min': self.safe_number(chain, 'minWd'),
|
@@ -1847,25 +1846,29 @@ class okx(Exchange, ImplicitAPI):
|
|
1847
1846
|
},
|
1848
1847
|
'info': chain,
|
1849
1848
|
}
|
1849
|
+
else:
|
1850
|
+
# only happens for FIAT currency
|
1851
|
+
type = 'fiat'
|
1850
1852
|
firstChain = self.safe_dict(chains, 0, {})
|
1851
|
-
result[code] = {
|
1853
|
+
result[code] = self.safe_currency_structure({
|
1852
1854
|
'info': chains,
|
1853
1855
|
'code': code,
|
1854
1856
|
'id': currencyId,
|
1855
1857
|
'name': self.safe_string(firstChain, 'name'),
|
1856
|
-
'active':
|
1857
|
-
'deposit':
|
1858
|
-
'withdraw':
|
1858
|
+
'active': None,
|
1859
|
+
'deposit': None,
|
1860
|
+
'withdraw': None,
|
1859
1861
|
'fee': None,
|
1860
|
-
'precision':
|
1862
|
+
'precision': None,
|
1861
1863
|
'limits': {
|
1862
1864
|
'amount': {
|
1863
1865
|
'min': None,
|
1864
1866
|
'max': None,
|
1865
1867
|
},
|
1866
1868
|
},
|
1869
|
+
'type': type,
|
1867
1870
|
'networks': networks,
|
1868
|
-
}
|
1871
|
+
})
|
1869
1872
|
return result
|
1870
1873
|
|
1871
1874
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
ccxt/async_support/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/async_support/paymium.py
CHANGED
@@ -333,7 +333,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
333
333
|
response = await self.publicGetDataCurrencyTrades(self.extend(request, params))
|
334
334
|
return self.parse_trades(response, market, since, limit)
|
335
335
|
|
336
|
-
async def create_deposit_address(self, code: str, params={}):
|
336
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
337
337
|
"""
|
338
338
|
create a currency deposit address
|
339
339
|
|