ccxt 4.4.33__py2.py3-none-any.whl → 4.4.34__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 +3 -1
- ccxt/abstract/bingx.py +16 -0
- ccxt/abstract/bitbank.py +5 -0
- ccxt/abstract/bitfinex2.py +1 -0
- ccxt/abstract/ellipx.py +25 -0
- ccxt/alpaca.py +2 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/alpaca.py +2 -0
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +19 -15
- ccxt/async_support/bingx.py +155 -8
- ccxt/async_support/bitbank.py +5 -0
- ccxt/async_support/bitbns.py +2 -0
- ccxt/async_support/bitfinex2.py +1 -0
- ccxt/async_support/bitget.py +174 -40
- ccxt/async_support/bitmex.py +2 -0
- ccxt/async_support/bitopro.py +3 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/btcmarkets.py +2 -0
- ccxt/async_support/bybit.py +13 -10
- ccxt/async_support/cex.py +13 -4
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinex.py +1 -0
- ccxt/async_support/coinone.py +7 -7
- ccxt/async_support/coinsph.py +7 -7
- ccxt/async_support/coinspot.py +39 -39
- ccxt/async_support/cryptocom.py +36 -34
- ccxt/async_support/ellipx.py +1828 -0
- ccxt/async_support/gate.py +1 -0
- ccxt/async_support/hyperliquid.py +2 -0
- ccxt/async_support/krakenfutures.py +3 -1
- ccxt/async_support/okcoin.py +2 -0
- ccxt/async_support/okx.py +14 -10
- ccxt/async_support/onetrading.py +20 -1
- ccxt/async_support/paradex.py +2 -0
- ccxt/async_support/phemex.py +16 -0
- ccxt/async_support/poloniex.py +3 -1
- ccxt/async_support/poloniexfutures.py +3 -1
- ccxt/async_support/vertex.py +2 -0
- ccxt/async_support/woo.py +69 -69
- ccxt/base/exchange.py +27 -7
- ccxt/binance.py +19 -15
- ccxt/bingx.py +155 -8
- ccxt/bitbank.py +5 -0
- ccxt/bitbns.py +2 -0
- ccxt/bitfinex2.py +1 -0
- ccxt/bitget.py +174 -40
- ccxt/bitmex.py +2 -0
- ccxt/bitopro.py +3 -0
- ccxt/bitrue.py +1 -0
- ccxt/btcmarkets.py +2 -0
- ccxt/bybit.py +13 -10
- ccxt/cex.py +13 -4
- ccxt/coinbase.py +3 -2
- ccxt/coinex.py +1 -0
- ccxt/coinone.py +7 -7
- ccxt/coinsph.py +7 -7
- ccxt/coinspot.py +39 -39
- ccxt/cryptocom.py +36 -34
- ccxt/ellipx.py +1828 -0
- ccxt/gate.py +1 -0
- ccxt/hyperliquid.py +2 -0
- ccxt/krakenfutures.py +3 -1
- ccxt/okcoin.py +2 -0
- ccxt/okx.py +14 -10
- ccxt/onetrading.py +20 -1
- ccxt/paradex.py +2 -0
- ccxt/phemex.py +16 -0
- ccxt/poloniex.py +3 -1
- ccxt/poloniexfutures.py +3 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/idex.py +15 -0
- ccxt/pro/probit.py +4 -2
- ccxt/pro/woo.py +15 -15
- ccxt/test/tests_helpers.py +0 -2
- ccxt/vertex.py +2 -0
- ccxt/woo.py +69 -69
- {ccxt-4.4.33.dist-info → ccxt-4.4.34.dist-info}/METADATA +9 -8
- {ccxt-4.4.33.dist-info → ccxt-4.4.34.dist-info}/RECORD +82 -79
- {ccxt-4.4.33.dist-info → ccxt-4.4.34.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.33.dist-info → ccxt-4.4.34.dist-info}/WHEEL +0 -0
- {ccxt-4.4.33.dist-info → ccxt-4.4.34.dist-info}/top_level.txt +0 -0
ccxt/async_support/gate.py
CHANGED
@@ -946,6 +946,7 @@ class gate(Exchange, ImplicitAPI):
|
|
946
946
|
except Exception as e:
|
947
947
|
# if the request fails, the unifiedAccount is disabled
|
948
948
|
self.options['unifiedAccount'] = False
|
949
|
+
return self.options['unifiedAccount']
|
949
950
|
|
950
951
|
async def upgrade_unified_trade_account(self, params={}):
|
951
952
|
return await self.privateUnifiedPutUnifiedMode(params)
|
@@ -51,6 +51,8 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
51
51
|
'cancelOrders': True,
|
52
52
|
'createMarketOrder': False,
|
53
53
|
'createOrder': True,
|
54
|
+
'createStopOrder': True,
|
55
|
+
'createTriggerOrder': True,
|
54
56
|
'editOrder': True,
|
55
57
|
'fetchBalance': True,
|
56
58
|
'fetchBorrowRateHistories': False,
|
@@ -216,7 +218,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
216
218
|
'invalidAmount': BadRequest,
|
217
219
|
'insufficientFunds': InsufficientFunds,
|
218
220
|
'Bad Request': BadRequest, # The URL contains invalid characters.(Please encode the json URL parameter)
|
219
|
-
'Unavailable':
|
221
|
+
'Unavailable': ExchangeNotAvailable, # https://github.com/ccxt/ccxt/issues/24338
|
220
222
|
'invalidUnit': BadRequest,
|
221
223
|
'Json Parse Error': ExchangeError,
|
222
224
|
'nonceBelowThreshold': InvalidNonce,
|
ccxt/async_support/okcoin.py
CHANGED
@@ -56,6 +56,8 @@ class okcoin(Exchange, ImplicitAPI):
|
|
56
56
|
'createMarketOrderWithCost': False,
|
57
57
|
'createMarketSellOrderWithCost': False,
|
58
58
|
'createOrder': True,
|
59
|
+
'createStopOrder': True,
|
60
|
+
'createTriggerOrder': True,
|
59
61
|
'fetchBalance': True,
|
60
62
|
'fetchBorrowInterest': False,
|
61
63
|
'fetchBorrowRate': False,
|
ccxt/async_support/okx.py
CHANGED
@@ -1205,6 +1205,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1205
1205
|
'default': {
|
1206
1206
|
'sandbox': True,
|
1207
1207
|
'createOrder': {
|
1208
|
+
'marginMode': True,
|
1208
1209
|
'triggerPrice': True,
|
1209
1210
|
'triggerPriceType': {
|
1210
1211
|
'last': True,
|
@@ -1214,7 +1215,6 @@ class okx(Exchange, ImplicitAPI):
|
|
1214
1215
|
'triggerDirection': False,
|
1215
1216
|
'stopLossPrice': True,
|
1216
1217
|
'takeProfitPrice': True,
|
1217
|
-
'marginMode': True,
|
1218
1218
|
'attachedStopLossTakeProfit': {
|
1219
1219
|
'triggerPriceType': {
|
1220
1220
|
'last': True,
|
@@ -1242,6 +1242,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1242
1242
|
'max': 20,
|
1243
1243
|
},
|
1244
1244
|
'fetchMyTrades': {
|
1245
|
+
'marginMode': False,
|
1245
1246
|
'daysBack': 90,
|
1246
1247
|
'limit': 100,
|
1247
1248
|
'untilDays': 10000,
|
@@ -1252,18 +1253,18 @@ class okx(Exchange, ImplicitAPI):
|
|
1252
1253
|
'trailing': True,
|
1253
1254
|
},
|
1254
1255
|
'fetchOpenOrders': {
|
1255
|
-
'limit': 100,
|
1256
1256
|
'marginMode': False,
|
1257
|
+
'limit': 100,
|
1257
1258
|
'trigger': True,
|
1258
1259
|
'trailing': True,
|
1259
1260
|
},
|
1260
1261
|
'fetchOrders': None, # not supported
|
1261
1262
|
'fetchClosedOrders': {
|
1263
|
+
'marginMode': False,
|
1262
1264
|
'limit': 100,
|
1263
1265
|
'daysBackClosed': 90, # 3 months
|
1264
1266
|
'daysBackCanceled': 1 / 12, # 2 hour
|
1265
1267
|
'untilDays': None,
|
1266
|
-
'marginMode': False,
|
1267
1268
|
'trigger': True,
|
1268
1269
|
'trailing': True,
|
1269
1270
|
},
|
@@ -1818,7 +1819,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1818
1819
|
'active': active,
|
1819
1820
|
'deposit': canDeposit,
|
1820
1821
|
'withdraw': canWithdraw,
|
1821
|
-
'fee': self.safe_number(chain, '
|
1822
|
+
'fee': self.safe_number(chain, 'fee'),
|
1822
1823
|
'precision': self.parse_number(precision),
|
1823
1824
|
'limits': {
|
1824
1825
|
'withdraw': {
|
@@ -6176,7 +6177,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6176
6177
|
:param str symbol: unified market symbol
|
6177
6178
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6178
6179
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
6179
|
-
:param str [params.posSide]: 'long' or 'short' for isolated margin long/short mode on futures and swap markets
|
6180
|
+
:param str [params.posSide]: 'long' or 'short' or 'net' for isolated margin long/short mode on futures and swap markets, default is 'net'
|
6180
6181
|
:returns dict: response from the exchange
|
6181
6182
|
"""
|
6182
6183
|
if symbol is None:
|
@@ -6198,12 +6199,11 @@ class okx(Exchange, ImplicitAPI):
|
|
6198
6199
|
'mgnMode': marginMode,
|
6199
6200
|
'instId': market['id'],
|
6200
6201
|
}
|
6201
|
-
posSide = self.safe_string(params, 'posSide')
|
6202
|
+
posSide = self.safe_string(params, 'posSide', 'net')
|
6202
6203
|
if marginMode == 'isolated':
|
6203
|
-
if posSide is None:
|
6204
|
-
raise ArgumentsRequired(self.id + ' setLeverage() requires a posSide argument for isolated margin')
|
6205
6204
|
if posSide != 'long' and posSide != 'short' and posSide != 'net':
|
6206
6205
|
raise BadRequest(self.id + ' setLeverage() requires the posSide argument to be either "long", "short" or "net"')
|
6206
|
+
request['posSide'] = posSide
|
6207
6207
|
response = await self.privatePostAccountSetLeverage(self.extend(request, params))
|
6208
6208
|
#
|
6209
6209
|
# {
|
@@ -7106,7 +7106,11 @@ class okx(Exchange, ImplicitAPI):
|
|
7106
7106
|
:returns dict[]: a list of `fees structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
7107
7107
|
"""
|
7108
7108
|
await self.load_markets()
|
7109
|
-
|
7109
|
+
request = {}
|
7110
|
+
if codes is not None:
|
7111
|
+
ids = self.currency_ids(codes)
|
7112
|
+
request['ccy'] = ','.join(ids)
|
7113
|
+
response = await self.privateGetAssetCurrencies(self.extend(request, params))
|
7110
7114
|
#
|
7111
7115
|
# {
|
7112
7116
|
# "code": "0",
|
@@ -7191,7 +7195,7 @@ class okx(Exchange, ImplicitAPI):
|
|
7191
7195
|
continue
|
7192
7196
|
chainSplit = chain.split('-')
|
7193
7197
|
networkId = self.safe_value(chainSplit, 1)
|
7194
|
-
withdrawFee = self.safe_number(feeInfo, '
|
7198
|
+
withdrawFee = self.safe_number(feeInfo, 'fee')
|
7195
7199
|
withdrawResult: dict = {
|
7196
7200
|
'fee': withdrawFee,
|
7197
7201
|
'percentage': False if (withdrawFee is not None) else None,
|
ccxt/async_support/onetrading.py
CHANGED
@@ -16,6 +16,7 @@ from ccxt.base.errors import InsufficientFunds
|
|
16
16
|
from ccxt.base.errors import InvalidAddress
|
17
17
|
from ccxt.base.errors import InvalidOrder
|
18
18
|
from ccxt.base.errors import OrderNotFound
|
19
|
+
from ccxt.base.errors import NotSupported
|
19
20
|
from ccxt.base.errors import DDoSProtection
|
20
21
|
from ccxt.base.errors import ExchangeNotAvailable
|
21
22
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
@@ -317,6 +318,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
317
318
|
async def fetch_time(self, params={}):
|
318
319
|
"""
|
319
320
|
fetches the current integer timestamp in milliseconds from the exchange server
|
321
|
+
|
322
|
+
https://docs.onetrading.com/#time
|
323
|
+
|
320
324
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
321
325
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
322
326
|
"""
|
@@ -332,6 +336,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
332
336
|
async def fetch_currencies(self, params={}) -> Currencies:
|
333
337
|
"""
|
334
338
|
fetches all available currencies on an exchange
|
339
|
+
|
340
|
+
https://docs.onetrading.com/#currencies
|
341
|
+
|
335
342
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
336
343
|
:returns dict: an associative dictionary of currencies
|
337
344
|
"""
|
@@ -370,6 +377,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
370
377
|
async def fetch_markets(self, params={}) -> List[Market]:
|
371
378
|
"""
|
372
379
|
retrieves data on all markets for onetrading
|
380
|
+
|
381
|
+
https://docs.onetrading.com/#instruments
|
382
|
+
|
373
383
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
374
384
|
:returns dict[]: an array of objects representing market data
|
375
385
|
"""
|
@@ -450,6 +460,10 @@ class onetrading(Exchange, ImplicitAPI):
|
|
450
460
|
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
451
461
|
"""
|
452
462
|
fetch the trading fees for multiple markets
|
463
|
+
|
464
|
+
https://docs.onetrading.com/#fee-groups
|
465
|
+
https://docs.onetrading.com/#fees
|
466
|
+
|
453
467
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
454
468
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
455
469
|
"""
|
@@ -458,7 +472,12 @@ class onetrading(Exchange, ImplicitAPI):
|
|
458
472
|
if method is None:
|
459
473
|
options = self.safe_value(self.options, 'fetchTradingFees', {})
|
460
474
|
method = self.safe_string(options, 'method', 'fetchPrivateTradingFees')
|
461
|
-
|
475
|
+
if method == 'fetchPrivateTradingFees':
|
476
|
+
return await self.fetch_private_trading_fees(params)
|
477
|
+
elif method == 'fetchPublicTradingFees':
|
478
|
+
return await self.fetch_public_trading_fees(params)
|
479
|
+
else:
|
480
|
+
raise NotSupported(self.id + ' fetchTradingFees() does not support ' + method + ', fetchPrivateTradingFees and fetchPublicTradingFees are supported')
|
462
481
|
|
463
482
|
async def fetch_public_trading_fees(self, params={}):
|
464
483
|
await self.load_markets()
|
ccxt/async_support/paradex.py
CHANGED
ccxt/async_support/phemex.py
CHANGED
@@ -2537,6 +2537,22 @@ class phemex(Exchange, ImplicitAPI):
|
|
2537
2537
|
if triggerPrice is not None:
|
2538
2538
|
triggerType = self.safe_string(params, 'triggerType', 'ByMarkPrice')
|
2539
2539
|
request['triggerType'] = triggerType
|
2540
|
+
# set direction & exchange specific order type
|
2541
|
+
triggerDirection = None
|
2542
|
+
triggerDirection, params = self.handle_param_string(params, 'triggerDirection')
|
2543
|
+
if triggerDirection is None:
|
2544
|
+
raise ArgumentsRequired(self.id + " createOrder() also requires a 'triggerDirection' parameter with either 'up' or 'down' value")
|
2545
|
+
# the flow defined per https://phemex-docs.github.io/#more-order-type-examples
|
2546
|
+
if triggerDirection == 'up':
|
2547
|
+
if side == 'sell':
|
2548
|
+
request['ordType'] = 'MarketIfTouched' if (type == 'Market') else 'LimitIfTouched'
|
2549
|
+
elif side == 'buy':
|
2550
|
+
request['ordType'] = 'Stop' if (type == 'Market') else 'StopLimit'
|
2551
|
+
elif triggerDirection == 'down':
|
2552
|
+
if side == 'sell':
|
2553
|
+
request['ordType'] = 'Stop' if (type == 'Market') else 'StopLimit'
|
2554
|
+
elif side == 'buy':
|
2555
|
+
request['ordType'] = 'MarketIfTouched' if (type == 'Market') else 'LimitIfTouched'
|
2540
2556
|
if stopLossDefined or takeProfitDefined:
|
2541
2557
|
if stopLossDefined:
|
2542
2558
|
stopLossTriggerPrice = self.safe_value_2(stopLoss, 'triggerPrice', 'stopPrice')
|
ccxt/async_support/poloniex.py
CHANGED
@@ -51,6 +51,8 @@ class poloniex(Exchange, ImplicitAPI):
|
|
51
51
|
'createMarketOrderWithCost': False,
|
52
52
|
'createMarketSellOrderWithCost': False,
|
53
53
|
'createOrder': True,
|
54
|
+
'createStopOrder': True,
|
55
|
+
'createTriggerOrder': True,
|
54
56
|
'editOrder': True,
|
55
57
|
'fetchBalance': True,
|
56
58
|
'fetchClosedOrder': False,
|
@@ -1256,7 +1258,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1256
1258
|
:param float amount: how much of currency you want to trade in units of base currency
|
1257
1259
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1258
1260
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1259
|
-
:param float [params.triggerPrice]:
|
1261
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1260
1262
|
:param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
|
1261
1263
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1262
1264
|
"""
|
@@ -42,6 +42,8 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
42
42
|
'future': False,
|
43
43
|
'option': None,
|
44
44
|
'createOrder': True,
|
45
|
+
'createStopOrder': True,
|
46
|
+
'createTriggerOrder': True,
|
45
47
|
'fetchBalance': True,
|
46
48
|
'fetchClosedOrders': True,
|
47
49
|
'fetchCurrencies': False,
|
@@ -827,7 +829,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
827
829
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
828
830
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
829
831
|
:param float [params.leverage]: Leverage size of the order
|
830
|
-
:param float [params.
|
832
|
+
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
831
833
|
:param bool [params.reduceOnly]: A mark to reduce the position size only. Set to False by default. Need to set the position size when reduceOnly is True.
|
832
834
|
:param str [params.timeInForce]: GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
833
835
|
:param str [params.postOnly]: Post only flag, invalid when timeInForce is IOC or FOK
|
ccxt/async_support/vertex.py
CHANGED