fix: show token transaction history on address-token view (closes #72) #76
Reference in New Issue
Block a user
Delete Branch "fix/72-address-token-tx-history"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The address-token view showed no transactions for ERC-20 tokens even when transactions existed.
Root Cause
In
fetchRecentTransactions, the transaction merger used tx hash as the sole map key. A single transaction (e.g. a DEX swap) produces multiple ERC-20 token transfers (one per token involved), but only the last one survived in the map. When the address-token view filtered by contract address, it often found nothing.Fix
Use a composite key (
hash:contractAddress) for token transfers so all transfers from a single transaction are preserved. Also clean up the bare normal-tx entry when token transfers replace it to avoid duplicates.Closes #72