ccxt 4.3.85__py2.py3-none-any.whl → 4.3.86__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/hashkey.py +67 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +2 -2
- ccxt/async_support/binance.py +4 -2
- ccxt/async_support/bitfinex.py +2 -2
- ccxt/async_support/hashkey.py +4062 -0
- ccxt/async_support/hyperliquid.py +80 -62
- ccxt/async_support/indodax.py +29 -8
- ccxt/async_support/krakenfutures.py +10 -9
- ccxt/base/exchange.py +2 -2
- ccxt/binance.py +4 -2
- ccxt/bitfinex.py +2 -2
- ccxt/hashkey.py +4062 -0
- ccxt/hyperliquid.py +80 -62
- ccxt/indodax.py +29 -8
- ccxt/krakenfutures.py +10 -9
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/ascendex.py +41 -5
- ccxt/pro/bingx.py +13 -12
- ccxt/pro/hashkey.py +783 -0
- ccxt/pro/hyperliquid.py +118 -1
- ccxt/pro/mexc.py +13 -7
- ccxt/pro/woo.py +1 -0
- ccxt/pro/woofipro.py +1 -0
- ccxt/pro/xt.py +1 -0
- ccxt/test/tests_async.py +13 -30
- ccxt/test/tests_sync.py +13 -30
- {ccxt-4.3.85.dist-info → ccxt-4.3.86.dist-info}/METADATA +8 -6
- {ccxt-4.3.85.dist-info → ccxt-4.3.86.dist-info}/RECORD +33 -29
- {ccxt-4.3.85.dist-info → ccxt-4.3.86.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.85.dist-info → ccxt-4.3.86.dist-info}/WHEEL +0 -0
- {ccxt-4.3.85.dist-info → ccxt-4.3.86.dist-info}/top_level.txt +0 -0
ccxt/hyperliquid.py
CHANGED
@@ -1066,24 +1066,9 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1066
1066
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1067
1067
|
"""
|
1068
1068
|
self.load_markets()
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
symbol = market['symbol']
|
1073
|
-
order = {
|
1074
|
-
'symbol': symbol,
|
1075
|
-
'type': type,
|
1076
|
-
'side': side,
|
1077
|
-
'amount': amount,
|
1078
|
-
'price': price,
|
1079
|
-
'params': params,
|
1080
|
-
}
|
1081
|
-
globalParams: dict = {}
|
1082
|
-
if vaultAddress is not None:
|
1083
|
-
globalParams['vaultAddress'] = vaultAddress
|
1084
|
-
response = self.create_orders([order], globalParams)
|
1085
|
-
first = self.safe_dict(response, 0)
|
1086
|
-
return first
|
1069
|
+
order, globalParams = self.parse_create_order_args(symbol, type, side, amount, price, params)
|
1070
|
+
orders = self.create_orders([order], globalParams)
|
1071
|
+
return orders[0]
|
1087
1072
|
|
1088
1073
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
1089
1074
|
"""
|
@@ -1092,8 +1077,39 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1092
1077
|
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
1093
1078
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1094
1079
|
"""
|
1095
|
-
self.check_required_credentials()
|
1096
1080
|
self.load_markets()
|
1081
|
+
request = self.create_orders_request(orders, params)
|
1082
|
+
response = self.privatePostExchange(request)
|
1083
|
+
#
|
1084
|
+
# {
|
1085
|
+
# "status": "ok",
|
1086
|
+
# "response": {
|
1087
|
+
# "type": "order",
|
1088
|
+
# "data": {
|
1089
|
+
# "statuses": [
|
1090
|
+
# {
|
1091
|
+
# "resting": {
|
1092
|
+
# "oid": 5063830287
|
1093
|
+
# }
|
1094
|
+
# }
|
1095
|
+
# ]
|
1096
|
+
# }
|
1097
|
+
# }
|
1098
|
+
# }
|
1099
|
+
#
|
1100
|
+
responseObj = self.safe_dict(response, 'response', {})
|
1101
|
+
data = self.safe_dict(responseObj, 'data', {})
|
1102
|
+
statuses = self.safe_list(data, 'statuses', [])
|
1103
|
+
return self.parse_orders(statuses, None)
|
1104
|
+
|
1105
|
+
def create_orders_request(self, orders, params={}) -> dict:
|
1106
|
+
"""
|
1107
|
+
create a list of trade orders
|
1108
|
+
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
1109
|
+
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
1110
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1111
|
+
"""
|
1112
|
+
self.check_required_credentials()
|
1097
1113
|
defaultSlippage = self.safe_string(self.options, 'defaultSlippage')
|
1098
1114
|
defaultSlippage = self.safe_string(params, 'slippage', defaultSlippage)
|
1099
1115
|
hasClientOrderId = False
|
@@ -1196,28 +1212,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1196
1212
|
if vaultAddress is not None:
|
1197
1213
|
params = self.omit(params, 'vaultAddress')
|
1198
1214
|
request['vaultAddress'] = vaultAddress
|
1199
|
-
|
1200
|
-
#
|
1201
|
-
# {
|
1202
|
-
# "status": "ok",
|
1203
|
-
# "response": {
|
1204
|
-
# "type": "order",
|
1205
|
-
# "data": {
|
1206
|
-
# "statuses": [
|
1207
|
-
# {
|
1208
|
-
# "resting": {
|
1209
|
-
# "oid": 5063830287
|
1210
|
-
# }
|
1211
|
-
# }
|
1212
|
-
# ]
|
1213
|
-
# }
|
1214
|
-
# }
|
1215
|
-
# }
|
1216
|
-
#
|
1217
|
-
responseObj = self.safe_dict(response, 'response', {})
|
1218
|
-
data = self.safe_dict(responseObj, 'data', {})
|
1219
|
-
statuses = self.safe_list(data, 'statuses', [])
|
1220
|
-
return self.parse_orders(statuses, None)
|
1215
|
+
return request
|
1221
1216
|
|
1222
1217
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1223
1218
|
"""
|
@@ -1416,30 +1411,10 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1416
1411
|
#
|
1417
1412
|
return response
|
1418
1413
|
|
1419
|
-
def
|
1420
|
-
"""
|
1421
|
-
edit a trade order
|
1422
|
-
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
1423
|
-
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
1424
|
-
:param str id: cancel order id
|
1425
|
-
:param str symbol: unified symbol of the market to create an order in
|
1426
|
-
:param str type: 'market' or 'limit'
|
1427
|
-
:param str side: 'buy' or 'sell'
|
1428
|
-
:param float amount: how much of currency you want to trade in units of base currency
|
1429
|
-
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1430
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1431
|
-
:param str [params.timeInForce]: 'Gtc', 'Ioc', 'Alo'
|
1432
|
-
:param bool [params.postOnly]: True or False whether the order is post-only
|
1433
|
-
:param bool [params.reduceOnly]: True or False whether the order is reduce-only
|
1434
|
-
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1435
|
-
:param str [params.clientOrderId]: client order id,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
1436
|
-
:param str [params.vaultAddress]: the vault address for order
|
1437
|
-
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1438
|
-
"""
|
1414
|
+
def edit_order_request(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={}):
|
1439
1415
|
self.check_required_credentials()
|
1440
1416
|
if id is None:
|
1441
1417
|
raise ArgumentsRequired(self.id + ' editOrder() requires an id argument')
|
1442
|
-
self.load_markets()
|
1443
1418
|
market = self.market(symbol)
|
1444
1419
|
type = type.upper()
|
1445
1420
|
isMarket = (type == 'MARKET')
|
@@ -1516,6 +1491,31 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1516
1491
|
if vaultAddress is not None:
|
1517
1492
|
params = self.omit(params, 'vaultAddress')
|
1518
1493
|
request['vaultAddress'] = vaultAddress
|
1494
|
+
return request
|
1495
|
+
|
1496
|
+
def edit_order(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={}):
|
1497
|
+
"""
|
1498
|
+
edit a trade order
|
1499
|
+
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
1500
|
+
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
1501
|
+
:param str id: cancel order id
|
1502
|
+
:param str symbol: unified symbol of the market to create an order in
|
1503
|
+
:param str type: 'market' or 'limit'
|
1504
|
+
:param str side: 'buy' or 'sell'
|
1505
|
+
:param float amount: how much of currency you want to trade in units of base currency
|
1506
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1507
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1508
|
+
:param str [params.timeInForce]: 'Gtc', 'Ioc', 'Alo'
|
1509
|
+
:param bool [params.postOnly]: True or False whether the order is post-only
|
1510
|
+
:param bool [params.reduceOnly]: True or False whether the order is reduce-only
|
1511
|
+
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
1512
|
+
:param str [params.clientOrderId]: client order id,(optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
1513
|
+
:param str [params.vaultAddress]: the vault address for order
|
1514
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1515
|
+
"""
|
1516
|
+
self.load_markets()
|
1517
|
+
market = self.market(symbol)
|
1518
|
+
request = self.edit_order_request(id, symbol, type, side, amount, price, params)
|
1519
1519
|
response = self.privatePostExchange(request)
|
1520
1520
|
#
|
1521
1521
|
# {
|
@@ -2604,3 +2604,21 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2604
2604
|
}
|
2605
2605
|
body = self.json(params)
|
2606
2606
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
2607
|
+
|
2608
|
+
def parse_create_order_args(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2609
|
+
market = self.market(symbol)
|
2610
|
+
vaultAddress = self.safe_string(params, 'vaultAddress')
|
2611
|
+
params = self.omit(params, 'vaultAddress')
|
2612
|
+
symbol = market['symbol']
|
2613
|
+
order = {
|
2614
|
+
'symbol': symbol,
|
2615
|
+
'type': type,
|
2616
|
+
'side': side,
|
2617
|
+
'amount': amount,
|
2618
|
+
'price': price,
|
2619
|
+
'params': params,
|
2620
|
+
}
|
2621
|
+
globalParams = {}
|
2622
|
+
if vaultAddress is not None:
|
2623
|
+
globalParams['vaultAddress'] = vaultAddress
|
2624
|
+
return [order, globalParams]
|
ccxt/indodax.py
CHANGED
@@ -17,6 +17,7 @@ from ccxt.base.errors import InsufficientFunds
|
|
17
17
|
from ccxt.base.errors import InvalidOrder
|
18
18
|
from ccxt.base.errors import OrderNotFound
|
19
19
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
20
|
+
from ccxt.base.precise import Precise
|
20
21
|
|
21
22
|
|
22
23
|
class indodax(Exchange, ImplicitAPI):
|
@@ -801,8 +802,6 @@ class indodax(Exchange, ImplicitAPI):
|
|
801
802
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
802
803
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
803
804
|
"""
|
804
|
-
if type != 'limit':
|
805
|
-
raise ExchangeError(self.id + ' createOrder() allows limit orders only')
|
806
805
|
self.load_markets()
|
807
806
|
market = self.market(symbol)
|
808
807
|
request: dict = {
|
@@ -810,12 +809,34 @@ class indodax(Exchange, ImplicitAPI):
|
|
810
809
|
'type': side,
|
811
810
|
'price': price,
|
812
811
|
}
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
812
|
+
priceIsRequired = False
|
813
|
+
quantityIsRequired = False
|
814
|
+
if type == 'market':
|
815
|
+
if side == 'buy':
|
816
|
+
quoteAmount = None
|
817
|
+
cost = self.safe_number(params, 'cost')
|
818
|
+
params = self.omit(params, 'cost')
|
819
|
+
if cost is not None:
|
820
|
+
quoteAmount = self.cost_to_precision(symbol, cost)
|
821
|
+
else:
|
822
|
+
if price is None:
|
823
|
+
raise InvalidOrder(self.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price).')
|
824
|
+
amountString = self.number_to_string(amount)
|
825
|
+
priceString = self.number_to_string(price)
|
826
|
+
costRequest = Precise.string_mul(amountString, priceString)
|
827
|
+
quoteAmount = self.cost_to_precision(symbol, costRequest)
|
828
|
+
request[market['quoteId']] = quoteAmount
|
829
|
+
else:
|
830
|
+
quantityIsRequired = True
|
831
|
+
elif type == 'limit':
|
832
|
+
priceIsRequired = True
|
833
|
+
quantityIsRequired = True
|
834
|
+
if priceIsRequired:
|
835
|
+
if price is None:
|
836
|
+
raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')
|
837
|
+
request['price'] = price
|
838
|
+
if quantityIsRequired:
|
839
|
+
request[market['baseId']] = self.amount_to_precision(symbol, amount)
|
819
840
|
result = self.privatePostTrade(self.extend(request, params))
|
820
841
|
data = self.safe_value(result, 'return', {})
|
821
842
|
id = self.safe_string(data, 'order_id')
|
ccxt/krakenfutures.py
CHANGED
@@ -1678,16 +1678,17 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1678
1678
|
executions.append(item)
|
1679
1679
|
# Final order(after placement / editing / execution / canceling)
|
1680
1680
|
orderTrigger = self.safe_value(item, 'orderTrigger')
|
1681
|
-
details
|
1682
|
-
|
1683
|
-
isPrior = False
|
1684
|
-
fixed = True
|
1685
|
-
elif not fixed:
|
1686
|
-
orderPriorExecution = self.safe_value(item, 'orderPriorExecution')
|
1687
|
-
details = self.safe_value_2(item, 'orderPriorExecution', 'orderPriorEdit')
|
1688
|
-
price = self.safe_string(orderPriorExecution, 'limitPrice')
|
1681
|
+
if details is None:
|
1682
|
+
details = self.safe_value_2(item, 'new', 'order', orderTrigger)
|
1689
1683
|
if details is not None:
|
1690
|
-
isPrior =
|
1684
|
+
isPrior = False
|
1685
|
+
fixed = True
|
1686
|
+
elif not fixed:
|
1687
|
+
orderPriorExecution = self.safe_value(item, 'orderPriorExecution')
|
1688
|
+
details = self.safe_value_2(item, 'orderPriorExecution', 'orderPriorEdit')
|
1689
|
+
price = self.safe_string(orderPriorExecution, 'limitPrice')
|
1690
|
+
if details is not None:
|
1691
|
+
isPrior = True
|
1691
1692
|
trades = self.parse_trades(executions)
|
1692
1693
|
statusId = self.safe_string(order, 'status')
|
1693
1694
|
if details is None:
|
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.86'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -49,6 +49,7 @@ from ccxt.pro.exmo import exmo # noqa
|
|
49
49
|
from ccxt.pro.gate import gate # noqa: F401
|
50
50
|
from ccxt.pro.gateio import gateio # noqa: F401
|
51
51
|
from ccxt.pro.gemini import gemini # noqa: F401
|
52
|
+
from ccxt.pro.hashkey import hashkey # noqa: F401
|
52
53
|
from ccxt.pro.hitbtc import hitbtc # noqa: F401
|
53
54
|
from ccxt.pro.hollaex import hollaex # noqa: F401
|
54
55
|
from ccxt.pro.htx import htx # noqa: F401
|
@@ -121,6 +122,7 @@ exchanges = [
|
|
121
122
|
'gate',
|
122
123
|
'gateio',
|
123
124
|
'gemini',
|
125
|
+
'hashkey',
|
124
126
|
'hitbtc',
|
125
127
|
'hollaex',
|
126
128
|
'htx',
|
ccxt/pro/ascendex.py
CHANGED
@@ -25,6 +25,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
25
25
|
'watchOrders': True,
|
26
26
|
'watchTicker': False,
|
27
27
|
'watchTrades': True,
|
28
|
+
'watchTradesForSymbols': True,
|
28
29
|
},
|
29
30
|
'urls': {
|
30
31
|
'api': {
|
@@ -62,6 +63,16 @@ class ascendex(ccxt.async_support.ascendex):
|
|
62
63
|
message = self.extend(request, params)
|
63
64
|
return await self.watch(url, messageHash, message, messageHash)
|
64
65
|
|
66
|
+
async def watch_public_multiple(self, messageHashes, params={}):
|
67
|
+
url = self.urls['api']['ws']['public']
|
68
|
+
id = self.nonce()
|
69
|
+
request: dict = {
|
70
|
+
'id': str(id),
|
71
|
+
'op': 'sub',
|
72
|
+
}
|
73
|
+
message = self.extend(request, params)
|
74
|
+
return await self.watch_multiple(url, messageHashes, message, messageHashes)
|
75
|
+
|
65
76
|
async def watch_private(self, channel, messageHash, params={}):
|
66
77
|
await self.load_accounts()
|
67
78
|
accountGroup = self.safe_string(self.options, 'account-group')
|
@@ -80,6 +91,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
80
91
|
async def watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
81
92
|
"""
|
82
93
|
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
94
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#channel-bar-data
|
83
95
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
84
96
|
:param str timeframe: the length of time each candle represents
|
85
97
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -140,22 +152,44 @@ class ascendex(ccxt.async_support.ascendex):
|
|
140
152
|
async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
141
153
|
"""
|
142
154
|
get the list of most recent trades for a particular symbol
|
155
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#channel-market-trades
|
143
156
|
:param str symbol: unified symbol of the market to fetch trades for
|
144
157
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
145
158
|
:param int [limit]: the maximum amount of trades to fetch
|
146
159
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
147
160
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
148
161
|
"""
|
162
|
+
return await self.watch_trades_for_symbols([symbol], since, limit, params)
|
163
|
+
|
164
|
+
async def watch_trades_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
165
|
+
"""
|
166
|
+
get the list of most recent trades for a list of symbols
|
167
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#channel-market-trades
|
168
|
+
:param str[] symbols: unified symbol of the market to fetch trades for
|
169
|
+
:param int [since]: timestamp in ms of the earliest trade to fetch
|
170
|
+
:param int [limit]: the maximum amount of trades to fetch
|
171
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
172
|
+
:param str [params.name]: the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
|
173
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
174
|
+
"""
|
149
175
|
await self.load_markets()
|
150
|
-
|
151
|
-
|
152
|
-
|
176
|
+
symbols = self.market_symbols(symbols, None, False, True, True)
|
177
|
+
marketIds = []
|
178
|
+
messageHashes = []
|
179
|
+
if symbols is not None:
|
180
|
+
for i in range(0, len(symbols)):
|
181
|
+
market = self.market(symbols[i])
|
182
|
+
marketIds.append(market['id'])
|
183
|
+
messageHashes.append('trades:' + market['id'])
|
184
|
+
channel = 'trades:' + ','.join(marketIds)
|
153
185
|
params = self.extend(params, {
|
154
186
|
'ch': channel,
|
155
187
|
})
|
156
|
-
trades = await self.
|
188
|
+
trades = await self.watch_public_multiple(messageHashes, params)
|
157
189
|
if self.newUpdates:
|
158
|
-
|
190
|
+
first = self.safe_value(trades, 0)
|
191
|
+
tradeSymbol = self.safe_string(first, 'symbol')
|
192
|
+
limit = trades.getLimit(tradeSymbol, limit)
|
159
193
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
160
194
|
|
161
195
|
def handle_trades(self, client: Client, message):
|
@@ -195,6 +229,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
195
229
|
async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
196
230
|
"""
|
197
231
|
watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
232
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#channel-level-2-order-book-updates
|
198
233
|
:param str symbol: unified symbol of the market to fetch the order book for
|
199
234
|
:param int [limit]: the maximum amount of order book entries to return
|
200
235
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -342,6 +377,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
342
377
|
async def watch_balance(self, params={}) -> Balances:
|
343
378
|
"""
|
344
379
|
watch balance and get the amount of funds available for trading or funds locked in orders
|
380
|
+
:see: https://ascendex.github.io/ascendex-pro-api/#channel-order-and-balance
|
345
381
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
346
382
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
347
383
|
"""
|
ccxt/pro/bingx.py
CHANGED
@@ -22,6 +22,7 @@ class bingx(ccxt.async_support.bingx):
|
|
22
22
|
'has': {
|
23
23
|
'ws': True,
|
24
24
|
'watchTrades': True,
|
25
|
+
'watchTradesForSymbols': False,
|
25
26
|
'watchOrderBook': True,
|
26
27
|
'watchOrderBookForSymbols': True,
|
27
28
|
'watchOHLCV': True,
|
@@ -403,8 +404,8 @@ class bingx(ccxt.async_support.bingx):
|
|
403
404
|
async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
404
405
|
"""
|
405
406
|
watches information on multiple trades made in a market
|
406
|
-
:see: https://bingx-api.github.io/docs/#/spot/socket/market.html#
|
407
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
|
407
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscription%20transaction%20by%20transaction
|
408
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
|
408
409
|
:param str symbol: unified market symbol of the market orders were made in
|
409
410
|
:param int [since]: the earliest time in ms to fetch orders for
|
410
411
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -517,8 +518,8 @@ class bingx(ccxt.async_support.bingx):
|
|
517
518
|
async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
518
519
|
"""
|
519
520
|
watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
520
|
-
:see: https://bingx-api.github.io/docs/#/spot/socket/market.html#Subscribe%20Market%20Depth%20Data
|
521
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data
|
521
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscribe%20Market%20Depth%20Data
|
522
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data
|
522
523
|
:param str symbol: unified symbol of the market to fetch the order book for
|
523
524
|
:param int [limit]: the maximum amount of order book entries to return
|
524
525
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -737,8 +738,8 @@ class bingx(ccxt.async_support.bingx):
|
|
737
738
|
async def watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
738
739
|
"""
|
739
740
|
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
740
|
-
:see: https://bingx-api.github.io/docs/#/spot/socket/market.html#K%
|
741
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20K-Line%20Data
|
741
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#K-line%20Streams
|
742
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20K-Line%20Data
|
742
743
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
743
744
|
:param str timeframe: the length of time each candle represents
|
744
745
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -776,8 +777,8 @@ class bingx(ccxt.async_support.bingx):
|
|
776
777
|
|
777
778
|
async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
778
779
|
"""
|
779
|
-
:see: https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
780
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
780
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/socket/account.html#Subscription%20order%20update%20data
|
781
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
781
782
|
watches information on multiple orders made by the user
|
782
783
|
:param str symbol: unified market symbol of the market orders were made in
|
783
784
|
:param int [since]: the earliest time in ms to fetch orders for
|
@@ -817,8 +818,8 @@ class bingx(ccxt.async_support.bingx):
|
|
817
818
|
|
818
819
|
async def watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
819
820
|
"""
|
820
|
-
:see: https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
821
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
821
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/socket/account.html#Subscription%20order%20update%20data
|
822
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
822
823
|
watches information on multiple trades made by the user
|
823
824
|
:param str symbol: unified market symbol of the market trades were made in
|
824
825
|
:param int [since]: the earliest time in ms to trades orders for
|
@@ -858,8 +859,8 @@ class bingx(ccxt.async_support.bingx):
|
|
858
859
|
|
859
860
|
async def watch_balance(self, params={}) -> Balances:
|
860
861
|
"""
|
861
|
-
:see: https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%
|
862
|
-
:see: https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
862
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/socket/account.html#Subscription%20account%20balance%20push
|
863
|
+
:see: https://bingx-api.github.io/docs/#/en-us/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
863
864
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
864
865
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
865
866
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|