ccxt 4.4.32__py2.py3-none-any.whl → 4.4.33__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 +1 -1
- ccxt/abstract/coinbaseexchange.py +1 -0
- ccxt/abstract/kraken.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +153 -0
- ccxt/async_support/bybit.py +134 -6
- ccxt/async_support/cex.py +3 -1
- ccxt/async_support/coinbase.py +2 -22
- ccxt/async_support/coinbaseexchange.py +2 -1
- ccxt/async_support/coinex.py +1 -0
- ccxt/async_support/hyperliquid.py +11 -2
- ccxt/async_support/kraken.py +1 -0
- ccxt/async_support/kucoinfutures.py +1 -1
- ccxt/async_support/lbank.py +1 -0
- ccxt/async_support/okx.py +92 -1
- ccxt/async_support/phemex.py +17 -6
- ccxt/base/exchange.py +79 -1
- ccxt/binance.py +153 -0
- ccxt/bybit.py +134 -6
- ccxt/cex.py +3 -1
- ccxt/coinbase.py +2 -22
- ccxt/coinbaseexchange.py +2 -1
- ccxt/coinex.py +1 -0
- ccxt/hyperliquid.py +11 -2
- ccxt/kraken.py +1 -0
- ccxt/kucoinfutures.py +1 -1
- ccxt/lbank.py +1 -0
- ccxt/okx.py +92 -1
- ccxt/phemex.py +17 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/okx.py +8 -0
- ccxt/test/tests_async.py +3 -1
- ccxt/test/tests_helpers.py +1 -1
- ccxt/test/tests_sync.py +3 -1
- {ccxt-4.4.32.dist-info → ccxt-4.4.33.dist-info}/METADATA +4 -4
- {ccxt-4.4.32.dist-info → ccxt-4.4.33.dist-info}/RECORD +40 -40
- {ccxt-4.4.32.dist-info → ccxt-4.4.33.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.32.dist-info → ccxt-4.4.33.dist-info}/WHEEL +0 -0
- {ccxt-4.4.32.dist-info → ccxt-4.4.33.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
@@ -12,6 +12,7 @@ class ImplicitAPI:
|
|
12
12
|
public_get_products_id_trades = publicGetProductsIdTrades = Entry('products/{id}/trades', 'public', 'GET', {})
|
13
13
|
public_get_time = publicGetTime = Entry('time', 'public', 'GET', {})
|
14
14
|
public_get_products_spark_lines = publicGetProductsSparkLines = Entry('products/spark-lines', 'public', 'GET', {})
|
15
|
+
public_get_products_volume_summary = publicGetProductsVolumeSummary = Entry('products/volume-summary', 'public', 'GET', {})
|
15
16
|
private_get_address_book = privateGetAddressBook = Entry('address-book', 'private', 'GET', {})
|
16
17
|
private_get_accounts = privateGetAccounts = Entry('accounts', 'private', 'GET', {})
|
17
18
|
private_get_accounts_id = privateGetAccountsId = Entry('accounts/{id}', 'private', 'GET', {})
|
ccxt/abstract/kraken.py
CHANGED
@@ -16,6 +16,7 @@ class ImplicitAPI:
|
|
16
16
|
private_post_addorder = privatePostAddOrder = Entry('AddOrder', 'private', 'POST', {'cost': 0})
|
17
17
|
private_post_addorderbatch = privatePostAddOrderBatch = Entry('AddOrderBatch', 'private', 'POST', {'cost': 0})
|
18
18
|
private_post_addexport = privatePostAddExport = Entry('AddExport', 'private', 'POST', {'cost': 3})
|
19
|
+
private_post_amendorder = privatePostAmendOrder = Entry('AmendOrder', 'private', 'POST', {'cost': 0})
|
19
20
|
private_post_balance = privatePostBalance = Entry('Balance', 'private', 'POST', {'cost': 3})
|
20
21
|
private_post_cancelall = privatePostCancelAll = Entry('CancelAll', 'private', 'POST', {'cost': 3})
|
21
22
|
private_post_cancelallordersafter = privatePostCancelAllOrdersAfter = Entry('CancelAllOrdersAfter', 'private', 'POST', {'cost': 3})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -1579,6 +1579,157 @@ class binance(Exchange, ImplicitAPI):
|
|
1579
1579
|
'BUSD': 'USD',
|
1580
1580
|
},
|
1581
1581
|
},
|
1582
|
+
'features': {
|
1583
|
+
# https://developers.binance.com/docs/binance-spot-api-docs/rest-api#:~:text=quoteOrderQty
|
1584
|
+
'spot': {
|
1585
|
+
'sandbox': True,
|
1586
|
+
'createOrder': {
|
1587
|
+
'triggerPrice': True,
|
1588
|
+
'triggerPriceType': None,
|
1589
|
+
'triggerDirection': False,
|
1590
|
+
'stopLossPrice': True,
|
1591
|
+
'takeProfitPrice': True,
|
1592
|
+
'attachedStopLossTakeProfit': None, # not supported
|
1593
|
+
'marginMode': True,
|
1594
|
+
'timeInForce': {
|
1595
|
+
'GTC': True,
|
1596
|
+
'IOC': True,
|
1597
|
+
'FOK': True,
|
1598
|
+
'PO': True,
|
1599
|
+
'GTD': False,
|
1600
|
+
},
|
1601
|
+
'hedged': True,
|
1602
|
+
# exchange-supported features
|
1603
|
+
'selfTradePrevention': True,
|
1604
|
+
'trailing': True,
|
1605
|
+
'twap': False,
|
1606
|
+
'iceberg': True,
|
1607
|
+
'oco': False,
|
1608
|
+
},
|
1609
|
+
'createOrders': None,
|
1610
|
+
'fetchMyTrades': {
|
1611
|
+
'limit': 1000,
|
1612
|
+
'daysBack': None,
|
1613
|
+
'untilDays': 1, # days between start-end
|
1614
|
+
},
|
1615
|
+
'fetchOrder': {
|
1616
|
+
'marginMode': True,
|
1617
|
+
'trigger': False,
|
1618
|
+
'trailing': False,
|
1619
|
+
},
|
1620
|
+
'fetchOpenOrders': {
|
1621
|
+
'limit': None,
|
1622
|
+
'marginMode': True,
|
1623
|
+
'trigger': False,
|
1624
|
+
'trailing': False,
|
1625
|
+
},
|
1626
|
+
'fetchOrders': {
|
1627
|
+
'limit': 1000,
|
1628
|
+
'daysBack': None,
|
1629
|
+
'untilDays': 10000,
|
1630
|
+
'marginMode': True,
|
1631
|
+
'trigger': False,
|
1632
|
+
'trailing': False,
|
1633
|
+
},
|
1634
|
+
'fetchClosedOrders': {
|
1635
|
+
'limit': 1000,
|
1636
|
+
'daysBackClosed': None,
|
1637
|
+
'daysBackCanceled': None,
|
1638
|
+
'untilDays': 10000,
|
1639
|
+
'marginMode': True,
|
1640
|
+
'trigger': False,
|
1641
|
+
'trailing': False,
|
1642
|
+
},
|
1643
|
+
'fetchOHLCV': {
|
1644
|
+
'limit': 1000,
|
1645
|
+
},
|
1646
|
+
},
|
1647
|
+
'default': {
|
1648
|
+
'sandbox': True,
|
1649
|
+
'createOrder': {
|
1650
|
+
'triggerPrice': True,
|
1651
|
+
'triggerPriceType': {
|
1652
|
+
'mark': True,
|
1653
|
+
'last': True,
|
1654
|
+
'index': False,
|
1655
|
+
},
|
1656
|
+
'stopLossPrice': True,
|
1657
|
+
'takeProfitPrice': True,
|
1658
|
+
'attachedStopLossTakeProfit': None, # not supported
|
1659
|
+
'marginMode': False,
|
1660
|
+
'timeInForce': {
|
1661
|
+
'GTC': True,
|
1662
|
+
'IOC': True,
|
1663
|
+
'FOK': True,
|
1664
|
+
'PO': True,
|
1665
|
+
'GTD': True,
|
1666
|
+
# 'GTX': True,
|
1667
|
+
},
|
1668
|
+
'hedged': True,
|
1669
|
+
# exchange-supported features
|
1670
|
+
'selfTradePrevention': True,
|
1671
|
+
'trailing': True,
|
1672
|
+
'twap': False,
|
1673
|
+
'iceberg': False,
|
1674
|
+
'oco': False,
|
1675
|
+
},
|
1676
|
+
'createOrders': {
|
1677
|
+
'max': 5,
|
1678
|
+
},
|
1679
|
+
'fetchMyTrades': {
|
1680
|
+
'daysBack': None,
|
1681
|
+
'limit': 1000,
|
1682
|
+
'untilDays': 7,
|
1683
|
+
},
|
1684
|
+
'fetchOrder': {
|
1685
|
+
'marginMode': False,
|
1686
|
+
'trigger': False,
|
1687
|
+
'trailing': False,
|
1688
|
+
},
|
1689
|
+
'fetchOpenOrders': {
|
1690
|
+
'limit': 500,
|
1691
|
+
'marginMode': True,
|
1692
|
+
'trigger': False,
|
1693
|
+
'trailing': False,
|
1694
|
+
},
|
1695
|
+
'fetchOrders': {
|
1696
|
+
'limit': 1000,
|
1697
|
+
'daysBack': 90,
|
1698
|
+
'untilDays': 7,
|
1699
|
+
'marginMode': True,
|
1700
|
+
'trigger': False,
|
1701
|
+
'trailing': False,
|
1702
|
+
},
|
1703
|
+
'fetchClosedOrders': {
|
1704
|
+
'limit': 1000,
|
1705
|
+
'daysBackClosed': 90,
|
1706
|
+
'daysBackCanceled': 3,
|
1707
|
+
'untilDays': 7,
|
1708
|
+
'marginMode': True,
|
1709
|
+
'trigger': False,
|
1710
|
+
'trailing': False,
|
1711
|
+
},
|
1712
|
+
'fetchOHLCV': {
|
1713
|
+
'limit': 1500,
|
1714
|
+
},
|
1715
|
+
},
|
1716
|
+
'swap': {
|
1717
|
+
'linear': {
|
1718
|
+
'extends': 'default',
|
1719
|
+
},
|
1720
|
+
'inverse': {
|
1721
|
+
'extends': 'default',
|
1722
|
+
},
|
1723
|
+
},
|
1724
|
+
'future': {
|
1725
|
+
'linear': {
|
1726
|
+
'extends': 'default',
|
1727
|
+
},
|
1728
|
+
'inverse': {
|
1729
|
+
'extends': 'default',
|
1730
|
+
},
|
1731
|
+
},
|
1732
|
+
},
|
1582
1733
|
'exceptions': {
|
1583
1734
|
'spot': {
|
1584
1735
|
'exact': {
|
@@ -1974,6 +2125,8 @@ class binance(Exchange, ImplicitAPI):
|
|
1974
2125
|
'-4088': PermissionDenied, # User can not place order currently
|
1975
2126
|
'-4114': BadRequest, # INVALID_CLIENT_TRAN_ID_LEN
|
1976
2127
|
'-4115': BadRequest, # DUPLICATED_CLIENT_TRAN_ID
|
2128
|
+
'-4116': InvalidOrder, # DUPLICATED_CLIENT_ORDER_ID
|
2129
|
+
'-4117': OperationRejected, # STOP_ORDER_TRIGGERING
|
1977
2130
|
'-4118': OperationRejected, # REDUCE_ONLY_MARGIN_CHECK_FAILED
|
1978
2131
|
'-4131': OperationRejected, # The counterparty's best price does not meet the PERCENT_PRICE filter limit
|
1979
2132
|
'-4140': BadRequest, # Invalid symbol status for opening position
|
ccxt/async_support/bybit.py
CHANGED
@@ -12,6 +12,7 @@ from typing import List
|
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
14
14
|
from ccxt.base.errors import PermissionDenied
|
15
|
+
from ccxt.base.errors import AccountSuspended
|
15
16
|
from ccxt.base.errors import ArgumentsRequired
|
16
17
|
from ccxt.base.errors import BadRequest
|
17
18
|
from ccxt.base.errors import BadSymbol
|
@@ -568,7 +569,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
568
569
|
'10005': PermissionDenied, # permission denied for current apikey
|
569
570
|
'10006': RateLimitExceeded, # too many requests
|
570
571
|
'10007': AuthenticationError, # api_key not found in your request parameters
|
571
|
-
'10008':
|
572
|
+
'10008': AccountSuspended, # User had been banned
|
572
573
|
'10009': AuthenticationError, # IP had been banned
|
573
574
|
'10010': PermissionDenied, # request ip mismatch
|
574
575
|
'10014': BadRequest, # Request is duplicate
|
@@ -1012,7 +1013,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
1012
1013
|
'enableUnifiedMargin': None,
|
1013
1014
|
'enableUnifiedAccount': None,
|
1014
1015
|
'unifiedMarginStatus': None,
|
1015
|
-
'createMarketBuyOrderRequiresPrice':
|
1016
|
+
'createMarketBuyOrderRequiresPrice': False, # only True for classic accounts
|
1016
1017
|
'createUnifiedMarginAccount': False,
|
1017
1018
|
'defaultType': 'swap', # 'swap', 'future', 'option', 'spot'
|
1018
1019
|
'defaultSubType': 'linear', # 'linear', 'inverse'
|
@@ -1072,6 +1073,122 @@ class bybit(Exchange, ImplicitAPI):
|
|
1072
1073
|
'1d': '1d',
|
1073
1074
|
},
|
1074
1075
|
},
|
1076
|
+
'features': {
|
1077
|
+
'default': {
|
1078
|
+
'sandbox': True,
|
1079
|
+
'createOrder': {
|
1080
|
+
'triggerPrice': True,
|
1081
|
+
'triggerPriceType': {
|
1082
|
+
'last': True,
|
1083
|
+
'mark': True,
|
1084
|
+
'index': True,
|
1085
|
+
},
|
1086
|
+
'triggerDirection': True,
|
1087
|
+
'stopLossPrice': True,
|
1088
|
+
'takeProfitPrice': True,
|
1089
|
+
'attachedStopLossTakeProfit': {
|
1090
|
+
'triggerPriceType': {
|
1091
|
+
'last': True,
|
1092
|
+
'mark': True,
|
1093
|
+
'index': True,
|
1094
|
+
},
|
1095
|
+
'limitPrice': True,
|
1096
|
+
},
|
1097
|
+
'marginMode': False,
|
1098
|
+
'timeInForce': {
|
1099
|
+
'GTC': True,
|
1100
|
+
'IOC': True,
|
1101
|
+
'FOK': True,
|
1102
|
+
'PO': True,
|
1103
|
+
'GTD': False,
|
1104
|
+
},
|
1105
|
+
'hedged': True,
|
1106
|
+
# exchange-supported features
|
1107
|
+
'selfTradePrevention': True,
|
1108
|
+
'trailing': True,
|
1109
|
+
'twap': False,
|
1110
|
+
'iceberg': False,
|
1111
|
+
'oco': False,
|
1112
|
+
},
|
1113
|
+
'createOrders': {
|
1114
|
+
'max': 10,
|
1115
|
+
},
|
1116
|
+
'fetchMyTrades': {
|
1117
|
+
'limit': 100,
|
1118
|
+
'daysBack': 365 * 2, # 2 years
|
1119
|
+
'untilDays': 7, # days between start-end
|
1120
|
+
},
|
1121
|
+
'fetchOrder': {
|
1122
|
+
'marginMode': False,
|
1123
|
+
'trigger': True,
|
1124
|
+
'trailing': False,
|
1125
|
+
},
|
1126
|
+
'fetchOpenOrders': {
|
1127
|
+
'limit': 50,
|
1128
|
+
'marginMode': False,
|
1129
|
+
'trigger': True,
|
1130
|
+
'trailing': False,
|
1131
|
+
},
|
1132
|
+
'fetchOrders': None,
|
1133
|
+
'fetchClosedOrders': {
|
1134
|
+
'limit': 50,
|
1135
|
+
'daysBackClosed': 365 * 2, # 2 years
|
1136
|
+
'daysBackCanceled': 1,
|
1137
|
+
'untilDays': 7,
|
1138
|
+
'marginMode': False,
|
1139
|
+
'trigger': True,
|
1140
|
+
'trailing': False,
|
1141
|
+
},
|
1142
|
+
'fetchOHLCV': {
|
1143
|
+
'limit': 1000,
|
1144
|
+
},
|
1145
|
+
},
|
1146
|
+
'spot': {
|
1147
|
+
'extends': 'default',
|
1148
|
+
'createOrder': {
|
1149
|
+
'triggerPrice': True,
|
1150
|
+
'triggerPriceType': None,
|
1151
|
+
'triggerDirection': False,
|
1152
|
+
'stopLossPrice': True,
|
1153
|
+
'takeProfitPrice': True,
|
1154
|
+
'attachedStopLossTakeProfit': {
|
1155
|
+
'triggerPriceType': None,
|
1156
|
+
'limitPrice': True,
|
1157
|
+
},
|
1158
|
+
'marginMode': False,
|
1159
|
+
'timeInForce': {
|
1160
|
+
'GTC': True,
|
1161
|
+
'IOC': True,
|
1162
|
+
'FOK': True,
|
1163
|
+
'PO': True,
|
1164
|
+
'GTD': False,
|
1165
|
+
},
|
1166
|
+
'hedged': True,
|
1167
|
+
# exchange-supported features
|
1168
|
+
'selfTradePrevention': True,
|
1169
|
+
'trailing': True,
|
1170
|
+
'twap': False,
|
1171
|
+
'iceberg': False,
|
1172
|
+
'oco': False,
|
1173
|
+
},
|
1174
|
+
},
|
1175
|
+
'swap': {
|
1176
|
+
'linear': {
|
1177
|
+
'extends': 'default',
|
1178
|
+
},
|
1179
|
+
'inverse': {
|
1180
|
+
'extends': 'default',
|
1181
|
+
},
|
1182
|
+
},
|
1183
|
+
'future': {
|
1184
|
+
'linear': {
|
1185
|
+
'extends': 'default',
|
1186
|
+
},
|
1187
|
+
'inverse': {
|
1188
|
+
'extends': 'default',
|
1189
|
+
},
|
1190
|
+
},
|
1191
|
+
},
|
1075
1192
|
'fees': {
|
1076
1193
|
'trading': {
|
1077
1194
|
'feeSide': 'get',
|
@@ -3346,11 +3463,17 @@ class bybit(Exchange, ImplicitAPI):
|
|
3346
3463
|
market = self.safe_market(marketId, market, None, marketType)
|
3347
3464
|
symbol = market['symbol']
|
3348
3465
|
timestamp = self.safe_integer_2(order, 'createdTime', 'createdAt')
|
3466
|
+
marketUnit = self.safe_string(order, 'marketUnit', 'baseCoin')
|
3349
3467
|
id = self.safe_string(order, 'orderId')
|
3350
3468
|
type = self.safe_string_lower(order, 'orderType')
|
3351
3469
|
price = self.safe_string(order, 'price')
|
3352
|
-
amount =
|
3353
|
-
cost =
|
3470
|
+
amount: Str = None
|
3471
|
+
cost: Str = None
|
3472
|
+
if marketUnit == 'baseCoin':
|
3473
|
+
amount = self.safe_string(order, 'qty')
|
3474
|
+
cost = self.safe_string(order, 'cumExecValue')
|
3475
|
+
else:
|
3476
|
+
cost = self.safe_string(order, 'cumExecValue')
|
3354
3477
|
filled = self.safe_string(order, 'cumExecQty')
|
3355
3478
|
remaining = self.safe_string(order, 'leavesQty')
|
3356
3479
|
lastTradeTimestamp = self.safe_integer_2(order, 'updatedTime', 'updatedAt')
|
@@ -3666,7 +3789,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3666
3789
|
# classic accounts
|
3667
3790
|
# for market buy it requires the amount of quote currency to spend
|
3668
3791
|
createMarketBuyOrderRequiresPrice = True
|
3669
|
-
createMarketBuyOrderRequiresPrice, params = self.handle_option_and_params(params, 'createOrder', 'createMarketBuyOrderRequiresPrice'
|
3792
|
+
createMarketBuyOrderRequiresPrice, params = self.handle_option_and_params(params, 'createOrder', 'createMarketBuyOrderRequiresPrice')
|
3670
3793
|
if createMarketBuyOrderRequiresPrice:
|
3671
3794
|
if (price is None) and (cost is None):
|
3672
3795
|
raise InvalidOrder(self.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument')
|
@@ -3675,7 +3798,12 @@ class bybit(Exchange, ImplicitAPI):
|
|
3675
3798
|
costRequest = cost if (cost is not None) else quoteAmount
|
3676
3799
|
request['qty'] = self.get_cost(symbol, costRequest)
|
3677
3800
|
else:
|
3678
|
-
|
3801
|
+
if cost is not None:
|
3802
|
+
request['qty'] = self.get_cost(symbol, self.number_to_string(cost))
|
3803
|
+
elif price is not None:
|
3804
|
+
request['qty'] = self.get_cost(symbol, Precise.string_mul(amountString, priceString))
|
3805
|
+
else:
|
3806
|
+
request['qty'] = self.get_cost(symbol, self.number_to_string(amount))
|
3679
3807
|
else:
|
3680
3808
|
if not isTrailingAmountOrder and not isAlternativeEndpoint:
|
3681
3809
|
request['qty'] = amountString
|
ccxt/async_support/cex.py
CHANGED
@@ -10,6 +10,7 @@ import hashlib
|
|
10
10
|
from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
|
+
from ccxt.base.errors import AuthenticationError
|
13
14
|
from ccxt.base.errors import PermissionDenied
|
14
15
|
from ccxt.base.errors import ArgumentsRequired
|
15
16
|
from ccxt.base.errors import BadRequest
|
@@ -127,6 +128,7 @@ class cex(Exchange, ImplicitAPI):
|
|
127
128
|
'Insufficient funds': InsufficientFunds,
|
128
129
|
'Get deposit address for main account is not allowed': PermissionDenied,
|
129
130
|
'Market Trigger orders are not allowed': BadRequest, # for some reason, triggerPrice does not work for market orders
|
131
|
+
'key not passed or incorrect': AuthenticationError,
|
130
132
|
},
|
131
133
|
},
|
132
134
|
'timeframes': {
|
@@ -837,7 +839,7 @@ class cex(Exchange, ImplicitAPI):
|
|
837
839
|
code = self.safe_currency_code(key)
|
838
840
|
account: dict = {
|
839
841
|
'used': self.safe_string(balance, 'balanceOnHold'),
|
840
|
-
'
|
842
|
+
'total': self.safe_string(balance, 'balance'),
|
841
843
|
}
|
842
844
|
result[code] = account
|
843
845
|
return self.safe_balance(result)
|
ccxt/async_support/coinbase.py
CHANGED
@@ -2311,28 +2311,8 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2311
2311
|
pagination = self.safe_dict(response, 'pagination', {})
|
2312
2312
|
cursor = self.safe_string(pagination, 'next_starting_after')
|
2313
2313
|
if (cursor is not None) and (cursor != ''):
|
2314
|
-
|
2315
|
-
|
2316
|
-
ledger[lastIndex] = {
|
2317
|
-
'info': self.safe_dict(last, 'info'),
|
2318
|
-
'id': self.safe_string(last, 'id'),
|
2319
|
-
'timestamp': self.safe_integer(last, 'timestamp'),
|
2320
|
-
'datetime': self.safe_string(last, 'datetime'),
|
2321
|
-
'direction': self.safe_string(last, 'direction'),
|
2322
|
-
'account': self.safe_string(last, 'account'),
|
2323
|
-
'referenceId': None,
|
2324
|
-
'referenceAccount': None,
|
2325
|
-
'type': self.safe_string(last, 'type'),
|
2326
|
-
'currency': self.safe_string(last, 'currency'),
|
2327
|
-
'amount': self.safe_number(last, 'amount'),
|
2328
|
-
'before': None,
|
2329
|
-
'after': None,
|
2330
|
-
'status': self.safe_string(last, 'status'),
|
2331
|
-
'fee': {
|
2332
|
-
'cost': self.safe_number(lastFee, 'cost'),
|
2333
|
-
'currency': self.safe_string(lastFee, 'currency'),
|
2334
|
-
},
|
2335
|
-
}
|
2314
|
+
last['info']['next_starting_after'] = cursor
|
2315
|
+
ledger[lastIndex] = last
|
2336
2316
|
return ledger
|
2337
2317
|
|
2338
2318
|
def parse_ledger_entry_status(self, status):
|
@@ -127,7 +127,8 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
127
127
|
'products/{id}/ticker',
|
128
128
|
'products/{id}/trades',
|
129
129
|
'time',
|
130
|
-
'products/spark-lines', # experimental
|
130
|
+
'products/spark-lines', # experimental,
|
131
|
+
'products/volume-summary',
|
131
132
|
],
|
132
133
|
},
|
133
134
|
'private': {
|
ccxt/async_support/coinex.py
CHANGED
@@ -734,14 +734,23 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
734
734
|
https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
735
735
|
https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
736
736
|
|
737
|
-
:param str[]
|
737
|
+
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
738
738
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
739
|
+
:param str [params.type]: 'spot' or 'swap', by default fetches both
|
739
740
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
740
741
|
"""
|
741
742
|
await self.load_markets()
|
742
743
|
symbols = self.market_symbols(symbols)
|
743
744
|
# at self stage, to get tickers data, we use fetchMarkets endpoints
|
744
|
-
response =
|
745
|
+
response = []
|
746
|
+
type = self.safe_string(params, 'type')
|
747
|
+
params = self.omit(params, 'type')
|
748
|
+
if type == 'spot':
|
749
|
+
response = await self.fetch_spot_markets(params)
|
750
|
+
elif type == 'swap':
|
751
|
+
response = await self.fetch_swap_markets(params)
|
752
|
+
else:
|
753
|
+
response = await self.fetch_markets(params)
|
745
754
|
# same response "fetchMarkets"
|
746
755
|
result: dict = {}
|
747
756
|
for i in range(0, len(response)):
|
ccxt/async_support/kraken.py
CHANGED
@@ -1423,7 +1423,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1423
1423
|
:param str [params.postOnly]: Post only flag, invalid when timeInForce is IOC or FOK
|
1424
1424
|
:param float [params.cost]: the cost of the order in units of USDT
|
1425
1425
|
----------------- Exchange Specific Parameters -----------------
|
1426
|
-
:param float [params.leverage]: Leverage size of the order
|
1426
|
+
:param float [params.leverage]: Leverage size of the order(mandatory param in request, default is 1)
|
1427
1427
|
:param str [params.clientOid]: client order id, defaults to uuid if not passed
|
1428
1428
|
:param str [params.remark]: remark for the order, length cannot exceed 100 utf8 characters
|
1429
1429
|
:param str [params.stop]: 'up' or 'down', the direction the stopPrice is triggered from, requires stopPrice. down: Triggers when the price reaches or goes below the stopPrice. up: Triggers when the price reaches or goes above the stopPrice.
|
ccxt/async_support/lbank.py
CHANGED
ccxt/async_support/okx.py
CHANGED
@@ -1200,6 +1200,97 @@ class okx(Exchange, ImplicitAPI):
|
|
1200
1200
|
},
|
1201
1201
|
'brokerId': 'e847386590ce4dBC',
|
1202
1202
|
},
|
1203
|
+
'features': {
|
1204
|
+
# https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
1205
|
+
'default': {
|
1206
|
+
'sandbox': True,
|
1207
|
+
'createOrder': {
|
1208
|
+
'triggerPrice': True,
|
1209
|
+
'triggerPriceType': {
|
1210
|
+
'last': True,
|
1211
|
+
'mark': True,
|
1212
|
+
'index': True,
|
1213
|
+
},
|
1214
|
+
'triggerDirection': False,
|
1215
|
+
'stopLossPrice': True,
|
1216
|
+
'takeProfitPrice': True,
|
1217
|
+
'marginMode': True,
|
1218
|
+
'attachedStopLossTakeProfit': {
|
1219
|
+
'triggerPriceType': {
|
1220
|
+
'last': True,
|
1221
|
+
'mark': True,
|
1222
|
+
'index': True,
|
1223
|
+
},
|
1224
|
+
'limitPrice': True,
|
1225
|
+
},
|
1226
|
+
'timeInForce': {
|
1227
|
+
'GTC': True,
|
1228
|
+
'IOC': True,
|
1229
|
+
'FOK': True,
|
1230
|
+
'PO': True,
|
1231
|
+
'GTD': False,
|
1232
|
+
},
|
1233
|
+
'hedged': True,
|
1234
|
+
# even though the below params not unified yet, it's useful metadata for users to know that exchange supports them
|
1235
|
+
'selfTradePrevention': True,
|
1236
|
+
'trailing': True,
|
1237
|
+
'twap': True,
|
1238
|
+
'iceberg': True,
|
1239
|
+
'oco': True,
|
1240
|
+
},
|
1241
|
+
'createOrders': {
|
1242
|
+
'max': 20,
|
1243
|
+
},
|
1244
|
+
'fetchMyTrades': {
|
1245
|
+
'daysBack': 90,
|
1246
|
+
'limit': 100,
|
1247
|
+
'untilDays': 10000,
|
1248
|
+
},
|
1249
|
+
'fetchOrder': {
|
1250
|
+
'marginMode': False,
|
1251
|
+
'trigger': True,
|
1252
|
+
'trailing': True,
|
1253
|
+
},
|
1254
|
+
'fetchOpenOrders': {
|
1255
|
+
'limit': 100,
|
1256
|
+
'marginMode': False,
|
1257
|
+
'trigger': True,
|
1258
|
+
'trailing': True,
|
1259
|
+
},
|
1260
|
+
'fetchOrders': None, # not supported
|
1261
|
+
'fetchClosedOrders': {
|
1262
|
+
'limit': 100,
|
1263
|
+
'daysBackClosed': 90, # 3 months
|
1264
|
+
'daysBackCanceled': 1 / 12, # 2 hour
|
1265
|
+
'untilDays': None,
|
1266
|
+
'marginMode': False,
|
1267
|
+
'trigger': True,
|
1268
|
+
'trailing': True,
|
1269
|
+
},
|
1270
|
+
'fetchOHLCV': {
|
1271
|
+
'limit': 300,
|
1272
|
+
},
|
1273
|
+
},
|
1274
|
+
'spot': {
|
1275
|
+
'extends': 'default',
|
1276
|
+
},
|
1277
|
+
'swap': {
|
1278
|
+
'linear': {
|
1279
|
+
'extends': 'default',
|
1280
|
+
},
|
1281
|
+
'inverse': {
|
1282
|
+
'extends': 'default',
|
1283
|
+
},
|
1284
|
+
},
|
1285
|
+
'future': {
|
1286
|
+
'linear': {
|
1287
|
+
'extends': 'default',
|
1288
|
+
},
|
1289
|
+
'inverse': {
|
1290
|
+
'extends': 'default',
|
1291
|
+
},
|
1292
|
+
},
|
1293
|
+
},
|
1203
1294
|
'commonCurrencies': {
|
1204
1295
|
# the exchange refers to ERC20 version of Aeternity(AEToken)
|
1205
1296
|
'AE': 'AET', # https://github.com/ccxt/ccxt/issues/4981
|
@@ -3078,7 +3169,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3078
3169
|
if not isAlgoOrder:
|
3079
3170
|
if price is not None:
|
3080
3171
|
request['newPx'] = self.price_to_precision(symbol, price)
|
3081
|
-
params = self.omit(params, ['clOrdId', 'clientOrderId', 'takeProfitPrice', 'stopLossPrice', 'stopLoss', 'takeProfit'])
|
3172
|
+
params = self.omit(params, ['clOrdId', 'clientOrderId', 'takeProfitPrice', 'stopLossPrice', 'stopLoss', 'takeProfit', 'postOnly'])
|
3082
3173
|
return self.extend(request, params)
|
3083
3174
|
|
3084
3175
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|