-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: adds the Tron staking details preview #23180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
app/components/UI/Earn/Views/EarnWithdrawInputView/EarnWithdrawInputView.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Earn/Views/EarnWithdrawInputView/EarnWithdrawInputView.test.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned with the large amount of tron-specific code in components and worry it will be difficult to debug and maintain.
I have some ideas on how to improve this in the future but don't have the capacity to help right now unfortunately.
For example, EarnInputView is currently a god component. It may be easier to have a different approach where components are layout-based, dumb, and only concerned about presentation.
I wonder if an approach like this would scale better:
<EarnInputView asset={asset}/> (router) -> Calls <TronStakingInputView/>, <LendingInputView asset={asset}/>, etc. (experience-specific logic) all consume layout under the hood -> <EarnInputViewLayout/> (concerned with presentation only and exposes section/component based props and overrides)
This is an oversimplification but just thinking out loud!
app/components/UI/Earn/Views/EarnInputView/EarnInputView.test.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Earn/Views/EarnWithdrawInputView/EarnWithdrawInputView.tsx
Show resolved
Hide resolved
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes in this PR are focused entirely on the Earn/Staking feature, specifically adding and improving TRON staking support. Here's a summary of the changes:
All these changes are self-contained within the Earn/Staking feature with no impact on core wallet functionality, accounts management, networking, or other features. The existing stake E2E test (stake-action-smoke.spec.ts) is tagged with There are no E2E tests specifically for TRON staking in the codebase yet, but running |
|
Matt561
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment but pre-approving so you're not blocked.
| asset: { | ||
| unit: 'TRX', | ||
| type: 'TRX', | ||
| amount: '0.01', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a ticket created to replace this hardcoded fee value in useTronStake and useTronUnstake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yap, it's already in a PR 👍🏼



Description
Adds the Tron staking preview details:
Screen.Recording.2025-11-24.at.11.08.14.mov
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Introduces a Tron stake/unstake preview flow (animated panel, “Done” quick action) and updates hooks, types, and tests with new validation APIs and i18n strings.
TronStakePreview) and hide keypad/quick amounts during preview; show conditional review button.MaxwithDonein quick amounts when a non-zero amount is entered (TRON only); tapping amount exits preview.TronStakePreviewstake/unstakemodes; show fee; add enter animation.useTronStake: renamevalidate→validateStakeAmount; addpreview(fee) support.useTronUnstake: renamevalidate→validateUnstakeAmount; addpreview(fee) and staked-balance handling.earn/types/tron-staking.types.ts):ComputeFeeResultshape; refactor Tron unstake param types.PressablewithonPressAmounthandler.Written by Cursor Bugbot for commit 66a0be4. This will update automatically on new commits. Configure here.