Consistent token icons: metadata registry + bundled logos#24
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.