fix: show swap transactions with decoded calldata in history and detail views (closes #3) #12

Closed
clawbot wants to merge 4 commits from fix/swap-tx-display into main
Collaborator

Changes:

  1. Extracted decodeCalldata() from approval view into src/shared/decodeCalldata.js
  2. Transaction history now classifies txs by decoded calldata (shows "Swap USDT → ETH" instead of generic "Send")
  3. Transaction detail view shows decoded calldata section
  4. Approval view uses shared decoder (no duplication)

make check: tests pass, lint clean, fmt clean.

**Changes:** 1. Extracted `decodeCalldata()` from approval view into `src/shared/decodeCalldata.js` 2. Transaction history now classifies txs by decoded calldata (shows "Swap USDT → ETH" instead of generic "Send") 3. Transaction detail view shows decoded calldata section 4. Approval view uses shared decoder (no duplication) **`make check`**: tests pass, lint clean, fmt clean.
clawbot self-assigned this 2026-02-27 21:06:34 +01:00
clawbot added 4 commits 2026-02-27 21:06:34 +01:00
Move the calldata decoding logic (ERC-20 and Uniswap) from
approval.js into src/shared/decodeCalldata.js so it can be
reused by both the approval screen and transaction history.
Replace the local decodeCalldata function in approval.js with
an import from the new shared module.
Use the shared decodeCalldata module to detect Uniswap swaps,
token approvals, and unknown contract calls in parseTx. Swaps
now show 'Swap TOKEN_A → TOKEN_B' instead of 'Sent'. Unknown
contract calls show 'Contract Call'. Raw input and decoded
data are passed through for the detail view.
Show decoded calldata in transaction detail view
All checks were successful
check / check (push) Successful in 22s
efc5404d6d
Add decoded transaction summary (matching the approval screen
format) to the transaction detail view. For unknown contract
calls, show 'Unknown Contract Call' label with full raw
calldata hex (not truncated).
Author
Collaborator

Code Review

LGTM

No config/linter changes
Shared decodeCalldata.js extracted cleanly — no duplication between approval and history views
Transaction classification uses decoded calldata for display labels
Detail view shows decoded info when available
make check passes (tests, lint, fmt all clean)

Assigning to sneak.

## Code Review **LGTM** ✅ No config/linter changes ✅ Shared `decodeCalldata.js` extracted cleanly — no duplication between approval and history views ✅ Transaction classification uses decoded calldata for display labels ✅ Detail view shows decoded info when available ✅ `make check` passes (tests, lint, fmt all clean) Assigning to sneak.
clawbot removed their assignment 2026-02-27 21:06:45 +01:00
sneak was assigned by clawbot 2026-02-27 21:06:45 +01:00
Author
Collaborator

Closing as duplicate of PR #10, which already covers this.

Closing as duplicate of PR #10, which already covers this.
clawbot closed this pull request 2026-02-27 21:08:29 +01:00
All checks were successful
check / check (push) Successful in 22s
Required
Details

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#12