feat(tron): add claim button for unstaked TRX withdrawal#27076
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
81bab44 to
a717f8c
Compare
a717f8c to
e9689ce
Compare
e9689ce to
fd08859
Compare
70ebc1a to
d3ec54c
Compare
d3ec54c to
6775b65
Compare
Yes I believe we do! |
db58b1e to
18c731b
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
18c731b to
169bc22
Compare
169bc22 to
aa66c06
Compare
ff48390 to
ea1becd
Compare
Replace the read-only TronUnstakedBanner with an actionable TronClaimBanner that has a "Claim TRX" button triggering the claimUnstakedTrx snap method. Wire up the full claim flow including the useTronClaim hook, snap RPC methods (claimUnstakedTrx and claimTrxStakingRewards), and the associated types. Made-with: Cursor
ea1becd to
630084e
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key impact areas:
No Engine/Controller-level changes were made, and no modifications to core network or account architecture were detected. Therefore, broader tags like SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeIdentity, or SmokeAccounts are not required. package.json changes introduce some systemic risk (dependency updates), but changes are feature-scoped to Earn/Tron and do not affect core initialization paths. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
Add a "Withdraw" button to
TronUnstakedBannerso users can claim TRX that has completed the 14-day unstaking lock period. Also migrates Tron staking components (TronStakingButtons,TronStakingCta) fromStyleSheet/Viewto@metamask/design-system-react-nativeand restructures related i18n keys.Changes
TronUnstakedBanner— Upgraded from info-only to actionable: now acceptschainId, renders a "Withdraw"Button, and wires it to the newuseTronClaimUnstakedTrxhook.useTronClaimUnstakedTrxhook (new) — Selects the Tron account viaselectSelectedInternalAccountByScope, calls theclaimUnstakedTrxsnap RPC, and exposeshandleClaimUnstakedTrx,isSubmitting, anderrors.claimUnstakedTrxsnap RPC wrapper (new) — SendsclaimUnstakedTrxrequest to the Tron Wallet Snap viahandleSnapRequest.TronClaimUnstakedTrxParams/TronClaimUnstakedTrxResulttypes (new).TronStakingButtons/TronStakingCta— Migrated fromStyleSheet.create/View/component-libraryButton/Textto design-systemBox/Button/Text. Deleted corresponding.styles.tsfiles and removeduseStylesmocks from tests.TronUnstakingBanner— Simplified to use Banner's built-intitle/descriptionstring props instead of a customTextwrapper.AssetOverviewContent— PasseschainIdtoTronUnstakedBanner; replacedViewwrappers withBox.stake.tronkeys from flat (trx_unstaking_in_progress,has_claimable_trx) to nested (unstaking_banner.{title,description},unstaked_banner.{title,description,button}).@metamask-previews/tron-wallet-snapand@metamask-previews/assets-controllers.TronUnstakedBannertests (5 cases) and addeduseTronClaimUnstakedTrxtests (5 cases).Screen.Recording.2026-03-12.at.15.51.30.mov
Changelog
CHANGELOG entry: Added a "Withdraw" button to the unstaked TRX banner so users can claim TRX that has completed the lock period.
Related issues
Refs: NEB-576
Manual testing steps
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds a new Tron withdrawal flow that triggers a Snap RPC from the token details screen and introduces new error-toast behavior; failures could affect users’ ability to reclaim funds after unstaking. UI refactors to the design system are lower risk but touch several Tron Earn surfaces and i18n keys.
Overview
Adds an actionable unstaked TRX banner:
TronUnstakedBannernow takes achainId, renders a Withdraw button, calls new hookuseTronClaimUnstakedTrx, disables while submitting, and surfaces failures via a newuseEarnToaststronWithdrawal.failed(errors)toast.Introduces Snap plumbing for withdrawals (
claimUnstakedTrxrequest + newTronClaimUnstakedTrx*types) and updatesAssetOverviewContentto pass the TronchainIdinto the banner.Refactors Tron staking CTA/buttons (and related token-detail wrappers) from
View/StyleSheet+ component-library controls to@metamask/design-system-react-native, simplifiesTronUnstakingBannerto useBannertitle/description, and restructures relatedstake.troni18n keys; tests are updated/added accordingly.Written by Cursor Bugbot for commit 630084e. This will update automatically on new commits. Configure here.