ccxt 4.4.36__py2.py3-none-any.whl → 4.4.38__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 -3
- ccxt/abstract/bingx.py +0 -1
- ccxt/abstract/bitfinex.py +136 -65
- ccxt/abstract/bitfinex1.py +69 -0
- ccxt/async_support/__init__.py +3 -3
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +0 -2
- ccxt/async_support/bingx.py +89 -8
- ccxt/async_support/bitfinex.py +3005 -1084
- ccxt/async_support/bitfinex1.py +1704 -0
- ccxt/async_support/bitget.py +2 -4
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +160 -13
- ccxt/async_support/bybit.py +3 -2
- ccxt/async_support/coinbase.py +86 -0
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hyperliquid.py +124 -14
- ccxt/async_support/kucoin.py +75 -2
- ccxt/async_support/kucoinfutures.py +92 -5
- ccxt/async_support/ndax.py +5 -1
- ccxt/async_support/okx.py +0 -1
- ccxt/async_support/paradex.py +2 -2
- ccxt/async_support/probit.py +3 -1
- ccxt/base/exchange.py +9 -2
- ccxt/binance.py +0 -2
- ccxt/bingx.py +89 -8
- ccxt/bitfinex.py +3005 -1084
- ccxt/bitfinex1.py +1703 -0
- ccxt/bitget.py +2 -4
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +160 -13
- ccxt/bybit.py +3 -2
- ccxt/coinbase.py +86 -0
- ccxt/gate.py +1 -1
- ccxt/hyperliquid.py +124 -14
- ccxt/kucoin.py +75 -2
- ccxt/kucoinfutures.py +92 -5
- ccxt/ndax.py +5 -1
- ccxt/okx.py +0 -1
- ccxt/paradex.py +2 -2
- ccxt/pro/__init__.py +3 -3
- ccxt/pro/bitfinex.py +725 -274
- ccxt/pro/bitfinex1.py +635 -0
- ccxt/pro/probit.py +1 -0
- ccxt/probit.py +3 -1
- ccxt/test/tests_async.py +5 -1
- ccxt/test/tests_sync.py +5 -1
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/METADATA +8 -8
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/RECORD +52 -49
- ccxt/abstract/bitfinex2.py +0 -140
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/WHEEL +0 -0
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/top_level.txt +0 -0
ccxt/kucoin.py
CHANGED
@@ -927,6 +927,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
927
927
|
'TRUE': 'true',
|
928
928
|
'CS': 'cs',
|
929
929
|
'ORAI': 'orai',
|
930
|
+
'BASE': 'base',
|
930
931
|
# below will be uncommented after consensus
|
931
932
|
# 'BITCOINDIAMON': 'bcd',
|
932
933
|
# 'BITCOINGOLD': 'btg',
|
@@ -1002,6 +1003,74 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1002
1003
|
'spot': 'TRADE',
|
1003
1004
|
},
|
1004
1005
|
},
|
1006
|
+
'features': {
|
1007
|
+
'spot': {
|
1008
|
+
'sandbox': False,
|
1009
|
+
'createOrder': {
|
1010
|
+
'marginMode': True,
|
1011
|
+
'triggerPrice': True,
|
1012
|
+
'triggerPriceType': None,
|
1013
|
+
'triggerDirection': False,
|
1014
|
+
'stopLossPrice': True,
|
1015
|
+
'takeProfitPrice': True,
|
1016
|
+
'attachedStopLossTakeProfit': None, # not supported
|
1017
|
+
'timeInForce': {
|
1018
|
+
'IOC': True,
|
1019
|
+
'FOK': True,
|
1020
|
+
'PO': True,
|
1021
|
+
'GTD': True,
|
1022
|
+
},
|
1023
|
+
'hedged': False,
|
1024
|
+
'trailing': False,
|
1025
|
+
# exchange-supported features
|
1026
|
+
# 'iceberg': True,
|
1027
|
+
# 'selfTradePrevention': True,
|
1028
|
+
# 'twap': False,
|
1029
|
+
# 'oco': False,
|
1030
|
+
},
|
1031
|
+
'createOrders': {
|
1032
|
+
'max': 5,
|
1033
|
+
},
|
1034
|
+
'fetchMyTrades': {
|
1035
|
+
'marginMode': True,
|
1036
|
+
'limit': None,
|
1037
|
+
'daysBack': None,
|
1038
|
+
'untilDays': 7, # per implementation comments
|
1039
|
+
},
|
1040
|
+
'fetchOrder': {
|
1041
|
+
'marginMode': False,
|
1042
|
+
'trigger': True,
|
1043
|
+
'trailing': False,
|
1044
|
+
},
|
1045
|
+
'fetchOpenOrders': {
|
1046
|
+
'marginMode': True,
|
1047
|
+
'limit': 500,
|
1048
|
+
'trigger': True,
|
1049
|
+
'trailing': False,
|
1050
|
+
},
|
1051
|
+
'fetchOrders': None,
|
1052
|
+
'fetchClosedOrders': {
|
1053
|
+
'marginMode': True,
|
1054
|
+
'limit': 500,
|
1055
|
+
'daysBackClosed': None,
|
1056
|
+
'daysBackCanceled': None,
|
1057
|
+
'untilDays': 7,
|
1058
|
+
'trigger': True,
|
1059
|
+
'trailing': False,
|
1060
|
+
},
|
1061
|
+
'fetchOHLCV': {
|
1062
|
+
'limit': 1500,
|
1063
|
+
},
|
1064
|
+
},
|
1065
|
+
'swap': {
|
1066
|
+
'linear': None,
|
1067
|
+
'inverse': None,
|
1068
|
+
},
|
1069
|
+
'future': {
|
1070
|
+
'linear': None,
|
1071
|
+
'inverse': None,
|
1072
|
+
},
|
1073
|
+
},
|
1005
1074
|
})
|
1006
1075
|
|
1007
1076
|
def nonce(self):
|
@@ -2615,7 +2684,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2615
2684
|
self.load_markets()
|
2616
2685
|
lowercaseStatus = status.lower()
|
2617
2686
|
until = self.safe_integer(params, 'until')
|
2618
|
-
|
2687
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
2619
2688
|
hf = None
|
2620
2689
|
hf, params = self.handle_hf_and_params(params)
|
2621
2690
|
if hf and (symbol is None):
|
@@ -2641,7 +2710,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2641
2710
|
request['endAt'] = until
|
2642
2711
|
request['tradeType'] = self.safe_string(self.options['marginModes'], marginMode, 'TRADE')
|
2643
2712
|
response = None
|
2644
|
-
if
|
2713
|
+
if trigger:
|
2645
2714
|
response = self.privateGetStopOrder(self.extend(request, query))
|
2646
2715
|
elif hf:
|
2647
2716
|
if lowercaseStatus == 'active':
|
@@ -3053,6 +3122,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3053
3122
|
response = None
|
3054
3123
|
request, params = self.handle_until_option('endAt', request, params)
|
3055
3124
|
if hf:
|
3125
|
+
# does not return trades earlier than 2019-02-18T00:00:00Z
|
3126
|
+
if since is not None:
|
3127
|
+
# only returns trades up to one week after the since param
|
3128
|
+
request['startAt'] = since
|
3056
3129
|
response = self.privateGetHfFills(self.extend(request, params))
|
3057
3130
|
elif method == 'private_get_fills':
|
3058
3131
|
# does not return trades earlier than 2019-02-18T00:00:00Z
|
ccxt/kucoinfutures.py
CHANGED
@@ -370,6 +370,91 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
370
370
|
# 'code': 'BTC',
|
371
371
|
# },
|
372
372
|
},
|
373
|
+
'features': {
|
374
|
+
'spot': None,
|
375
|
+
'forDerivs': {
|
376
|
+
'sandbox': False,
|
377
|
+
'createOrder': {
|
378
|
+
'marginMode': True,
|
379
|
+
'triggerPrice': True,
|
380
|
+
'triggerPriceType': {
|
381
|
+
'last': True,
|
382
|
+
'mark': True,
|
383
|
+
'index': True,
|
384
|
+
},
|
385
|
+
'triggerDirection': True,
|
386
|
+
'stopLossPrice': True,
|
387
|
+
'takeProfitPrice': True,
|
388
|
+
'attachedStopLossTakeProfit': {
|
389
|
+
'triggerPrice': None,
|
390
|
+
'triggerPriceType': None,
|
391
|
+
'limitPrice': True,
|
392
|
+
},
|
393
|
+
'timeInForce': {
|
394
|
+
'IOC': True,
|
395
|
+
'FOK': False,
|
396
|
+
'PO': True,
|
397
|
+
'GTD': False,
|
398
|
+
},
|
399
|
+
'hedged': False,
|
400
|
+
'trailing': False,
|
401
|
+
# exchange-supported features
|
402
|
+
# 'iceberg': True,
|
403
|
+
# 'selfTradePrevention': True,
|
404
|
+
# 'twap': False,
|
405
|
+
# 'oco': False,
|
406
|
+
},
|
407
|
+
'createOrders': {
|
408
|
+
'max': 20,
|
409
|
+
},
|
410
|
+
'fetchMyTrades': {
|
411
|
+
'marginMode': True,
|
412
|
+
'limit': 1000,
|
413
|
+
'daysBack': None,
|
414
|
+
'untilDays': 7,
|
415
|
+
},
|
416
|
+
'fetchOrder': {
|
417
|
+
'marginMode': False,
|
418
|
+
'trigger': False,
|
419
|
+
'trailing': False,
|
420
|
+
},
|
421
|
+
'fetchOpenOrders': {
|
422
|
+
'marginMode': False,
|
423
|
+
'limit': 1000,
|
424
|
+
'trigger': True,
|
425
|
+
'trailing': False,
|
426
|
+
},
|
427
|
+
'fetchOrders': None,
|
428
|
+
'fetchClosedOrders': {
|
429
|
+
'marginMode': False,
|
430
|
+
'limit': 1000,
|
431
|
+
'daysBackClosed': None,
|
432
|
+
'daysBackCanceled': None,
|
433
|
+
'untilDays': None,
|
434
|
+
'trigger': True,
|
435
|
+
'trailing': False,
|
436
|
+
},
|
437
|
+
'fetchOHLCV': {
|
438
|
+
'limit': 500,
|
439
|
+
},
|
440
|
+
},
|
441
|
+
'swap': {
|
442
|
+
'linear': {
|
443
|
+
'extends': 'forDerivs',
|
444
|
+
},
|
445
|
+
'inverse': {
|
446
|
+
'extends': 'forDerivs',
|
447
|
+
},
|
448
|
+
},
|
449
|
+
'future': {
|
450
|
+
'linear': {
|
451
|
+
'extends': 'forDerivs',
|
452
|
+
},
|
453
|
+
'inverse': {
|
454
|
+
'extends': 'forDerivs',
|
455
|
+
},
|
456
|
+
},
|
457
|
+
},
|
373
458
|
})
|
374
459
|
|
375
460
|
def fetch_status(self, params={}):
|
@@ -1698,10 +1783,10 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1698
1783
|
request: dict = {}
|
1699
1784
|
if symbol is not None:
|
1700
1785
|
request['symbol'] = self.market_id(symbol)
|
1701
|
-
|
1786
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1702
1787
|
params = self.omit(params, ['stop', 'trigger'])
|
1703
1788
|
response = None
|
1704
|
-
if
|
1789
|
+
if trigger:
|
1705
1790
|
response = self.futuresPrivateDeleteStopOrders(self.extend(request, params))
|
1706
1791
|
else:
|
1707
1792
|
response = self.futuresPrivateDeleteOrders(self.extend(request, params))
|
@@ -1882,7 +1967,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1882
1967
|
paginate, params = self.handle_option_and_params(params, 'fetchOrdersByStatus', 'paginate')
|
1883
1968
|
if paginate:
|
1884
1969
|
return self.fetch_paginated_call_dynamic('fetchOrdersByStatus', symbol, since, limit, params)
|
1885
|
-
|
1970
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
1886
1971
|
until = self.safe_integer(params, 'until')
|
1887
1972
|
params = self.omit(params, ['stop', 'until', 'trigger'])
|
1888
1973
|
if status == 'closed':
|
@@ -1890,7 +1975,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1890
1975
|
elif status == 'open':
|
1891
1976
|
status = 'active'
|
1892
1977
|
request: dict = {}
|
1893
|
-
if not
|
1978
|
+
if not trigger:
|
1894
1979
|
request['status'] = status
|
1895
1980
|
elif status != 'active':
|
1896
1981
|
raise BadRequest(self.id + ' fetchOrdersByStatus() can only fetch untriggered stop orders')
|
@@ -1903,7 +1988,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1903
1988
|
if until is not None:
|
1904
1989
|
request['endAt'] = until
|
1905
1990
|
response = None
|
1906
|
-
if
|
1991
|
+
if trigger:
|
1907
1992
|
response = self.futuresPrivateGetStopOrders(self.extend(request, params))
|
1908
1993
|
else:
|
1909
1994
|
response = self.futuresPrivateGetOrders(self.extend(request, params))
|
@@ -2510,6 +2595,8 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2510
2595
|
request['symbol'] = market['id']
|
2511
2596
|
if since is not None:
|
2512
2597
|
request['startAt'] = since
|
2598
|
+
if limit is not None:
|
2599
|
+
request['pageSize'] = min(1000, limit)
|
2513
2600
|
request, params = self.handle_until_option('endAt', request, params)
|
2514
2601
|
response = self.futuresPrivateGetFills(self.extend(request, params))
|
2515
2602
|
#
|
ccxt/ndax.py
CHANGED
@@ -1069,8 +1069,10 @@ class ndax(Exchange, ImplicitAPI):
|
|
1069
1069
|
omsId = self.safe_integer(self.options, 'omsId', 1)
|
1070
1070
|
self.load_markets()
|
1071
1071
|
self.load_accounts()
|
1072
|
-
defaultAccountId = self.safe_integer_2(self.options, 'accountId', 'AccountId'
|
1072
|
+
defaultAccountId = self.safe_integer_2(self.options, 'accountId', 'AccountId')
|
1073
1073
|
accountId = self.safe_integer_2(params, 'accountId', 'AccountId', defaultAccountId)
|
1074
|
+
if accountId is None:
|
1075
|
+
accountId = int(self.accounts[0]['id'])
|
1074
1076
|
params = self.omit(params, ['accountId', 'AccountId'])
|
1075
1077
|
request: dict = {
|
1076
1078
|
'omsId': omsId,
|
@@ -1348,6 +1350,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
1348
1350
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1349
1351
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1350
1352
|
:param float [params.triggerPrice]: the price at which a trigger order would be triggered
|
1353
|
+
:param str [params.clientOrderId]: a unique id for the order
|
1351
1354
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1352
1355
|
"""
|
1353
1356
|
omsId = self.safe_integer(self.options, 'omsId', 1)
|
@@ -1578,6 +1581,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
1578
1581
|
:param str id: order id
|
1579
1582
|
:param str symbol: unified symbol of the market the order was made in
|
1580
1583
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1584
|
+
:param str [params.clientOrderId]: a unique id for the order
|
1581
1585
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1582
1586
|
"""
|
1583
1587
|
omsId = self.safe_integer(self.options, 'omsId', 1)
|
ccxt/okx.py
CHANGED
ccxt/paradex.py
CHANGED
@@ -276,6 +276,7 @@ class paradex(Exchange, ImplicitAPI):
|
|
276
276
|
'commonCurrencies': {
|
277
277
|
},
|
278
278
|
'options': {
|
279
|
+
'paradexAccount': None, # add {"privateKey": A, "publicKey": B, "address": C}
|
279
280
|
'broker': 'CCXT',
|
280
281
|
},
|
281
282
|
})
|
@@ -964,10 +965,10 @@ class paradex(Exchange, ImplicitAPI):
|
|
964
965
|
}
|
965
966
|
|
966
967
|
def retrieve_account(self):
|
967
|
-
self.check_required_credentials()
|
968
968
|
cachedAccount: dict = self.safe_dict(self.options, 'paradexAccount')
|
969
969
|
if cachedAccount is not None:
|
970
970
|
return cachedAccount
|
971
|
+
self.check_required_credentials()
|
971
972
|
systemConfig = self.get_system_config()
|
972
973
|
domain = self.prepare_paradex_domain(True)
|
973
974
|
messageTypes = {
|
@@ -1956,7 +1957,6 @@ class paradex(Exchange, ImplicitAPI):
|
|
1956
1957
|
if query:
|
1957
1958
|
url += '?' + self.urlencode(query)
|
1958
1959
|
elif api == 'private':
|
1959
|
-
self.check_required_credentials()
|
1960
1960
|
headers = {
|
1961
1961
|
'Accept': 'application/json',
|
1962
1962
|
'PARADEX-PARTNER': self.safe_string(self.options, 'broker', 'CCXT'),
|
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.38'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -22,7 +22,7 @@ from ccxt.pro.binanceusdm import binanceusdm # noqa
|
|
22
22
|
from ccxt.pro.bingx import bingx # noqa: F401
|
23
23
|
from ccxt.pro.bitcoincom import bitcoincom # noqa: F401
|
24
24
|
from ccxt.pro.bitfinex import bitfinex # noqa: F401
|
25
|
-
from ccxt.pro.
|
25
|
+
from ccxt.pro.bitfinex1 import bitfinex1 # noqa: F401
|
26
26
|
from ccxt.pro.bitget import bitget # noqa: F401
|
27
27
|
from ccxt.pro.bithumb import bithumb # noqa: F401
|
28
28
|
from ccxt.pro.bitmart import bitmart # noqa: F401
|
@@ -98,7 +98,7 @@ exchanges = [
|
|
98
98
|
'bingx',
|
99
99
|
'bitcoincom',
|
100
100
|
'bitfinex',
|
101
|
-
'
|
101
|
+
'bitfinex1',
|
102
102
|
'bitget',
|
103
103
|
'bithumb',
|
104
104
|
'bitmart',
|