unicex 0.10.2__tar.gz → 0.10.3__tar.gz
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.
- {unicex-0.10.2/unicex.egg-info → unicex-0.10.3}/PKG-INFO +1 -1
- {unicex-0.10.2 → unicex-0.10.3}/pyproject.toml +1 -1
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_base/websocket.py +1 -2
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/adapter.py +27 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/uni_websocket_manager.py +15 -3
- {unicex-0.10.2 → unicex-0.10.3/unicex.egg-info}/PKG-INFO +1 -1
- {unicex-0.10.2 → unicex-0.10.3}/LICENSE +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/README.md +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/setup.cfg +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_abc/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_abc/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_abc/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_abc/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_base/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/_base/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/adapter.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/binance/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/adapter.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bitget/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/bybit/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/enums.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/exceptions.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/extra.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/adapter.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/gateio/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/adapter.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/hyperliquid/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mapper.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PrivateAccountV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PrivateDealsV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PrivateOrdersV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicAggreBookTickerV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicAggreDealsV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicAggreDepthsV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicBookTickerBatchV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicBookTickerV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicDealsV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicFuture_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicIncreaseDepthsBatchV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicIncreaseDepthsV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicLimitDepthsV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicMiniTickerV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicMiniTickersV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicSpotKlineV3Api_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PushDataV3ApiWrapper_pb2.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/adapter.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/__init__.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/adapter.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/exchange_info.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/uni_client.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/uni_websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/user_websocket.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/okx/websocket_manager.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/types.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex/utils.py +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex.egg-info/SOURCES.txt +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex.egg-info/dependency_links.txt +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex.egg-info/requires.txt +0 -0
- {unicex-0.10.2 → unicex-0.10.3}/unicex.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ name = "unicex"
|
|
|
4
4
|
# • PATCH (x.y.Z) → увеличивается при багфиксе, который не ломает совместимость.
|
|
5
5
|
# • MINOR (x.Y.z) → увеличивается при добавлении новой функциональности, но без ломающих изменений (backward-compatible).
|
|
6
6
|
# • MAJOR (X.y.z) → увеличивается при изменениях, которые ломают обратную совместимость.
|
|
7
|
-
version = "0.10.
|
|
7
|
+
version = "0.10.3"
|
|
8
8
|
|
|
9
9
|
description = "Unified Crypto Exchange API "
|
|
10
10
|
readme = "README.md"
|
|
@@ -199,13 +199,12 @@ class Websocket:
|
|
|
199
199
|
try:
|
|
200
200
|
data = await self._queue.get() # Получаем сообщение
|
|
201
201
|
await self._callback(data) # Передаем в callback
|
|
202
|
+
self._queue.task_done()
|
|
202
203
|
except asyncio.exceptions.CancelledError:
|
|
203
204
|
break
|
|
204
205
|
except Exception as e:
|
|
205
206
|
self._logger.error(f"Error({type(e)}) while processing message: {e}")
|
|
206
207
|
|
|
207
|
-
self._queue.task_done()
|
|
208
|
-
|
|
209
208
|
def _generate_ws_kwargs(self) -> dict:
|
|
210
209
|
"""Генерирует аргументы для запуска вебсокета."""
|
|
211
210
|
ws_kwargs = {}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
__all__ = ["Adapter"]
|
|
2
2
|
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
5
|
from unicex.types import (
|
|
5
6
|
KlineDict,
|
|
@@ -7,6 +8,7 @@ from unicex.types import (
|
|
|
7
8
|
OpenInterestItem,
|
|
8
9
|
TickerDailyDict,
|
|
9
10
|
TickerDailyItem,
|
|
11
|
+
TradeDict,
|
|
10
12
|
)
|
|
11
13
|
from unicex.utils import catch_adapter_errors, decorate_all_methods
|
|
12
14
|
|
|
@@ -125,3 +127,28 @@ class Adapter:
|
|
|
125
127
|
key=lambda x: int(x[0]),
|
|
126
128
|
)
|
|
127
129
|
]
|
|
130
|
+
|
|
131
|
+
@staticmethod
|
|
132
|
+
def Klines_message(raw_msg: Any) -> list[KlineDict]:
|
|
133
|
+
symbol = raw_msg["topic"].split(".")[-1]
|
|
134
|
+
return [
|
|
135
|
+
KlineDict(
|
|
136
|
+
s=symbol,
|
|
137
|
+
t=kline["start"],
|
|
138
|
+
o=float(kline["open"]),
|
|
139
|
+
h=float(kline["high"]),
|
|
140
|
+
l=float(kline["low"]),
|
|
141
|
+
c=float(kline["close"]),
|
|
142
|
+
v=float(kline["volume"]),
|
|
143
|
+
q=float(kline["turnover"]),
|
|
144
|
+
T=kline["end"],
|
|
145
|
+
x=kline["confirm"],
|
|
146
|
+
)
|
|
147
|
+
for kline in raw_msg["data"]
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
@staticmethod
|
|
151
|
+
def aggtrades_message(raw_msg: Any) -> list[TradeDict]: ...
|
|
152
|
+
|
|
153
|
+
@staticmethod
|
|
154
|
+
def trades_message(raw_msg: Any) -> list[TradeDict]: ...
|
|
@@ -5,7 +5,7 @@ from typing import Any, overload
|
|
|
5
5
|
|
|
6
6
|
from unicex._abc import IUniWebsocketManager
|
|
7
7
|
from unicex._base import Websocket
|
|
8
|
-
from unicex.enums import Timeframe
|
|
8
|
+
from unicex.enums import Exchange, Timeframe
|
|
9
9
|
from unicex.types import LoggerLike
|
|
10
10
|
|
|
11
11
|
from .adapter import Adapter
|
|
@@ -72,7 +72,13 @@ class UniWebsocketManager(IUniWebsocketManager):
|
|
|
72
72
|
Возвращает:
|
|
73
73
|
`Websocket`: Экземпляр вебсокета для управления соединением.
|
|
74
74
|
"""
|
|
75
|
-
|
|
75
|
+
return self._websocket_manager.klines(
|
|
76
|
+
callback=self._make_wrapper(self._adapter.Klines_message, callback),
|
|
77
|
+
category="spot",
|
|
78
|
+
interval=timeframe.to_exchange_format(Exchange.BYBIT), # type: ignore
|
|
79
|
+
symbol=symbol,
|
|
80
|
+
symbols=symbols,
|
|
81
|
+
)
|
|
76
82
|
|
|
77
83
|
@overload
|
|
78
84
|
def futures_klines(
|
|
@@ -114,7 +120,13 @@ class UniWebsocketManager(IUniWebsocketManager):
|
|
|
114
120
|
Возвращает:
|
|
115
121
|
`Websocket`: Экземпляр вебсокета.
|
|
116
122
|
"""
|
|
117
|
-
|
|
123
|
+
return self._websocket_manager.klines(
|
|
124
|
+
callback=self._make_wrapper(self._adapter.Klines_message, callback),
|
|
125
|
+
category="linear",
|
|
126
|
+
interval=timeframe.to_exchange_format(Exchange.BYBIT), # type: ignore
|
|
127
|
+
symbol=symbol,
|
|
128
|
+
symbols=symbols,
|
|
129
|
+
)
|
|
118
130
|
|
|
119
131
|
@overload
|
|
120
132
|
def trades(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicAggreBookTickerV3Api_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicBookTickerBatchV3Api_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unicex-0.10.2 → unicex-0.10.3}/unicex/mexc/_spot_ws_proto/PublicIncreaseDepthsBatchV3Api_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|