ccxt 4.4.33__py2.py3-none-any.whl → 4.4.35__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 +17 -0
- ccxt/abstract/bitbank.py +5 -0
- ccxt/abstract/bitfinex2.py +1 -0
- ccxt/abstract/bitpanda.py +0 -12
- ccxt/abstract/bitrue.py +3 -3
- ccxt/abstract/ellipx.py +25 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/onetrading.py +0 -12
- ccxt/abstract/xt.py +5 -5
- 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 +479 -146
- 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 +3 -1
- ccxt/async_support/bitopro.py +3 -0
- ccxt/async_support/bitrue.py +3 -2
- ccxt/async_support/btcmarkets.py +5 -3
- ccxt/async_support/btcturk.py +19 -19
- 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 +143 -39
- ccxt/async_support/hyperliquid.py +70 -11
- ccxt/async_support/idex.py +3 -4
- ccxt/async_support/kraken.py +58 -49
- ccxt/async_support/krakenfutures.py +3 -1
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/okcoin.py +2 -0
- ccxt/async_support/okx.py +15 -10
- ccxt/async_support/onetrading.py +67 -370
- 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/async_support/xt.py +10 -10
- ccxt/base/exchange.py +28 -7
- ccxt/binance.py +19 -15
- ccxt/bingx.py +479 -146
- ccxt/bitbank.py +5 -0
- ccxt/bitbns.py +2 -0
- ccxt/bitfinex2.py +1 -0
- ccxt/bitget.py +174 -40
- ccxt/bitmex.py +3 -1
- ccxt/bitopro.py +3 -0
- ccxt/bitrue.py +3 -2
- ccxt/btcmarkets.py +5 -3
- ccxt/btcturk.py +19 -19
- 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 +143 -39
- ccxt/hyperliquid.py +70 -11
- ccxt/idex.py +3 -4
- ccxt/kraken.py +58 -49
- ccxt/krakenfutures.py +3 -1
- ccxt/kucoin.py +1 -1
- ccxt/okcoin.py +2 -0
- ccxt/okx.py +15 -10
- ccxt/onetrading.py +67 -370
- 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/bitrue.py +13 -11
- ccxt/pro/idex.py +15 -0
- ccxt/pro/probit.py +58 -68
- ccxt/pro/woo.py +15 -15
- ccxt/test/tests_async.py +29 -2
- ccxt/test/tests_helpers.py +0 -2
- ccxt/test/tests_sync.py +29 -2
- ccxt/vertex.py +2 -0
- ccxt/woo.py +69 -69
- ccxt/xt.py +10 -10
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/METADATA +9 -8
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/RECORD +100 -97
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/WHEEL +0 -0
- {ccxt-4.4.33.dist-info → ccxt-4.4.35.dist-info}/top_level.txt +0 -0
ccxt/async_support/kraken.py
CHANGED
@@ -1553,18 +1553,9 @@ class kraken(Exchange, ImplicitAPI):
|
|
1553
1553
|
# editOrder
|
1554
1554
|
#
|
1555
1555
|
# {
|
1556
|
-
# "
|
1557
|
-
# "txid": "OAW2BO-7RWEK-PZY5UO",
|
1558
|
-
# "originaltxid": "OXL6SS-UPNMC-26WBE7",
|
1559
|
-
# "newuserref": 1234,
|
1560
|
-
# "olduserref": 123,
|
1561
|
-
# "volume": "0.00075000",
|
1562
|
-
# "price": "13500.0",
|
1563
|
-
# "orders_cancelled": 1,
|
1564
|
-
# "descr": {
|
1565
|
-
# "order": "buy 0.00075000 XBTUSDT @ limit 13500.0"
|
1566
|
-
# }
|
1556
|
+
# "amend_id": "TJSMEH-AA67V-YUSQ6O"
|
1567
1557
|
# }
|
1558
|
+
#
|
1568
1559
|
# ws - createOrder
|
1569
1560
|
# {
|
1570
1561
|
# "descr": 'sell 0.00010000 XBTUSDT @ market',
|
@@ -1687,11 +1678,11 @@ class kraken(Exchange, ImplicitAPI):
|
|
1687
1678
|
elif flags.find('fcib') >= 0:
|
1688
1679
|
fee['currency'] = market['base']
|
1689
1680
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
1690
|
-
id = self.
|
1681
|
+
id = self.safe_string_n(order, ['id', 'txid', 'amend_id'])
|
1691
1682
|
if (id is None) or (id.startswith('[')):
|
1692
1683
|
txid = self.safe_list(order, 'txid')
|
1693
1684
|
id = self.safe_string(txid, 0)
|
1694
|
-
clientOrderId = self.
|
1685
|
+
clientOrderId = self.safe_string(order, 'userref')
|
1695
1686
|
rawTrades = self.safe_value(order, 'trades', [])
|
1696
1687
|
trades = []
|
1697
1688
|
for i in range(0, len(rawTrades)):
|
@@ -1706,22 +1697,26 @@ class kraken(Exchange, ImplicitAPI):
|
|
1706
1697
|
takeProfitPrice = None
|
1707
1698
|
# the dashed strings are not provided from fields(eg. fetch order)
|
1708
1699
|
# while spaced strings from "order" sentence(when other fields not available)
|
1709
|
-
if rawType
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1700
|
+
if rawType is not None:
|
1701
|
+
if rawType.startswith('take-profit'):
|
1702
|
+
takeProfitPrice = self.safe_string(description, 'price')
|
1703
|
+
price = self.omit_zero(self.safe_string(description, 'price2'))
|
1704
|
+
elif rawType.startswith('stop-loss'):
|
1705
|
+
stopLossPrice = self.safe_string(description, 'price')
|
1706
|
+
price = self.omit_zero(self.safe_string(description, 'price2'))
|
1707
|
+
elif rawType == 'take profit':
|
1708
|
+
takeProfitPrice = triggerPrice
|
1709
|
+
elif rawType == 'stop loss':
|
1710
|
+
stopLossPrice = triggerPrice
|
1719
1711
|
finalType = self.parse_order_type(rawType)
|
1720
1712
|
# unlike from endpoints which provide eg: "take-profit-limit"
|
1721
1713
|
# for "space-delimited" orders we dont have market/limit suffixes, their format is
|
1722
1714
|
# eg: `stop loss > limit 123`, so we need to parse them manually
|
1723
1715
|
if self.in_array(finalType, ['stop loss', 'take profit']):
|
1724
1716
|
finalType = 'market' if (price is None) else 'limit'
|
1717
|
+
amendId = self.safe_string(order, 'amend_id')
|
1718
|
+
if amendId is not None:
|
1719
|
+
isPostOnly = None
|
1725
1720
|
return self.safe_order({
|
1726
1721
|
'id': id,
|
1727
1722
|
'clientOrderId': clientOrderId,
|
@@ -1751,10 +1746,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1751
1746
|
}, market)
|
1752
1747
|
|
1753
1748
|
def order_request(self, method: str, symbol: str, type: str, request: dict, amount: Num, price: Num = None, params={}):
|
1754
|
-
clientOrderId = self.
|
1755
|
-
params = self.omit(params, ['
|
1749
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
1750
|
+
params = self.omit(params, ['clientOrderId'])
|
1756
1751
|
if clientOrderId is not None:
|
1757
|
-
request['
|
1752
|
+
request['cl_ord_id'] = clientOrderId
|
1758
1753
|
stopLossTriggerPrice = self.safe_string(params, 'stopLossPrice')
|
1759
1754
|
takeProfitTriggerPrice = self.safe_string(params, 'takeProfitPrice')
|
1760
1755
|
isStopLossTriggerOrder = stopLossTriggerPrice is not None
|
@@ -1854,21 +1849,24 @@ class kraken(Exchange, ImplicitAPI):
|
|
1854
1849
|
"""
|
1855
1850
|
edit a trade order
|
1856
1851
|
|
1857
|
-
https://docs.kraken.com/rest
|
1852
|
+
https://docs.kraken.com/api/docs/rest-api/amend-order
|
1858
1853
|
|
1859
1854
|
:param str id: order id
|
1860
1855
|
:param str symbol: unified symbol of the market to create an order in
|
1861
1856
|
:param str type: 'market' or 'limit'
|
1862
1857
|
:param str side: 'buy' or 'sell'
|
1863
|
-
:param float amount: how much of the currency you want to trade in units of the base currency
|
1858
|
+
:param float [amount]: how much of the currency you want to trade in units of the base currency
|
1864
1859
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1865
1860
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1866
|
-
:param float [params.stopLossPrice]:
|
1867
|
-
:param float [params.takeProfitPrice]:
|
1868
|
-
:param str [params.trailingAmount]:
|
1869
|
-
:param str [params.
|
1870
|
-
:param str [params.
|
1871
|
-
:param str [params.
|
1861
|
+
:param float [params.stopLossPrice]: the price that a stop loss order is triggered at
|
1862
|
+
:param float [params.takeProfitPrice]: the price that a take profit order is triggered at
|
1863
|
+
:param str [params.trailingAmount]: the quote amount to trail away from the current market price
|
1864
|
+
:param str [params.trailingPercent]: the percent to trail away from the current market price
|
1865
|
+
:param str [params.trailingLimitAmount]: the quote amount away from the trailingAmount
|
1866
|
+
:param str [params.trailingLimitPercent]: the percent away from the trailingAmount
|
1867
|
+
:param str [params.offset]: '+' or '-' whether you want the trailingLimitAmount value to be positive or negative
|
1868
|
+
:param boolean [params.postOnly]: if True, the order will only be posted to the order book and not executed immediately
|
1869
|
+
:param str [params.clientOrderId]: the orders client order id
|
1872
1870
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1873
1871
|
"""
|
1874
1872
|
await self.load_markets()
|
@@ -1877,30 +1875,41 @@ class kraken(Exchange, ImplicitAPI):
|
|
1877
1875
|
raise NotSupported(self.id + ' editOrder() does not support ' + market['type'] + ' orders, only spot orders are accepted')
|
1878
1876
|
request: dict = {
|
1879
1877
|
'txid': id,
|
1880
|
-
'pair': market['id'],
|
1881
1878
|
}
|
1879
|
+
clientOrderId = self.safe_string(params, 'clientOrderId')
|
1880
|
+
if clientOrderId is not None:
|
1881
|
+
request['cl_ord_id'] = clientOrderId
|
1882
|
+
params = self.omit(params, 'clientOrderId')
|
1883
|
+
request = self.omit(request, 'txid')
|
1884
|
+
isMarket = (type == 'market')
|
1885
|
+
postOnly = None
|
1886
|
+
postOnly, params = self.handle_post_only(isMarket, False, params)
|
1887
|
+
if postOnly:
|
1888
|
+
request['post_only'] = 'true' # not using hasattr(self, boolean) case, because the urlencodedNested transforms it into 'True' string
|
1882
1889
|
if amount is not None:
|
1883
|
-
request['
|
1884
|
-
|
1885
|
-
|
1890
|
+
request['order_qty'] = self.amount_to_precision(symbol, amount)
|
1891
|
+
if price is not None:
|
1892
|
+
request['limit_price'] = self.price_to_precision(symbol, price)
|
1893
|
+
allTriggerPrices = self.safe_string_n(params, ['stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingLimitAmount', 'trailingLimitPercent'])
|
1894
|
+
if allTriggerPrices is not None:
|
1895
|
+
offset = self.safe_string(params, 'offset')
|
1896
|
+
params = self.omit(params, ['stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingLimitAmount', 'trailingLimitPercent', 'offset'])
|
1897
|
+
if offset is not None:
|
1898
|
+
allTriggerPrices = offset + allTriggerPrices
|
1899
|
+
request['trigger_price'] = allTriggerPrices
|
1900
|
+
else:
|
1901
|
+
request['trigger_price'] = self.price_to_precision(symbol, allTriggerPrices)
|
1902
|
+
response = await self.privatePostAmendOrder(self.extend(request, params))
|
1886
1903
|
#
|
1887
1904
|
# {
|
1888
1905
|
# "error": [],
|
1889
1906
|
# "result": {
|
1890
|
-
# "
|
1891
|
-
# "txid": "OAW2BO-7RWEK-PZY5UO",
|
1892
|
-
# "originaltxid": "OXL6SS-UPNMC-26WBE7",
|
1893
|
-
# "volume": "0.00075000",
|
1894
|
-
# "price": "13500.0",
|
1895
|
-
# "orders_cancelled": 1,
|
1896
|
-
# "descr": {
|
1897
|
-
# "order": "buy 0.00075000 XBTUSDT @ limit 13500.0"
|
1898
|
-
# }
|
1907
|
+
# "amend_id": "TJSMEH-AA67V-YUSQ6O"
|
1899
1908
|
# }
|
1900
1909
|
# }
|
1901
1910
|
#
|
1902
|
-
|
1903
|
-
return self.parse_order(
|
1911
|
+
result = self.safe_dict(response, 'result', {})
|
1912
|
+
return self.parse_order(result, market)
|
1904
1913
|
|
1905
1914
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1906
1915
|
"""
|
@@ -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/kucoin.py
CHANGED
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
@@ -352,6 +352,7 @@ class okx(Exchange, ImplicitAPI):
|
|
352
352
|
'asset/convert/history': 5 / 3,
|
353
353
|
'asset/monthly-statement': 2,
|
354
354
|
# account
|
355
|
+
'account/instruments': 1,
|
355
356
|
'account/balance': 2,
|
356
357
|
'account/positions': 2,
|
357
358
|
'account/positions-history': 100,
|
@@ -1205,6 +1206,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1205
1206
|
'default': {
|
1206
1207
|
'sandbox': True,
|
1207
1208
|
'createOrder': {
|
1209
|
+
'marginMode': True,
|
1208
1210
|
'triggerPrice': True,
|
1209
1211
|
'triggerPriceType': {
|
1210
1212
|
'last': True,
|
@@ -1214,7 +1216,6 @@ class okx(Exchange, ImplicitAPI):
|
|
1214
1216
|
'triggerDirection': False,
|
1215
1217
|
'stopLossPrice': True,
|
1216
1218
|
'takeProfitPrice': True,
|
1217
|
-
'marginMode': True,
|
1218
1219
|
'attachedStopLossTakeProfit': {
|
1219
1220
|
'triggerPriceType': {
|
1220
1221
|
'last': True,
|
@@ -1242,6 +1243,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1242
1243
|
'max': 20,
|
1243
1244
|
},
|
1244
1245
|
'fetchMyTrades': {
|
1246
|
+
'marginMode': False,
|
1245
1247
|
'daysBack': 90,
|
1246
1248
|
'limit': 100,
|
1247
1249
|
'untilDays': 10000,
|
@@ -1252,18 +1254,18 @@ class okx(Exchange, ImplicitAPI):
|
|
1252
1254
|
'trailing': True,
|
1253
1255
|
},
|
1254
1256
|
'fetchOpenOrders': {
|
1255
|
-
'limit': 100,
|
1256
1257
|
'marginMode': False,
|
1258
|
+
'limit': 100,
|
1257
1259
|
'trigger': True,
|
1258
1260
|
'trailing': True,
|
1259
1261
|
},
|
1260
1262
|
'fetchOrders': None, # not supported
|
1261
1263
|
'fetchClosedOrders': {
|
1264
|
+
'marginMode': False,
|
1262
1265
|
'limit': 100,
|
1263
1266
|
'daysBackClosed': 90, # 3 months
|
1264
1267
|
'daysBackCanceled': 1 / 12, # 2 hour
|
1265
1268
|
'untilDays': None,
|
1266
|
-
'marginMode': False,
|
1267
1269
|
'trigger': True,
|
1268
1270
|
'trailing': True,
|
1269
1271
|
},
|
@@ -1818,7 +1820,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1818
1820
|
'active': active,
|
1819
1821
|
'deposit': canDeposit,
|
1820
1822
|
'withdraw': canWithdraw,
|
1821
|
-
'fee': self.safe_number(chain, '
|
1823
|
+
'fee': self.safe_number(chain, 'fee'),
|
1822
1824
|
'precision': self.parse_number(precision),
|
1823
1825
|
'limits': {
|
1824
1826
|
'withdraw': {
|
@@ -6176,7 +6178,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6176
6178
|
:param str symbol: unified market symbol
|
6177
6179
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6178
6180
|
: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
|
6181
|
+
:param str [params.posSide]: 'long' or 'short' or 'net' for isolated margin long/short mode on futures and swap markets, default is 'net'
|
6180
6182
|
:returns dict: response from the exchange
|
6181
6183
|
"""
|
6182
6184
|
if symbol is None:
|
@@ -6198,12 +6200,11 @@ class okx(Exchange, ImplicitAPI):
|
|
6198
6200
|
'mgnMode': marginMode,
|
6199
6201
|
'instId': market['id'],
|
6200
6202
|
}
|
6201
|
-
posSide = self.safe_string(params, 'posSide')
|
6203
|
+
posSide = self.safe_string(params, 'posSide', 'net')
|
6202
6204
|
if marginMode == 'isolated':
|
6203
|
-
if posSide is None:
|
6204
|
-
raise ArgumentsRequired(self.id + ' setLeverage() requires a posSide argument for isolated margin')
|
6205
6205
|
if posSide != 'long' and posSide != 'short' and posSide != 'net':
|
6206
6206
|
raise BadRequest(self.id + ' setLeverage() requires the posSide argument to be either "long", "short" or "net"')
|
6207
|
+
request['posSide'] = posSide
|
6207
6208
|
response = await self.privatePostAccountSetLeverage(self.extend(request, params))
|
6208
6209
|
#
|
6209
6210
|
# {
|
@@ -7106,7 +7107,11 @@ class okx(Exchange, ImplicitAPI):
|
|
7106
7107
|
:returns dict[]: a list of `fees structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
7107
7108
|
"""
|
7108
7109
|
await self.load_markets()
|
7109
|
-
|
7110
|
+
request = {}
|
7111
|
+
if codes is not None:
|
7112
|
+
ids = self.currency_ids(codes)
|
7113
|
+
request['ccy'] = ','.join(ids)
|
7114
|
+
response = await self.privateGetAssetCurrencies(self.extend(request, params))
|
7110
7115
|
#
|
7111
7116
|
# {
|
7112
7117
|
# "code": "0",
|
@@ -7191,7 +7196,7 @@ class okx(Exchange, ImplicitAPI):
|
|
7191
7196
|
continue
|
7192
7197
|
chainSplit = chain.split('-')
|
7193
7198
|
networkId = self.safe_value(chainSplit, 1)
|
7194
|
-
withdrawFee = self.safe_number(feeInfo, '
|
7199
|
+
withdrawFee = self.safe_number(feeInfo, 'fee')
|
7195
7200
|
withdrawResult: dict = {
|
7196
7201
|
'fee': withdrawFee,
|
7197
7202
|
'percentage': False if (withdrawFee is not None) else None,
|