ccxt 4.4.34__py2.py3-none-any.whl → 4.4.36__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 +1 -0
- ccxt/abstract/bitopro.py +1 -0
- ccxt/abstract/bitpanda.py +0 -12
- ccxt/abstract/bitrue.py +3 -3
- ccxt/abstract/bybit.py +15 -0
- ccxt/abstract/defx.py +69 -0
- ccxt/abstract/deribit.py +1 -0
- ccxt/abstract/gate.py +14 -0
- ccxt/abstract/gateio.py +14 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/onetrading.py +0 -12
- ccxt/abstract/xt.py +5 -5
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bingx.py +324 -138
- ccxt/async_support/bitfinex2.py +18 -13
- ccxt/async_support/bitmex.py +104 -2
- ccxt/async_support/bitopro.py +21 -4
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +2 -1
- ccxt/async_support/btcmarkets.py +3 -3
- ccxt/async_support/btcturk.py +19 -19
- ccxt/async_support/bybit.py +21 -1
- ccxt/async_support/defx.py +1981 -0
- ccxt/async_support/deribit.py +27 -12
- ccxt/async_support/gate.py +156 -39
- ccxt/async_support/htx.py +11 -2
- ccxt/async_support/hyperliquid.py +68 -11
- ccxt/async_support/idex.py +3 -4
- ccxt/async_support/kraken.py +97 -90
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/okx.py +1 -0
- ccxt/async_support/onetrading.py +47 -369
- ccxt/async_support/xt.py +10 -10
- ccxt/base/exchange.py +2 -1
- ccxt/bingx.py +324 -138
- ccxt/bitfinex2.py +18 -13
- ccxt/bitmex.py +104 -2
- ccxt/bitopro.py +21 -4
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +2 -1
- ccxt/btcmarkets.py +3 -3
- ccxt/btcturk.py +19 -19
- ccxt/bybit.py +21 -1
- ccxt/defx.py +1980 -0
- ccxt/deribit.py +27 -12
- ccxt/gate.py +156 -39
- ccxt/htx.py +11 -2
- ccxt/hyperliquid.py +68 -11
- ccxt/idex.py +3 -4
- ccxt/kraken.py +97 -90
- ccxt/kucoin.py +1 -1
- ccxt/okx.py +1 -0
- ccxt/onetrading.py +47 -369
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bitrue.py +13 -11
- ccxt/pro/defx.py +832 -0
- ccxt/pro/probit.py +54 -66
- ccxt/test/tests_async.py +44 -3
- ccxt/test/tests_sync.py +44 -3
- ccxt/xt.py +10 -10
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/METADATA +7 -6
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/RECORD +67 -63
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/WHEEL +0 -0
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitfinex2.py
CHANGED
@@ -16,7 +16,6 @@ from ccxt.base.errors import ArgumentsRequired
|
|
16
16
|
from ccxt.base.errors import BadRequest
|
17
17
|
from ccxt.base.errors import BadSymbol
|
18
18
|
from ccxt.base.errors import InsufficientFunds
|
19
|
-
from ccxt.base.errors import InvalidAddress
|
20
19
|
from ccxt.base.errors import InvalidOrder
|
21
20
|
from ccxt.base.errors import OrderNotFound
|
22
21
|
from ccxt.base.errors import NotSupported
|
@@ -433,12 +432,10 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
433
432
|
'temporarily_unavailable': ExchangeNotAvailable,
|
434
433
|
},
|
435
434
|
'broad': {
|
436
|
-
'address': InvalidAddress,
|
437
435
|
'available balance is only': InsufficientFunds,
|
438
436
|
'not enough exchange balance': InsufficientFunds,
|
439
437
|
'Order not found': OrderNotFound,
|
440
438
|
'symbol: invalid': BadSymbol,
|
441
|
-
'Invalid order': InvalidOrder,
|
442
439
|
},
|
443
440
|
},
|
444
441
|
'commonCurrencies': {
|
@@ -782,7 +779,10 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
782
779
|
name = self.safe_string(label, 1)
|
783
780
|
pool = self.safe_value(indexed['pool'], id, [])
|
784
781
|
rawType = self.safe_string(pool, 1)
|
785
|
-
|
782
|
+
isCryptoCoin = (rawType is not None) or (id in indexed['explorer']) # "hacky" solution
|
783
|
+
type = None
|
784
|
+
if isCryptoCoin:
|
785
|
+
type = 'crypto'
|
786
786
|
feeValues = self.safe_value(indexed['fees'], id, [])
|
787
787
|
fees = self.safe_value(feeValues, 1, [])
|
788
788
|
fee = self.safe_number(fees, 1)
|
@@ -1681,7 +1681,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1681
1681
|
raise ExchangeError(self.id + ' ' + response[6] + ': ' + errorText + '(#' + errorCode + ')')
|
1682
1682
|
orders = self.safe_list(response, 4, [])
|
1683
1683
|
order = self.safe_list(orders, 0)
|
1684
|
-
|
1684
|
+
newOrder = {'result': order}
|
1685
|
+
return self.parse_order(newOrder, market)
|
1685
1686
|
|
1686
1687
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
1687
1688
|
"""
|
@@ -1777,6 +1778,9 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1777
1778
|
await self.load_markets()
|
1778
1779
|
cid = self.safe_value_2(params, 'cid', 'clientOrderId') # client order id
|
1779
1780
|
request = None
|
1781
|
+
market = None
|
1782
|
+
if symbol is not None:
|
1783
|
+
market = self.market(symbol)
|
1780
1784
|
if cid is not None:
|
1781
1785
|
cidDate = self.safe_value(params, 'cidDate') # client order id date
|
1782
1786
|
if cidDate is None:
|
@@ -1792,8 +1796,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1792
1796
|
}
|
1793
1797
|
response = await self.privatePostAuthWOrderCancel(self.extend(request, params))
|
1794
1798
|
order = self.safe_value(response, 4)
|
1795
|
-
|
1796
|
-
return self.parse_order(
|
1799
|
+
newOrder = {'result': order}
|
1800
|
+
return self.parse_order(newOrder, market)
|
1797
1801
|
|
1798
1802
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1799
1803
|
"""
|
@@ -2294,6 +2298,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2294
2298
|
status = 'failed'
|
2295
2299
|
tag = self.safe_string(data, 3)
|
2296
2300
|
type = 'withdrawal'
|
2301
|
+
networkId = self.safe_string(data, 2)
|
2302
|
+
network = self.network_id_to_code(networkId.upper()) # withdraw returns in lowercase
|
2297
2303
|
elif transactionLength == 22:
|
2298
2304
|
id = self.safe_string(transaction, 0)
|
2299
2305
|
currencyId = self.safe_string(transaction, 1)
|
@@ -2590,10 +2596,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2590
2596
|
text = self.safe_string(response, 7)
|
2591
2597
|
if text != 'success':
|
2592
2598
|
self.throw_broadly_matched_exception(self.exceptions['broad'], text, text)
|
2593
|
-
|
2594
|
-
return self.extend(transaction, {
|
2595
|
-
'address': address,
|
2596
|
-
})
|
2599
|
+
return self.parse_transaction(response, currency)
|
2597
2600
|
|
2598
2601
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2599
2602
|
"""
|
@@ -3502,7 +3505,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
3502
3505
|
# ]
|
3503
3506
|
#
|
3504
3507
|
order = self.safe_list(response, 0)
|
3505
|
-
|
3508
|
+
newOrder = {'result': order}
|
3509
|
+
return self.parse_order(newOrder, market)
|
3506
3510
|
|
3507
3511
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3508
3512
|
"""
|
@@ -3617,4 +3621,5 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
3617
3621
|
errorText = response[7]
|
3618
3622
|
raise ExchangeError(self.id + ' ' + response[6] + ': ' + errorText + '(#' + errorCode + ')')
|
3619
3623
|
order = self.safe_list(response, 4, [])
|
3620
|
-
|
3624
|
+
newOrder = {'result': order}
|
3625
|
+
return self.parse_order(newOrder, market)
|
ccxt/async_support/bitmex.py
CHANGED
@@ -286,6 +286,108 @@ class bitmex(Exchange, ImplicitAPI):
|
|
286
286
|
'SOL': 'sol',
|
287
287
|
'ADA': 'ada',
|
288
288
|
},
|
289
|
+
'features': {
|
290
|
+
'default': {
|
291
|
+
'sandbox': True,
|
292
|
+
'createOrder': {
|
293
|
+
'marginMode': True,
|
294
|
+
'triggerPrice': True,
|
295
|
+
'triggerPriceType': {
|
296
|
+
'last': True,
|
297
|
+
'mark': True,
|
298
|
+
},
|
299
|
+
'triggerDirection': True,
|
300
|
+
'stopLossPrice': False,
|
301
|
+
'takeProfitPrice': False,
|
302
|
+
'attachedStopLossTakeProfit': None,
|
303
|
+
'timeInForce': {
|
304
|
+
'IOC': True,
|
305
|
+
'FOK': True,
|
306
|
+
'PO': True,
|
307
|
+
'GTD': False,
|
308
|
+
},
|
309
|
+
'hedged': False,
|
310
|
+
'trailing': True,
|
311
|
+
'marketBuyRequiresPrice': False,
|
312
|
+
'marketBuyByCost': False,
|
313
|
+
# exchange-supported features
|
314
|
+
# 'selfTradePrevention': True,
|
315
|
+
# 'twap': False,
|
316
|
+
# 'iceberg': False,
|
317
|
+
# 'oco': False,
|
318
|
+
},
|
319
|
+
'createOrders': None,
|
320
|
+
'fetchMyTrades': {
|
321
|
+
'marginMode': False,
|
322
|
+
'limit': 500,
|
323
|
+
'daysBack': None,
|
324
|
+
'untilDays': 1000000,
|
325
|
+
},
|
326
|
+
'fetchOrder': {
|
327
|
+
'marginMode': False,
|
328
|
+
'trigger': False,
|
329
|
+
'trailing': False,
|
330
|
+
},
|
331
|
+
'fetchOpenOrders': {
|
332
|
+
'marginMode': False,
|
333
|
+
'limit': 500,
|
334
|
+
'trigger': False,
|
335
|
+
'trailing': False,
|
336
|
+
},
|
337
|
+
'fetchOrders': {
|
338
|
+
'marginMode': False,
|
339
|
+
'limit': 500,
|
340
|
+
'daysBack': None,
|
341
|
+
'untilDays': 1000000,
|
342
|
+
'trigger': False,
|
343
|
+
'trailing': False,
|
344
|
+
},
|
345
|
+
'fetchClosedOrders': {
|
346
|
+
'marginMode': False,
|
347
|
+
'limit': 500,
|
348
|
+
'daysBackClosed': None,
|
349
|
+
'daysBackCanceled': None,
|
350
|
+
'untilDays': 1000000,
|
351
|
+
'trigger': False,
|
352
|
+
'trailing': False,
|
353
|
+
},
|
354
|
+
'fetchOHLCV': {
|
355
|
+
'limit': 10000,
|
356
|
+
},
|
357
|
+
},
|
358
|
+
'spot': {
|
359
|
+
'extends': 'default',
|
360
|
+
'createOrder': {
|
361
|
+
'triggerPriceType': {
|
362
|
+
'index': False,
|
363
|
+
},
|
364
|
+
},
|
365
|
+
},
|
366
|
+
'forDeriv': {
|
367
|
+
'extends': 'default',
|
368
|
+
'createOrder': {
|
369
|
+
'triggerPriceType': {
|
370
|
+
'index': True,
|
371
|
+
},
|
372
|
+
},
|
373
|
+
},
|
374
|
+
'swap': {
|
375
|
+
'linear': {
|
376
|
+
'extends': 'forDeriv',
|
377
|
+
},
|
378
|
+
'inverse': {
|
379
|
+
'extends': 'forDeriv',
|
380
|
+
},
|
381
|
+
},
|
382
|
+
'future': {
|
383
|
+
'linear': {
|
384
|
+
'extends': 'forDeriv',
|
385
|
+
},
|
386
|
+
'inverse': {
|
387
|
+
'extends': 'forDeriv',
|
388
|
+
},
|
389
|
+
},
|
390
|
+
},
|
289
391
|
},
|
290
392
|
'commonCurrencies': {
|
291
393
|
'USDt': 'USDT',
|
@@ -991,7 +1093,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
991
1093
|
if since is not None:
|
992
1094
|
request['startTime'] = self.iso8601(since)
|
993
1095
|
if limit is not None:
|
994
|
-
request['count'] = limit
|
1096
|
+
request['count'] = min(500, limit)
|
995
1097
|
until = self.safe_integer_2(params, 'until', 'endTime')
|
996
1098
|
if until is not None:
|
997
1099
|
params = self.omit(params, ['until'])
|
@@ -1471,7 +1573,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1471
1573
|
}
|
1472
1574
|
if limit is not None:
|
1473
1575
|
request['count'] = limit # default 100, max 500
|
1474
|
-
until = self.
|
1576
|
+
until = self.safe_integer(params, 'until')
|
1475
1577
|
if until is not None:
|
1476
1578
|
params = self.omit(params, ['until'])
|
1477
1579
|
request['endTime'] = self.iso8601(until)
|
ccxt/async_support/bitopro.py
CHANGED
@@ -153,6 +153,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
153
153
|
'wallet/withdraw/{currency}/id/{id}': 1,
|
154
154
|
'wallet/depositHistory/{currency}': 1,
|
155
155
|
'wallet/withdrawHistory/{currency}': 1,
|
156
|
+
'orders/open': 1,
|
156
157
|
},
|
157
158
|
'post': {
|
158
159
|
'orders/{pair}': 1 / 2, # 1200/m => 20/s => 10/20 = 1/2
|
@@ -1248,10 +1249,26 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1248
1249
|
return self.parse_orders(orders, market, since, limit)
|
1249
1250
|
|
1250
1251
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1252
|
+
"""
|
1253
|
+
fetch all unfilled currently open orders
|
1254
|
+
|
1255
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_open_orders_data.md
|
1256
|
+
|
1257
|
+
:param str symbol: unified market symbol
|
1258
|
+
:param int [since]: the earliest time in ms to fetch open orders for
|
1259
|
+
:param int [limit]: the maximum number of open orders structures to retrieve
|
1260
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1261
|
+
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1262
|
+
"""
|
1263
|
+
await self.load_markets()
|
1264
|
+
request: dict = {}
|
1265
|
+
market = None
|
1266
|
+
if symbol is not None:
|
1267
|
+
market = self.market(symbol)
|
1268
|
+
request['pair'] = market['id']
|
1269
|
+
response = await self.privateGetOrdersOpen(self.extend(request, params))
|
1270
|
+
orders = self.safe_list(response, 'data', [])
|
1271
|
+
return self.parse_orders(orders, market, since, limit)
|
1255
1272
|
|
1256
1273
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1257
1274
|
"""
|
ccxt/async_support/bitrue.py
CHANGED
@@ -2940,7 +2940,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2940
2940
|
version = self.safe_string(api, 1)
|
2941
2941
|
access = self.safe_string(api, 2)
|
2942
2942
|
url = None
|
2943
|
-
if type == 'api' and version == 'kline':
|
2943
|
+
if (type == 'api' and version == 'kline') or (type == 'open' and path.find('listenKey') >= 0):
|
2944
2944
|
url = self.urls['api'][type]
|
2945
2945
|
else:
|
2946
2946
|
url = self.urls['api'][type] + '/' + version
|
@@ -2949,7 +2949,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2949
2949
|
if access == 'private':
|
2950
2950
|
self.check_required_credentials()
|
2951
2951
|
recvWindow = self.safe_integer(self.options, 'recvWindow', 5000)
|
2952
|
-
if type == 'spot':
|
2952
|
+
if type == 'spot' or type == 'open':
|
2953
2953
|
query = self.urlencode(self.extend({
|
2954
2954
|
'timestamp': self.nonce(),
|
2955
2955
|
'recvWindow': recvWindow,
|
ccxt/async_support/bitso.py
CHANGED
@@ -1683,6 +1683,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1683
1683
|
if api == 'private':
|
1684
1684
|
self.check_required_credentials()
|
1685
1685
|
nonce = str(self.nonce())
|
1686
|
+
endpoint = '/api' + endpoint
|
1686
1687
|
request = ''.join([nonce, method, endpoint])
|
1687
1688
|
if method != 'GET' and method != 'DELETE':
|
1688
1689
|
if query:
|
@@ -1692,7 +1693,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1692
1693
|
auth = self.apiKey + ':' + nonce + ':' + signature
|
1693
1694
|
headers = {
|
1694
1695
|
'Authorization': 'Bitso ' + auth,
|
1695
|
-
'Content-Type': 'application/json',
|
1696
|
+
# 'Content-Type': 'application/json',
|
1696
1697
|
}
|
1697
1698
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
1698
1699
|
|
ccxt/async_support/btcmarkets.py
CHANGED
@@ -313,7 +313,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
313
313
|
type = self.parse_transaction_type(self.safe_string_lower(transaction, 'type'))
|
314
314
|
if type == 'withdraw':
|
315
315
|
type = 'withdrawal'
|
316
|
-
cryptoPaymentDetail = self.
|
316
|
+
cryptoPaymentDetail = self.safe_dict(transaction, 'paymentDetail', {})
|
317
317
|
txid = self.safe_string(cryptoPaymentDetail, 'txId')
|
318
318
|
address = self.safe_string(cryptoPaymentDetail, 'address')
|
319
319
|
tag = None
|
@@ -394,7 +394,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
394
394
|
base = self.safe_currency_code(baseId)
|
395
395
|
quote = self.safe_currency_code(quoteId)
|
396
396
|
symbol = base + '/' + quote
|
397
|
-
fees = self.safe_value(self.
|
397
|
+
fees = self.safe_value(self.safe_dict(self.options, 'fees', {}), quote, self.fees)
|
398
398
|
pricePrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'priceDecimals')))
|
399
399
|
minAmount = self.safe_number(market, 'minOrderAmount')
|
400
400
|
maxAmount = self.safe_number(market, 'maxOrderAmount')
|
@@ -1016,7 +1016,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1016
1016
|
clientOrderId = self.safe_string(order, 'clientOrderId')
|
1017
1017
|
timeInForce = self.safe_string(order, 'timeInForce')
|
1018
1018
|
stopPrice = self.safe_number(order, 'triggerPrice')
|
1019
|
-
postOnly = self.
|
1019
|
+
postOnly = self.safe_bool(order, 'postOnly')
|
1020
1020
|
return self.safe_order({
|
1021
1021
|
'info': order,
|
1022
1022
|
'id': id,
|
ccxt/async_support/btcturk.py
CHANGED
@@ -205,8 +205,8 @@ class btcturk(Exchange, ImplicitAPI):
|
|
205
205
|
# ],
|
206
206
|
# }
|
207
207
|
#
|
208
|
-
data = self.
|
209
|
-
markets = self.
|
208
|
+
data = self.safe_dict(response, 'data', {})
|
209
|
+
markets = self.safe_list(data, 'symbols', [])
|
210
210
|
return self.parse_markets(markets)
|
211
211
|
|
212
212
|
def parse_market(self, entry) -> Market:
|
@@ -215,7 +215,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
215
215
|
quoteId = self.safe_string(entry, 'denominator')
|
216
216
|
base = self.safe_currency_code(baseId)
|
217
217
|
quote = self.safe_currency_code(quoteId)
|
218
|
-
filters = self.
|
218
|
+
filters = self.safe_list(entry, 'filters', [])
|
219
219
|
minPrice = None
|
220
220
|
maxPrice = None
|
221
221
|
minAmount = None
|
@@ -282,7 +282,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
282
282
|
}
|
283
283
|
|
284
284
|
def parse_balance(self, response) -> Balances:
|
285
|
-
data = self.
|
285
|
+
data = self.safe_list(response, 'data', [])
|
286
286
|
result: dict = {
|
287
287
|
'info': response,
|
288
288
|
'timestamp': None,
|
@@ -356,7 +356,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
356
356
|
# ]
|
357
357
|
# }
|
358
358
|
# }
|
359
|
-
data = self.
|
359
|
+
data = self.safe_dict(response, 'data', {})
|
360
360
|
timestamp = self.safe_integer(data, 'timestamp')
|
361
361
|
return self.parse_order_book(data, market['symbol'], timestamp, 'bids', 'asks', 0, 1)
|
362
362
|
|
@@ -637,20 +637,20 @@ class btcturk(Exchange, ImplicitAPI):
|
|
637
637
|
|
638
638
|
def parse_ohlcvs(self, ohlcvs, market=None, timeframe='1m', since: Int = None, limit: Int = None, tail: Bool = False):
|
639
639
|
results = []
|
640
|
-
timestamp = self.
|
641
|
-
high = self.
|
642
|
-
open = self.
|
643
|
-
low = self.
|
644
|
-
close = self.
|
645
|
-
volume = self.
|
640
|
+
timestamp = self.safe_list(ohlcvs, 't', [])
|
641
|
+
high = self.safe_list(ohlcvs, 'h', [])
|
642
|
+
open = self.safe_list(ohlcvs, 'o', [])
|
643
|
+
low = self.safe_list(ohlcvs, 'l', [])
|
644
|
+
close = self.safe_list(ohlcvs, 'c', [])
|
645
|
+
volume = self.safe_list(ohlcvs, 'v', [])
|
646
646
|
for i in range(0, len(timestamp)):
|
647
647
|
ohlcv: dict = {
|
648
|
-
'timestamp': self.
|
649
|
-
'high': self.
|
650
|
-
'open': self.
|
651
|
-
'low': self.
|
652
|
-
'close': self.
|
653
|
-
'volume': self.
|
648
|
+
'timestamp': self.safe_integer(timestamp, i),
|
649
|
+
'high': self.safe_number(high, i),
|
650
|
+
'open': self.safe_number(open, i),
|
651
|
+
'low': self.safe_number(low, i),
|
652
|
+
'close': self.safe_number(close, i),
|
653
|
+
'volume': self.safe_number(volume, i),
|
654
654
|
}
|
655
655
|
results.append(self.parse_ohlcv(ohlcv, market))
|
656
656
|
sorted = self.sort_by(results, 0)
|
@@ -733,8 +733,8 @@ class btcturk(Exchange, ImplicitAPI):
|
|
733
733
|
market = self.market(symbol)
|
734
734
|
request['pairSymbol'] = market['id']
|
735
735
|
response = await self.privateGetOpenOrders(self.extend(request, params))
|
736
|
-
data = self.
|
737
|
-
bids = self.
|
736
|
+
data = self.safe_dict(response, 'data', {})
|
737
|
+
bids = self.safe_list(data, 'bids', [])
|
738
738
|
asks = self.safe_list(data, 'asks', [])
|
739
739
|
return self.parse_orders(self.array_concat(bids, asks), market, since, limit)
|
740
740
|
|
ccxt/async_support/bybit.py
CHANGED
@@ -258,6 +258,9 @@ class bybit(Exchange, ImplicitAPI):
|
|
258
258
|
'v5/spot-cross-margin-trade/data': 5,
|
259
259
|
'v5/spot-cross-margin-trade/pledge-token': 5,
|
260
260
|
'v5/spot-cross-margin-trade/borrow-token': 5,
|
261
|
+
# crypto loan
|
262
|
+
'v5/crypto-loan/collateral-data': 5,
|
263
|
+
'v5/crypto-loan/loanable-data': 5,
|
261
264
|
# institutional lending
|
262
265
|
'v5/ins-loan/product-infos': 5,
|
263
266
|
'v5/ins-loan/ensure-tokens-convert': 5,
|
@@ -385,6 +388,8 @@ class bybit(Exchange, ImplicitAPI):
|
|
385
388
|
'v5/user/aff-customer-info': 5,
|
386
389
|
'v5/user/del-submember': 5,
|
387
390
|
'v5/user/submembers': 5,
|
391
|
+
# affilate
|
392
|
+
'v5/affiliate/aff-user-list': 5,
|
388
393
|
# spot leverage token
|
389
394
|
'v5/spot-lever-token/order-record': 1, # 50/s => cost = 50 / 50 = 1
|
390
395
|
# spot margin trade
|
@@ -394,6 +399,13 @@ class bybit(Exchange, ImplicitAPI):
|
|
394
399
|
'v5/spot-cross-margin-trade/account': 1, # 50/s => cost = 50 / 50 = 1
|
395
400
|
'v5/spot-cross-margin-trade/orders': 1, # 50/s => cost = 50 / 50 = 1
|
396
401
|
'v5/spot-cross-margin-trade/repay-history': 1, # 50/s => cost = 50 / 50 = 1
|
402
|
+
# crypto loan
|
403
|
+
'v5/crypto-loan/borrowable-collateralisable-number': 5,
|
404
|
+
'v5/crypto-loan/ongoing-orders': 5,
|
405
|
+
'v5/crypto-loan/repayment-history': 5,
|
406
|
+
'v5/crypto-loan/borrow-history': 5,
|
407
|
+
'v5/crypto-loan/max-collateral-amount': 5,
|
408
|
+
'v5/crypto-loan/adjustment-history': 5,
|
397
409
|
# institutional lending
|
398
410
|
'v5/ins-loan/product-infos': 5,
|
399
411
|
'v5/ins-loan/ensure-tokens-convert': 5,
|
@@ -405,7 +417,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
405
417
|
'v5/lending/history-order': 5,
|
406
418
|
'v5/lending/account': 5,
|
407
419
|
# broker
|
408
|
-
'v5/broker/earning-record': 5,
|
420
|
+
'v5/broker/earning-record': 5, # deprecated
|
409
421
|
'v5/broker/earnings-info': 5,
|
410
422
|
'v5/broker/account-info': 5,
|
411
423
|
'v5/broker/asset/query-sub-member-deposit-record': 10,
|
@@ -526,6 +538,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
526
538
|
'v5/spot-cross-margin-trade/loan': 2.5, # 20/s => cost = 50 / 20 = 2.5
|
527
539
|
'v5/spot-cross-margin-trade/repay': 2.5, # 20/s => cost = 50 / 20 = 2.5
|
528
540
|
'v5/spot-cross-margin-trade/switch': 2.5, # 20/s => cost = 50 / 20 = 2.5
|
541
|
+
# crypto loan
|
542
|
+
'v5/crypto-loan/borrow': 5,
|
543
|
+
'v5/crypto-loan/repay': 5,
|
544
|
+
'v5/crypto-loan/adjust-ltv': 5,
|
529
545
|
# institutional lending
|
530
546
|
'v5/ins-loan/association-uid': 5,
|
531
547
|
# c2c lending
|
@@ -536,6 +552,10 @@ class bybit(Exchange, ImplicitAPI):
|
|
536
552
|
'v5/account/set-collateral-switch-batch': 5,
|
537
553
|
# demo trading
|
538
554
|
'v5/account/demo-apply-money': 5,
|
555
|
+
# broker
|
556
|
+
'v5/broker/award/info': 5,
|
557
|
+
'v5/broker/award/distribute-award': 5,
|
558
|
+
'v5/broker/award/distribution-record': 5,
|
539
559
|
},
|
540
560
|
},
|
541
561
|
},
|