Skip to content

Consistent token icons: metadata registry + bundled logos#24

Merged
MagicalTux merged 1 commit into
masterfrom
token-icon
Jul 7, 2026
Merged

Consistent token icons: metadata registry + bundled logos#24
MagicalTux merged 1 commit into
masterfrom
token-icon

Conversation

@jvinai

@jvinai jvinai commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Token logos were inconsistent (e.g. shown on the dashboard but a letter in swap) because each surface used a different metadata source — Jupiter for holdings, libwallet search for swap's To-picker, hardcoded/curated lists, Helius for token detail. Two fixes give one source of truth:

  • TokenMetaStore (new, provided at root): a single mint->metadata cache backed by Helius getAssetBatch, with batched lookups (one RPC call per burst of icons) and session caching (incl. negatives). TokenIcon now self-resolves any missing logo through it, so every list — dashboard, swap (all sections), send, search, favorites — gets the same icon with no per-call-site plumbing. Degrades to the letter if the store isn't in the tree.

  • Bundled logos for well-known mints (kBundledTokenIcons: SOL, USDC, USDT, ChiefPussy), used with priority over the network imageUrl — generalizing the existing wSOL->sol.png shortcut. USDT in particular has no logo from Helius or libwallet, so the local asset is the only reliable fix.

Adds usdc.png / usdt.png / chiefp.jpeg assets and TokenMetaStore unit tests. analyze clean. See TOKEN_METADATA_REGISTRY.md.

Token logos were inconsistent (e.g. shown on the dashboard but a letter in
swap) because each surface used a different metadata source — Jupiter for
holdings, libwallet search for swap's To-picker, hardcoded/curated lists,
Helius for token detail. Two fixes give one source of truth:

- TokenMetaStore (new, provided at root): a single mint->metadata cache
  backed by Helius getAssetBatch, with batched lookups (one RPC call per
  burst of icons) and session caching (incl. negatives). TokenIcon now
  self-resolves any missing logo through it, so every list — dashboard,
  swap (all sections), send, search, favorites — gets the same icon with
  no per-call-site plumbing. Degrades to the letter if the store isn't in
  the tree.

- Bundled logos for well-known mints (kBundledTokenIcons: SOL, USDC, USDT,
  ChiefPussy), used with priority over the network imageUrl — generalizing
  the existing wSOL->sol.png shortcut. USDT in particular has no logo from
  Helius or libwallet, so the local asset is the only reliable fix.

Adds usdc.png / usdt.png / chiefp.jpeg assets and TokenMetaStore unit
tests. analyze clean. See TOKEN_METADATA_REGISTRY.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MagicalTux MagicalTux merged commit 9bbeb70 into master Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants