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.
@@ -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
- end_time = int(time.time() * 1000)
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: ...