Skip to content

fix: cp-7.65.0 totals in MUSD conversion using max button#26029

Merged
joaoloureirop merged 1 commit intorelease/7.65.0from
fix/cp-7.65.0-metamask-pay-max-totals
Feb 12, 2026
Merged

fix: cp-7.65.0 totals in MUSD conversion using max button#26029
joaoloureirop merged 1 commit intorelease/7.65.0from
fix/cp-7.65.0-metamask-pay-max-totals

Conversation

@matthewwalsh0
Copy link
Copy Markdown
Member

@matthewwalsh0 matthewwalsh0 commented 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

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.

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.

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

…nd stablecoins

Cherry-pick changes from fix/metamask-pay-max-totals:
- Expand stablecoin list for fiat rate calculations
- Update setIsMaxAmount to setTransactionConfig API
- Remove TokenListController from pay controller messenger

Apply yarn patch for @metamask/transaction-pay-controller@12.1.0:
- Add subsidized fee to target amount for EXACT_INPUT trades
- Narrow targetAmount from Amount to FiatValue type
- Use amountFormatted as USD value for stablecoin target amounts
- Centralize and expand STABLECOINS map
(core commit: 44ebd35472f63196fbb79d9f4df4fe045ca7e02d)
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Feb 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.65.0)

All E2E tests pre-selected.

View GitHub Actions results

@matthewwalsh0 matthewwalsh0 changed the title fix: cp-7.65.0 patch transaction-pay-controller for relay quote target amount and stablecoins fix: cp-7.65.0 totals in MUSD conversion using max button Feb 12, 2026
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review February 12, 2026 17:45
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners February 12, 2026 17:45
@sonarqubecloud
Copy link
Copy Markdown

@joaoloureirop joaoloureirop merged commit 81c5841 into release/7.65.0 Feb 12, 2026
196 of 199 checks passed
@joaoloureirop joaoloureirop deleted the fix/cp-7.65.0-metamask-pay-max-totals branch February 12, 2026 19:08
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Feb 20, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

No release label on PR. Adding release label release-7.65.0 on PR, as PR was added to branch 7.65.0 when release was cut.

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

Labels

release-7.65.0 Issue or pull request that will be included in release 7.65.0 size-L team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants