Skip to content

feat: Add MPToken display support in tokens page#437

Open
RomThpt wants to merge 2 commits intoGemWallet:masterfrom
XRPL-Commons:pr/mptoken-display
Open

feat: Add MPToken display support in tokens page#437
RomThpt wants to merge 2 commits intoGemWallet:masterfrom
XRPL-Commons:pr/mptoken-display

Conversation

@RomThpt
Copy link

@RomThpt RomThpt commented Jan 12, 2026

Summary

  • Add MPToken types for XLS-89 metadata structure (ticker, name, icon, issuer info)
  • Add fetchMPTokenData utility for fetching and parsing MPToken data from ledger
  • Create MPTokenDisplay molecule for rendering individual MPTokens with metadata
  • Create MPTokenListing organism that lists all MPTokens for an account
  • Integrate MPTokenListing into the TokenListing component
  • Support balance formatting using AssetScale from token issuance

This PR adds display-only support for Multi-Purpose Tokens (MPT). Users will be able to see their MPTokens in the tokens page with proper metadata when available.

Note: This PR depends on #436 (TanStack Query setup). The remove functionality shown in the UI requires a separate PR for MPToken authorization transactions.

Test plan

  • TypeScript compilation passes
  • Existing TokenListing tests pass
  • Manual testing: View MPTokens on testnet with various metadata configurations
  • Manual testing: Verify tokens without metadata show truncated issuance ID
  • Manual testing: Verify balance formatting works correctly with different AssetScale values

Add TanStack Query (React Query) to improve data fetching performance
and user experience by caching account balance data across page
navigations.

Changes:
- Add @tanstack/react-query dependency
- Create QueryContext with QueryClientProvider and sensible defaults
- Add useAccountBalances hook for cached balance fetching
- Refactor TokenListing to use the new cached hook
- Update TokenListing tests to work with QueryClient
Add support for displaying Multi-Purpose Tokens (MPT) in the wallet's
tokens page with metadata support following XLS-89 specification.

Changes:
- Add MPToken types for XLS-89 metadata structure
- Add fetchMPTokenData utility for fetching and parsing MPToken data
- Create MPTokenDisplay molecule for individual token rendering
- Create MPTokenListing organism for listing all MPTokens
- Integrate MPTokenListing into TokenListing component
- Add MPTOKEN_REMOVE_PATH constant (for future PR)

Features:
- Display ticker, name, icon from token metadata
- Format balance using AssetScale from issuance
- Show issuer name with truncation and tooltips
- Support remove button for zero-balance tokens (requires authorization PR)
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.

1 participant