fix: show token transaction history on address-token view (closes #72) #76

Merged
sneak merged 2 commits from fix/72-address-token-tx-history into main 2026-02-28 21:22:05 +01:00
Collaborator

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

## 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
sneak was assigned by clawbot 2026-02-28 21:08:58 +01:00
clawbot added 1 commit 2026-02-28 21:08:58 +01:00
fix: preserve multiple token transfers per tx hash for address-token view
All checks were successful
check / check (push) Successful in 21s
4157732f4b
A single transaction (e.g. a DEX swap) can produce multiple ERC-20
token transfers. The transaction merger was keyed by tx hash alone,
so only the last token transfer survived. This meant the address-token
view's contract-address filter often matched nothing.

Use a composite key (hash + contract address) so all token transfers
are preserved. Also remove the bare normal-tx entry when it gets
replaced by token transfers to avoid duplicates.

Closes #72
sneak added 1 commit 2026-02-28 21:21:49 +01:00
Merge branch 'main' into fix/72-address-token-tx-history
All checks were successful
check / check (push) Successful in 23s
c2fdb3e0c1
sneak merged commit 9444b06b52 into main 2026-02-28 21:22:05 +01:00
sneak deleted branch fix/72-address-token-tx-history 2026-02-28 21:22:05 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#76