Skip to content

feat(wallet): add asset metadata registry and icon display (#1721) - #1838

Merged
github-actions[bot] merged 3 commits into
Smartdevs17:mainfrom
Clement-coder:feat/1721-asset-metadata-icon-display
Oct 19, 2026
Merged

github-actions[bot] merged 3 commits into
Smartdevs17:mainfrom
Clement-coder:feat/1721-asset-metadata-icon-display

Conversation

@Clement-coder

Copy link
Copy Markdown
Contributor

Summary

Resolves #1721. Assets previously rendered as raw ticker codes. This PR adds a full metadata + icon pipeline so every asset displays its name, logo, and a graceful fallback.


Changes

src/services/assetMetadataService.ts

  • Static registry of 18 known assets (XLM, USDC, ETH, BTC, MATIC, ARB, OP, SOL, AVAX, BNB, LINK, UNI, DAI, WBTC, ATOM, DOT, ADA, LTC) with name, logoURI, and brand fallbackColor
  • resolveAssetMetadata(symbol) — async, never throws; checks L1/L2 cache first, then registry, then fallback
  • getAssetMetadataSync(symbol) — synchronous fast-path for initial render seeding
  • pickFallbackColor(symbol) — deterministic hash → 8-colour accessible palette
  • deriveInitials(symbol) — 1–3 char abbreviation
  • 24-hour TTL cache via CacheService; tag-based bulk invalidation via invalidateAllAssetMetadata()

src/hooks/useAssetMetadata.ts

  • Synchronous initial state (no loading flash for known assets)
  • Async resolution fills the cache on mount / symbol change
  • In-flight dedup via inFlightRef
  • Stable refresh() callback
  • Returns { metadata, isLoading, isKnown, refresh }

src/components/wallet/AssetIcon.tsx

  • expo-image with blurhash placeholder for logos
  • Coloured initials badge fallback when no logo is available or image errors
  • Skeleton placeholder during async loading
  • Accepts logoURIOverride for TokenBalance.logoURI passthrough
  • Fully accessible (accessibilityLabel)

Acceptance criteria

  • Uses known asset list (18-asset static registry)
  • Fallback for unknown assets (deterministic colour + initials badge)
  • Cached (24-hour TTL, L1 in-memory + L2 AsyncStorage via CacheService)

Test output

Tests: 45 passed, 45 total
Test Suites: 2 passed, 2 total

github-actions Bot and others added 3 commits October 19, 2026 11:10
…17#1721)

Resolve and display asset metadata and icons for on-chain assets.

- Add assetMetadataService with a static registry of 18 known assets
  (XLM, USDC, ETH, BTC, MATIC, ARB, OP, SOL, AVAX, BNB, LINK, UNI,
  DAI, WBTC, ATOM, DOT, ADA, LTC) including logoURI, name, and brand
  colour for each
- Two-layer cache (L1 in-memory + L2 AsyncStorage) via CacheService
  with 24-hour TTL and tag-based bulk invalidation
- Deterministic fallback for unknown assets: pickFallbackColor hashes
  the symbol to a palette of 8 accessible colours; deriveInitials
  produces a 1-3 char badge — guarantees graceful display for any token
- Add useAssetMetadata hook: synchronous fast-path seeds the initial
  render from the static registry; async resolve fills the cache on
  subsequent calls; stable refresh() callback for manual re-resolve
- Add AssetIcon component: expo-image with blurhash placeholder for
  known logos; coloured initials badge fallback; skeleton while loading;
  supports logoURIOverride for TokenBalance.logoURI passthrough
- 45 passing tests covering registry lookup, cache read/write/
  invalidation, fallback determinism, symbol normalisation

Closes Smartdevs17#1721
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Clement-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@github-actions
github-actions Bot merged commit 345e1c9 into Smartdevs17:main Oct 19, 2026
15 of 34 checks passed
@Clement-coder
Clement-coder deployed to security-review October 19, 2026 12:10 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
security-review — b0704292 Deployed Oct 19, 2026 by Clement-coder via Security Dashboard #1391
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.

Add asset metadata and icon display

1 participant