…by MetaMask label in sponsored transactions from activity page cp-13.41.0 (#44780)
<!--
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?
-->
Fixes Monad swap activity details showing a network fee amount instead
of `Paid by MetaMask` for gas-sponsored swaps.
This PR reuses the existing gas sponsorship display logic and applies it
to the new Activity Details fee rows.
When a local transaction is marked as gas-sponsored, Activity Details
now renders the network fee as `Paid by MetaMask` instead of showing a
calculated fee.
Also adds unit tests for the sponsorship logic and fee row rendering.
## **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: Fixed sponsored network fee transfer to show the `Paid
by MetaMask` label in activity page
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/WPN-1713
## **Manual testing steps**
1. Perform a MON to USDC swap on Monad.
2. Open the Activity tab.
3. Click the completed swap transaction.
4. Verify the transaction details show:
- Network fee
- Paid by MetaMask
5. Open the same swap from the token details activity list
6. Verify the token details transaction view also shows
- Network fee
- Paid by MetaMask
10. As a regression check, open a normal non-sponsored transaction
11. Verify normal transactions still show the calculated network fee
amount instead of `Paid by MetaMask`
12. As another regression check, verify rejected transactions do not
show `Paid by MetaMask`
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
<img width="831" height="813"
alt="625474154-06befb51-1ed3-48be-8a88-a91cbd295c6a"
src="https://github.com/user-attachments/assets/da34bba1-ba3c-47c1-98f0-432494f4a094"
/>
### **After**
<!-- [screenshots/recordings] -->
<img width="1009" height="1283" alt="Screenshot From 2026-07-23
15-51-51"
src="https://github.com/user-attachments/assets/9b921be1-41c5-4906-94a7-1376c9f8b0a5"
/>
## **Pre-merge author checklist**
- [X] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [X] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [X] 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]
> **Low Risk**
> Display-only activity fee labeling with shared sponsorship helper;
covered by unit tests and no payment or signing logic changes.
>
> **Overview**
> Gas-sponsored swaps (e.g. Monad) were showing a calculated **network
fee** in Activity Details instead of **Paid by MetaMask**. This change
wires the same sponsorship rules used on the legacy transaction
breakdown into the activity fee pipeline.
>
> Local activity items now attach a `gas-fee-sponsored` fee marker when
`isGasFeeSponsored` applies (with hardware wallets,
failed-without-receipt, revoke delegation, and rejected txs excluded).
When API-enriched activity replaces the local row,
`mergeActivityItemSponsoredFees` keeps that marker and drops the API’s
base network fee. **FeesRows** renders the sponsored type as **Paid by
MetaMask** via `SuccessPill`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1800b9b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Description
Fixes Monad swap activity details showing a network fee amount instead
of
Paid by MetaMaskfor gas-sponsored swaps.This PR reuses the existing gas sponsorship display logic and applies it
to the new Activity Details fee rows.
When a local transaction is marked as gas-sponsored, Activity Details
now renders the network fee as
Paid by MetaMaskinstead of showing acalculated fee.
Also adds unit tests for the sponsorship logic and fee row rendering.
Changelog
CHANGELOG entry: Fixed sponsored network fee transfer to show the
Paid by MetaMasklabel in activity pageRelated issues
Fixes: https://consensyssoftware.atlassian.net/browse/WPN-1713
Manual testing steps
amount instead of
Paid by MetaMaskshow
Paid by MetaMaskScreenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask
Extension Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Low Risk
Display-only activity fee labeling with shared sponsorship helper;
covered by unit tests and no payment or signing logic changes.
Overview
Gas-sponsored swaps (e.g. Monad) were showing a calculated network
fee in Activity Details instead of Paid by MetaMask. This change
wires the same sponsorship rules used on the legacy transaction
breakdown into the activity fee pipeline.
Local activity items now attach a
gas-fee-sponsoredfee marker whenisGasFeeSponsoredapplies (with hardware wallets,failed-without-receipt, revoke delegation, and rejected txs excluded).
When API-enriched activity replaces the local row,
mergeActivityItemSponsoredFeeskeeps that marker and drops the API’sbase network fee. FeesRows renders the sponsored type as Paid by
MetaMask via
SuccessPill.Reviewed by Cursor Bugbot for commit
1800b9b. Bugbot is set up for automated
code reviews on this repo. Configure
here.