ccxt 4.3.61__py2.py3-none-any.whl → 4.3.63__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 +2 -1
- ccxt/abstract/binance.py +5 -5
- ccxt/abstract/binancecoinm.py +5 -5
- ccxt/abstract/binanceus.py +5 -5
- ccxt/abstract/binanceusdm.py +5 -5
- ccxt/abstract/cryptocom.py +11 -0
- ccxt/abstract/woo.py +3 -0
- ccxt/ace.py +33 -15
- ccxt/async_support/__init__.py +2 -1
- ccxt/async_support/ace.py +33 -15
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/fast_client.py +2 -2
- ccxt/async_support/binance.py +43 -38
- ccxt/async_support/bingx.py +492 -184
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/cryptocom.py +17 -2
- ccxt/async_support/mercado.py +5 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/woo.py +296 -81
- ccxt/async_support/xt.py +4 -4
- ccxt/base/errors.py +8 -1
- ccxt/base/exchange.py +8 -2
- ccxt/binance.py +43 -38
- ccxt/bingx.py +492 -184
- ccxt/bybit.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/cryptocom.py +17 -2
- ccxt/mercado.py +5 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/binance.py +58 -39
- ccxt/pro/bingx.py +2 -2
- ccxt/pro/bitfinex2.py +8 -6
- ccxt/pro/bitget.py +6 -3
- ccxt/pro/bitmex.py +1 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +46 -23
- ccxt/pro/coinbaseexchange.py +2 -2
- ccxt/pro/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/cryptocom.py +8 -3
- ccxt/pro/deribit.py +1 -1
- ccxt/pro/gate.py +8 -5
- ccxt/pro/hollaex.py +1 -1
- ccxt/pro/htx.py +6 -2
- ccxt/pro/hyperliquid.py +3 -3
- ccxt/pro/independentreserve.py +6 -4
- ccxt/pro/kraken.py +80 -7
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/okx.py +5 -5
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/phemex.py +1 -1
- ccxt/pro/poloniexfutures.py +5 -2
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/whitebit.py +1 -1
- ccxt/pro/woo.py +1 -1
- ccxt/pro/woofipro.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/woo.py +296 -81
- ccxt/xt.py +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/METADATA +4 -4
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/RECORD +69 -69
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/WHEEL +0 -0
- {ccxt-4.3.61.dist-info → ccxt-4.3.63.dist-info}/top_level.txt +0 -0
ccxt/async_support/xt.py
CHANGED
@@ -3308,7 +3308,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3308
3308
|
}
|
3309
3309
|
return self.safe_string(statuses, status, status)
|
3310
3310
|
|
3311
|
-
async def fetch_ledger(self, code:
|
3311
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3312
3312
|
"""
|
3313
3313
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
3314
3314
|
:see: https://doc.xt.com/#futures_usergetBalanceBill
|
@@ -3467,7 +3467,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3467
3467
|
'info': depositAddress,
|
3468
3468
|
}
|
3469
3469
|
|
3470
|
-
async def fetch_deposits(self, code:
|
3470
|
+
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3471
3471
|
"""
|
3472
3472
|
fetch all deposits made to an account
|
3473
3473
|
:see: https://doc.xt.com/#deposit_withdrawalhistoryDepositGet
|
@@ -3518,7 +3518,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3518
3518
|
deposits = self.safe_value(data, 'items', [])
|
3519
3519
|
return self.parse_transactions(deposits, currency, since, limit, params)
|
3520
3520
|
|
3521
|
-
async def fetch_withdrawals(self, code:
|
3521
|
+
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3522
3522
|
"""
|
3523
3523
|
fetch all withdrawals made from an account
|
3524
3524
|
:see: https://doc.xt.com/#deposit_withdrawalwithdrawHistory
|
@@ -4490,7 +4490,7 @@ class xt(Exchange, ImplicitAPI):
|
|
4490
4490
|
if isUndefinedBody:
|
4491
4491
|
if urlencoded:
|
4492
4492
|
url += '?' + urlencoded
|
4493
|
-
payloadString += '#' + method + '#' + payload + '#' +
|
4493
|
+
payloadString += '#' + method + '#' + payload + '#' + self.rawencode(self.keysort(query))
|
4494
4494
|
else:
|
4495
4495
|
payloadString += '#' + method + '#' + payload
|
4496
4496
|
else:
|
ccxt/base/errors.py
CHANGED
@@ -40,7 +40,9 @@ error_hierarchy = {
|
|
40
40
|
'ExchangeNotAvailable': {
|
41
41
|
'OnMaintenance': {},
|
42
42
|
},
|
43
|
-
'InvalidNonce': {
|
43
|
+
'InvalidNonce': {
|
44
|
+
'ChecksumError': {},
|
45
|
+
},
|
44
46
|
'RequestTimeout': {},
|
45
47
|
},
|
46
48
|
'BadResponse': {
|
@@ -184,6 +186,10 @@ class InvalidNonce(NetworkError):
|
|
184
186
|
pass
|
185
187
|
|
186
188
|
|
189
|
+
class ChecksumError(InvalidNonce):
|
190
|
+
pass
|
191
|
+
|
192
|
+
|
187
193
|
class RequestTimeout(NetworkError):
|
188
194
|
pass
|
189
195
|
|
@@ -235,6 +241,7 @@ __all__ = [
|
|
235
241
|
'ExchangeNotAvailable',
|
236
242
|
'OnMaintenance',
|
237
243
|
'InvalidNonce',
|
244
|
+
'ChecksumError',
|
238
245
|
'RequestTimeout',
|
239
246
|
'BadResponse',
|
240
247
|
'NullResponse',
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.63'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2378,6 +2378,9 @@ class Exchange(object):
|
|
2378
2378
|
def after_construct(self):
|
2379
2379
|
self.create_networks_by_id_object()
|
2380
2380
|
|
2381
|
+
def orderbook_checksum_message(self, symbol: Str):
|
2382
|
+
return symbol + ' = False'
|
2383
|
+
|
2381
2384
|
def create_networks_by_id_object(self):
|
2382
2385
|
# automatically generate network-id-to-code mappings
|
2383
2386
|
networkIdsToCodesGenerated = self.invert_flat_string_dictionary(self.safe_value(self.options, 'networks', {})) # invert defined networks dictionary
|
@@ -5719,8 +5722,11 @@ class Exchange(object):
|
|
5719
5722
|
return [request, params]
|
5720
5723
|
|
5721
5724
|
def safe_open_interest(self, interest, market: Market = None):
|
5725
|
+
symbol = self.safe_string(interest, 'symbol')
|
5726
|
+
if symbol is None:
|
5727
|
+
symbol = self.safe_string(market, 'symbol')
|
5722
5728
|
return self.extend(interest, {
|
5723
|
-
'symbol':
|
5729
|
+
'symbol': symbol,
|
5724
5730
|
'baseVolume': self.safe_number(interest, 'baseVolume'), # deprecated
|
5725
5731
|
'quoteVolume': self.safe_number(interest, 'quoteVolume'), # deprecated
|
5726
5732
|
'openInterestAmount': self.safe_number(interest, 'openInterestAmount'),
|
ccxt/binance.py
CHANGED
@@ -836,7 +836,7 @@ class binance(Exchange, ImplicitAPI):
|
|
836
836
|
'forceOrders': {'cost': 20, 'noSymbol': 50},
|
837
837
|
'allOrders': 5,
|
838
838
|
'openOrder': 1,
|
839
|
-
'openOrders': 1,
|
839
|
+
'openOrders': {'cost': 1, 'noSymbol': 40},
|
840
840
|
'order': 1,
|
841
841
|
'account': 5,
|
842
842
|
'balance': 5,
|
@@ -1028,18 +1028,18 @@ class binance(Exchange, ImplicitAPI):
|
|
1028
1028
|
'ping': 1,
|
1029
1029
|
'um/order': 1, # 1
|
1030
1030
|
'um/openOrder': 1, # 1
|
1031
|
-
'um/openOrders': 1,
|
1031
|
+
'um/openOrders': {'cost': 1, 'noSymbol': 40},
|
1032
1032
|
'um/allOrders': 5, # 5
|
1033
1033
|
'cm/order': 1, # 1
|
1034
1034
|
'cm/openOrder': 1, # 1
|
1035
|
-
'cm/openOrders': 1,
|
1035
|
+
'cm/openOrders': {'cost': 1, 'noSymbol': 40},
|
1036
1036
|
'cm/allOrders': 20, # 20
|
1037
1037
|
'um/conditional/openOrder': 1,
|
1038
|
-
'um/conditional/openOrders': 40,
|
1038
|
+
'um/conditional/openOrders': {'cost': 1, 'noSymbol': 40},
|
1039
1039
|
'um/conditional/orderHistory': 1,
|
1040
1040
|
'um/conditional/allOrders': 40,
|
1041
1041
|
'cm/conditional/openOrder': 1,
|
1042
|
-
'cm/conditional/openOrders': 40,
|
1042
|
+
'cm/conditional/openOrders': {'cost': 1, 'noSymbol': 40},
|
1043
1043
|
'cm/conditional/orderHistory': 1,
|
1044
1044
|
'cm/conditional/allOrders': 40,
|
1045
1045
|
'margin/order': 5,
|
@@ -6201,10 +6201,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6201
6201
|
marketType = market['type'] if ('type' in market) else defaultType
|
6202
6202
|
type = self.safe_string(params, 'type', marketType)
|
6203
6203
|
elif self.options['warnOnFetchOpenOrdersWithoutSymbol']:
|
6204
|
-
|
6205
|
-
numSymbols = len(symbols)
|
6206
|
-
fetchOpenOrdersRateLimit = self.parse_to_int(numSymbols / 2)
|
6207
|
-
raise ExchangeError(self.id + ' fetchOpenOrders() WARNING: fetching open orders without specifying a symbol is rate-limited to one call per ' + str(fetchOpenOrdersRateLimit) + ' seconds. Do not call self method frequently to avoid ban. Set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.')
|
6204
|
+
raise ExchangeError(self.id + ' fetchOpenOrders() WARNING: fetching open orders without specifying a symbol has stricter rate limits(10 times more for spot, 40 times more for other markets) compared to requesting with symbol argument. To acknowledge self warning, set ' + self.id + '.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.')
|
6208
6205
|
else:
|
6209
6206
|
defaultType = self.safe_string_2(self.options, 'fetchOpenOrders', 'defaultType', 'spot')
|
6210
6207
|
type = self.safe_string(params, 'type', defaultType)
|
@@ -9103,34 +9100,38 @@ class binance(Exchange, ImplicitAPI):
|
|
9103
9100
|
if marginMode == 'cross':
|
9104
9101
|
# calculate collateral
|
9105
9102
|
precision = self.safe_dict(market, 'precision', {})
|
9106
|
-
|
9107
|
-
|
9108
|
-
|
9109
|
-
|
9110
|
-
if
|
9111
|
-
|
9112
|
-
|
9113
|
-
|
9114
|
-
|
9115
|
-
|
9116
|
-
|
9117
|
-
|
9118
|
-
|
9119
|
-
|
9120
|
-
|
9121
|
-
|
9122
|
-
|
9123
|
-
|
9124
|
-
if side == 'short':
|
9125
|
-
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9103
|
+
basePrecisionValue = self.safe_string(precision, 'base')
|
9104
|
+
quotePrecisionValue = self.safe_string_2(precision, 'quote', 'price')
|
9105
|
+
precisionIsUndefined = (basePrecisionValue is None) and (quotePrecisionValue is None)
|
9106
|
+
if not precisionIsUndefined:
|
9107
|
+
if linear:
|
9108
|
+
# walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
|
9109
|
+
onePlusMaintenanceMarginPercentageString = None
|
9110
|
+
entryPriceSignString = entryPriceString
|
9111
|
+
if side == 'short':
|
9112
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('1', maintenanceMarginPercentageString)
|
9113
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9114
|
+
else:
|
9115
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_add('-1', maintenanceMarginPercentageString)
|
9116
|
+
inner = Precise.string_mul(liquidationPriceString, onePlusMaintenanceMarginPercentageString)
|
9117
|
+
leftSide = Precise.string_add(inner, entryPriceSignString)
|
9118
|
+
quotePrecision = self.precision_from_string(self.safe_string_2(precision, 'quote', 'price'))
|
9119
|
+
if quotePrecision is not None:
|
9120
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', quotePrecision)
|
9126
9121
|
else:
|
9127
|
-
|
9128
|
-
|
9129
|
-
|
9130
|
-
|
9131
|
-
|
9132
|
-
|
9133
|
-
|
9122
|
+
# walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
|
9123
|
+
onePlusMaintenanceMarginPercentageString = None
|
9124
|
+
entryPriceSignString = entryPriceString
|
9125
|
+
if side == 'short':
|
9126
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('1', maintenanceMarginPercentageString)
|
9127
|
+
else:
|
9128
|
+
onePlusMaintenanceMarginPercentageString = Precise.string_sub('-1', maintenanceMarginPercentageString)
|
9129
|
+
entryPriceSignString = Precise.string_mul('-1', entryPriceSignString)
|
9130
|
+
leftSide = Precise.string_mul(contractsAbs, contractSizeString)
|
9131
|
+
rightSide = Precise.string_sub(Precise.string_div('1', entryPriceSignString), Precise.string_div(onePlusMaintenanceMarginPercentageString, liquidationPriceString))
|
9132
|
+
basePrecision = self.precision_from_string(self.safe_string(precision, 'base'))
|
9133
|
+
if basePrecision is not None:
|
9134
|
+
collateralString = Precise.string_div(Precise.string_mul(leftSide, rightSide), '1', basePrecision)
|
9134
9135
|
else:
|
9135
9136
|
collateralString = self.safe_string(position, 'isolatedMargin')
|
9136
9137
|
collateralString = '0' if (collateralString is None) else collateralString
|
@@ -9695,9 +9696,10 @@ class binance(Exchange, ImplicitAPI):
|
|
9695
9696
|
#
|
9696
9697
|
result = []
|
9697
9698
|
for i in range(0, len(response)):
|
9698
|
-
|
9699
|
-
entryPrice = self.safe_string(
|
9699
|
+
rawPosition = response[i]
|
9700
|
+
entryPrice = self.safe_string(rawPosition, 'entryPrice')
|
9700
9701
|
if (entryPrice != '0') and (entryPrice != '0.0') and (entryPrice != '0.00000000'):
|
9702
|
+
parsed = self.parse_position_risk(response[i])
|
9701
9703
|
result.append(parsed)
|
9702
9704
|
symbols = self.market_symbols(symbols)
|
9703
9705
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
@@ -11200,6 +11202,8 @@ class binance(Exchange, ImplicitAPI):
|
|
11200
11202
|
request: dict = {}
|
11201
11203
|
if market['option']:
|
11202
11204
|
request['underlyingAsset'] = market['baseId']
|
11205
|
+
if market['expiry'] is None:
|
11206
|
+
raise NotSupported(self.id + ' fetchOpenInterest does not support ' + symbol)
|
11203
11207
|
request['expiration'] = self.yymmdd(market['expiry'])
|
11204
11208
|
else:
|
11205
11209
|
request['symbol'] = market['id']
|
@@ -11241,6 +11245,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11241
11245
|
# ]
|
11242
11246
|
#
|
11243
11247
|
if market['option']:
|
11248
|
+
symbol = market['symbol']
|
11244
11249
|
result = self.parse_open_interests(response, market)
|
11245
11250
|
for i in range(0, len(result)):
|
11246
11251
|
item = result[i]
|