ccxt 4.3.51__py2.py3-none-any.whl → 4.3.53__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 +3 -1
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/vertex.py +19 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/cache.py +2 -2
- ccxt/async_support/binance.py +3 -3
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/bybit.py +5 -0
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/hyperliquid.py +27 -25
- ccxt/async_support/krakenfutures.py +1 -0
- ccxt/async_support/okx.py +1 -0
- ccxt/async_support/probit.py +9 -5
- ccxt/async_support/vertex.py +2811 -0
- ccxt/base/exchange.py +2 -2
- ccxt/base/precise.py +10 -0
- ccxt/binance.py +3 -3
- ccxt/bitget.py +1 -1
- ccxt/bitmart.py +1 -1
- ccxt/bybit.py +5 -0
- ccxt/coinex.py +1 -1
- ccxt/htx.py +1 -1
- ccxt/hyperliquid.py +27 -25
- ccxt/krakenfutures.py +1 -0
- ccxt/okx.py +1 -0
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/okx.py +1 -1
- ccxt/pro/probit.py +6 -4
- ccxt/pro/vertex.py +916 -0
- ccxt/probit.py +9 -5
- ccxt/test/test_async.py +37 -3
- ccxt/test/test_sync.py +37 -3
- ccxt/vertex.py +2811 -0
- ccxt-4.3.53.dist-info/LICENSE.txt +21 -0
- {ccxt-4.3.51.dist-info → ccxt-4.3.53.dist-info}/METADATA +19 -17
- {ccxt-4.3.51.dist-info → ccxt-4.3.53.dist-info}/RECORD +41 -36
- {ccxt-4.3.51.dist-info → ccxt-4.3.53.dist-info}/WHEEL +1 -1
- {ccxt-4.3.51.dist-info → ccxt-4.3.53.dist-info}/top_level.txt +0 -0
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.53'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -2255,7 +2255,7 @@ class Exchange(object):
|
|
2255
2255
|
def parse_borrow_interest(self, info: dict, market: Market = None):
|
2256
2256
|
raise NotSupported(self.id + ' parseBorrowInterest() is not supported yet')
|
2257
2257
|
|
2258
|
-
def parse_isolated_borrow_rate(self, info, market: Market = None):
|
2258
|
+
def parse_isolated_borrow_rate(self, info: dict, market: Market = None):
|
2259
2259
|
raise NotSupported(self.id + ' parseIsolatedBorrowRate() is not supported yet')
|
2260
2260
|
|
2261
2261
|
def parse_ws_trade(self, trade, market: Market = None):
|
ccxt/base/precise.py
CHANGED
@@ -126,6 +126,10 @@ class Precise:
|
|
126
126
|
result = numerator % denominator
|
127
127
|
return Precise(result, rationizerDenominator + other.decimals)
|
128
128
|
|
129
|
+
def orn(self, other):
|
130
|
+
integer_result = self.integer | other.integer
|
131
|
+
return Precise(integer_result, self.decimals)
|
132
|
+
|
129
133
|
def min(self, other):
|
130
134
|
return self if self.lt(other) else other
|
131
135
|
|
@@ -238,6 +242,12 @@ class Precise:
|
|
238
242
|
return None
|
239
243
|
return str(Precise(string1).mod(Precise(string2)))
|
240
244
|
|
245
|
+
@staticmethod
|
246
|
+
def string_or(string1, string2):
|
247
|
+
if string1 is None or string2 is None:
|
248
|
+
return None
|
249
|
+
return str(Precise(string1).orn(Precise(string2)))
|
250
|
+
|
241
251
|
@staticmethod
|
242
252
|
def string_equals(string1, string2):
|
243
253
|
if string1 is None or string2 is None:
|
ccxt/binance.py
CHANGED
@@ -10282,9 +10282,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10282
10282
|
orderidlistLength = len(orderidlist)
|
10283
10283
|
origclientorderidlistLength = len(origclientorderidlist)
|
10284
10284
|
if orderidlistLength > 0:
|
10285
|
-
query = query + '&' + 'orderidlist
|
10285
|
+
query = query + '&' + 'orderidlist=%5B' + '%2C'.join(orderidlist) + '%5D'
|
10286
10286
|
if origclientorderidlistLength > 0:
|
10287
|
-
query = query + '&' + 'origclientorderidlist
|
10287
|
+
query = query + '&' + 'origclientorderidlist=%5B' + '%2C'.join(origclientorderidlist) + '%5D'
|
10288
10288
|
else:
|
10289
10289
|
query = self.rawencode(extendedParams)
|
10290
10290
|
else:
|
@@ -10681,7 +10681,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10681
10681
|
'info': info,
|
10682
10682
|
}
|
10683
10683
|
|
10684
|
-
def parse_isolated_borrow_rate(self, info, market: Market = None):
|
10684
|
+
def parse_isolated_borrow_rate(self, info: dict, market: Market = None) -> IsolatedBorrowRate:
|
10685
10685
|
#
|
10686
10686
|
# {
|
10687
10687
|
# "vipLevel": 0,
|
ccxt/bitget.py
CHANGED
@@ -7450,7 +7450,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7450
7450
|
first['timestamp'] = timestamp
|
7451
7451
|
return self.parse_isolated_borrow_rate(first, market)
|
7452
7452
|
|
7453
|
-
def parse_isolated_borrow_rate(self, info, market: Market = None) -> IsolatedBorrowRate:
|
7453
|
+
def parse_isolated_borrow_rate(self, info: dict, market: Market = None) -> IsolatedBorrowRate:
|
7454
7454
|
#
|
7455
7455
|
# {
|
7456
7456
|
# "symbol": "BTCUSDT",
|
ccxt/bitmart.py
CHANGED
@@ -3601,7 +3601,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3601
3601
|
borrowRate = self.safe_value(symbols, 0)
|
3602
3602
|
return self.parse_isolated_borrow_rate(borrowRate, market)
|
3603
3603
|
|
3604
|
-
def parse_isolated_borrow_rate(self, info, market: Market = None) -> IsolatedBorrowRate:
|
3604
|
+
def parse_isolated_borrow_rate(self, info: dict, market: Market = None) -> IsolatedBorrowRate:
|
3605
3605
|
#
|
3606
3606
|
# {
|
3607
3607
|
# "symbol": "BTC_USDT",
|
ccxt/bybit.py
CHANGED
@@ -4838,9 +4838,14 @@ class bybit(Exchange, ImplicitAPI):
|
|
4838
4838
|
:param str [params.baseCoin]: Base coin. Supports linear, inverse & option
|
4839
4839
|
:param str [params.settleCoin]: Settle coin. Supports linear, inverse & option
|
4840
4840
|
:param str [params.orderFilter]: 'Order' or 'StopOrder' or 'tpslOrder'
|
4841
|
+
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
4841
4842
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4842
4843
|
"""
|
4843
4844
|
self.load_markets()
|
4845
|
+
paginate = False
|
4846
|
+
paginate, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'paginate')
|
4847
|
+
if paginate:
|
4848
|
+
return self.fetch_paginated_call_cursor('fetchOpenOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 50)
|
4844
4849
|
enableUnifiedMargin, enableUnifiedAccount = self.is_unified_enabled()
|
4845
4850
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
4846
4851
|
request: dict = {}
|
ccxt/coinex.py
CHANGED
@@ -4837,7 +4837,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4837
4837
|
data = self.safe_list(response, 'data', [])
|
4838
4838
|
return self.parse_transactions(data, currency, since, limit)
|
4839
4839
|
|
4840
|
-
def parse_isolated_borrow_rate(self, info, market: Market = None) -> IsolatedBorrowRate:
|
4840
|
+
def parse_isolated_borrow_rate(self, info: dict, market: Market = None) -> IsolatedBorrowRate:
|
4841
4841
|
#
|
4842
4842
|
# {
|
4843
4843
|
# "market": "BTCUSDT",
|
ccxt/htx.py
CHANGED
@@ -6180,7 +6180,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6180
6180
|
data = self.safe_value(response, 'data', [])
|
6181
6181
|
return self.parse_isolated_borrow_rates(data)
|
6182
6182
|
|
6183
|
-
def parse_isolated_borrow_rate(self, info, market: Market = None) -> IsolatedBorrowRate:
|
6183
|
+
def parse_isolated_borrow_rate(self, info: dict, market: Market = None) -> IsolatedBorrowRate:
|
6184
6184
|
#
|
6185
6185
|
# {
|
6186
6186
|
# "symbol": "1inchusdt",
|
ccxt/hyperliquid.py
CHANGED
@@ -444,23 +444,26 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
444
444
|
for i in range(0, len(meta)):
|
445
445
|
market = self.safe_dict(meta, i, {})
|
446
446
|
marketName = self.safe_string(market, 'name')
|
447
|
-
if marketName.find('/') < 0:
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
quote = self.safe_currency_code(quoteId)
|
455
|
-
symbol = base + '/' + quote
|
447
|
+
# if marketName.find('/') < 0:
|
448
|
+
# # there are some weird spot markets in testnet, eg @2
|
449
|
+
# continue
|
450
|
+
# }
|
451
|
+
# marketParts = marketName.split('/')
|
452
|
+
# baseName = self.safe_string(marketParts, 0)
|
453
|
+
# quoteId = self.safe_string(marketParts, 1)
|
456
454
|
fees = self.safe_dict(self.fees, 'spot', {})
|
457
455
|
taker = self.safe_number(fees, 'taker')
|
458
456
|
maker = self.safe_number(fees, 'maker')
|
459
457
|
tokensPos = self.safe_list(market, 'tokens', [])
|
460
458
|
baseTokenPos = self.safe_integer(tokensPos, 0)
|
461
|
-
|
459
|
+
quoteTokenPos = self.safe_integer(tokensPos, 1)
|
462
460
|
baseTokenInfo = self.safe_dict(tokens, baseTokenPos, {})
|
463
|
-
|
461
|
+
quoteTokenInfo = self.safe_dict(tokens, quoteTokenPos, {})
|
462
|
+
baseName = self.safe_string(baseTokenInfo, 'name')
|
463
|
+
quoteId = self.safe_string(quoteTokenInfo, 'name')
|
464
|
+
base = self.safe_currency_code(baseName)
|
465
|
+
quote = self.safe_currency_code(quoteId)
|
466
|
+
symbol = base + '/' + quote
|
464
467
|
innerBaseTokenInfo = self.safe_dict(baseTokenInfo, 'spec', baseTokenInfo)
|
465
468
|
# innerQuoteTokenInfo = self.safe_dict(quoteTokenInfo, 'spec', quoteTokenInfo)
|
466
469
|
amountPrecision = self.parse_number(self.parse_precision(self.safe_string(innerBaseTokenInfo, 'szDecimals')))
|
@@ -1114,7 +1117,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1114
1117
|
}
|
1115
1118
|
if clientOrderId is not None:
|
1116
1119
|
orderObj['c'] = clientOrderId
|
1117
|
-
orderReq.append(
|
1120
|
+
orderReq.append(orderObj)
|
1118
1121
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
1119
1122
|
orderAction: dict = {
|
1120
1123
|
'type': 'order',
|
@@ -1134,7 +1137,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1134
1137
|
if vaultAddress is not None:
|
1135
1138
|
params = self.omit(params, 'vaultAddress')
|
1136
1139
|
request['vaultAddress'] = vaultAddress
|
1137
|
-
response = self.privatePostExchange(
|
1140
|
+
response = self.privatePostExchange(request)
|
1138
1141
|
#
|
1139
1142
|
# {
|
1140
1143
|
# "status": "ok",
|
@@ -1226,7 +1229,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1226
1229
|
if vaultAddress is not None:
|
1227
1230
|
params = self.omit(params, 'vaultAddress')
|
1228
1231
|
request['vaultAddress'] = vaultAddress
|
1229
|
-
response = self.privatePostExchange(
|
1232
|
+
response = self.privatePostExchange(request)
|
1230
1233
|
#
|
1231
1234
|
# {
|
1232
1235
|
# "status":"ok",
|
@@ -1302,7 +1305,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1302
1305
|
if vaultAddress is not None:
|
1303
1306
|
params = self.omit(params, 'vaultAddress')
|
1304
1307
|
request['vaultAddress'] = vaultAddress
|
1305
|
-
response = self.privatePostExchange(
|
1308
|
+
response = self.privatePostExchange(request)
|
1306
1309
|
#
|
1307
1310
|
# {
|
1308
1311
|
# "status":"ok",
|
@@ -1345,7 +1348,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1345
1348
|
if vaultAddress is not None:
|
1346
1349
|
params = self.omit(params, 'vaultAddress')
|
1347
1350
|
request['vaultAddress'] = vaultAddress
|
1348
|
-
response = self.privatePostExchange(
|
1351
|
+
response = self.privatePostExchange(request)
|
1349
1352
|
#
|
1350
1353
|
# {
|
1351
1354
|
# "status":"err",
|
@@ -1454,7 +1457,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1454
1457
|
if vaultAddress is not None:
|
1455
1458
|
params = self.omit(params, 'vaultAddress')
|
1456
1459
|
request['vaultAddress'] = vaultAddress
|
1457
|
-
response = self.privatePostExchange(
|
1460
|
+
response = self.privatePostExchange(request)
|
1458
1461
|
#
|
1459
1462
|
# {
|
1460
1463
|
# "status": "ok",
|
@@ -2096,10 +2099,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2096
2099
|
params = self.omit(params, 'vaultAddress')
|
2097
2100
|
if vaultAddress.startswith('0x'):
|
2098
2101
|
vaultAddress = vaultAddress.replace('0x', '')
|
2099
|
-
|
2100
|
-
signature = self.sign_l1_action(extendedAction, nonce, vaultAddress)
|
2102
|
+
signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
|
2101
2103
|
request: dict = {
|
2102
|
-
'action':
|
2104
|
+
'action': updateAction,
|
2103
2105
|
'nonce': nonce,
|
2104
2106
|
'signature': signature,
|
2105
2107
|
# 'vaultAddress': vaultAddress,
|
@@ -2152,7 +2154,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2152
2154
|
if vaultAddress is not None:
|
2153
2155
|
params = self.omit(params, 'vaultAddress')
|
2154
2156
|
request['vaultAddress'] = vaultAddress
|
2155
|
-
response = self.privatePostExchange(
|
2157
|
+
response = self.privatePostExchange(request)
|
2156
2158
|
#
|
2157
2159
|
# {
|
2158
2160
|
# 'response': {
|
@@ -2210,7 +2212,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2210
2212
|
if vaultAddress is not None:
|
2211
2213
|
params = self.omit(params, 'vaultAddress')
|
2212
2214
|
request['vaultAddress'] = vaultAddress
|
2213
|
-
response = self.privatePostExchange(
|
2215
|
+
response = self.privatePostExchange(request)
|
2214
2216
|
#
|
2215
2217
|
# {
|
2216
2218
|
# 'response': {
|
@@ -2274,7 +2276,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2274
2276
|
}
|
2275
2277
|
signature = self.sign_l1_action(action, nonce, vaultAddress)
|
2276
2278
|
innerRequest: dict = {
|
2277
|
-
'action':
|
2279
|
+
'action': action,
|
2278
2280
|
'nonce': nonce,
|
2279
2281
|
'signature': signature,
|
2280
2282
|
}
|
@@ -2307,7 +2309,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2307
2309
|
'nonce': nonce,
|
2308
2310
|
'signature': sig,
|
2309
2311
|
}
|
2310
|
-
response = self.privatePostExchange(
|
2312
|
+
response = self.privatePostExchange(request)
|
2311
2313
|
return response
|
2312
2314
|
|
2313
2315
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
@@ -2349,7 +2351,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2349
2351
|
'nonce': nonce,
|
2350
2352
|
'signature': sig,
|
2351
2353
|
}
|
2352
|
-
response = self.privatePostExchange(
|
2354
|
+
response = self.privatePostExchange(request)
|
2353
2355
|
return self.parse_transaction(response)
|
2354
2356
|
|
2355
2357
|
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
ccxt/krakenfutures.py
CHANGED
@@ -96,6 +96,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
96
96
|
'public': 'https://demo-futures.kraken.com/derivatives/api/',
|
97
97
|
'private': 'https://demo-futures.kraken.com/derivatives/api/',
|
98
98
|
'charts': 'https://demo-futures.kraken.com/api/charts/',
|
99
|
+
'history': 'https://demo-futures.kraken.com/api/history/',
|
99
100
|
'www': 'https://demo-futures.kraken.com',
|
100
101
|
},
|
101
102
|
'logo': 'https://user-images.githubusercontent.com/24300605/81436764-b22fd580-9172-11ea-9703-742783e6376d.jpg',
|
ccxt/okx.py
CHANGED
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.53'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -74,6 +74,7 @@ from ccxt.pro.poloniex import poloniex # noqa
|
|
74
74
|
from ccxt.pro.poloniexfutures import poloniexfutures # noqa: F401
|
75
75
|
from ccxt.pro.probit import probit # noqa: F401
|
76
76
|
from ccxt.pro.upbit import upbit # noqa: F401
|
77
|
+
from ccxt.pro.vertex import vertex # noqa: F401
|
77
78
|
from ccxt.pro.wazirx import wazirx # noqa: F401
|
78
79
|
from ccxt.pro.whitebit import whitebit # noqa: F401
|
79
80
|
from ccxt.pro.woo import woo # noqa: F401
|
@@ -142,6 +143,7 @@ exchanges = [
|
|
142
143
|
'poloniexfutures',
|
143
144
|
'probit',
|
144
145
|
'upbit',
|
146
|
+
'vertex',
|
145
147
|
'wazirx',
|
146
148
|
'whitebit',
|
147
149
|
'woo',
|
ccxt/pro/okx.py
CHANGED
ccxt/pro/probit.py
CHANGED
@@ -52,8 +52,6 @@ class probit(ccxt.async_support.probit):
|
|
52
52
|
},
|
53
53
|
'streaming': {
|
54
54
|
},
|
55
|
-
'exceptions': {
|
56
|
-
},
|
57
55
|
})
|
58
56
|
|
59
57
|
async def watch_balance(self, params={}) -> Balances:
|
@@ -467,8 +465,12 @@ class probit(ccxt.async_support.probit):
|
|
467
465
|
code = self.safe_string(message, 'errorCode')
|
468
466
|
errMessage = self.safe_string(message, 'message', '')
|
469
467
|
details = self.safe_value(message, 'details')
|
470
|
-
|
471
|
-
|
468
|
+
feedback = self.id + ' ' + code + ' ' + errMessage + ' ' + self.json(details)
|
469
|
+
if 'exact' in self.exceptions:
|
470
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
|
471
|
+
if 'broad' in self.exceptions:
|
472
|
+
self.throw_broadly_matched_exception(self.exceptions['broad'], errMessage, feedback)
|
473
|
+
raise ExchangeError(feedback)
|
472
474
|
|
473
475
|
def handle_authenticate(self, client: Client, message):
|
474
476
|
#
|