unicex 0.15.2__py3-none-any.whl → 0.16.0__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.
- unicex/_abc/exchange_info.py +1 -1
- unicex/_abc/uni_client.py +1 -1
- unicex/_abc/uni_websocket_manager.py +1 -1
- unicex/_base/client.py +7 -0
- unicex/binance/adapter.py +5 -1
- unicex/bingx/adapter.py +1 -1
- unicex/bingx/uni_websocket_manager.py +2 -2
- unicex/bingx/websocket_manager.py +2 -4
- unicex/bitget/adapter.py +1 -0
- unicex/bitget/uni_websocket_manager.py +21 -4
- unicex/bitget/websocket_manager.py +2 -4
- unicex/bybit/adapter.py +1 -0
- unicex/bybit/websocket_manager.py +7 -24
- unicex/extra.py +23 -23
- unicex/gate/adapter.py +103 -0
- unicex/gate/uni_websocket_manager.py +41 -7
- unicex/hyperliquid/adapter.py +1 -0
- unicex/kucoin/adapter.py +4 -9
- unicex/kucoin/client.py +13 -0
- unicex/kucoin/uni_client.py +2 -14
- unicex/mexc/_spot_ws_proto/__init__.py +335 -335
- unicex/mexc/adapter.py +104 -0
- unicex/mexc/uni_websocket_manager.py +25 -7
- unicex/mexc/websocket_manager.py +26 -5
- unicex/okx/adapter.py +51 -0
- unicex/okx/uni_websocket_manager.py +44 -7
- unicex/types.py +6 -3
- unicex/utils.py +22 -1
- {unicex-0.15.2.dist-info → unicex-0.16.0.dist-info}/METADATA +5 -5
- {unicex-0.15.2.dist-info → unicex-0.16.0.dist-info}/RECORD +33 -33
- {unicex-0.15.2.dist-info → unicex-0.16.0.dist-info}/WHEEL +0 -0
- {unicex-0.15.2.dist-info → unicex-0.16.0.dist-info}/licenses/LICENSE +0 -0
- {unicex-0.15.2.dist-info → unicex-0.16.0.dist-info}/top_level.txt +0 -0
unicex/kucoin/uni_client.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
__all__ = ["UniClient"]
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import time
|
|
5
4
|
from typing import overload
|
|
6
5
|
|
|
7
6
|
from unicex._abc import IUniClient
|
|
@@ -181,19 +180,8 @@ class UniClient(IUniClient[Client]):
|
|
|
181
180
|
"""
|
|
182
181
|
if not symbol:
|
|
183
182
|
raise ValueError("Symbol is required to fetch Kucoin funding rate")
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
# Kucoin публикует ставку каждые 8 часов, берем окно в 24 часа для гарантии наличия записи.
|
|
187
|
-
start_time = end_time - 24 * 60 * 60 * 1000
|
|
188
|
-
raw_data = await self._client.funding_rate_history(
|
|
189
|
-
symbol=symbol,
|
|
190
|
-
start_at=start_time,
|
|
191
|
-
end_at=end_time,
|
|
192
|
-
)
|
|
193
|
-
adapted_data = Adapter.funding_rate(raw_data)
|
|
194
|
-
if symbol not in adapted_data:
|
|
195
|
-
raise ValueError(f"Kucoin funding rate history is empty for {symbol}")
|
|
196
|
-
return adapted_data[symbol]
|
|
183
|
+
raw_data = await self._client.funding_rate(symbol=symbol)
|
|
184
|
+
return Adapter.funding_rate(raw_data)
|
|
197
185
|
|
|
198
186
|
@overload
|
|
199
187
|
async def open_interest(self, symbol: str) -> OpenInterestItem: ...
|