fix: display swaps and contract calls correctly in tx history (closes #3)

- Preserve contract call metadata (direction, label, method) when token
  transfers merge with normal txs in fetchRecentTransactions
- Handle 'contract' direction in counterparty display for home and
  address detail list views
- Add decoded calldata display to transaction detail view, fetching
  raw input from Blockscout and using decodeCalldata from approval.js
- Show 'Unknown contract call' with raw hex for unrecognized calldata
- Export decodeCalldata from approval.js for reuse
This commit is contained in:
clawbot
2026-02-27 12:03:57 -08:00
committed by user
parent 0ed7b8e61d
commit 76059c3674
6 changed files with 100 additions and 4 deletions

View File

@@ -185,7 +185,10 @@ function renderTransactions(txs) {
let html = "";
let i = 0;
for (const tx of txs) {
const counterparty = tx.direction === "sent" ? tx.to : tx.from;
const counterparty =
tx.direction === "sent" || tx.direction === "contract"
? tx.to
: tx.from;
const ensName = ensNameMap.get(counterparty) || null;
const dirLabel = tx.directionLabel;
const amountStr = tx.value