fix: totals in MUSD conversion using max button#26015
Merged
matthewwalsh0 merged 3 commits intomainfrom Feb 13, 2026
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
8a8a0b1 to
8d1faf4
Compare
Matt561
reviewed
Feb 12, 2026
app/components/Views/confirmations/hooks/transactions/useTransactionCustomAmount.ts
Show resolved
Hide resolved
7 tasks
7974246 to
6ed2017
Compare
joaoloureirop
pushed a commit
that referenced
this pull request
Feb 12, 2026
## **Description** Cherry-pick #26015 into `7.65.0` release. Applies a Yarn patch to `@metamask/transaction-pay-controller` instead of bumping controller version to avoid unrelated changes. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #25972 ## **Manual testing steps** ## **Screenshots/Recordings** ## **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] > **Medium Risk** > Touches transaction-pay quoting/totals and stablecoin detection, which can affect displayed costs and max-amount behavior across networks; mitigated by being a targeted patch and limited app-side changes. > > **Overview** > Fixes transaction pay quote/total calculations by **patching `@metamask/transaction-pay-controller` 12.1.0** rather than bumping the dependency. > > The patch centralizes a multi-chain `STABLECOINS` list, treats stablecoins as $1 in token fiat-rate logic, and changes `targetAmount` across quotes/totals to be a `FiatValue` summed via `sumFiat` (avoiding incorrect max/totals math). Relay quote normalization now accounts for `fees.subsidized` by zeroing provider fees when subsidized and optionally including the subsidized amount in the computed target fiat value; Bridge normalization aligns `targetAmount` to fiat-only as well. > > On the mobile side, `useTokenFiatRates` now uses a stablecoin allowlist (Mainnet/Arbitrum/Linea/Polygon) to return a fixed USD rate of `1`, and the related unit test is generalized accordingly. The Transaction Pay controller messenger drops the unused `TokenListController:getState` action, and `package.json`/`yarn.lock` are updated to consume the patched controller via Yarn’s `patch:` protocol. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 61d257e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
nickewansmith
previously approved these changes
Feb 12, 2026
OGPoyraz
previously approved these changes
Feb 12, 2026
sleepytanya
previously approved these changes
Feb 12, 2026
vinistevam
previously approved these changes
Feb 12, 2026
Handle controller breaking changes. Update stablecoins.
9d2309c
9d2309c
6ed2017 to
9d2309c
Compare
Contributor
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
OGPoyraz
approved these changes
Feb 13, 2026
tommasini
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Ensure totals are correct for MUSD conversions using
Maxbutton.@metamask/transaction-pay-controllerand handle breaking changes.useTokenFiatRates.Changelog
CHANGELOG entry: null
Related issues
Fixes: #25972
Manual testing steps
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Upgrades
@metamask/transaction-pay-controllerwith API changes and alters how Max-state is persisted, which could impact confirmation totals and transaction config behavior across networks.Overview
Fixes USD totals for stablecoin payments by treating a broader set of stablecoins as having a fixed
1USD rate inuseTokenFiatRates(adds MUSD/USDC/USDT on Mainnet & Linea, plus Polygon USDC.e; replaces per-feature constants with a chain/address allowlist).Updates
useTransactionCustomAmountto reflect breaking changes from bumping@metamask/transaction-pay-controllerto^14.0.0, switching fromsetIsMaxAmounttosetTransactionConfigfor togglingisMaxAmount, and adjusts related unit tests/messenger action delegation accordingly.Written by Cursor Bugbot for commit 9d2309c. This will update automatically on new commits. Configure here.