From 31dda200a6305e236996e61168ee92e0464eab96 Mon Sep 17 00:00:00 2001 From: AnkitSingh411 Date: Sat, 7 Nov 2026 21:33:40 +0530 Subject: [PATCH] fix(sdk): fall back to V3.5 logs when the V3 query returns an empty array getDepositLogs and getFillLogs returned 'v3Logs ?? v3_5Logs'. viem getLogs returns [] (not null) when nothing matches, and [] is not nullish, so the V3.5 result was discarded whenever the V3 query was empty. SpokePool no longer emits V3FundsDeposited or FilledV3Relay, so this broke the by-id deposit lookup and the fill-log fallback for every current deposit and fill. Check the array length instead. --- .changeset/fix-v3-logs-fallback.md | 5 +++++ packages/sdk/src/actions/getDeposit.ts | 2 +- packages/sdk/src/actions/getFillByDepositTx.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/fix-v3-logs-fallback.md diff --git a/.changeset/fix-v3-logs-fallback.md b/.changeset/fix-v3-logs-fallback.md new file mode 100644 index 0000000..9791c4f --- /dev/null +++ b/.changeset/fix-v3-logs-fallback.md @@ -0,0 +1,5 @@ +--- +"@across-protocol/app-sdk": patch +--- + +Fix getDeposit and getFillByDepositTx discarding V3.5 logs when the V3 query returns an empty array diff --git a/packages/sdk/src/actions/getDeposit.ts b/packages/sdk/src/actions/getDeposit.ts index 2fc3b8d..2f599fa 100644 --- a/packages/sdk/src/actions/getDeposit.ts +++ b/packages/sdk/src/actions/getDeposit.ts @@ -338,5 +338,5 @@ async function getDepositLogs({ }), ]); - return v3Logs ?? v3_5Logs; + return v3Logs.length > 0 ? v3Logs : v3_5Logs; } diff --git a/packages/sdk/src/actions/getFillByDepositTx.ts b/packages/sdk/src/actions/getFillByDepositTx.ts index 875f7c9..e1b7dea 100644 --- a/packages/sdk/src/actions/getFillByDepositTx.ts +++ b/packages/sdk/src/actions/getFillByDepositTx.ts @@ -413,5 +413,5 @@ export async function getFillLogs(params: GetFillByDepositTxParams) { }), ]); - return v3Logs ?? v3_5Logs; + return v3Logs.length > 0 ? v3Logs : v3_5Logs; }