chore: make some internal fetch-trades methods require since

This commit is contained in:
Matthias
2025-01-27 20:36:14 +01:00
parent 9b0beb0e6d
commit 62e3f408a6
3 changed files with 7 additions and 7 deletions

View File

@@ -444,7 +444,7 @@ def _download_trades_history(
if not trades.empty and since < trades.iloc[-1]["timestamp"]:
# Reset since to the last available point
# - 5 seconds (to ensure we're getting all trades)
since = trades.iloc[-1]["timestamp"] - (5 * 1000)
since = int(trades.iloc[-1]["timestamp"] - (5 * 1000))
logger.info(
f"Using last trade date -5s - Downloading trades for {pair} "
f"since: {format_ms_time(since)}."

View File

@@ -363,7 +363,7 @@ class Binance(Exchange):
return {}
async def _async_get_trade_history_id_startup(
self, pair: str, since: int | None
self, pair: str, since: int
) -> tuple[list[list], str]:
"""
override for initial call

View File

@@ -2960,7 +2960,7 @@ class Exchange:
return trades[-1].get("timestamp")
async def _async_get_trade_history_id_startup(
self, pair: str, since: int | None
self, pair: str, since: int
) -> tuple[list[list], str]:
"""
override for initial trade_history_id call
@@ -2968,7 +2968,7 @@ class Exchange:
return await self._async_fetch_trades(pair, since=since)
async def _async_get_trade_history_id(
self, pair: str, until: int, since: int | None = None, from_id: str | None = None
self, pair: str, *, until: int, since: int, from_id: str | None = None
) -> tuple[str, list[list]]:
"""
Asynchronously gets trade history using fetch_trades
@@ -3022,7 +3022,7 @@ class Exchange:
return (pair, trades)
async def _async_get_trade_history_time(
self, pair: str, until: int, since: int | None = None
self, pair: str, until: int, since: int
) -> tuple[str, list[list]]:
"""
Asynchronously gets trade history using fetch_trades,
@@ -3063,7 +3063,7 @@ class Exchange:
async def _async_get_trade_history(
self,
pair: str,
since: int | None = None,
since: int,
until: int | None = None,
from_id: str | None = None,
) -> tuple[str, list[list]]:
@@ -3094,7 +3094,7 @@ class Exchange:
def get_historic_trades(
self,
pair: str,
since: int | None = None,
since: int,
until: int | None = None,
from_id: str | None = None,
) -> tuple[str, list]: