From 2b09a4155810e4f1d242bbdd83253838aa90c6c8 Mon Sep 17 00:00:00 2001 From: officeyutong Date: Tue, 3 Dec 2024 18:42:41 +0800 Subject: [PATCH] fix in bug --- light-client-js/src/types.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/light-client-js/src/types.ts b/light-client-js/src/types.ts index e471004..a6f3a13 100644 --- a/light-client-js/src/types.ts +++ b/light-client-js/src/types.ts @@ -212,6 +212,12 @@ interface GetTransactionsResponse { } export function lightClientGetTransactionsResultTo(input: LightClientPagination | LightClientPagination): GetTransactionsResponse | GetTransactionsResponse { + if (input.objects.length === 0) { + return ({ + lastCursor: input.last_cursor, + transactions: [] + }) + } if ("io_index" in input.objects[0]) { return ({ lastCursor: input.last_cursor,