Skip to content

Conversation

@metamaskbot
Copy link
Collaborator

@metamaskbot metamaskbot commented Dec 24, 2025

🚀 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

  • Developer Teams:
    Conduct regression and exploratory testing for your functional areas, including automated and manual tests for critical workflows.
  • QA Team:
    Focus on exploratory testing across the wallet, prioritize high-impact areas, and triage any Sentry errors found during testing.
  • Customer Success Team:
    Validate new functionalities and provide feedback to support release monitoring.

GitHub Signoff

  • Each team must sign off on the Release Candidate (RC) via GitHub by the end of the validation timeline (Tuesday EOD PT).
  • Ensure all tests outlined in the Testing Plan are executed, and any identified issues are addressed.

Issue Resolution

  • Resolve all Release Blockers (Sev0 and Sev1) by Tuesday EOD PT.
  • For unresolved blockers, PRs may be reverted, or feature flags disabled to maintain release quality and timelines.

Cherry-Picking Criteria

  • Only critical fixes meeting outlined criteria will be cherry-picked.
  • Developers must ensure these fixes are thoroughly reviewed, tested, and merged by Tuesday EOD PT.

🗓️ Timeline and Milestones

  1. Today (Friday): Begin Release Candidate validation.
  2. Tuesday EOD PT: Finalize RC with all fixes and cherry-picks.
  3. Wednesday: Buffer day for final checks.
  4. Thursday: Submit release to app stores and begin rollout to 1% of users.
  5. Monday: Scale deployment to 10%.
  6. Tuesday: Full rollout to 100%.

✅ Signoff Checklist

Each team is responsible for signing off via GitHub. Use the checkbox below to track signoff completion:

Team sign-off checklist

  • Mobile Platform

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

  • Bump Android versionName to 7.61.5 (versionCode 3341) and update CHANGELOG.md

TRON staking/unstaking UX

  • Add TRON-specific flows: useTronStake/useTronUnstake, TronStakePreview, ResourceToggle, APY display, and preview mode with "Done" replacing "Max" during input
  • Pass TRON data to navbar; make amount press re-open editing; add analytics chain id formatting via formatChainIdForAnalytics

Multichain input handling (non‑EVM)

  • New useMultichainInputHandlers to compute fiat/token amounts using multichain rates and preserve typed fiat, integrated into useEarnInput and useEarnWithdrawInput

Earn flows and assets

  • AssetOverview: prefer live TRON balances via selectAsset; refine fiat/balance sources; derive staked TRX asset
  • EarnTokenList: include TRX when staking enabled and navigate without EVM network switching; prepare network only for EVM
  • TronStakingButtons: resolve base TRX from selector when starting from sTRX
  • EarnTokenSelector: choose output token for withdraw, earn token for stake
  • InputDisplay: make amount area pressable to exit preview/edit

Signing flow

  • RootRPCMethodsUI: only auto-sign for Ledger/QR hardware accounts; unified swaps/bridge no longer pass through this path

Tests

  • Add/expand comprehensive unit tests and snapshots across Earn input/withdraw, token list, TRON preview/buttons, and multichain input behavior

Written by Cursor Bugbot for commit f306b8e. This will update automatically on new commits. Configure here.

metamaskbot and others added 20 commits December 19, 2025 16:36
…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 -->
@github-actions
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Dec 24, 2025
@socket-security
Copy link

socket-security bot commented Dec 24, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​multichain-api-middleware@​1.2.4 ⏵ 1.2.5991007695100
Updatednpm/​@​metamask/​chain-agnostic-permission@​1.2.2 ⏵ 1.3.0100 +11007895 +1100
Updatednpm/​@​metamask/​multichain-api-client@​0.7.0 ⏵ 0.10.110010010096 -4100

View full report

@socket-security
Copy link

socket-security bot commented Dec 24, 2025

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Network access: npm @metamask/multichain-api-middleware in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.jsonnpm/@metamask/multichain-api-middleware@1.2.5

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/multichain-api-middleware@1.2.5. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@metamaskbot metamaskbot added the release-7.61.5 Issue or pull request that will be included in release 7.61.5 label Dec 24, 2025
<!--
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 -->
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeCore, SmokeWalletPlatform, SmokeAccounts, SmokeMultiChainPermissions, SmokeStake, SmokeConfirmationsRedesigned, SmokeNetworkAbstractions
  • Risk Level: high
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

This 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)

  • Files: BackgroundBridge.js, WalletConnectV2.ts, WalletConnect2Session.ts, SDKConnect handlers, DeeplinkManager handlers, eth_sendTransaction.ts
  • Impact: Prevents external connections (WalletConnect, SDK, Deeplinks) from impersonating internal MetaMask origins
  • Risk: Security-critical changes across ALL external connection entry points
  • Testing needed: SmokeCore, SmokeWalletPlatform, SmokeMultiChainPermissions, SmokeConfirmationsRedesigned

2. BackgroundBridge - Tron Account Change Notifications

  • File: app/core/BackgroundBridge/BackgroundBridge.js (300+ lines changed)
  • Impact: Adds complete Tron account change notification system parallel to existing Solana implementation
  • Changes:
    • New Tron account tracking (lastSelectedTronAccountAddress)
    • Event subscriptions for Tron account changes
    • Multi-chain notification system (_notifyMultichainAccountChange)
    • TrxScope, TrxAccountType imports and handling
  • Risk: Core wallet infrastructure change affecting multi-chain account management
  • Testing needed: SmokeCore, SmokeAccounts, SmokeMultiChainPermissions

3. Tron Staking Feature Implementation

  • Files: Extensive changes across app/components/UI/Earn/* (30+ files), selectors/earnController, multichain constants
  • Impact: Complete Tron staking UI and business logic
  • New Features:
    • useTronStake, useTronUnstake hooks
    • Tron resource types (ENERGY, BANDWIDTH)
    • Integration with Tron Snap
    • Earn token selector updates for Tron
    • Balance calculations for non-EVM chains
  • Risk: New feature affecting staking flows and asset management
  • Testing needed: SmokeStake, SmokeAssets (if it existed), SmokeNetworkAbstractions

4. Account Selector & Multichain Updates

  • Files: accountsController.ts selector fix (TrxMethod.SignMessage), multichain.ts selector (selectAccountTokensAcrossChainsUnified)
  • Impact:
    • Fixed Tron signing capability detection
    • New unified selector merging EVM and non-EVM tokens
    • Filters out Tron resource tokens from Earn list
  • Risk: Account permission and token display logic changes
  • Testing needed: SmokeAccounts, SmokeWalletPlatform, SmokeMultiChainPermissions

5. Package Dependencies

  • File: package.json - version bump to 7.61.5
  • Major updates:
    • @metamask/snaps-sdk: 10.1.0 (from ^10.0.0)
    • @metamask/snaps-utils: 11.6.1 (new)
    • @metamask/snaps-controllers: 17.0.0 (patched)
    • @metamask/bridge-controller: 61.0.0 (patched)
    • @metamask/chain-agnostic-permission: ^1.3.0 (from ^1.2.2)
    • @metamask/network-controller: ^27.1.0 (from ^25.0.0)
    • @metamask/transaction-controller: 62.6.0 (from 62.3.0)
    • @metamask/tron-wallet-snap: ^1.16.0 (from ^1.13.0)
    • @metamask/stake-sdk: ^3.4.0 (from ^3.2.0)
    • Many middleware and controller updates
  • Risk: Controller and Snap updates can affect core functionality
  • Testing needed: SmokeCore, SmokeWalletPlatform, SmokeStake

6. WalletConnect V2 Changes

  • Files: WalletConnectV2.ts, WalletConnect2Session.ts
  • Impact: Added origin validation to reject ORIGIN_METAMASK connections, session validation
  • Risk: External dApp connection flow changes
  • Testing needed: SmokeCore, SmokeWalletPlatform, SmokeMultiChainPermissions

TEST TAG SELECTION RATIONALE:

  1. SmokeCore - BackgroundBridge is the core bridge between app and engine; security changes affect all external connections
  2. SmokeWalletPlatform - Core wallet functionality, account management, network switching all affected
  3. SmokeAccounts - Account selection, multi-chain account management, signing capabilities updated
  4. SmokeMultiChainPermissions - Multi-chain permissions system updated with Tron support and security hardening
  5. SmokeStake - Tron staking feature is a major addition to existing staking functionality
  6. SmokeConfirmationsRedesigned - Transaction confirmations affected by eth_sendTransaction security changes
  7. SmokeNetworkAbstractions - Multi-chain network layer changes with Tron integration

NOT SELECTED:

  • SmokeSwaps/SmokeTrade - No swap/trade changes
  • SmokeRamps - Only minor UI snapshot changes
  • SmokeAssets - Would be ideal but tag doesn't exist; covered partially by other tags
  • Other specialized tags (Card, Perps, Predictions, etc.) - No related changes

View GitHub Actions results

@sonarqubecloud
Copy link

Cal-L
Cal-L previously approved these changes Dec 24, 2025
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@weitingsun weitingsun marked this pull request as ready for review December 24, 2025 18:09
@weitingsun weitingsun requested review from a team as code owners December 24, 2025 18:09
@metamaskbot metamaskbot dismissed Cal-L’s stale review December 24, 2025 18:24

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)}
Copy link

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)

Fix in Cursor Fix in Web

isOverMaximum.isOverMaximumEth ||
!isNonZeroAmount ||
(isTronNative ? isTronStakeValidating : isLoadingEarnGasFee) ||
isSubmittingStakeDepositTransaction;
Copy link

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)

Fix in Cursor Fix in Web

}

return percentageOptions;
}, [isTronEnabled, isPreviewVisible, isNonZeroAmount, percentageOptions]);
Copy link

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.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-7.61.5 Issue or pull request that will be included in release 7.61.5 size-XL team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants