Skip to content

feat: Add MPToken authorization feature#438

Open
RomThpt wants to merge 3 commits intoGemWallet:masterfrom
XRPL-Commons:pr/mptoken-authorization
Open

feat: Add MPToken authorization feature#438
RomThpt wants to merge 3 commits intoGemWallet:masterfrom
XRPL-Commons:pr/mptoken-authorization

Conversation

@RomThpt
Copy link

@RomThpt RomThpt commented Jan 12, 2026

Summary

  • Add addMPTokenAuthorization and removeMPTokenAuthorization functions to LedgerContext
  • Create AddMPToken page for authorizing new MPTokens by entering the issuance ID
  • Create MPTokenRemove page for revoking MPToken authorization (when balance is 0)
  • Add routes for /add-mptoken and /mptoken-remove pages
  • Update ledger context mock for tests

This PR enables users to:

  • Authorize holding a new MPToken by providing the 64-character MPTokenIssuanceID
  • Remove MPToken authorization when their balance is 0 (via the Remove button in MPToken listing)

Note: This PR depends on #436 (TanStack Query) and #437 (MPToken display).

Test plan

  • TypeScript compilation passes
  • Existing tests pass
  • Manual testing: Add MPToken authorization with valid issuance ID
  • Manual testing: Verify validation prevents invalid issuance IDs
  • Manual testing: Remove MPToken authorization when balance is 0
  • Manual testing: Verify error handling for failed transactions

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)
Add ability to authorize (hold) and revoke MPTokens via the UI.

Changes:
- Add addMPTokenAuthorization and removeMPTokenAuthorization to LedgerContext
- Create AddMPToken page for authorizing new MPTokens by issuance ID
- Create MPTokenRemove page for revoking MPToken authorization
- Add routes for /add-mptoken and /mptoken-remove
- Update ledger context mock for tests

The MPTokenAuthorize transaction allows users to:
- Hold a new MPToken by providing the MPTokenIssuanceID
- Remove authorization when balance is 0
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