Skip to content

feat: Add MPToken issuance destroy and set features#440

Open
RomThpt wants to merge 5 commits intoGemWallet:masterfrom
XRPL-Commons:pr/mptoken-issuance-management
Open

feat: Add MPToken issuance destroy and set features#440
RomThpt wants to merge 5 commits intoGemWallet:masterfrom
XRPL-Commons:pr/mptoken-issuance-management

Conversation

@RomThpt
Copy link

@RomThpt RomThpt commented Jan 12, 2026

Summary

  • Add destroyMPTokenIssuance function to destroy MPToken issuances when supply is zero
  • Add setMPTokenIssuance function to lock/unlock tokens for specific holders
  • Create UI pages for both operations with proper confirmation flows

Changes

LedgerContext

  • Add MPTokenIssuanceDestroyResponse and MPTokenIssuanceSetResponse interfaces
  • Add MPTokenIssuanceSetParams interface with mptIssuanceId, holder, and flags fields
  • Implement destroyMPTokenIssuance function for MPTokenIssuanceDestroy transaction
  • Implement setMPTokenIssuance function for MPTokenIssuanceSet transaction (lock/unlock)

New Pages

  • MPTokenIssuanceDestroy: Confirmation page to permanently destroy an MPToken issuance
  • MPTokenIssuanceSet: Page to lock/unlock tokens for specific holders

Routes & Constants

  • Add DESTROY_MPTOKEN_ISSUANCE_PATH and SET_MPTOKEN_ISSUANCE_PATH constants
  • Register new routes in private routes configuration

Dependencies

This PR depends on:

Test plan

  • Verify MPTokenIssuanceDestroy page loads correctly
  • Verify MPTokenIssuanceSet page loads correctly with lock/unlock options
  • Test destroy transaction with zero balance issuance
  • Test lock/unlock operations on holder accounts
  • Verify error handling for both operations

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
Add ability for users to create their own MPToken issuances (issue
new tokens on XRPL).

Changes:
- Add createMPTokenIssuance function to LedgerContext
- Create CreateMPTokenIssuance page with form for:
  - Asset scale (decimal places)
  - Maximum amount (supply cap)
  - Transfer fee percentage
  - XLS-89 metadata (JSON format)
  - Token capability flags (transfer, trade, escrow, lock, clawback, etc.)
- Add route for /create-mptoken-issuance
- Update mock for tests

This allows token issuers to create new MPToken issuances with full
control over token properties and capabilities.
- Add destroyMPTokenIssuance function to LedgerContext
- Add setMPTokenIssuance function to LedgerContext for lock/unlock
- Create MPTokenIssuanceDestroy page component
- Create MPTokenIssuanceSet page component with lock/unlock UI
- Add routes and path constants for new pages
- Update mock context
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