`kraken.`: drop trade history query limit

explicit_write_pps_on_exit
Tyler Goodlet 2023-03-01 17:34:38 -05:00
parent f53f4df583
commit 569df45d18
1 changed files with 7 additions and 3 deletions

View File

@ -221,7 +221,7 @@ class Client:
async def get_trades( async def get_trades(
self, self,
fetch_limit: int = 10, fetch_limit: int | None = None,
) -> dict[str, Any]: ) -> dict[str, Any]:
''' '''
@ -233,7 +233,10 @@ class Client:
trades_by_id: dict[str, Any] = {} trades_by_id: dict[str, Any] = {}
for i in itertools.count(): for i in itertools.count():
if i >= fetch_limit: if (
fetch_limit
and i >= fetch_limit
):
break break
# increment 'ofs' pagination offset # increment 'ofs' pagination offset
@ -246,7 +249,8 @@ class Client:
by_id = resp['result']['trades'] by_id = resp['result']['trades']
trades_by_id.update(by_id) trades_by_id.update(by_id)
# we can get up to 50 results per query # can get up to 50 results per query, see:
# https://docs.kraken.com/rest/#tag/User-Data/operation/getTradeHistory
if ( if (
len(by_id) < 50 len(by_id) < 50
): ):