fix: the swap's unknown first take shows only when the user pays that step (closes #634)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

decode() now records whether the user pays the V4 step that sets the
input side, from who pays its SETTLE of its input token. That step's
Unknown (could not be decoded) line is added only then, and also when a
PERMIT2_TRANSFER_FROM of its token goes into the router, whose figure is
on its Paid to line. Paid from the router, the step takes nothing from
the wallet and never gets the line. README Transaction Decoding says so.

Model: opus-5-5
This commit is contained in:
2026-10-20 09:00:21 +00:00
parent c13385b270
commit 0c59883991
3 changed files with 102 additions and 26 deletions
+9 -7
View File
@@ -3193,13 +3193,15 @@ Currently supported:
`Token In` after an amount that is not a quantity (a V4 open delta,
`ALREADY_PAID`, which keep their wording on the `Amount` line, or no stated
amount, as of a V4 exact-out step); and one whose amount the decoder does not
know. When the step that sets the input side states no amount and there is no
`Amount` line, that step gets them too whenever another take's lines give a
figure, or a `PERMIT2_TRANSFER_FROM` of its token gets the lines below, so
that figure cannot read as all that leaves. They come in step order, the step
that sets the input side first when it has them: `Moved from the sender`, its
amount, worded as the `Amount` line words one, or
`Unknown (could not be decoded)` when the decoder does not know it;
know. When the step that sets the input side states no amount, the user pays
it some of its input token, and there is no `Amount` line, that step gets them
too whenever another take's lines give a figure, or a `PERMIT2_TRANSFER_FROM`
of its token gives one, on the lines below or, into the router, on its
`Paid to` line, so that figure cannot read as all that leaves. Paid from the
router, that step takes nothing from the user's wallet and never gets them.
They come in step order, the step that sets the input side first when it has
them: `Moved from the sender`, its amount, worded as the `Amount` line words
one, or `Unknown (could not be decoded)` when the decoder does not know it;
`Token moved`, giving the token's address as the `Token In` line does; and
`Moved to`, which reads `The swap step that spends it`. A token the decoder
does not know gives the `Moved from the sender` line alone. A step may also