-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore(runway): cherry-pick chore: broadcast staking TRX transaction cp-7.61.3 #24196
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
chore(runway): cherry-pick chore: broadcast staking TRX transaction cp-7.61.3 #24196
Conversation
…22522) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Staking and unstaking methods connected to the tron-snap: https://github.com/user-attachments/assets/a7f66644-1a44-4035-9e06-64c2ff71322f <img width="1323" height="45" alt="Screenshot 2025-11-19 at 17 54 46" src="https://github.com/user-attachments/assets/9ebe514b-2333-4b0a-ab12-969c48aa22bd" /> Example: https://tronscan.org/address/TGXFnQBLAdbdkupHUGSpeBfbxB72hkMsh2#/transaction/85bfd85b620e6a8fc5966458cbfcf3a9757454917f78c36b675e223b68564499 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Integrates TRON staking and unstaking via Snap, updating Earn flows, lists, and selectors to support TRX with new validation, previews, and navigation. > > - **TRON staking/unstaking integration**: > - Add `useTronStake` and `useTronUnstake` hooks for validation/confirmation via `tron-staking-snap`. > - New utils: `tron-staking-snap` (Snap RPCs), `tron` (navigation/result handling, token builder, staked total). > - Add `TronStakePreview` UI for fee preview; reuse `ResourceToggle`. > - **Earn Input/Withdraw flows** (`EarnInputView.tsx`, `EarnWithdrawInputView.tsx`): > - Wire TRX validation on keypad input; confirm flows call Snap and navigate to success/error sheets. > - Show Tron-specific UI (resource toggle, fee preview) and simplified button labels; adjust disabled/loading states. > - Limit gas-cost warning to `isETH` only; debounce validation handler. > - **Token list and selection**: > - `EarnTokenList`: include TRX native in deposit list (even with zero balance when enabled); navigate without EVM network switch; sorting updated. > - `EarnTokenSelector`: render output token for withdraw; earn token for stake. > - **Selectors and data plumbing**: > - Support non-EVM (TRX) balances/tokens in earn selectors; default TRX pooled-staking APR to `0`. > - Add unified multichain token selector including non-EVM; filter Tron resource/testnet assets; use `getDecimalChainId`. > - **Utilities/constants/i18n**: > - Add `normalizeToDotDecimal`; `TronResourceType` constant; new TRON strings (fee, success/error copy). > - **Tests**: Extensive new/updated tests for views, hooks, lists, buttons, selectors, and utils; snapshot updates. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0989d7f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThis PR introduces Tron staking functionality with significant changes to multichain infrastructure and earn/staking features. The changes are well-contained but touch critical areas:
NOT selecting:
The changes are focused on Tron staking but touch critical multichain infrastructure. Running these 5 tags provides comprehensive coverage of the impacted areas while remaining efficient. |
|
No release label on PR. Adding release label release-7.61.3 on PR, as PR was cherry-picked in branch 7.61.3. |
Description
Staking and unstaking methods connected to the tron-snap:
Screen.Recording.2025-11-19.at.17.51.52.mov
Example:
https://tronscan.org/address/TGXFnQBLAdbdkupHUGSpeBfbxB72hkMsh2#/transaction/85bfd85b620e6a8fc5966458cbfcf3a9757454917f78c36b675e223b68564499
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Adds TRON staking and unstaking flows powered by the Tron Wallet Snap, including UI (stake/unstake, preview, validation), token list inclusion, and selector/util updates for non‑EVM assets.
useTronStakeanduseTronUnstakehandling validation, confirmation, resource type, and preview viatron-staking-snap.tron-staking-snap(Snap requests) andtron(token building, staked totals, navigation results).TronStakePreviewand updatedResourceToggleusage.EarnInputViewandEarnWithdrawInputView: branch TRON flows (direct confirm, keypad validation, simplified labels), preview rendering, and button disable logic.EarnTokenSelector: chooseearnTokenvsoutputTokenbased on action.EarnTokenList: include nativeTRX(even with zero balance when enabled); navigate without EVM network switch; sorting updated for TRX.TronStakingButtons: derive base TRX for staking and navigate accordingly.getDecimalChainId.selectAccountTokensAcrossChainsUnifiedand enhance multichain selectors to surface non‑EVM tokens (filter TRON resource assets, non‑mainnet TRON).normalizeToDotDecimal; constants forTronResourceType.Written by Cursor Bugbot for commit 2731234. This will update automatically on new commits. Configure here.
5fd9eb9