ccxt 4.3.20__py2.py3-none-any.whl → 4.3.22__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/coinex.py +1 -1
- ccxt/abstract/okx.py +3 -0
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +8 -2
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bitmex.py +1 -0
- ccxt/async_support/coinex.py +140 -178
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hyperliquid.py +25 -3
- ccxt/async_support/okx.py +4 -1
- ccxt/async_support/phemex.py +35 -5
- ccxt/base/exchange.py +2 -2
- ccxt/binance.py +8 -2
- ccxt/bingx.py +1 -1
- ccxt/bitget.py +1 -1
- ccxt/bitmex.py +1 -0
- ccxt/coinex.py +140 -178
- ccxt/delta.py +1 -1
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +1 -1
- ccxt/gate.py +1 -1
- ccxt/hitbtc.py +1 -1
- ccxt/hyperliquid.py +25 -3
- ccxt/okx.py +4 -1
- ccxt/phemex.py +35 -5
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/kucoinfutures.py +89 -1
- ccxt/pro/woo.py +46 -22
- {ccxt-4.3.20.dist-info → ccxt-4.3.22.dist-info}/METADATA +4 -4
- {ccxt-4.3.20.dist-info → ccxt-4.3.22.dist-info}/RECORD +45 -45
- {ccxt-4.3.20.dist-info → ccxt-4.3.22.dist-info}/WHEEL +0 -0
- {ccxt-4.3.20.dist-info → ccxt-4.3.22.dist-info}/top_level.txt +0 -0
ccxt/async_support/exmo.py
CHANGED
@@ -270,7 +270,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
270
270
|
margin['amount'] = amount
|
271
271
|
return margin
|
272
272
|
|
273
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
273
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
274
274
|
#
|
275
275
|
# {}
|
276
276
|
#
|
ccxt/async_support/gate.py
CHANGED
@@ -5679,7 +5679,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5679
5679
|
raise NotSupported(self.id + ' modifyMarginHelper() not support self market type')
|
5680
5680
|
return self.parse_margin_modification(response, market)
|
5681
5681
|
|
5682
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
5682
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
5683
5683
|
#
|
5684
5684
|
# {
|
5685
5685
|
# "value": "11.9257",
|
ccxt/async_support/hitbtc.py
CHANGED
@@ -3057,7 +3057,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3057
3057
|
'type': type,
|
3058
3058
|
})
|
3059
3059
|
|
3060
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
3060
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
3061
3061
|
#
|
3062
3062
|
# addMargin/reduceMargin
|
3063
3063
|
#
|
@@ -1545,14 +1545,17 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1545
1545
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1546
1546
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1547
1547
|
:param str [params.user]: user address, will default to self.walletAddress if not provided
|
1548
|
+
:param str [params.method]: 'openOrders' or 'frontendOpenOrders' default is 'frontendOpenOrders'
|
1548
1549
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1549
1550
|
"""
|
1550
1551
|
userAddress = None
|
1551
1552
|
userAddress, params = self.handle_public_address('fetchOpenOrders', params)
|
1553
|
+
method = None
|
1554
|
+
method, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'method', 'frontendOpenOrders')
|
1552
1555
|
await self.load_markets()
|
1553
1556
|
market = self.safe_market(symbol)
|
1554
1557
|
request = {
|
1555
|
-
'type':
|
1558
|
+
'type': method,
|
1556
1559
|
'user': userAddress,
|
1557
1560
|
}
|
1558
1561
|
response = await self.publicPostInfo(self.extend(request, params))
|
@@ -1726,6 +1729,25 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1726
1729
|
# "oid":6195281425
|
1727
1730
|
# }
|
1728
1731
|
# }
|
1732
|
+
# frontendOrder
|
1733
|
+
# {
|
1734
|
+
# "children": [],
|
1735
|
+
# "cloid": null,
|
1736
|
+
# "coin": "BLUR",
|
1737
|
+
# "isPositionTpsl": False,
|
1738
|
+
# "isTrigger": True,
|
1739
|
+
# "limitPx": "0.5",
|
1740
|
+
# "oid": 8670487141,
|
1741
|
+
# "orderType": "Stop Limit",
|
1742
|
+
# "origSz": "20.0",
|
1743
|
+
# "reduceOnly": False,
|
1744
|
+
# "side": "B",
|
1745
|
+
# "sz": "20.0",
|
1746
|
+
# "tif": null,
|
1747
|
+
# "timestamp": 1715523663687,
|
1748
|
+
# "triggerCondition": "Price above 0.6",
|
1749
|
+
# "triggerPx": "0.6"
|
1750
|
+
# }
|
1729
1751
|
#
|
1730
1752
|
entry = self.safe_dict_n(order, ['order', 'resting', 'filled'])
|
1731
1753
|
if entry is None:
|
@@ -1756,7 +1778,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1756
1778
|
'lastTradeTimestamp': None,
|
1757
1779
|
'lastUpdateTimestamp': None,
|
1758
1780
|
'symbol': symbol,
|
1759
|
-
'type': self.safe_string_lower(entry, 'orderType'),
|
1781
|
+
'type': self.parse_order_type(self.safe_string_lower(entry, 'orderType')),
|
1760
1782
|
'timeInForce': self.safe_string_upper(entry, 'tif'),
|
1761
1783
|
'postOnly': None,
|
1762
1784
|
'reduceOnly': self.safe_bool(entry, 'reduceOnly'),
|
@@ -2191,7 +2213,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2191
2213
|
'code': self.safe_string(response, 'status'),
|
2192
2214
|
})
|
2193
2215
|
|
2194
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
2216
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
2195
2217
|
#
|
2196
2218
|
# {
|
2197
2219
|
# 'type': 'default'
|
ccxt/async_support/okx.py
CHANGED
@@ -270,6 +270,9 @@ class okx(Exchange, ImplicitAPI):
|
|
270
270
|
'sprd/books': 1 / 2,
|
271
271
|
'sprd/ticker': 1,
|
272
272
|
'sprd/public-trades': 1 / 5,
|
273
|
+
'market/sprd-ticker': 2,
|
274
|
+
'market/sprd-candles': 2,
|
275
|
+
'market/sprd-history-candles': 2,
|
273
276
|
'tradingBot/grid/ai-param': 1,
|
274
277
|
'tradingBot/grid/min-investment': 1,
|
275
278
|
'tradingBot/public/rsi-back-testing': 1,
|
@@ -6236,7 +6239,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6236
6239
|
'status': 'ok' if (errorCode == '0') else 'failed',
|
6237
6240
|
})
|
6238
6241
|
|
6239
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
6242
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
6240
6243
|
#
|
6241
6244
|
# addMargin/reduceMargin
|
6242
6245
|
#
|
ccxt/async_support/phemex.py
CHANGED
@@ -1658,6 +1658,26 @@ class phemex(Exchange, ImplicitAPI):
|
|
1658
1658
|
# "execId": "8718cae",
|
1659
1659
|
# "execStatus": 6
|
1660
1660
|
# }
|
1661
|
+
# spot with fees paid using PT token
|
1662
|
+
# "createdAt": "1714990724076",
|
1663
|
+
# "symbol": "BTCUSDT",
|
1664
|
+
# "currency": "USDT",
|
1665
|
+
# "action": "1",
|
1666
|
+
# "tradeType": "1",
|
1667
|
+
# "execQtyRq": "0.003",
|
1668
|
+
# "execPriceRp": "64935",
|
1669
|
+
# "side": "2",
|
1670
|
+
# "orderQtyRq": "0.003",
|
1671
|
+
# "priceRp": "51600",
|
1672
|
+
# "execValueRv": "194.805",
|
1673
|
+
# "feeRateRr": "0.000495",
|
1674
|
+
# "execFeeRv": "0",
|
1675
|
+
# "ordType": "3",
|
1676
|
+
# "execId": "XXXXXX",
|
1677
|
+
# "execStatus": "7",
|
1678
|
+
# "posSide": "1",
|
1679
|
+
# "ptFeeRv": "0.110012249248",
|
1680
|
+
# "ptPriceRp": "0.876524893"
|
1661
1681
|
#
|
1662
1682
|
priceString: Str
|
1663
1683
|
amountString: Str
|
@@ -1706,10 +1726,16 @@ class phemex(Exchange, ImplicitAPI):
|
|
1706
1726
|
priceString = self.safe_string(trade, 'execPriceRp')
|
1707
1727
|
amountString = self.safe_string(trade, 'execQtyRq')
|
1708
1728
|
costString = self.safe_string(trade, 'execValueRv')
|
1709
|
-
feeCostString = self.safe_string(trade, 'execFeeRv')
|
1729
|
+
feeCostString = self.omit_zero(self.safe_string(trade, 'execFeeRv'))
|
1710
1730
|
feeRateString = self.safe_string(trade, 'feeRateRr')
|
1711
|
-
|
1712
|
-
|
1731
|
+
if feeCostString is not None:
|
1732
|
+
currencyId = self.safe_string(trade, 'currency')
|
1733
|
+
feeCurrencyCode = self.safe_currency_code(currencyId)
|
1734
|
+
else:
|
1735
|
+
ptFeeRv = self.omit_zero(self.safe_string(trade, 'ptFeeRv'))
|
1736
|
+
if ptFeeRv is not None:
|
1737
|
+
feeCostString = ptFeeRv
|
1738
|
+
feeCurrencyCode = 'PT'
|
1713
1739
|
else:
|
1714
1740
|
side = self.safe_string_lower(trade, 'side')
|
1715
1741
|
type = self.parse_order_type(self.safe_string(trade, 'ordType'))
|
@@ -1720,7 +1746,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1720
1746
|
amountString = self.from_ev(self.safe_string(trade, 'execBaseQtyEv'), market)
|
1721
1747
|
amountString = self.safe_string(trade, 'execQty', amountString)
|
1722
1748
|
costString = self.from_er(self.safe_string_2(trade, 'execQuoteQtyEv', 'execValueEv'), market)
|
1723
|
-
feeCostString = self.from_er(self.safe_string(trade, 'execFeeEv'), market)
|
1749
|
+
feeCostString = self.from_er(self.omit_zero(self.safe_string(trade, 'execFeeEv')), market)
|
1724
1750
|
if feeCostString is not None:
|
1725
1751
|
feeRateString = self.from_er(self.safe_string(trade, 'feeRateEr'), market)
|
1726
1752
|
if market['spot']:
|
@@ -1730,6 +1756,10 @@ class phemex(Exchange, ImplicitAPI):
|
|
1730
1756
|
if info is not None:
|
1731
1757
|
settlementCurrencyId = self.safe_string(info, 'settlementCurrency')
|
1732
1758
|
feeCurrencyCode = self.safe_currency_code(settlementCurrencyId)
|
1759
|
+
else:
|
1760
|
+
feeCostString = self.safe_string(trade, 'ptFeeRv')
|
1761
|
+
if feeCostString is not None:
|
1762
|
+
feeCurrencyCode = 'PT'
|
1733
1763
|
fee = {
|
1734
1764
|
'cost': feeCostString,
|
1735
1765
|
'rate': feeRateString,
|
@@ -3790,7 +3820,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3790
3820
|
}
|
3791
3821
|
return self.safe_string(statuses, status, status)
|
3792
3822
|
|
3793
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
3823
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
3794
3824
|
#
|
3795
3825
|
# {
|
3796
3826
|
# "code": 0,
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.22'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -5854,7 +5854,7 @@ class Exchange(object):
|
|
5854
5854
|
"""
|
5855
5855
|
raise NotSupported(self.id + ' fetchPositionsHistory() is not supported yet')
|
5856
5856
|
|
5857
|
-
def parse_margin_modification(self, data, market: Market = None):
|
5857
|
+
def parse_margin_modification(self, data: dict, market: Market = None):
|
5858
5858
|
raise NotSupported(self.id + ' parseMarginModification() is not supported yet')
|
5859
5859
|
|
5860
5860
|
def parse_margin_modifications(self, response: List[object], symbols: List[str] = None, symbolKey: Str = None, marketType: MarketType = None):
|
ccxt/binance.py
CHANGED
@@ -153,7 +153,7 @@ class binance(Exchange, ImplicitAPI):
|
|
153
153
|
'fetchPositions': True,
|
154
154
|
'fetchPositionsHistory': False,
|
155
155
|
'fetchPositionsRisk': True,
|
156
|
-
'fetchPremiumIndexOHLCV':
|
156
|
+
'fetchPremiumIndexOHLCV': True,
|
157
157
|
'fetchSettlementHistory': True,
|
158
158
|
'fetchStatus': True,
|
159
159
|
'fetchTicker': True,
|
@@ -802,6 +802,7 @@ class binance(Exchange, ImplicitAPI):
|
|
802
802
|
'continuousKlines': {'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]]},
|
803
803
|
'markPriceKlines': {'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]]},
|
804
804
|
'indexPriceKlines': {'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]]},
|
805
|
+
'premiumIndexKlines': {'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]]},
|
805
806
|
'fundingRate': 1,
|
806
807
|
'fundingInfo': 1,
|
807
808
|
'premiumIndex': 1,
|
@@ -4155,6 +4156,11 @@ class binance(Exchange, ImplicitAPI):
|
|
4155
4156
|
response = self.dapiPublicGetIndexPriceKlines(self.extend(request, params))
|
4156
4157
|
else:
|
4157
4158
|
response = self.fapiPublicGetIndexPriceKlines(self.extend(request, params))
|
4159
|
+
elif price == 'premiumIndex':
|
4160
|
+
if market['inverse']:
|
4161
|
+
response = self.dapiPublicGetPremiumIndexKlines(self.extend(request, params))
|
4162
|
+
else:
|
4163
|
+
response = self.fapiPublicGetPremiumIndexKlines(self.extend(request, params))
|
4158
4164
|
elif market['linear']:
|
4159
4165
|
response = self.fapiPublicGetKlines(self.extend(request, params))
|
4160
4166
|
elif market['inverse']:
|
@@ -10356,7 +10362,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10356
10362
|
'code': code,
|
10357
10363
|
})
|
10358
10364
|
|
10359
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
10365
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
10360
10366
|
#
|
10361
10367
|
# add/reduce margin
|
10362
10368
|
#
|
ccxt/bingx.py
CHANGED
@@ -3436,7 +3436,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3436
3436
|
#
|
3437
3437
|
return self.parse_margin_modification(response, market)
|
3438
3438
|
|
3439
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
3439
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
3440
3440
|
#
|
3441
3441
|
# {
|
3442
3442
|
# "code": 0,
|
ccxt/bitget.py
CHANGED
@@ -6478,7 +6478,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6478
6478
|
'type': type,
|
6479
6479
|
})
|
6480
6480
|
|
6481
|
-
def parse_margin_modification(self, data, market: Market = None) -> MarginModification:
|
6481
|
+
def parse_margin_modification(self, data: dict, market: Market = None) -> MarginModification:
|
6482
6482
|
#
|
6483
6483
|
# addMargin/reduceMargin
|
6484
6484
|
#
|
ccxt/bitmex.py
CHANGED
@@ -253,6 +253,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
253
253
|
'orderQty is invalid': InvalidOrder,
|
254
254
|
'Invalid price': InvalidOrder,
|
255
255
|
'Invalid stopPx for ordType': InvalidOrder,
|
256
|
+
'Account is restricted': PermissionDenied, # {"error":{"message":"Account is restricted","name":"HTTPError"}}
|
256
257
|
},
|
257
258
|
'broad': {
|
258
259
|
'Signature not valid': AuthenticationError,
|