ccxt 4.2.85__py2.py3-none-any.whl → 4.2.86__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/coinex.py +232 -123
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bingx.py +33 -19
- ccxt/async_support/bitbank.py +19 -21
- ccxt/async_support/coinex.py +393 -251
- ccxt/async_support/idex.py +10 -10
- ccxt/async_support/okcoin.py +2 -1
- ccxt/base/exchange.py +1 -1
- ccxt/bingx.py +33 -19
- ccxt/bitbank.py +19 -21
- ccxt/coinex.py +393 -251
- ccxt/idex.py +10 -10
- ccxt/okcoin.py +2 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -0
- {ccxt-4.2.85.dist-info → ccxt-4.2.86.dist-info}/METADATA +6 -6
- {ccxt-4.2.85.dist-info → ccxt-4.2.86.dist-info}/RECORD +21 -21
- {ccxt-4.2.85.dist-info → ccxt-4.2.86.dist-info}/WHEEL +0 -0
- {ccxt-4.2.85.dist-info → ccxt-4.2.86.dist-info}/top_level.txt +0 -0
ccxt/async_support/idex.py
CHANGED
@@ -173,13 +173,15 @@ class idex(Exchange, ImplicitAPI):
|
|
173
173
|
'network': 'MATIC',
|
174
174
|
},
|
175
175
|
'exceptions': {
|
176
|
-
'
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
176
|
+
'exact': {
|
177
|
+
'INVALID_ORDER_QUANTITY': InvalidOrder,
|
178
|
+
'INSUFFICIENT_FUNDS': InsufficientFunds,
|
179
|
+
'SERVICE_UNAVAILABLE': ExchangeNotAvailable,
|
180
|
+
'EXCEEDED_RATE_LIMIT': DDoSProtection,
|
181
|
+
'INVALID_PARAMETER': BadRequest,
|
182
|
+
'WALLET_NOT_ASSOCIATED': InvalidAddress,
|
183
|
+
'INVALID_WALLET_SIGNATURE': AuthenticationError,
|
184
|
+
},
|
183
185
|
},
|
184
186
|
'requiredCredentials': {
|
185
187
|
'walletAddress': True,
|
@@ -1413,10 +1415,8 @@ class idex(Exchange, ImplicitAPI):
|
|
1413
1415
|
def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
1414
1416
|
errorCode = self.safe_string(response, 'code')
|
1415
1417
|
message = self.safe_string(response, 'message')
|
1416
|
-
if errorCode in self.exceptions:
|
1417
|
-
Exception = self.exceptions[errorCode]
|
1418
|
-
raise Exception(self.id + ' ' + message)
|
1419
1418
|
if errorCode is not None:
|
1419
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, message)
|
1420
1420
|
raise ExchangeError(self.id + ' ' + message)
|
1421
1421
|
return None
|
1422
1422
|
|
ccxt/async_support/okcoin.py
CHANGED
@@ -1121,8 +1121,9 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1121
1121
|
request = {
|
1122
1122
|
'instId': market['id'],
|
1123
1123
|
'bar': bar,
|
1124
|
-
'limit': limit,
|
1125
1124
|
}
|
1125
|
+
if limit is not None:
|
1126
|
+
request['limit'] = limit # default 100, max 100
|
1126
1127
|
method = None
|
1127
1128
|
method, params = self.handle_option_and_params(params, 'fetchOHLCV', 'method', 'publicGetMarketCandles')
|
1128
1129
|
response = None
|
ccxt/base/exchange.py
CHANGED
ccxt/bingx.py
CHANGED
@@ -630,7 +630,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
630
630
|
if settle is not None:
|
631
631
|
symbol += ':' + settle
|
632
632
|
fees = self.safe_dict(self.fees, type, {})
|
633
|
-
contractSize = self.
|
633
|
+
contractSize = self.parse_number('1') if (swap) else None
|
634
634
|
isActive = self.safe_string(market, 'status') == '1'
|
635
635
|
isInverse = None if (spot) else False
|
636
636
|
isLinear = None if (spot) else swap
|
@@ -671,7 +671,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
671
671
|
'max': self.safe_integer(market, 'maxLongLeverage'),
|
672
672
|
},
|
673
673
|
'amount': {
|
674
|
-
'min': self.
|
674
|
+
'min': self.safe_number_2(market, 'minQty', 'tradeMinQuantity'),
|
675
675
|
'max': self.safe_number(market, 'maxQty'),
|
676
676
|
},
|
677
677
|
'price': {
|
@@ -679,7 +679,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
679
679
|
'max': None,
|
680
680
|
},
|
681
681
|
'cost': {
|
682
|
-
'min': self.
|
682
|
+
'min': self.safe_number_2(market, 'minNotional', 'tradeMinUSDT'),
|
683
683
|
'max': self.safe_number(market, 'maxNotional'),
|
684
684
|
},
|
685
685
|
},
|
@@ -1009,6 +1009,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
1009
1009
|
isMaker = self.safe_bool(trade, 'isMaker')
|
1010
1010
|
if isMaker is not None:
|
1011
1011
|
takeOrMaker = 'maker' if isMaker else 'taker'
|
1012
|
+
amount = self.safe_string_n(trade, ['qty', 'amount', 'q'])
|
1013
|
+
if (market is not None) and market['swap'] and ('volume' in trade):
|
1014
|
+
# private trade returns num of contracts instead of base currency(as the order-related methods do)
|
1015
|
+
contractSize = self.safe_string(market['info'], 'tradeMinQuantity')
|
1016
|
+
volume = self.safe_string(trade, 'volume')
|
1017
|
+
amount = Precise.string_mul(volume, contractSize)
|
1012
1018
|
return self.safe_trade({
|
1013
1019
|
'id': self.safe_string_n(trade, ['id', 't']),
|
1014
1020
|
'info': trade,
|
@@ -1020,7 +1026,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1020
1026
|
'side': self.parse_order_side(side),
|
1021
1027
|
'takerOrMaker': takeOrMaker,
|
1022
1028
|
'price': self.safe_string_2(trade, 'price', 'p'),
|
1023
|
-
'amount':
|
1029
|
+
'amount': amount,
|
1024
1030
|
'cost': cost,
|
1025
1031
|
'fee': {
|
1026
1032
|
'cost': self.parse_number(Precise.string_abs(self.safe_string_2(trade, 'commission', 'n'))),
|
@@ -1607,19 +1613,27 @@ class bingx(Exchange, ImplicitAPI):
|
|
1607
1613
|
|
1608
1614
|
def parse_position(self, position, market: Market = None):
|
1609
1615
|
#
|
1610
|
-
#
|
1611
|
-
#
|
1612
|
-
#
|
1613
|
-
#
|
1614
|
-
#
|
1615
|
-
#
|
1616
|
-
#
|
1617
|
-
#
|
1618
|
-
#
|
1619
|
-
#
|
1620
|
-
#
|
1621
|
-
#
|
1622
|
-
#
|
1616
|
+
# {
|
1617
|
+
# "positionId":"1773122376147623936",
|
1618
|
+
# "symbol":"XRP-USDT",
|
1619
|
+
# "currency":"USDT",
|
1620
|
+
# "positionAmt":"3",
|
1621
|
+
# "availableAmt":"3",
|
1622
|
+
# "positionSide":"LONG",
|
1623
|
+
# "isolated":false,
|
1624
|
+
# "avgPrice":"0.6139",
|
1625
|
+
# "initialMargin":"0.0897",
|
1626
|
+
# "leverage":20,
|
1627
|
+
# "unrealizedProfit":"-0.0023",
|
1628
|
+
# "realisedProfit":"-0.0009",
|
1629
|
+
# "liquidationPrice":0,
|
1630
|
+
# "pnlRatio":"-0.0260",
|
1631
|
+
# "maxMarginReduction":"",
|
1632
|
+
# "riskRate":"",
|
1633
|
+
# "markPrice":"",
|
1634
|
+
# "positionValue":"",
|
1635
|
+
# "onlyOnePosition":false
|
1636
|
+
# }
|
1623
1637
|
#
|
1624
1638
|
# standard position
|
1625
1639
|
#
|
@@ -1645,7 +1659,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1645
1659
|
'info': position,
|
1646
1660
|
'id': self.safe_string(position, 'positionId'),
|
1647
1661
|
'symbol': self.safe_symbol(marketId, market, '-', 'swap'),
|
1648
|
-
'notional': self.safe_number(position, '
|
1662
|
+
'notional': self.safe_number(position, 'positionValue'),
|
1649
1663
|
'marginMode': marginMode,
|
1650
1664
|
'liquidationPrice': None,
|
1651
1665
|
'entryPrice': self.safe_number_2(position, 'avgPrice', 'entryPrice'),
|
@@ -1663,7 +1677,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1663
1677
|
'lastUpdateTimestamp': None,
|
1664
1678
|
'maintenanceMargin': None,
|
1665
1679
|
'maintenanceMarginPercentage': None,
|
1666
|
-
'collateral':
|
1680
|
+
'collateral': None,
|
1667
1681
|
'initialMargin': self.safe_number(position, 'initialMargin'),
|
1668
1682
|
'initialMarginPercentage': None,
|
1669
1683
|
'leverage': self.safe_number(position, 'leverage'),
|
ccxt/bitbank.py
CHANGED
@@ -146,21 +146,23 @@ class bitbank(Exchange, ImplicitAPI):
|
|
146
146
|
},
|
147
147
|
'precisionMode': TICK_SIZE,
|
148
148
|
'exceptions': {
|
149
|
-
'
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
149
|
+
'exact': {
|
150
|
+
'20001': AuthenticationError,
|
151
|
+
'20002': AuthenticationError,
|
152
|
+
'20003': AuthenticationError,
|
153
|
+
'20005': AuthenticationError,
|
154
|
+
'20004': InvalidNonce,
|
155
|
+
'40020': InvalidOrder,
|
156
|
+
'40021': InvalidOrder,
|
157
|
+
'40025': ExchangeError,
|
158
|
+
'40013': OrderNotFound,
|
159
|
+
'40014': OrderNotFound,
|
160
|
+
'50008': PermissionDenied,
|
161
|
+
'50009': OrderNotFound,
|
162
|
+
'50010': OrderNotFound,
|
163
|
+
'60001': InsufficientFunds,
|
164
|
+
'60005': InvalidOrder,
|
165
|
+
},
|
164
166
|
},
|
165
167
|
})
|
166
168
|
|
@@ -944,12 +946,8 @@ class bitbank(Exchange, ImplicitAPI):
|
|
944
946
|
'70009': 'We are currently temporarily restricting orders to be carried out. Please use the limit order.',
|
945
947
|
'70010': 'We are temporarily raising the minimum order quantity system load is now rising.',
|
946
948
|
}
|
947
|
-
errorClasses = self.exceptions
|
948
949
|
code = self.safe_string(data, 'code')
|
949
950
|
message = self.safe_string(errorMessages, code, 'Error')
|
950
|
-
|
951
|
-
|
952
|
-
raise errorClasses[code](message)
|
953
|
-
else:
|
954
|
-
raise ExchangeError(self.id + ' ' + self.json(response))
|
951
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], code, message)
|
952
|
+
raise ExchangeError(self.id + ' ' + self.json(response))
|
955
953
|
return None
|