ccxt 4.4.69__py2.py3-none-any.whl → 4.4.71__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/bybit.py +4 -0
- ccxt/abstract/myokx.py +3 -0
- ccxt/abstract/okx.py +3 -0
- ccxt/abstract/poloniex.py +36 -0
- ccxt/abstract/tradeogre.py +1 -1
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/binance.py +107 -102
- ccxt/async_support/bingx.py +64 -42
- ccxt/async_support/bitget.py +47 -265
- ccxt/async_support/bitmart.py +12 -1
- ccxt/async_support/bitopro.py +1 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/bybit.py +7 -0
- ccxt/async_support/cex.py +1 -0
- ccxt/async_support/coinbase.py +23 -4
- ccxt/async_support/coinbaseexchange.py +1 -0
- ccxt/async_support/deribit.py +1 -0
- ccxt/async_support/hashkey.py +4 -2
- ccxt/async_support/hyperliquid.py +16 -7
- ccxt/async_support/kraken.py +77 -5
- ccxt/async_support/kucoin.py +4 -2
- ccxt/async_support/mexc.py +8 -4
- ccxt/async_support/okx.py +62 -46
- ccxt/async_support/poloniex.py +1263 -85
- ccxt/async_support/tradeogre.py +20 -4
- ccxt/async_support/whitebit.py +4 -2
- ccxt/base/exchange.py +23 -4
- ccxt/base/types.py +28 -0
- ccxt/binance.py +107 -102
- ccxt/bingx.py +64 -42
- ccxt/bitget.py +47 -265
- ccxt/bitmart.py +12 -1
- ccxt/bitopro.py +1 -0
- ccxt/bitrue.py +1 -0
- ccxt/bybit.py +7 -0
- ccxt/cex.py +1 -0
- ccxt/coinbase.py +23 -4
- ccxt/coinbaseexchange.py +1 -0
- ccxt/deribit.py +1 -0
- ccxt/hashkey.py +4 -2
- ccxt/hyperliquid.py +16 -7
- ccxt/kraken.py +77 -5
- ccxt/kucoin.py +4 -2
- ccxt/mexc.py +8 -4
- ccxt/okx.py +62 -46
- ccxt/poloniex.py +1262 -85
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/binance.py +102 -102
- ccxt/pro/bingx.py +62 -51
- ccxt/pro/bitget.py +28 -3
- ccxt/pro/bybit.py +81 -37
- ccxt/test/tests_async.py +4 -3
- ccxt/test/tests_sync.py +4 -3
- ccxt/tradeogre.py +20 -4
- ccxt/whitebit.py +4 -2
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/METADATA +6 -9
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/RECORD +64 -65
- ccxt/abstract/poloniexfutures.py +0 -48
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/WHEEL +0 -0
- {ccxt-4.4.69.dist-info → ccxt-4.4.71.dist-info}/top_level.txt +0 -0
ccxt/async_support/bybit.py
CHANGED
@@ -267,6 +267,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
267
267
|
# institutional lending
|
268
268
|
'v5/ins-loan/product-infos': 5,
|
269
269
|
'v5/ins-loan/ensure-tokens-convert': 5,
|
270
|
+
# earn
|
271
|
+
'v5/earn/product': 5,
|
270
272
|
},
|
271
273
|
},
|
272
274
|
'private': {
|
@@ -425,6 +427,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
425
427
|
'v5/broker/earnings-info': 5,
|
426
428
|
'v5/broker/account-info': 5,
|
427
429
|
'v5/broker/asset/query-sub-member-deposit-record': 10,
|
430
|
+
# earn
|
431
|
+
'v5/earn/order': 5,
|
432
|
+
'v5/earn/position': 5,
|
428
433
|
},
|
429
434
|
'post': {
|
430
435
|
# spot
|
@@ -560,6 +565,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
560
565
|
'v5/broker/award/info': 5,
|
561
566
|
'v5/broker/award/distribute-award': 5,
|
562
567
|
'v5/broker/award/distribution-record': 5,
|
568
|
+
# earn
|
569
|
+
'v5/earn/place-order': 5,
|
563
570
|
},
|
564
571
|
},
|
565
572
|
},
|
ccxt/async_support/cex.py
CHANGED
ccxt/async_support/coinbase.py
CHANGED
@@ -336,6 +336,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
336
336
|
'INSUFFICIENT_FUND': BadRequest,
|
337
337
|
'PERMISSION_DENIED': PermissionDenied,
|
338
338
|
'INVALID_ARGUMENT': BadRequest,
|
339
|
+
'PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE': InvalidOrder,
|
339
340
|
},
|
340
341
|
'broad': {
|
341
342
|
'request timestamp expired': InvalidNonce, # {"errors":[{"id":"authentication_error","message":"request timestamp expired"}]}
|
@@ -4864,19 +4865,37 @@ class coinbase(Exchange, ImplicitAPI):
|
|
4864
4865
|
# ]
|
4865
4866
|
# }
|
4866
4867
|
# or
|
4867
|
-
#
|
4868
|
+
# {
|
4869
|
+
# "success": False,
|
4870
|
+
# "error_response": {
|
4868
4871
|
# "error": "UNKNOWN_FAILURE_REASON",
|
4869
4872
|
# "message": "",
|
4870
4873
|
# "error_details": "",
|
4871
|
-
# "preview_failure_reason": "
|
4872
|
-
#
|
4874
|
+
# "preview_failure_reason": "PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE"
|
4875
|
+
# },
|
4876
|
+
# "order_configuration": {
|
4877
|
+
# "stop_limit_stop_limit_gtc": {
|
4878
|
+
# "base_size": "0.0001",
|
4879
|
+
# "limit_price": "2000",
|
4880
|
+
# "stop_price": "2005",
|
4881
|
+
# "stop_direction": "STOP_DIRECTION_STOP_DOWN",
|
4882
|
+
# "reduce_only": False
|
4883
|
+
# }
|
4884
|
+
# }
|
4885
|
+
# }
|
4873
4886
|
#
|
4874
4887
|
errorCode = self.safe_string(response, 'error')
|
4875
4888
|
if errorCode is not None:
|
4876
|
-
errorMessage = self.safe_string_2(response, 'error_description', '
|
4889
|
+
errorMessage = self.safe_string_2(response, 'error_description', 'error')
|
4877
4890
|
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
|
4878
4891
|
self.throw_broadly_matched_exception(self.exceptions['broad'], errorMessage, feedback)
|
4879
4892
|
raise ExchangeError(feedback)
|
4893
|
+
errorResponse = self.safe_dict(response, 'error_response')
|
4894
|
+
if errorResponse is not None:
|
4895
|
+
errorMessageInner = self.safe_string_2(errorResponse, 'preview_failure_reason', 'preview_failure_reason')
|
4896
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], errorMessageInner, feedback)
|
4897
|
+
self.throw_broadly_matched_exception(self.exceptions['broad'], errorMessageInner, feedback)
|
4898
|
+
raise ExchangeError(feedback)
|
4880
4899
|
errors = self.safe_list(response, 'errors')
|
4881
4900
|
if errors is not None:
|
4882
4901
|
if isinstance(errors, list):
|
ccxt/async_support/deribit.py
CHANGED
ccxt/async_support/hashkey.py
CHANGED
@@ -2399,8 +2399,10 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2399
2399
|
market = self.market(symbol)
|
2400
2400
|
if not market['spot']:
|
2401
2401
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() is supported for spot markets only')
|
2402
|
-
|
2403
|
-
|
2402
|
+
req = {
|
2403
|
+
'cost': cost,
|
2404
|
+
}
|
2405
|
+
return await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2404
2406
|
|
2405
2407
|
async def create_spot_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
|
2406
2408
|
"""
|
@@ -1757,11 +1757,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1757
1757
|
isTrigger = (stopLossPrice or takeProfitPrice)
|
1758
1758
|
reduceOnly = self.safe_bool(orderParams, 'reduceOnly', False)
|
1759
1759
|
orderParams = self.omit(orderParams, ['slippage', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'clientOrderId', 'client_id', 'postOnly', 'reduceOnly'])
|
1760
|
-
px =
|
1760
|
+
px = self.number_to_string(price)
|
1761
1761
|
if isMarket:
|
1762
|
-
px =
|
1762
|
+
px = Precise.string_mul(px, Precise.string_add('1', slippage)) if (isBuy) else Precise.string_mul(px, Precise.string_sub('1', slippage))
|
1763
|
+
px = self.price_to_precision(symbol, px)
|
1763
1764
|
else:
|
1764
|
-
px = self.price_to_precision(symbol,
|
1765
|
+
px = self.price_to_precision(symbol, px)
|
1765
1766
|
sz = self.amount_to_precision(symbol, amount)
|
1766
1767
|
orderType: dict = {}
|
1767
1768
|
if isTrigger:
|
@@ -2243,6 +2244,10 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2243
2244
|
side = 'sell' if (side == 'A') else 'buy'
|
2244
2245
|
totalAmount = self.safe_string_2(entry, 'origSz', 'totalSz')
|
2245
2246
|
remaining = self.safe_string(entry, 'sz')
|
2247
|
+
tif = self.safe_string_upper(entry, 'tif')
|
2248
|
+
postOnly = None
|
2249
|
+
if tif is not None:
|
2250
|
+
postOnly = (tif == 'ALO')
|
2246
2251
|
return self.safe_order({
|
2247
2252
|
'info': order,
|
2248
2253
|
'id': self.safe_string(entry, 'oid'),
|
@@ -2253,8 +2258,8 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2253
2258
|
'lastUpdateTimestamp': self.safe_integer(order, 'statusTimestamp'),
|
2254
2259
|
'symbol': symbol,
|
2255
2260
|
'type': self.parse_order_type(self.safe_string_lower(entry, 'orderType')),
|
2256
|
-
'timeInForce':
|
2257
|
-
'postOnly':
|
2261
|
+
'timeInForce': tif,
|
2262
|
+
'postOnly': postOnly,
|
2258
2263
|
'reduceOnly': self.safe_bool(entry, 'reduceOnly'),
|
2259
2264
|
'side': side,
|
2260
2265
|
'price': self.safe_string(entry, 'limitPx'),
|
@@ -2372,6 +2377,10 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2372
2377
|
if side is not None:
|
2373
2378
|
side = 'sell' if (side == 'A') else 'buy'
|
2374
2379
|
fee = self.safe_string(trade, 'fee')
|
2380
|
+
takerOrMaker = None
|
2381
|
+
crossed = self.safe_bool(trade, 'crossed')
|
2382
|
+
if crossed is not None:
|
2383
|
+
takerOrMaker = 'taker' if crossed else 'maker'
|
2375
2384
|
return self.safe_trade({
|
2376
2385
|
'info': trade,
|
2377
2386
|
'timestamp': timestamp,
|
@@ -2381,7 +2390,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2381
2390
|
'order': self.safe_string(trade, 'oid'),
|
2382
2391
|
'type': None,
|
2383
2392
|
'side': side,
|
2384
|
-
'takerOrMaker':
|
2393
|
+
'takerOrMaker': takerOrMaker,
|
2385
2394
|
'price': price,
|
2386
2395
|
'amount': amount,
|
2387
2396
|
'cost': None,
|
@@ -2928,7 +2937,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2928
2937
|
'tagTo': None,
|
2929
2938
|
'tagFrom': None,
|
2930
2939
|
'type': None,
|
2931
|
-
'amount': self.
|
2940
|
+
'amount': self.safe_number(delta, 'usdc'),
|
2932
2941
|
'currency': None,
|
2933
2942
|
'status': self.safe_string(transaction, 'status'),
|
2934
2943
|
'updated': None,
|
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
|
"""
|
ccxt/async_support/kucoin.py
CHANGED
@@ -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/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
|
"""
|
ccxt/async_support/okx.py
CHANGED
@@ -333,7 +333,9 @@ class okx(Exchange, ImplicitAPI):
|
|
333
333
|
'trade/easy-convert-currency-list': 20,
|
334
334
|
'trade/easy-convert-history': 20,
|
335
335
|
'trade/one-click-repay-currency-list': 20,
|
336
|
+
'trade/one-click-repay-currency-list-v2': 20,
|
336
337
|
'trade/one-click-repay-history': 20,
|
338
|
+
'trade/one-click-repay-history-v2': 20,
|
337
339
|
'trade/account-rate-limit': 1,
|
338
340
|
# asset
|
339
341
|
'asset/currencies': 5 / 3,
|
@@ -490,6 +492,7 @@ class okx(Exchange, ImplicitAPI):
|
|
490
492
|
'trade/cancel-advance-algos': 1,
|
491
493
|
'trade/easy-convert': 20,
|
492
494
|
'trade/one-click-repay': 20,
|
495
|
+
'trade/one-click-repay-v2': 20,
|
493
496
|
'trade/mass-cancel': 4,
|
494
497
|
'trade/cancel-all-after': 10,
|
495
498
|
# asset
|
@@ -1010,71 +1013,64 @@ class okx(Exchange, ImplicitAPI):
|
|
1010
1013
|
'networks': {
|
1011
1014
|
'BTC': 'Bitcoin',
|
1012
1015
|
'BTCLN': 'Lightning',
|
1016
|
+
'BTCLIGHTNING': 'Lightning',
|
1013
1017
|
'BEP20': 'BSC',
|
1018
|
+
'BRC20': 'BRC20',
|
1014
1019
|
'ERC20': 'ERC20',
|
1015
1020
|
'TRC20': 'TRC20',
|
1016
1021
|
'CRC20': 'Crypto',
|
1017
|
-
# sorted
|
1018
1022
|
'ACA': 'Acala',
|
1019
1023
|
'ALGO': 'Algorand',
|
1020
|
-
'BHP': 'BHP',
|
1021
1024
|
'APT': 'Aptos',
|
1025
|
+
'SCROLL': 'Scroll',
|
1022
1026
|
'ARBONE': 'Arbitrum One',
|
1023
1027
|
'AVAXC': 'Avalanche C-Chain',
|
1024
1028
|
'AVAXX': 'Avalanche X-Chain',
|
1025
|
-
'
|
1029
|
+
'BASE': 'Base',
|
1030
|
+
'SUI': 'SUI',
|
1031
|
+
'ZKSYNCERA': 'zkSync Era',
|
1032
|
+
'LINEA': 'Linea',
|
1026
1033
|
'AR': 'Arweave',
|
1027
1034
|
'ASTR': 'Astar',
|
1028
1035
|
'BCH': 'BitcoinCash',
|
1029
1036
|
'BSV': 'Bitcoin SV',
|
1030
|
-
'BTM': 'Bytom',
|
1031
1037
|
'ADA': 'Cardano',
|
1032
1038
|
'CSPR': 'Casper',
|
1033
1039
|
'CELO': 'CELO',
|
1034
1040
|
'XCH': 'Chia',
|
1035
|
-
'CHZ': 'Chiliz',
|
1041
|
+
# 'CHZ': 'Chiliz', TBD: Chiliz 2.0 Chain vs Chiliz Chain
|
1036
1042
|
'ATOM': 'Cosmos',
|
1037
|
-
'TRUE': 'TrueChain',
|
1038
|
-
'DCR': 'Decred',
|
1039
1043
|
'DGB': 'Digibyte',
|
1040
1044
|
'DOGE': 'Dogecoin',
|
1041
|
-
'XEC': 'XEC',
|
1042
1045
|
'EGLD': 'Elrond',
|
1046
|
+
'CFX': 'Conflux', # CFX_EVM is different
|
1043
1047
|
'EOS': 'EOS',
|
1048
|
+
'CORE': 'CORE',
|
1044
1049
|
'ETC': 'Ethereum Classic',
|
1045
1050
|
'ETHW': 'EthereumPow',
|
1046
|
-
'FTM': 'Fantom',
|
1051
|
+
# 'FTM': 'Fantom', 'Sonic' TBD
|
1047
1052
|
'FIL': 'Filecoin',
|
1048
|
-
'FLOW': 'FLOW',
|
1049
|
-
'FSN': 'Fusion',
|
1050
1053
|
'ONE': 'Harmony',
|
1051
1054
|
'HBAR': 'Hedera',
|
1052
|
-
'HNT': 'Helium',
|
1053
|
-
'ZEN': 'Horizen',
|
1054
1055
|
'ICX': 'ICON',
|
1055
1056
|
'ICP': 'Dfinity',
|
1056
1057
|
'IOST': 'IOST',
|
1057
1058
|
'IOTA': 'MIOTA',
|
1058
|
-
'KDA': 'Kadena',
|
1059
|
-
'KAR': 'KAR',
|
1060
1059
|
'KLAY': 'Klaytn',
|
1061
1060
|
'KSM': 'Kusama',
|
1062
1061
|
'LSK': 'Lisk',
|
1063
1062
|
'LTC': 'Litecoin',
|
1064
1063
|
'METIS': 'Metis',
|
1065
1064
|
'MINA': 'Mina',
|
1066
|
-
'XMR': 'Monero',
|
1067
1065
|
'GLRM': 'Moonbeam',
|
1068
1066
|
'MOVR': 'Moonriver',
|
1069
1067
|
'NANO': 'Nano',
|
1070
1068
|
'NEAR': 'NEAR',
|
1071
|
-
'NAS': 'Nebulas',
|
1072
|
-
'NEM': 'New Economy Movement',
|
1073
1069
|
'NULS': 'NULS',
|
1074
1070
|
'OASYS': 'OASYS',
|
1075
|
-
'OKC': 'OKC',
|
1076
1071
|
'ONT': 'Ontology',
|
1077
1072
|
'OPTIMISM': 'Optimism',
|
1073
|
+
# 'OP': 'Optimism', or Optimism(V2), TBD
|
1078
1074
|
'LAT': 'PlatON',
|
1079
1075
|
'DOT': 'Polkadot',
|
1080
1076
|
'MATIC': 'Polygon',
|
@@ -1087,35 +1083,54 @@ class okx(Exchange, ImplicitAPI):
|
|
1087
1083
|
'XTZ': 'Tezos',
|
1088
1084
|
'TON': 'TON',
|
1089
1085
|
'THETA': 'Theta',
|
1090
|
-
'VSYS': 'VSYSTEMS',
|
1091
|
-
'WAVES': 'WAVES',
|
1092
1086
|
'WAX': 'Wax',
|
1093
|
-
'ZEC': 'Zcash',
|
1094
1087
|
'ZIL': 'Zilliqa',
|
1095
|
-
|
1096
|
-
|
1097
|
-
#
|
1098
|
-
#
|
1099
|
-
#
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
-
#
|
1103
|
-
#
|
1104
|
-
#
|
1105
|
-
#
|
1106
|
-
#
|
1107
|
-
#
|
1108
|
-
#
|
1109
|
-
#
|
1110
|
-
#
|
1111
|
-
#
|
1112
|
-
#
|
1113
|
-
#
|
1114
|
-
#
|
1115
|
-
#
|
1116
|
-
#
|
1117
|
-
#
|
1118
|
-
#
|
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",
|
1119
1134
|
},
|
1120
1135
|
'fetchOpenInterestHistory': {
|
1121
1136
|
'timeframes': {
|
@@ -3044,6 +3059,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3044
3059
|
:param str [params.trailingPercent]: the percent to trail away from the current market price
|
3045
3060
|
:param str [params.tpOrdKind]: 'condition' or 'limit', the default is 'condition'
|
3046
3061
|
:param bool [params.hedged]: *swap and future only* True for hedged mode, False for one way mode
|
3062
|
+
:param str [params.marginMode]: 'cross' or 'isolated', the default is 'cross'
|
3047
3063
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
3048
3064
|
"""
|
3049
3065
|
await self.load_markets()
|