Skip to content

Commit ce14f63

Browse files
authored
fix(debug): include request amount in swap failure logs (#9)
* 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. * style(debug): fix prettier formatting
1 parent 39ef7fa commit ce14f63

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/haystack/src/debug.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ 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 ? context.quote.amount.toString() : undefined,
3537
quote: context.quote.quote.toString(),
3638
requiredAppOptIns: context.quote.requiredAppOptIns,
3739
route: context.quote.route?.map((r) => ({

0 commit comments

Comments
 (0)