-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
release: 7.61.5 #24224
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
base: stable
Are you sure you want to change the base?
release: 7.61.5 #24224
Conversation
…p-7.61.3 (#24196) - chore: broadcast staking TRX transaction (#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] > 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. > > - **TRON staking/unstaking integration**: > - New hooks `useTronStake` and `useTronUnstake` handling validation, confirmation, resource type, and preview via `tron-staking-snap`. > - New utils `tron-staking-snap` (Snap requests) and `tron` (token building, staked totals, navigation results). > - New UI `TronStakePreview` and updated `ResourceToggle` usage. > - **Earn screens updates**: > - `EarnInputView` and `EarnWithdrawInputView`: branch TRON flows (direct confirm, keypad validation, simplified labels), preview rendering, and button disable logic. > - `EarnTokenSelector`: choose `earnToken` vs `outputToken` based on action. > - **Token list/navigation**: > - `EarnTokenList`: include native `TRX` (even with zero balance when enabled); navigate without EVM network switch; sorting updated for TRX. > - `TronStakingButtons`: derive base TRX for staking and navigate accordingly. > - **Selectors and data**: > - Extend earn selectors for non‑EVM (TRX) balances/APR, pair lookups use `getDecimalChainId`. > - Add `selectAccountTokensAcrossChainsUnified` and enhance multichain selectors to surface non‑EVM tokens (filter TRON resource assets, non‑mainnet TRON). > - **Utilities/locale**: > - Add `normalizeToDotDecimal`; constants for `TronResourceType`. > - New locale strings for TRON staking/fees. > - **Tests**: Comprehensive new/updated tests for hooks, utils, components, and selectors; minor snapshot/expect fixes. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2731234. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [5fd9eb9](5fd9eb9) Co-authored-by: António Regadas <antonio.regadas@consensys.net>
…e-gesture-handler in PaymentMethodSelectorModal (#24197) - fix(ramp): use ScrollView from react-native-gesture-handler in PaymentMethodSelectorModal (#24188) ## **Description** The `ScrollView` in `PaymentMethodSelectorModal` was imported from `react-native` instead of `react-native-gesture-handler`, causing the scroll functionality to not work when used inside a `BottomSheet` component. This fix changes the import source to use `ScrollView` from `react-native-gesture-handler`, which is required for proper gesture handling and scrolling within bottom sheets that use gesture handlers. ## **Changelog** CHANGELOG entry: Fixed payment method selector modal scroll not working ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Payment Method Selector Modal Scrolling Scenario: user scrolls through payment methods in the modal Given the user is on the Buy/Sell flow with multiple payment methods available When user opens the payment method selector modal And user scrolls down through the list of payment methods Then the list should scroll smoothly And all payment methods should be accessible via scrolling ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/b8be9891-2b09-4bff-a39f-e846af4e2ac0 ### **After** https://github.com/user-attachments/assets/954e1fcd-ef3c-4bae-a507-e481469620fa ## **Pre-merge author checklist** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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] > Switches `ScrollView` to `react-native-gesture-handler` in `PaymentMethodSelectorModal` to enable proper scrolling within the bottom sheet. > > - **UI (Ramp Aggregator)**: > - Replace `react-native` `ScrollView` with `react-native-gesture-handler` `ScrollView` in `app/components/UI/Ramp/Aggregator/components/PaymentMethodSelectorModal/PaymentMethodSelectorModal.tsx` for correct gesture-based scrolling inside `BottomSheet`. > - **Tests**: > - Update snapshots in `PaymentMethodSelectorModal.test.tsx.snap` reflecting `RCTScrollView` gesture handler props. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 370a2c9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [5d8e931](5d8e931) Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
…ew (#24198) - chore: adds the Tron staking details preview (#23180) <!-- 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** Adds the Tron staking preview details: <img height="550" alt="Screenshot 2025-11-24 at 10 50 47" src="https://github.com/user-attachments/assets/1f3823f7-08c8-4f2b-b80b-b33879b199ae" /> https://github.com/user-attachments/assets/9efc1de0-1fd7-42ee-9913-724ff340a216 ## **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] > Adds a TRON staking/unstaking preview UI with a "Done" quick action and integrates validation/preview flow across Earn views/hooks, plus tests and locale updates. > > - **Earn Input/Withdraw Flows**: > - Replace final quick amount "Max" with "Done" for TRON when a non‑zero amount is entered; pressing it shows preview and hides keypad/quick amounts. > - Right action now toggles preview (TRON) or performs Max/100% otherwise; review button shown only in TRON preview. > - Amount display is pressable to exit preview and resume editing. > - **TRON Preview**: > - New `TronStakePreview` shows est. annual reward, lock/release info, and `fee`; supports `stake`/`unstake` modes with entry animation and resource-based calculations. > - **Hooks/Types**: > - Rename `validate`→`validateStakeAmount` and `validateUnstakeAmount`; expose `preview` (incl. fee) in `useTronStake`/`useTronUnstake`; refine staked balance override. > - Update `ComputeFeeResult`/TRON unstake types. > - **Tests**: > - Add/adjust tests for TRON "Done" action, preview rendering, Max behavior, analytics, risk-aware withdrawal error, and hook API changes; snapshot updates. > - **i18n**: > - Update/add TRON strings (shortened estimated reward label; lock/release text). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 45f825e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [de7d453](de7d453) Co-authored-by: António Regadas <antonio.regadas@consensys.net>
…aking/unstaking flows (#24199) - chore: add support for fiat use in tron staking/unstaking flows (#23664) <!-- 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** Fixes incorrect fiat values for Tron (non-EVM chains) in stake/unstake input views by using multichain asset rates instead of EVM-based conversion rates. It uses uses selectMultichainAssetsRates to get the correct token to fiat rate for the non-EVM chains. <img height="320" alt="Screenshot 2025-12-04 at 10 58 37" src="https://github.com/user-attachments/assets/8c70b2ce-044d-4c3a-9572-6b0d9dbb058c" /> <img height="320" alt="Screenshot 2025-12-04 at 10 59 45" src="https://github.com/user-attachments/assets/7443c3a1-bb38-4825-9209-88187e98f64d" /> <img height="320" alt="Screenshot 2025-12-04 at 11 00 05" src="https://github.com/user-attachments/assets/0173b26f-0a05-4151-87a2-7dc2a9b43f39" /> <img height="320" alt="Screenshot 2025-12-04 at 11 23 35" src="https://github.com/user-attachments/assets/09864f5d-85f0-4e4c-af6e-e9ee80da405f" /> ## **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] > Implements multichain-aware fiat conversion for TRON/non‑EVM in Earn input/withdraw flows via a new shared hook, updates analytics chain_id formatting, refines input/limit logic, and expands tests. > > - **Earn (Input/Withdraw)**: > - Introduces `useMultichainInputHandlers` to derive fiat/token amounts using `selectMultichainAssetsRates` for non‑EVM chains and preserve typed fiat values when appropriate. > - Integrates the hook into `useEarnInput` and `useEarnWithdrawInput` to compute `amountFiatNumber`, `currencyToggleValue`, and balances for non‑EVM (e.g., TRON), with graceful fallback when rates are unavailable. > - Refines keypad handling for initial NaN input and period/digit keys; clears typed fiat on token/max/quick‑amount changes. > - Improves over‑maximum checks and ETH gas‑dependent state to prevent UI flicker; persists last ETH over‑max during gas loading. > - Clears typed fiat on `handleMax` and recalculates rewards/fiat consistently. > - **Analytics**: > - Adds `formatChainIdForAnalytics` and uses it in currency switch events in `EarnInputView` and `EarnWithdrawInputView`. > - **Tests**: > - Adds comprehensive unit tests for multichain input handling across Earn input/withdraw hooks (including TRON scenarios) and updates existing tests to mock `selectMultichainAssetsRates`. > - **Localization**: > - Minor copy tweak in TRON daily resource description in `en.json`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5a0a4b5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [84125c3](84125c3) Co-authored-by: António Regadas <antonio.regadas@consensys.net>
…improvements (#24204) - chore: adds localization method and other improvements (#23927) <!-- 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** - Improves Tron error handling by showing user friendly error messages instead of raw error codes. - Updates TRX staking input so Max skips the EVM modal. - Triggers Tron balances update after the staking operation. - Tron snap update to the latest version ## **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] > Improves TRON staking/unstaking UX with localized errors, immediate balance refresh, and live TRX balances in asset overview; also skips EVM max modal for TRX and adds supporting tests. > > - **TRON staking/unstaking UX**: > - Localizes error messages via `getLocalizedErrorMessage`; maps `InsufficientBalance` to i18n key (`en.json`). > - On successful stake/unstake, calls `MultichainBalancesController.updateBalance(accountId)` and navigates to success sheet; logs on failure. > - Passes `tronAccountId` from `useTronStake`/`useTronUnstake` to `handleTronStakingNavigationResult`. > - Skips EVM `MaxInputModal` for TRX and treats right action as preview/done; updates tests to assert behavior. > - **Asset overview (TRON)**: > - Uses live TRX asset data via `selectAsset` to source `balance`/`balanceFiat` instead of navigation params when on `tron:` chain. > - **Hooks & tests**: > - `useTronStake`/`useTronUnstake`: expose `tronAccountId`; corresponding unit tests added. > - Expanded tests for TRON earn input flow and tron utils (localization and balance refresh). > - **Misc**: > - Minor snapshot updates. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e8b8812. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [118250c](118250c) Co-authored-by: António Regadas <antonio.regadas@consensys.net>
…etamask/tron-wallet-snap versions (#24205) - chore: update @metamask/keyring-api and @metamask/tron-wallet-snap versions (#23818) <!-- 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. --> Following MetaMask/metamask-extension#38466 : - Bump @metamask/tron-wallet-snap to [v1.15.1](https://github.com/MetaMask/snap-tron-wallet/releases/tag/v1.15.1) - Bump @metamask/keyring-api to [v21.3.0](https://github.com/MetaMask/accounts/releases/tag/v81.0.0) This PR is required before enabling Tron dApp connectivity support. ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **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: ## **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] > Switch TRX signing detection to `TrxMethod.SignMessage`, update related tests, and bump `@metamask/keyring-api` to `^21.3.0`. > > - **Selectors**: > - Update `selectCanSignTransactions` to check `TrxMethod.SignMessage` (replacing `SignMessageV2`). > - **Tests**: > - Adjust `accountsController.test.ts` to use TRX `SignMessage` naming and expectations. > - **Dependencies**: > - Bump `@metamask/keyring-api` from `^21.2.0` to `^21.3.0` (lockfile updated). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5e61e10. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [94bc787](94bc787) Co-authored-by: Baptiste Marchand <75846779+baptiste-marchand@users.noreply.github.com>
…ron network (#24207) - feat: add support for accountChanged for Tron network (#23639) <!-- 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** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> After Solana, add the support for Tron account Change. In parallel, a new PR is in progress to factorize this code and make it generic for all non-EVM chains: Solana, Tron, Bitcoin, etc. ## **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: Add Tron Account Change detection support for multichain Api (#23639) ## **Related issues** Fixes: ## **Manual testing steps** You could try with our Tron test app here: https://metamask.github.io/test-dapp-tron/latest/ ```gherkin Feature: User connection Scenario: User connection on Mainnet Given the network Shasta Network is selected by default When user user select mainnet network, and then select MetaMask Wallet Then MetaMask connection screen popup Scenario: User connection on Shasta (2 step connection) Given the network Shasta Network is selected by default When user user select MetaMask Wallet Then MetaMask connection screen popup to connect. Once connected an other connection screen to accept to connect to Shasta. Scenario: User reload the page Given the user is already connected to a specific network and account When user user reload the app Then the app should re-connect to Metamask automatically with the right account and network. Feature: Chain Change Scenario: Ask permission for new chain Given the network Shasta Network is the only one user accepted When user user switch to mainnet Then MetaMask connection screen popup to accept. Once connected the chain mainnet is selected. Scenario: Do not ask permission for chain Given the network Shasta Network AND mainnet are allowed When user user switch to mainnet Then the chain mainnet is selected. Feature: Account Change Scenario: User do not change if select a not allowed account Given the user allow only one account When user user switch to an other account Then nothing happens in the app. Scenario: User change if select an allowed account Given the user allow only 2 accounts When user user switch to the second account Then nothing the selected address change in the app Feature: Disconnect Scenario: User disconnects from MM Given the user is connected When user remove the session from MM Then the app disconnects ``` ## **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] > Adds Tron accountChanged support in the multichain provider (parallel to Solana), wiring subscriptions, initial emits, and tests, plus minor refactor and dependency bumps. > > - **BackgroundBridge (Multichain provider)**: > - Add Tron support: import `TrxScope`/`TrxAccountType`, track `lastSelectedTronAccountAddress`, and subscribe/unsubscribe to Tron-related `PermissionController`, `AccountsController`, and `AccountTreeController` events. > - Emit initial Tron accountChanged on connection via `notifyTronAccountChangedForCurrentAccount()`. > - Implement Tron handlers: `handleTronAccountChangedFromScopeChanges`, `handleTronAccountChangedFromSelectedAccountChanges`, `handleTronAccountChangedFromSelectedAccountGroupChanges`, and `getTronAccountFromSelectedAccountGroup`. > - Generalize notifier to `_notifyMultichainAccountChange(value, scope)` and update Solana paths to use it; rename helper to `getSolanaAccountFromSelectedAccountGroup`. > - **Tests**: > - Add comprehensive Tron accountChanged tests mirroring Solana coverage; fix minor expectation usage (`not.toHaveBeenCalled`). > - **Dependencies**: > - Bump `@metamask/chain-agnostic-permission` to `^1.3.0`, `@metamask/multichain-api-client` to `^0.10.1`, and `@metamask/multichain-api-middleware` to `1.2.5` (lockfile updated). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 511d45c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Baptiste Marchand <75846779+baptiste-marchand@users.noreply.github.com> [d6aa74e](d6aa74e) Co-authored-by: Edouard Bougon <15703023+EdouardBougon@users.noreply.github.com> Co-authored-by: Baptiste Marchand <75846779+baptiste-marchand@users.noreply.github.com>
…24206) - feat: NWNT-681: Add useTronStakeApy hook (#23743) <!-- 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** Added new `useTronStakeApy` hook. ### Changes: - Added `useTronStakeApy` hook which fetches all witness data and returns the APY for the Consensys witness and exposes the following properties: - isLoading: returns `true` if actively fetching witness data. - errorMessage: error message if fetch fails - apyDecimal: Consensys witness/SR `annualizedRate` in decimal form - apyPercent: Consensys witness/SR `annualizedRate` in percentage form - refetch: Allows refetching of witness data - Bumped [@metamask/stake-sdk ](https://www.npmjs.com/package/@metamask/stake-sdk)to `^3.4.0`. - Added `truncateNumber` util. This is used to format the Tron staking APY without rounding. Note: `useTronStakeApy` calls `getWitnesses` from the stake-sdk which fetches **all** witnesses data. Meaning if additional data besides the APR is desired this function can be reused elsewhere. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **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: added useTronStakeApy hook ## **Related issues** Fixes: [NWNT-681: Add tron staking apy to client](https://consensyssoftware.atlassian.net/browse/NWNT-681) ## **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] --> N/A ### **After** <!-- [screenshots/recordings] --> N/A ## **Pre-merge author checklist** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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] > Adds `useTronStakeApy` hook to fetch Consensys TRON witness APY, introduces `truncateNumber`, exposes `tronStakingApiService`, and bumps `@metamask/stake-sdk` to ^3.4.0. > > - **Hooks**: > - Add `app/components/UI/Earn/hooks/useTronStakeApy.ts` to fetch witnesses via `tronStakingApiService.getWitnesses` and return Consensys APY (`apyDecimal`, `apyPercent`), with loading/error state and `refetch`. > - **Utils**: > - Add `truncateNumber` in `app/components/UI/Earn/utils/number.ts` for non-rounding 2-decimal truncation. > - **SDK Provider**: > - Expose `tronStakingApiService` in `app/components/UI/Stake/sdk/stakeSdkProvider.tsx`. > - **Dependencies**: > - Bump `@metamask/stake-sdk` to `^3.4.0`. > - **Tests**: > - Add comprehensive tests for `useTronStakeApy` and `truncateNumber`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 13b8f6b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [e434448](e434448) Co-authored-by: Matthew Grainger <46547583+Matt561@users.noreply.github.com>
…mprovements (#24209) - feat: add Tron stakeComputeFee and other improvements (#23662) <!-- 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** - Adds the tron snap call for the compute fee for staking and unstaking. - Small UI improvement. - Adds Tron APR value to a few places using the `useTronStakeApy` hook. - Adds the `Staking Withdrawal` and `Staking Deposit` mapping ## **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] > Adds Snap-backed Tron stake/unstake fee computation, passes/display Tron APR in headers/CTA, highlights “Done” quick amount for TRON, and maps staking tx titles. > > - **TRON staking/unstaking**: > - Compute and include stake/unstake fee via Snap `computeStakeFee`; add error logging; update previews to show `fee` when available. > - Use `useTronStakeApy` to surface APR: pass to `getStakingNavbar` and `TronStakingCta`. > - Input UX: replace last quick amount with highlighted `Done` when editing non-zero; show TRON preview with fees; wire validation on keypad input. > - **Navbar**: > - Extend `getStakingNavbar(title, ..., earnToken, aprOverride)`; format APR correctly and display with balance. > - **Hooks/Types**: > - Add `QuickAmount` type and `isHighlighted` support; adopt in `QuickAmounts` with new styles. > - Update `useInput` typings; Tron hooks depend on `resourceType` and include fee logic. > - **Transaction titles**: > - Map `StakeDeposit` and `StakeWithdraw` to localized staking titles in multichain display. > - **Tests**: > - Add/extend unit tests for TRON fee computation, previews, and navbar arg changes; adjust TRON quick amount “Done” behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5adaec3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Antonio Regadas <antonio.regadas@consensys.net> [730c8b9](730c8b9) --------- Co-authored-by: Ulisses Ferreira <ulisses@hey.com> Co-authored-by: Antonio Regadas <antonio.regadas@consensys.net> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
<!--
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**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **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:
## **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]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
bc90da8. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Nicholas Ellul <15018469+NicholasEllul@users.noreply.github.com>
Co-authored-by: Jiexi Luan <jiexiluan@gmail.com>
<!--
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**
Dapp connection implementaion robustness
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **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:
## **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]
> Strengthens origin validation to prevent external dapps from using
internal MetaMask origins.
>
> - Enforces `INTERNAL_ORIGINS` checks and throws
`rpcErrors.invalidParams` in `eth_sendTransaction`, SDK deeplink
`processDappRpcRequest`, SDK `setupBridge`, SDKConnectV2
`handleConnectDeeplink`, WC2 `onSessionProposal`, and WC2 session
`handleSendTransaction`.
> - Normalizes use of origin/hostname where needed and persists origin
metadata for UI as before.
> - Updates WC2 tests: stubs `rejectSession` to resolve, adds
comprehensive origin-rejection cases (blocks plain `metamask`, allows
valid URLs including subdomains and `metamask.io`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bd6a404. 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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
<!--
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**
More robust deeplinking
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **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:
## **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]
> Strengthens deeplink safety by rejecting internal-origin channelIds
for external flows.
>
> - Adds `INTERNAL_ORIGINS` validation in `connectWithWC` and
`handleMetaMaskDeeplink`; throws on internal-origin `channelId`
> - Refactors to derive `channelId` once and pass it to
`handleConnection`, `handleDeeplink`, and `handleMessage`
> - No other behavior changes intended
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
925feac. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThis PR contains significant security hardening and multi-chain (Tron) staking functionality changes that warrant comprehensive testing: HIGH RISK CHANGES:1. Critical Security Hardening (INTERNAL_ORIGINS protection)
2. BackgroundBridge - Tron Account Change Notifications
3. Tron Staking Feature Implementation
4. Account Selector & Multichain Updates
5. Package Dependencies
6. WalletConnect V2 Changes
TEST TAG SELECTION RATIONALE:
NOT SELECTED:
|
|
Cal-L
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.
LGTM
The merge-base changed after approval.
<!--
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**
Refine hardware signing flow
## **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] -->
Performing unified swaps and bridge
https://github.com/user-attachments/assets/224ccca4-bf1a-421b-8c35-6e33489755dc
## **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]
> **Hardware signing flow refinement**
>
> - In `RootRPCMethodsUI.autoSign`, detect `Ledger` and `QR` hardware
accounts and only auto-sign for those; non-hardware accounts return
early
> - Ledger transactions now navigate to the Ledger transaction
confirmation modal; QR accounts proceed via
`Engine.acceptPendingApproval`
> - Notes that unified swaps/bridge no longer use this path; maintains
transaction finish/confirm listeners and swaps metrics handling
>
> **Changelog updates**
>
> - Adds `7.61.3`, `7.61.4`, `7.61.5` sections and updates compare links
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1761028. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
| shouldShowTronReviewButton && renderReviewButton(isReviewButtonDisabled) | ||
| ///: END:ONLY_INCLUDE_IF | ||
| } | ||
| {!isTronEnabled && renderReviewButton(isReviewButtonDisabled)} |
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.
Undefined variables crash non-Tron builds
The variables isTronEnabled and isTronNative are only declared inside ONLY_INCLUDE_IF(tron) preprocessor blocks, but they're used outside these blocks at lines 204, 961, and 1075 in EarnInputView.tsx, and lines 198, 209, and 950 in EarnWithdrawInputView.tsx. In non-Tron builds where the preprocessor removes those blocks, accessing these undeclared variables will throw a ReferenceError, crashing the app. The code already has properly-scoped wrapper variables (showTronStakingUI, showTronUnstakingUI) initialized with fallback values that could be used instead.
Additional Locations (2)
| isOverMaximum.isOverMaximumEth || | ||
| !isNonZeroAmount || | ||
| (isTronNative ? isTronStakeValidating : isLoadingEarnGasFee) || | ||
| isSubmittingStakeDepositTransaction; |
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.
Tron variables used outside conditional block cause ReferenceError
Variables isTronNative and isTronStakeValidating are declared inside the ONLY_INCLUDE_IF(tron) block (lines 135-148) but are accessed outside conditional blocks at lines 204, 717, and 961. In non-Tron builds, these lines of code remain but the variable declarations are removed by the preprocessor, causing a ReferenceError crash. The pattern used for showTronStakingUI (declared outside, assigned inside) is correct, but this pattern is not followed for these variables.
Additional Locations (2)
| } | ||
|
|
||
| return percentageOptions; | ||
| }, [isTronEnabled, isPreviewVisible, isNonZeroAmount, percentageOptions]); |
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.
Undeclared isTronEnabled variable in withdraw view
The isTronEnabled variable is declared inside ONLY_INCLUDE_IF(tron) (line 87) but used outside at lines 198, 209, and 808. In non-Tron builds, the useMemo at line 197 and useCallback at line 807 will throw a ReferenceError because isTronEnabled is undeclared. Unlike showTronUnstakingUI which is properly declared outside the conditional block, isTronEnabled follows an incorrect pattern.



🚀 v7.61.5 Testing & Release Quality Process
Hi Team,
As part of our new MetaMask Release Quality Process, here’s a quick overview of the key processes, testing strategies, and milestones to ensure a smooth and high-quality deployment.
📋 Key Processes
Testing Strategy
Conduct regression and exploratory testing for your functional areas, including automated and manual tests for critical workflows.
Focus on exploratory testing across the wallet, prioritize high-impact areas, and triage any Sentry errors found during testing.
Validate new functionalities and provide feedback to support release monitoring.
GitHub Signoff
Issue Resolution
Cherry-Picking Criteria
🗓️ Timeline and Milestones
✅ Signoff Checklist
Each team is responsible for signing off via GitHub. Use the checkbox below to track signoff completion:
Team sign-off checklist
This process is a major step forward in ensuring release stability and quality. Let’s stay aligned and make this release a success! 🚀
Feel free to reach out if you have questions or need clarification.
Many thanks in advance
Reference
Note
Release prep and infra
versionNameto7.61.5(versionCode 3341) and updateCHANGELOG.mdTRON staking/unstaking UX
useTronStake/useTronUnstake,TronStakePreview,ResourceToggle, APY display, and preview mode with "Done" replacing "Max" during inputformatChainIdForAnalyticsMultichain input handling (non‑EVM)
useMultichainInputHandlersto compute fiat/token amounts using multichain rates and preserve typed fiat, integrated intouseEarnInputanduseEarnWithdrawInputEarn flows and assets
AssetOverview: prefer live TRON balances viaselectAsset; refine fiat/balance sources; derive staked TRX assetEarnTokenList: include TRX when staking enabled and navigate without EVM network switching; prepare network only for EVMTronStakingButtons: resolve base TRX from selector when starting from sTRXEarnTokenSelector: choose output token for withdraw, earn token for stakeInputDisplay: make amount area pressable to exit preview/editSigning flow
RootRPCMethodsUI: only auto-sign for Ledger/QR hardware accounts; unified swaps/bridge no longer pass through this pathTests
Written by Cursor Bugbot for commit f306b8e. This will update automatically on new commits. Configure here.