Skip to content

Commit 19ef112

Browse files
committed
fix(debug): include request amount in swap failure logs
Add the `amount` field to debug output in `logSwapExecutionFailure` so both sides of a quote are visible: the requested amount and the quoted amount. For fixed-input swaps this shows the requested input; for fixed-output swaps it shows the requested output. The field is only present on `SwapQuote` objects, so a runtime check guards access.
1 parent 39ef7fa commit 19ef112

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/haystack/src/debug.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ export function logSwapExecutionFailure(
3232
fromASAID: context.quote.fromASAID,
3333
toASAID: context.quote.toASAID,
3434
type: context.quote.type,
35+
amount:
36+
'amount' in context.quote
37+
? context.quote.amount.toString()
38+
: undefined,
3539
quote: context.quote.quote.toString(),
3640
requiredAppOptIns: context.quote.requiredAppOptIns,
3741
route: context.quote.route?.map((r) => ({

0 commit comments

Comments
 (0)