1
0

Kucoin order details now handle pagination correctly

This commit is contained in:
Jon Michael Aanes 2024-12-14 23:38:47 +01:00
parent 61a980387e
commit 99a5dc82e4
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -242,9 +242,16 @@ class KucoinDepoFetcher(DepoFetcher):
for _weeks_back in range(20): for _weeks_back in range(20):
end_time = end_time - datetime.timedelta(days=7) end_time = end_time - datetime.timedelta(days=7)
timestamp = int(end_time.timestamp() * 1000) timestamp = int(end_time.timestamp() * 1000)
raw_details = self.kucoin_client.get_orders(end=timestamp) page_index = 1
yield from (order_from_json(item) for item in raw_details['items']) while True:
del _weeks_back, raw_details raw_details = self.kucoin_client.get_orders(end=timestamp, page=page_index)
yield from (order_from_json(item) for item in raw_details['items'])
page_index = raw_details['currentPage'] + 1
if page_index > raw_details['totalPage']:
break
del raw_details
del _weeks_back
def _get_double_registers(self) -> list[DoubleRegister]: def _get_double_registers(self) -> list[DoubleRegister]:
double_registers: list[DoubleRegister] = [] double_registers: list[DoubleRegister] = []