feat(tron): display TRX ready for withdrawal#27075
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. |
296ad74 to
a3ca53c
Compare
9e8c3f0 to
52586fa
Compare
The base branch was changed.
598e6b6 to
8838893
Compare
8838893 to
7a42f76
Compare
924103b
924103b to
4474d4e
Compare
4474d4e to
685fd5f
Compare
Add info-only TronClaimBanner component to show TRX that has completed the unstaking lock period and is ready for withdrawal. The banner displays the claimable amount without any action button. The claim action will be added in a follow-up PR. Made-with: Cursor
ff386ec
685fd5f to
ff386ec
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Ineligible users (e.g. geo-blocked) without staked positions were shown the "Stake your TRX" CTA with a functional button they could not actually use. Add useStakingEligibility guard so the CTA returns null when the user is not eligible, matching TronStakingButtons behavior. Add test coverage for the new guard. Made-with: Cursor
Add TronStakingButtons.testIds.ts for consistency with TronStakingCta and TronUnstakedBanner, replacing inline string literals. Made-with: Cursor
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No controller, Engine, or network permission changes were introduced, so NetworkAbstractions, MultiChainAPI, Identity, or Accounts-specific tags are not required. Overall risk is medium due to balance hook changes and UI updates in user-facing wallet surfaces. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Display TRX that has completed the unstaking lock period and is ready for withdrawal on the token details view. Refactor Tron staking UI so
AssetOverviewContentorchestrates all Tron staking components directly.Added
TronUnstakedBannercomponent — Info-only success banner displaying "You can claim X TRX..." when TRX has completed the 14-day unstaking lock period and is ready for withdrawal. No action button (claim button deferred to NEB-576).TronStakingCtacomponent — "Stake your TRX" promotional CTA with APR percentage and an "Earn" button, shown to eligible users who have no staked TRX positions. Gated behinduseStakingEligibilityso geo-blocked users never see it.readyForWithdrawalBalancederivation inuseTokenBalance— ParsestrxReadyForWithdrawalfrom the Tron special assets selector and exposes it as a formatted string (only when > 0 and numeric).stake.tron.has_claimable_trxlocale string — New i18n key for the claimable TRX banner text.TronUnstakedBanner,TronStakingCta(including eligibility guard), andreadyForWithdrawalBalanceedge cases inuseTokenBalance.Changed
AssetOverviewContentis now the orchestrator for all Tron staking UI. It directly renders, in order: native Balance → staked Balance →TronUnstakedBanner→TronUnstakingBanner→TronStakingButtons(if staked) orTronStakingCta(if not staked). Previously, staking buttons/CTA were rendered insideEarnBalance.EarnBalanceno longer renders any Tron staking UI. When the Tron staking flag is enabled and the asset is a Tron chain asset, it returnsnull— all Tron staking rendering responsibility moved toAssetOverviewContent.TronStakingButtonssimplified — RemovedshowUnstake,hasStakedPositions, andaprTextprops. The CTA section was extracted into the newTronStakingCta. Now always renders "Unstake" and conditionally renders "Stake more" based onuseStakingEligibility. Removed theif (!isEligible && !hasStakedPositions) return nullearly exit since the parent now controls when to render it.useTokenBalanceguardsstakedTrxAssetwithtotalStaked > 0— PreviouslycreateStakedTrxAssetwas always called for Tron native tokens, producing a truthy object even with zero balance. NowstakedTrxAssetisundefinedwhen no TRX is actually staked, which correctly drives the conditional rendering inAssetOverviewContent.Note: This PR intentionally does not include a claim button. The button and snap interaction are in NEB-576.
Changelog
CHANGELOG entry: Added a banner to display TRX that is ready for withdrawal on the token details view
Related issues
Refs: NEB-582
Manual testing steps
Screenshots/Recordings
Before
N/A - new feature
After
Pre-merge author checklist
Pre-merge reviewer checklist
Made with Cursor
Note
Medium Risk
Updates Tron token details balance derivation and reorganizes staking/unstaking UI rendering paths, which could affect when/where staking CTAs and banners appear for TRX users; changes are UI/formatting focused with test coverage.
Overview
Adds a Tron-only “claimable TRX” success banner on the token details view by deriving a new
readyForWithdrawalBalancefromtrxReadyForWithdrawalinuseTokenBalance(with numeric/zero guards) and wiring it throughTokenDetailsintoAssetOverviewContent.Refactors Tron staking UI ownership:
AssetOverviewContentnow directly renders Tron staking/unstaking components (including a newTronStakingCtafor eligible users with no staked TRX), whileEarnBalanceno longer renders any Tron staking UI and returnsnullwhen Tron staking is enabled.Simplifies
TronStakingButtonsby removing CTA-related props/markup, always showing Unstake and conditionally showing “Stake more” based on eligibility, and introduces shared test IDs; adds/updates unit tests and introduces the newstake.tron.has_claimable_trxlocale string.Written by Cursor Bugbot for commit 4fbff82. This will update automatically on new commits. Configure here.