ccxt 4.3.96__py2.py3-none-any.whl → 4.3.97__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/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +2 -0
- ccxt/async_support/coinex.py +15 -3
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +2 -0
- ccxt/coinex.py +15 -3
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/gate.py +155 -0
- ccxt/pro/kucoin.py +107 -0
- {ccxt-4.3.96.dist-info → ccxt-4.3.97.dist-info}/METADATA +4 -4
- {ccxt-4.3.96.dist-info → ccxt-4.3.97.dist-info}/RECORD +16 -16
- {ccxt-4.3.96.dist-info → ccxt-4.3.97.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.96.dist-info → ccxt-4.3.97.dist-info}/WHEEL +0 -0
- {ccxt-4.3.96.dist-info → ccxt-4.3.97.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -4121,6 +4121,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4121
4121
|
price = self.safe_string(params, 'price')
|
4122
4122
|
until = self.safe_integer(params, 'until')
|
4123
4123
|
params = self.omit(params, ['price', 'until'])
|
4124
|
+
if since is not None and until is not None and limit is None:
|
4125
|
+
limit = maxLimit
|
4124
4126
|
limit = defaultLimit if (limit is None) else min(limit, maxLimit)
|
4125
4127
|
request: dict = {
|
4126
4128
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
ccxt/async_support/coinex.py
CHANGED
@@ -1199,7 +1199,10 @@ class coinex(Exchange, ImplicitAPI):
|
|
1199
1199
|
# "side": "buy",
|
1200
1200
|
# "order_id": 136915589622,
|
1201
1201
|
# "price": "64376",
|
1202
|
-
# "amount": "0.0001"
|
1202
|
+
# "amount": "0.0001",
|
1203
|
+
# "role": "taker",
|
1204
|
+
# "fee": "0.0299",
|
1205
|
+
# "fee_ccy": "USDT"
|
1203
1206
|
# }
|
1204
1207
|
#
|
1205
1208
|
timestamp = self.safe_integer(trade, 'created_at')
|
@@ -1208,6 +1211,15 @@ class coinex(Exchange, ImplicitAPI):
|
|
1208
1211
|
defaultType = market['type']
|
1209
1212
|
marketId = self.safe_string(trade, 'market')
|
1210
1213
|
market = self.safe_market(marketId, market, None, defaultType)
|
1214
|
+
feeCostString = self.safe_string(trade, 'fee')
|
1215
|
+
fee = None
|
1216
|
+
if feeCostString is not None:
|
1217
|
+
feeCurrencyId = self.safe_string(trade, 'fee_ccy')
|
1218
|
+
feeCurrencyCode = self.safe_currency_code(feeCurrencyId)
|
1219
|
+
fee = {
|
1220
|
+
'cost': feeCostString,
|
1221
|
+
'currency': feeCurrencyCode,
|
1222
|
+
}
|
1211
1223
|
return self.safe_trade({
|
1212
1224
|
'info': trade,
|
1213
1225
|
'timestamp': timestamp,
|
@@ -1217,11 +1229,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
1217
1229
|
'order': self.safe_string(trade, 'order_id'),
|
1218
1230
|
'type': None,
|
1219
1231
|
'side': self.safe_string(trade, 'side'),
|
1220
|
-
'takerOrMaker':
|
1232
|
+
'takerOrMaker': self.safe_string(trade, 'role'),
|
1221
1233
|
'price': self.safe_string(trade, 'price'),
|
1222
1234
|
'amount': self.safe_string(trade, 'amount'),
|
1223
1235
|
'cost': self.safe_string(trade, 'deal_money'),
|
1224
|
-
'fee':
|
1236
|
+
'fee': fee,
|
1225
1237
|
}, market)
|
1226
1238
|
|
1227
1239
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
ccxt/base/exchange.py
CHANGED
ccxt/binance.py
CHANGED
@@ -4120,6 +4120,8 @@ class binance(Exchange, ImplicitAPI):
|
|
4120
4120
|
price = self.safe_string(params, 'price')
|
4121
4121
|
until = self.safe_integer(params, 'until')
|
4122
4122
|
params = self.omit(params, ['price', 'until'])
|
4123
|
+
if since is not None and until is not None and limit is None:
|
4124
|
+
limit = maxLimit
|
4123
4125
|
limit = defaultLimit if (limit is None) else min(limit, maxLimit)
|
4124
4126
|
request: dict = {
|
4125
4127
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
ccxt/coinex.py
CHANGED
@@ -1198,7 +1198,10 @@ class coinex(Exchange, ImplicitAPI):
|
|
1198
1198
|
# "side": "buy",
|
1199
1199
|
# "order_id": 136915589622,
|
1200
1200
|
# "price": "64376",
|
1201
|
-
# "amount": "0.0001"
|
1201
|
+
# "amount": "0.0001",
|
1202
|
+
# "role": "taker",
|
1203
|
+
# "fee": "0.0299",
|
1204
|
+
# "fee_ccy": "USDT"
|
1202
1205
|
# }
|
1203
1206
|
#
|
1204
1207
|
timestamp = self.safe_integer(trade, 'created_at')
|
@@ -1207,6 +1210,15 @@ class coinex(Exchange, ImplicitAPI):
|
|
1207
1210
|
defaultType = market['type']
|
1208
1211
|
marketId = self.safe_string(trade, 'market')
|
1209
1212
|
market = self.safe_market(marketId, market, None, defaultType)
|
1213
|
+
feeCostString = self.safe_string(trade, 'fee')
|
1214
|
+
fee = None
|
1215
|
+
if feeCostString is not None:
|
1216
|
+
feeCurrencyId = self.safe_string(trade, 'fee_ccy')
|
1217
|
+
feeCurrencyCode = self.safe_currency_code(feeCurrencyId)
|
1218
|
+
fee = {
|
1219
|
+
'cost': feeCostString,
|
1220
|
+
'currency': feeCurrencyCode,
|
1221
|
+
}
|
1210
1222
|
return self.safe_trade({
|
1211
1223
|
'info': trade,
|
1212
1224
|
'timestamp': timestamp,
|
@@ -1216,11 +1228,11 @@ class coinex(Exchange, ImplicitAPI):
|
|
1216
1228
|
'order': self.safe_string(trade, 'order_id'),
|
1217
1229
|
'type': None,
|
1218
1230
|
'side': self.safe_string(trade, 'side'),
|
1219
|
-
'takerOrMaker':
|
1231
|
+
'takerOrMaker': self.safe_string(trade, 'role'),
|
1220
1232
|
'price': self.safe_string(trade, 'price'),
|
1221
1233
|
'amount': self.safe_string(trade, 'amount'),
|
1222
1234
|
'cost': self.safe_string(trade, 'deal_money'),
|
1223
|
-
'fee':
|
1235
|
+
'fee': fee,
|
1224
1236
|
}, market)
|
1225
1237
|
|
1226
1238
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/gate.py
CHANGED
@@ -9,12 +9,14 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Int, Liquidation, Market, MarketType, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
|
+
from typing import Any
|
12
13
|
from ccxt.base.errors import ExchangeError
|
13
14
|
from ccxt.base.errors import AuthenticationError
|
14
15
|
from ccxt.base.errors import ArgumentsRequired
|
15
16
|
from ccxt.base.errors import BadRequest
|
16
17
|
from ccxt.base.errors import NotSupported
|
17
18
|
from ccxt.base.errors import ChecksumError
|
19
|
+
from ccxt.base.errors import UnsubscribeError
|
18
20
|
from ccxt.base.precise import Precise
|
19
21
|
|
20
22
|
|
@@ -371,6 +373,31 @@ class gate(ccxt.async_support.gate):
|
|
371
373
|
orderbook = await self.subscribe_public(url, messageHash, payload, channel, query, subscription)
|
372
374
|
return orderbook.limit()
|
373
375
|
|
376
|
+
async def un_watch_order_book(self, symbol: str, params={}) -> Any:
|
377
|
+
"""
|
378
|
+
unWatches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
379
|
+
:param str symbol: unified symbol of the market to fetch the order book for
|
380
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
381
|
+
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
|
382
|
+
"""
|
383
|
+
await self.load_markets()
|
384
|
+
market = self.market(symbol)
|
385
|
+
symbol = market['symbol']
|
386
|
+
marketId = market['id']
|
387
|
+
interval = '100ms'
|
388
|
+
interval, params = self.handle_option_and_params(params, 'watchOrderBook', 'interval', interval)
|
389
|
+
messageType = self.get_type_by_market(market)
|
390
|
+
channel = messageType + '.order_book_update'
|
391
|
+
subMessageHash = 'orderbook' + ':' + symbol
|
392
|
+
messageHash = 'unsubscribe:orderbook' + ':' + symbol
|
393
|
+
url = self.get_url_by_market(market)
|
394
|
+
payload = [marketId, interval]
|
395
|
+
limit = self.safe_integer(params, 'limit', 100)
|
396
|
+
if market['contract']:
|
397
|
+
stringLimit = str(limit)
|
398
|
+
payload.append(stringLimit)
|
399
|
+
return await self.un_subscribe_public_multiple(url, 'orderbook', [symbol], [messageHash], [subMessageHash], payload, channel, params)
|
400
|
+
|
374
401
|
def handle_order_book_subscription(self, client: Client, message, subscription):
|
375
402
|
symbol = self.safe_string(subscription, 'symbol')
|
376
403
|
limit = self.safe_integer(subscription, 'limit')
|
@@ -671,6 +698,37 @@ class gate(ccxt.async_support.gate):
|
|
671
698
|
limit = trades.getLimit(tradeSymbol, limit)
|
672
699
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
673
700
|
|
701
|
+
async def un_watch_trades_for_symbols(self, symbols: List[str], params={}) -> Any:
|
702
|
+
"""
|
703
|
+
get the list of most recent trades for a particular symbol
|
704
|
+
:param str symbol: unified symbol of the market to fetch trades for
|
705
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
706
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
707
|
+
"""
|
708
|
+
await self.load_markets()
|
709
|
+
symbols = self.market_symbols(symbols)
|
710
|
+
marketIds = self.market_ids(symbols)
|
711
|
+
market = self.market(symbols[0])
|
712
|
+
messageType = self.get_type_by_market(market)
|
713
|
+
channel = messageType + '.trades'
|
714
|
+
subMessageHashes = []
|
715
|
+
messageHashes = []
|
716
|
+
for i in range(0, len(symbols)):
|
717
|
+
symbol = symbols[i]
|
718
|
+
subMessageHashes.append('trades:' + symbol)
|
719
|
+
messageHashes.append('unsubscribe:trades:' + symbol)
|
720
|
+
url = self.get_url_by_market(market)
|
721
|
+
return await self.un_subscribe_public_multiple(url, 'trades', symbols, messageHashes, subMessageHashes, marketIds, channel, params)
|
722
|
+
|
723
|
+
async def un_watch_trades(self, symbol: str, params={}) -> Any:
|
724
|
+
"""
|
725
|
+
get the list of most recent trades for a particular symbol
|
726
|
+
:param str symbol: unified symbol of the market to fetch trades for
|
727
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
728
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
729
|
+
"""
|
730
|
+
return await self.un_watch_trades_for_symbols([symbol], params)
|
731
|
+
|
674
732
|
def handle_trades(self, client: Client, message):
|
675
733
|
#
|
676
734
|
# {
|
@@ -1445,6 +1503,79 @@ class gate(ccxt.async_support.gate):
|
|
1445
1503
|
if id in client.subscriptions:
|
1446
1504
|
del client.subscriptions[id]
|
1447
1505
|
|
1506
|
+
def handle_un_subscribe(self, client: Client, message):
|
1507
|
+
#
|
1508
|
+
# {
|
1509
|
+
# "time":1725534679,
|
1510
|
+
# "time_ms":1725534679786,
|
1511
|
+
# "id":2,
|
1512
|
+
# "conn_id":"fac539b443fd7002",
|
1513
|
+
# "trace_id":"efe1d282b630b4aa266b84bee177791a",
|
1514
|
+
# "channel":"spot.trades",
|
1515
|
+
# "event":"unsubscribe",
|
1516
|
+
# "payload":[
|
1517
|
+
# "LTC_USDT"
|
1518
|
+
# ],
|
1519
|
+
# "result":{
|
1520
|
+
# "status":"success"
|
1521
|
+
# },
|
1522
|
+
# "requestId":"efe1d282b630b4aa266b84bee177791a"
|
1523
|
+
# }
|
1524
|
+
#
|
1525
|
+
id = self.safe_string(message, 'id')
|
1526
|
+
keys = list(client.subscriptions.keys())
|
1527
|
+
for i in range(0, len(keys)):
|
1528
|
+
messageHash = keys[i]
|
1529
|
+
if not (messageHash in client.subscriptions):
|
1530
|
+
continue
|
1531
|
+
# the previous iteration can have deleted the messageHash from the subscriptions
|
1532
|
+
if messageHash.startswith('unsubscribe'):
|
1533
|
+
subscription = client.subscriptions[messageHash]
|
1534
|
+
subId = self.safe_string(subscription, 'id')
|
1535
|
+
if id != subId:
|
1536
|
+
continue
|
1537
|
+
messageHashes = self.safe_list(subscription, 'messageHashes', [])
|
1538
|
+
subMessageHashes = self.safe_list(subscription, 'subMessageHashes', [])
|
1539
|
+
for j in range(0, len(messageHashes)):
|
1540
|
+
unsubHash = messageHashes[j]
|
1541
|
+
subHash = subMessageHashes[j]
|
1542
|
+
if unsubHash in client.subscriptions:
|
1543
|
+
del client.subscriptions[unsubHash]
|
1544
|
+
if subHash in client.subscriptions:
|
1545
|
+
del client.subscriptions[subHash]
|
1546
|
+
error = UnsubscribeError(self.id + ' ' + messageHash)
|
1547
|
+
client.reject(error, subHash)
|
1548
|
+
client.resolve(True, unsubHash)
|
1549
|
+
self.clean_cache(subscription)
|
1550
|
+
|
1551
|
+
def clean_cache(self, subscription: dict):
|
1552
|
+
topic = self.safe_string(subscription, 'topic', '')
|
1553
|
+
symbols = self.safe_list(subscription, 'symbols', [])
|
1554
|
+
symbolsLength = len(symbols)
|
1555
|
+
if topic == 'ohlcv':
|
1556
|
+
symbolsAndTimeFrames = self.safe_list(subscription, 'symbolsAndTimeframes', [])
|
1557
|
+
for i in range(0, len(symbolsAndTimeFrames)):
|
1558
|
+
symbolAndTimeFrame = symbolsAndTimeFrames[i]
|
1559
|
+
symbol = self.safe_string(symbolAndTimeFrame, 0)
|
1560
|
+
timeframe = self.safe_string(symbolAndTimeFrame, 1)
|
1561
|
+
del self.ohlcvs[symbol][timeframe]
|
1562
|
+
elif symbolsLength > 0:
|
1563
|
+
for i in range(0, len(symbols)):
|
1564
|
+
symbol = symbols[i]
|
1565
|
+
if topic.endswith('trades'):
|
1566
|
+
del self.trades[symbol]
|
1567
|
+
elif topic == 'orderbook':
|
1568
|
+
del self.orderbooks[symbol]
|
1569
|
+
elif topic == 'ticker':
|
1570
|
+
del self.tickers[symbol]
|
1571
|
+
else:
|
1572
|
+
if topic.endswith('trades'):
|
1573
|
+
# don't reset self.myTrades directly here
|
1574
|
+
# because in c# we need to use a different object
|
1575
|
+
keys = list(self.trades.keys())
|
1576
|
+
for i in range(0, len(keys)):
|
1577
|
+
del self.trades[keys[i]]
|
1578
|
+
|
1448
1579
|
def handle_message(self, client: Client, message):
|
1449
1580
|
#
|
1450
1581
|
# subscribe
|
@@ -1541,6 +1672,9 @@ class gate(ccxt.async_support.gate):
|
|
1541
1672
|
if event == 'subscribe':
|
1542
1673
|
self.handle_subscription_status(client, message)
|
1543
1674
|
return
|
1675
|
+
if event == 'unsubscribe':
|
1676
|
+
self.handle_un_subscribe(client, message)
|
1677
|
+
return
|
1544
1678
|
channel = self.safe_string(message, 'channel', '')
|
1545
1679
|
channelParts = channel.split('.')
|
1546
1680
|
channelType = self.safe_value(channelParts, 1)
|
@@ -1645,6 +1779,27 @@ class gate(ccxt.async_support.gate):
|
|
1645
1779
|
message = self.extend(request, params)
|
1646
1780
|
return await self.watch_multiple(url, messageHashes, message, messageHashes)
|
1647
1781
|
|
1782
|
+
async def un_subscribe_public_multiple(self, url, topic, symbols, messageHashes, subMessageHashes, payload, channel, params={}):
|
1783
|
+
requestId = self.request_id()
|
1784
|
+
time = self.seconds()
|
1785
|
+
request: dict = {
|
1786
|
+
'id': requestId,
|
1787
|
+
'time': time,
|
1788
|
+
'channel': channel,
|
1789
|
+
'event': 'unsubscribe',
|
1790
|
+
'payload': payload,
|
1791
|
+
}
|
1792
|
+
sub = {
|
1793
|
+
'id': str(requestId),
|
1794
|
+
'topic': topic,
|
1795
|
+
'unsubscribe': True,
|
1796
|
+
'messageHashes': messageHashes,
|
1797
|
+
'subMessageHashes': subMessageHashes,
|
1798
|
+
'symbols': symbols,
|
1799
|
+
}
|
1800
|
+
message = self.extend(request, params)
|
1801
|
+
return await self.watch_multiple(url, messageHashes, message, messageHashes, sub)
|
1802
|
+
|
1648
1803
|
async def authenticate(self, url, messageType):
|
1649
1804
|
channel = messageType + '.login'
|
1650
1805
|
client = self.client(url)
|
ccxt/pro/kucoin.py
CHANGED
@@ -8,8 +8,10 @@ from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById,
|
|
8
8
|
from ccxt.base.types import Balances, Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
|
9
9
|
from ccxt.async_support.base.ws.client import Client
|
10
10
|
from typing import List
|
11
|
+
from typing import Any
|
11
12
|
from ccxt.base.errors import ExchangeError
|
12
13
|
from ccxt.base.errors import ArgumentsRequired
|
14
|
+
from ccxt.base.errors import UnsubscribeError
|
13
15
|
|
14
16
|
|
15
17
|
class kucoin(ccxt.async_support.kucoin):
|
@@ -153,6 +155,24 @@ class kucoin(ccxt.async_support.kucoin):
|
|
153
155
|
client.subscriptions[requestId] = subscriptionHash
|
154
156
|
return await self.watch_multiple(url, messageHashes, message, subscriptionHashes, subscription)
|
155
157
|
|
158
|
+
async def un_subscribe_multiple(self, url, messageHashes, topic, subscriptionHashes, params={}, subscription: dict = None):
|
159
|
+
requestId = str(self.request_id())
|
160
|
+
request: dict = {
|
161
|
+
'id': requestId,
|
162
|
+
'type': 'unsubscribe',
|
163
|
+
'topic': topic,
|
164
|
+
'response': True,
|
165
|
+
}
|
166
|
+
message = self.extend(request, params)
|
167
|
+
if subscription is not None:
|
168
|
+
subscription[requestId] = requestId
|
169
|
+
client = self.client(url)
|
170
|
+
for i in range(0, len(subscriptionHashes)):
|
171
|
+
subscriptionHash = subscriptionHashes[i]
|
172
|
+
if not (subscriptionHash in client.subscriptions):
|
173
|
+
client.subscriptions[requestId] = subscriptionHash
|
174
|
+
return await self.watch_multiple(url, messageHashes, message, subscriptionHashes, subscription)
|
175
|
+
|
156
176
|
async def watch_ticker(self, symbol: str, params={}) -> Ticker:
|
157
177
|
"""
|
158
178
|
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
@@ -477,6 +497,46 @@ class kucoin(ccxt.async_support.kucoin):
|
|
477
497
|
limit = trades.getLimit(tradeSymbol, limit)
|
478
498
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
479
499
|
|
500
|
+
async def un_watch_trades_for_symbols(self, symbols: List[str], params={}) -> Any:
|
501
|
+
"""
|
502
|
+
unWatches trades stream
|
503
|
+
:see: https://www.kucoin.com/docs/websocket/spot-trading/public-channels/match-execution-data
|
504
|
+
:param str symbol: unified symbol of the market to fetch trades for
|
505
|
+
:param int [since]: timestamp in ms of the earliest trade to fetch
|
506
|
+
:param int [limit]: the maximum amount of trades to fetch
|
507
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
508
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
509
|
+
"""
|
510
|
+
await self.load_markets()
|
511
|
+
symbols = self.market_symbols(symbols, None, False)
|
512
|
+
marketIds = self.market_ids(symbols)
|
513
|
+
url = await self.negotiate(False)
|
514
|
+
messageHashes = []
|
515
|
+
subscriptionHashes = []
|
516
|
+
topic = '/market/match:' + ','.join(marketIds)
|
517
|
+
for i in range(0, len(symbols)):
|
518
|
+
symbol = symbols[i]
|
519
|
+
messageHashes.append('unsubscribe:trades:' + symbol)
|
520
|
+
subscriptionHashes.append('trades:' + symbol)
|
521
|
+
subscription = {
|
522
|
+
'messageHashes': messageHashes,
|
523
|
+
'subMessageHashes': subscriptionHashes,
|
524
|
+
'topic': 'trades',
|
525
|
+
'unsubscribe': True,
|
526
|
+
'symbols': symbols,
|
527
|
+
}
|
528
|
+
return await self.un_subscribe_multiple(url, messageHashes, topic, messageHashes, params, subscription)
|
529
|
+
|
530
|
+
async def un_watch_trades(self, symbol: str, params={}) -> Any:
|
531
|
+
"""
|
532
|
+
unWatches trades stream
|
533
|
+
:see: https://www.kucoin.com/docs/websocket/spot-trading/public-channels/match-execution-data
|
534
|
+
:param str symbol: unified symbol of the market to fetch trades for
|
535
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
536
|
+
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
537
|
+
"""
|
538
|
+
return await self.un_watch_trades_for_symbols([symbol], params)
|
539
|
+
|
480
540
|
def handle_trade(self, client: Client, message):
|
481
541
|
#
|
482
542
|
# {
|
@@ -731,6 +791,53 @@ class kucoin(ccxt.async_support.kucoin):
|
|
731
791
|
method = self.safe_value(subscription, 'method')
|
732
792
|
if method is not None:
|
733
793
|
method(client, message, subscription)
|
794
|
+
isUnSub = self.safe_bool(subscription, 'unsubscribe', False)
|
795
|
+
if isUnSub:
|
796
|
+
messageHashes = self.safe_list(subscription, 'messageHashes', [])
|
797
|
+
subMessageHashes = self.safe_list(subscription, 'subMessageHashes', [])
|
798
|
+
for i in range(0, len(messageHashes)):
|
799
|
+
messageHash = messageHashes[i]
|
800
|
+
subHash = subMessageHashes[i]
|
801
|
+
if messageHash in client.subscriptions:
|
802
|
+
del client.subscriptions[messageHash]
|
803
|
+
if subHash in client.subscriptions:
|
804
|
+
del client.subscriptions[subHash]
|
805
|
+
error = UnsubscribeError(self.id + ' ' + subHash)
|
806
|
+
client.reject(error, subHash)
|
807
|
+
client.resolve(True, messageHash)
|
808
|
+
self.clean_cache(subscription)
|
809
|
+
|
810
|
+
def clean_cache(self, subscription: dict):
|
811
|
+
topic = self.safe_string(subscription, 'topic')
|
812
|
+
symbols = self.safe_list(subscription, 'symbols', [])
|
813
|
+
symbolsLength = len(symbols)
|
814
|
+
if symbolsLength > 0:
|
815
|
+
for i in range(0, len(symbols)):
|
816
|
+
symbol = symbols[i]
|
817
|
+
if topic == 'trades':
|
818
|
+
if symbol in self.trades:
|
819
|
+
del self.trades[symbol]
|
820
|
+
elif topic == 'orderbook':
|
821
|
+
if symbol in self.orderbooks:
|
822
|
+
del self.orderbooks[symbol]
|
823
|
+
elif topic == 'ticker':
|
824
|
+
if symbol in self.tickers:
|
825
|
+
del self.tickers[symbol]
|
826
|
+
else:
|
827
|
+
if topic == 'myTrades':
|
828
|
+
# don't reset self.myTrades directly here
|
829
|
+
# because in c# we need to use a different object
|
830
|
+
keys = list(self.myTrades.keys())
|
831
|
+
for i in range(0, len(keys)):
|
832
|
+
del self.myTrades[keys[i]]
|
833
|
+
elif topic == 'orders':
|
834
|
+
orderSymbols = list(self.orders.keys())
|
835
|
+
for i in range(0, len(orderSymbols)):
|
836
|
+
del self.orders[orderSymbols[i]]
|
837
|
+
elif topic == 'ticker':
|
838
|
+
tickerSymbols = list(self.tickers.keys())
|
839
|
+
for i in range(0, len(tickerSymbols)):
|
840
|
+
del self.tickers[tickerSymbols[i]]
|
734
841
|
|
735
842
|
def handle_system_status(self, client: Client, message):
|
736
843
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.3.
|
3
|
+
Version: 4.3.97
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
|
5
5
|
Home-page: https://ccxt.com
|
6
6
|
Author: Igor Kroitor
|
@@ -272,13 +272,13 @@ console.log(version, Object.keys(exchanges));
|
|
272
272
|
|
273
273
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
274
274
|
|
275
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
276
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
275
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.97/dist/ccxt.browser.min.js
|
276
|
+
* unpkg: https://unpkg.com/ccxt@4.3.97/dist/ccxt.browser.min.js
|
277
277
|
|
278
278
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
279
279
|
|
280
280
|
```HTML
|
281
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
281
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.97/dist/ccxt.browser.min.js"></script>
|
282
282
|
```
|
283
283
|
|
284
284
|
Creates a global `ccxt` object:
|
@@ -1,10 +1,10 @@
|
|
1
|
-
ccxt/__init__.py,sha256=
|
1
|
+
ccxt/__init__.py,sha256=kpYw9B4E5ksqx39E5OpUQX7kxtQCdfCcPA7ovtP9Ka8,16486
|
2
2
|
ccxt/ace.py,sha256=3KFlbRm6N9hXsKUsgZbQCFPZT5WGLm4HOjR19Q3uPts,42419
|
3
3
|
ccxt/alpaca.py,sha256=nVQJ8vG4JrjEvMlu_nPoyR2lBq41j9Z2smPq95nDhng,47504
|
4
4
|
ccxt/ascendex.py,sha256=qYzddORwUgXBOuvuRi3AtaH2srPYr21MOT2THdrXyLE,151540
|
5
5
|
ccxt/bequant.py,sha256=RBiAmaTbL35DgiV3Hl6uchLUd78V0z1T9riTlNsrpdc,1174
|
6
6
|
ccxt/bigone.py,sha256=RiEDQutD2BtvKfwVvAo2T9_DPqr0oa6ZJFDXph_g1UI,93122
|
7
|
-
ccxt/binance.py,sha256=
|
7
|
+
ccxt/binance.py,sha256=mEgPDVGYzf93lRJhdINcnI73DJZro2_leWUebA7iLcM,641554
|
8
8
|
ccxt/binancecoinm.py,sha256=arFnEh8mErSyi23eVPWE4iwoT7PWQyxGGVJCKCy6UJY,1702
|
9
9
|
ccxt/binanceus.py,sha256=hdcT4OnadcdFFFjF3GtM0nWv90jqojqwdVS3xWGuW40,9163
|
10
10
|
ccxt/binanceusdm.py,sha256=bAPcJj5HLxoCdPolriM8sJpoTBwbV78vBTbKRmWhNP4,2632
|
@@ -42,7 +42,7 @@ ccxt/coinbaseadvanced.py,sha256=d5g6nRx-NCcCwZDdtp8FsI2D-pRjSvnAP9ISSKY_nCQ,538
|
|
42
42
|
ccxt/coinbaseexchange.py,sha256=7fdLpBd_Do9Fd1_6bfgwYGJkOv6tQIFbsXKFTX0qYAQ,78943
|
43
43
|
ccxt/coinbaseinternational.py,sha256=JHciYqg_ZcVXWAUBj_zlcaUKfSjOL6CQmoAtO8ZbtSE,97484
|
44
44
|
ccxt/coincheck.py,sha256=SeNvZm_3p01IsW8y6b3rw67qiMu29S59HHPG6Jma_T4,35942
|
45
|
-
ccxt/coinex.py,sha256=
|
45
|
+
ccxt/coinex.py,sha256=__ESSoFpz01uydvyK5uslqwQxTt-jqCbDErK-4BgN50,257309
|
46
46
|
ccxt/coinlist.py,sha256=Z2v-sn9_K3JUt42tQX5Naq3p55fH2giM2-fnSx--O2k,104123
|
47
47
|
ccxt/coinmate.py,sha256=BkPcT92OQFeUQtnLDIkl-Sg0PcLrQ87RfHMFIybJoWk,46190
|
48
48
|
ccxt/coinmetro.py,sha256=1HqUu4ScH4oZbloodvn0l25y7DaUMl_5MjBf5v8z_cA,80591
|
@@ -218,13 +218,13 @@ ccxt/abstract/xt.py,sha256=JkWvsic3L2O968BCr9H5Wd5NIbRE9aTT2A-9WbAtl0c,27146
|
|
218
218
|
ccxt/abstract/yobit.py,sha256=8ycfCO8ORFly9hc0Aa47sZyX4_ZKPXS9h9yJzI-uQ7Q,1339
|
219
219
|
ccxt/abstract/zaif.py,sha256=m15WHdl3gYy0GOXNZ8NEH8eE7sVh8c0T_ITNuU8vXeU,3935
|
220
220
|
ccxt/abstract/zonda.py,sha256=X-hCW0SdX3YKZWixDyW-O2211M58Rno8kKJ6quY7rw4,7183
|
221
|
-
ccxt/async_support/__init__.py,sha256=
|
221
|
+
ccxt/async_support/__init__.py,sha256=KePoEzOs1lPbGIfbYtCeGGidsTP00wmODPSW_L92Yog,16289
|
222
222
|
ccxt/async_support/ace.py,sha256=ucCkKaWRkILAIK9g4iEi1Q_-zmn0V89-rX8Al4WdK8s,42643
|
223
223
|
ccxt/async_support/alpaca.py,sha256=HxonsP_MzbE7Z9r6hZ1rgmf_jPcP4H7H3z1YQgCv4qc,47716
|
224
224
|
ccxt/async_support/ascendex.py,sha256=Yj4_0UHGd-cYY8s3vqu_zEwa6BLmqPYy6ztKapkuEaw,152353
|
225
225
|
ccxt/async_support/bequant.py,sha256=1hTwHovo1bW1XTIc8ZKjvJ-Xg6LfmpGdzT7TepykaVM,1188
|
226
226
|
ccxt/async_support/bigone.py,sha256=A7AjX0iWl2twYRwOc-2tKUbnI4KNmO2QVetMaAJujpg,93576
|
227
|
-
ccxt/async_support/binance.py,sha256=
|
227
|
+
ccxt/async_support/binance.py,sha256=EksRZxcbu72kYp2VPy7USViYSTtJOEHoP5_Vif4Ixu8,644288
|
228
228
|
ccxt/async_support/binancecoinm.py,sha256=yeE73xG5UXD_X3VPul6DMGnV_mgJfWYskpas1BUDdCU,1740
|
229
229
|
ccxt/async_support/binanceus.py,sha256=c-K3Tk7LaRJjmYdCx8vBOqsx01uXrtvt0PC2ekBiD0g,9177
|
230
230
|
ccxt/async_support/binanceusdm.py,sha256=8ugRkx7vyYmn67wdkEEf2f-DFMGAoC4t09usKlPVNyw,2670
|
@@ -262,7 +262,7 @@ ccxt/async_support/coinbaseadvanced.py,sha256=Kupwnuxiu_qTjwCNV2asacoDUNFQvcaHNA
|
|
262
262
|
ccxt/async_support/coinbaseexchange.py,sha256=f19V1ImoyhYNllwWxygVWuJuu7F6_LXcthgIeXEHiDM,79449
|
263
263
|
ccxt/async_support/coinbaseinternational.py,sha256=o7Fhezgb75wSyxzyH0hHYzRaNnQvkZtpylXdYYgRedo,98098
|
264
264
|
ccxt/async_support/coincheck.py,sha256=N_0cDMAiFRC4G--QgOmSH8esKDr_lEVZUpukc4QoHk8,36148
|
265
|
-
ccxt/async_support/coinex.py,sha256=
|
265
|
+
ccxt/async_support/coinex.py,sha256=Rdj2sthSVkATxJ9tAmPSWRnPf1gBpfNExm6j3lgPFgA,258567
|
266
266
|
ccxt/async_support/coinlist.py,sha256=NTN-W6Jm4fcwvBHRcSB6yj4QTeNrMg5IyZiYpkKUGZ0,104611
|
267
267
|
ccxt/async_support/coinmate.py,sha256=NI58zYMkuOL9lB3UFzyjUNbuFZGrtjZbb4PBFTOsbz4,46456
|
268
268
|
ccxt/async_support/coinmetro.py,sha256=BloSsFuLoLTt_lnaZL051g75Yn1M2LIf7kMCZLOiYTc,80911
|
@@ -330,7 +330,7 @@ ccxt/async_support/yobit.py,sha256=GQhvYrsGHQrVdTrNHQxx9isEGqUABexlllzao9HL3f8,5
|
|
330
330
|
ccxt/async_support/zaif.py,sha256=-ZTr8M2JaIRCL90VrbCDXBMAsZwbiwsFChSQ2rWODuQ,29044
|
331
331
|
ccxt/async_support/zonda.py,sha256=jncr6Wg12S72CTpu6mCKCse1pm1f8oefVQurQSrFvP0,81733
|
332
332
|
ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
|
333
|
-
ccxt/async_support/base/exchange.py,sha256=
|
333
|
+
ccxt/async_support/base/exchange.py,sha256=Z5NWBh-Y8mBiHecmZXh-brYALoWdLzzoFmGm4_pvOsg,110678
|
334
334
|
ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
|
335
335
|
ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
|
336
336
|
ccxt/async_support/base/ws/aiohttp_client.py,sha256=5IEiT0elWI9a7Vr-KV0jgmlbpLJWBzIlrLaCkTKGaqY,5752
|
@@ -344,10 +344,10 @@ ccxt/async_support/base/ws/order_book_side.py,sha256=GhnGUt78pJ-AYL_Dq9produGjmB
|
|
344
344
|
ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
|
345
345
|
ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
|
346
346
|
ccxt/base/errors.py,sha256=Pad-6ugvGUwhoYuKUliX-N7FTrcnKCQGFjsaq2tMn0I,4610
|
347
|
-
ccxt/base/exchange.py,sha256=
|
347
|
+
ccxt/base/exchange.py,sha256=CK7KRGBpym1C3eOfJPJVZzzwrclrWOUQRP4ZtrulvtU,295943
|
348
348
|
ccxt/base/precise.py,sha256=koce64Yrp6vFbGijJtUt-QQ6XhJgeGTCksZ871FPp_A,8886
|
349
349
|
ccxt/base/types.py,sha256=TaP_RElKjGEZWuzyp4o4u2YhREyTG3rUeVT6gDffY9A,9613
|
350
|
-
ccxt/pro/__init__.py,sha256=
|
350
|
+
ccxt/pro/__init__.py,sha256=wN1_kV6w3gXi2N9MmQzZaj3REboBkGrcvY55-2SpXf8,7710
|
351
351
|
ccxt/pro/alpaca.py,sha256=xh1yg1Ok-Zh_Mfx-MBjNrfJDs6MUU0exFfEj3GuQPC4,27631
|
352
352
|
ccxt/pro/ascendex.py,sha256=QueLgISoIxgGSOta2W7En4pwAsEXbTP5q5ef4UjpTQQ,37524
|
353
353
|
ccxt/pro/bequant.py,sha256=33OEUWBi4D9-2w8CmkwN3aF1qS-AlLqX3pxrWwNbXPY,1552
|
@@ -382,7 +382,7 @@ ccxt/pro/cryptocom.py,sha256=jJgBlJOzAWemQEQCiw1sNpEuX3RbqpIqwd9cPd3ZtP0,54607
|
|
382
382
|
ccxt/pro/currencycom.py,sha256=8B9pSuPyO0ROCWOROUFoNbJBeOU3bRmlKXSj1CBMkPI,22459
|
383
383
|
ccxt/pro/deribit.py,sha256=DG3UJE8VWuydP64_CJzDqmRC0vqc9ViBvQr28gW_nhY,41094
|
384
384
|
ccxt/pro/exmo.py,sha256=n44MqOwY-tSt0TFNhQKydjxRJoSbrMVBzL4NNswOZm4,24542
|
385
|
-
ccxt/pro/gate.py,sha256=
|
385
|
+
ccxt/pro/gate.py,sha256=lykOS-yeTZUN1YLOcZpa9H9Ym-oKfzofVpq7H5jZI6k,86576
|
386
386
|
ccxt/pro/gateio.py,sha256=_uBWXYQbmsHRivKnZOJDmxJ9tWLO_0HAxmOjAEUy9nE,391
|
387
387
|
ccxt/pro/gemini.py,sha256=8B8dbYPbKbZb3lzhlt8-x0oybQxOHr8Q4R_f5edLwbU,36899
|
388
388
|
ccxt/pro/hashkey.py,sha256=F-NAOAeNSEjHyuZnvGiIYHQow5RAKcwgyb23cGwOiJs,34065
|
@@ -396,7 +396,7 @@ ccxt/pro/idex.py,sha256=WAY58yMHFUPoqZUGFvzxqcKizvMuFXqdZ6BD0WgstQA,28361
|
|
396
396
|
ccxt/pro/independentreserve.py,sha256=JWMjJ0FUs4LhybAZ4rjHMQIWeOu5Njaj8aVimA7kf30,11356
|
397
397
|
ccxt/pro/kraken.py,sha256=hrYXzL-CLCgm0BbQBjNOoiAfC57Ca5JTiD_24eIvikM,63840
|
398
398
|
ccxt/pro/krakenfutures.py,sha256=Y9vqrxNbr7OJ0BIMZqrVtMedUzk7XtOZuF_OGQ2tUJc,64033
|
399
|
-
ccxt/pro/kucoin.py,sha256=
|
399
|
+
ccxt/pro/kucoin.py,sha256=v1a4ksoQCHj1fht_ENJ6OASFbW4AJ3asMw_8DuiWDsI,59505
|
400
400
|
ccxt/pro/kucoinfutures.py,sha256=gMRflEtuO_S_cuhhVOtIwarL_Nk9ThAmGqyvUncVqHc,50331
|
401
401
|
ccxt/pro/lbank.py,sha256=p6Ynjmud9B3Yw1SGTPdTB36AW4KtyR1JOotqFBdyyxs,35083
|
402
402
|
ccxt/pro/luno.py,sha256=ThXkXNrLvp9BW8XXxRcbpRaw9QcLCS2f2tCqbF6qpEU,12384
|
@@ -650,8 +650,8 @@ ccxt/test/tests_async.py,sha256=f4Q7u2feejQp5rh3-4oB6XDNZ7_gkaZbkHqAu1wGyIU,8457
|
|
650
650
|
ccxt/test/tests_helpers.py,sha256=xhOILoZ_x3RSfQjtKt6AQlkp9DkOtpTQe8GAUUZoM6s,10069
|
651
651
|
ccxt/test/tests_init.py,sha256=eVwwUHujX9t4rjgo4TqEeg7DDhR1Hb_e2SJN8NVGyl0,998
|
652
652
|
ccxt/test/tests_sync.py,sha256=ZFBHhpfH40I0VkpOdQo-8h2ccUMIEiKGppElvf1myK8,83635
|
653
|
-
ccxt-4.3.
|
654
|
-
ccxt-4.3.
|
655
|
-
ccxt-4.3.
|
656
|
-
ccxt-4.3.
|
657
|
-
ccxt-4.3.
|
653
|
+
ccxt-4.3.97.dist-info/LICENSE.txt,sha256=EIb9221AhMHV7xF1_55STFdKTFsnJVJYkRpY2Lnvo5w,1068
|
654
|
+
ccxt-4.3.97.dist-info/METADATA,sha256=COjpy0vFMszTHCx1mtiBsV_ig1uyTPq3BaMhi8J34qo,118342
|
655
|
+
ccxt-4.3.97.dist-info/WHEEL,sha256=z9j0xAa_JmUKMpmz72K0ZGALSM_n-wQVmGbleXx2VHg,110
|
656
|
+
ccxt-4.3.97.dist-info/top_level.txt,sha256=CkQDuCTDKNcImPV60t36G6MdYfxsAPNiSaEwifVoVMo,5
|
657
|
+
ccxt-4.3.97.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|