chore(runway): cherry-pick fix: hardware wallet eip 7702 issue ()#27892
Conversation
<!-- 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. --> <!-- 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? --> This PR will provide a fix for hardware wallet to gas free network like Monad and Sei. Due to currently Hardware wallet is not supported for EIP 7702 gas sponsorship, and Swap feature is not working for hardware wallet user. This fix will fall back the Gasless transaction to User pay gas previous model so that user can still do the swap and sign transaction like bfore. This is temporately fix for current version of extensions, and we will do a proper support in the future. Similar to extension PR: MetaMask/metamask-extension#40915 Ticket: https://consensyssoftware.atlassian.net/jira/software/c/projects/NEB/boards/3738/backlog?selectedIssue=NEB-767 <!-- 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: Hardware wallet user will fall back to use `User pay gas` for those Gasless network due to hardware wallet not supported in Gasless network like Sei and Monad. Fixes: ```gherkin Feature: Gas sponsorship disabled for hardware wallet accounts Scenario: Hardware wallet user does not use gas sponsorship on sponsored network Given the user has added a hardware wallet account (Ledger or QR-based) And the hardware wallet account is selected as the active account And the user has added a gas-sponsored network (e.g. Monad) When the user attempts to perform a swap a dapp interaction or send a transaction on the sponsored network Then the transaction should not use gas sponsorship And the UI should not display any gas sponsorship labels (e.g. "No network fee", "Paid by MetaMask") And the user should see the normal network gas fee And the transaction should follow the standard user-pays-gas flow ``` <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <!-- [screenshots/recordings] --> > With HW account: Network list: <img width="392" height="800" alt="Screenshot 2026-03-18 at 16 05 48" src="https://github.com/user-attachments/assets/601c30cc-fd78-456e-87b5-cc70e7ce3433" /> Tx flow: <img width="392" height="800" alt="Screenshot 2026-03-18 at 15 53 04" src="https://github.com/user-attachments/assets/7c7b60cf-3f79-4701-a1e5-1fbba2bfe84e" /> <img width="392" height="800" alt="Screenshot 2026-03-18 at 15 55 20" src="https://github.com/user-attachments/assets/a3258815-f1d2-4abf-8b22-209b73a0fbba" /> <img width="392" height="800" alt="Screenshot 2026-03-18 at 15 55 47" src="https://github.com/user-attachments/assets/9275c82c-e56a-47ad-a203-a34f67ed6ed9" /> > With HW account: Network list: <img width="392" height="800" alt="Screenshot 2026-03-18 at 16 06 19" src="https://github.com/user-attachments/assets/03a296be-17fe-4387-baa0-23bae3ba00eb" /> Tx flow: <img width="392" height="800" alt="Screenshot 2026-03-18 at 15 49 55" src="https://github.com/user-attachments/assets/b39bc1b0-4b28-4e06-ae06-a381458ba7f6" /> <img width="392" height="800" alt="Screenshot 2026-03-18 at 15 50 29" src="https://github.com/user-attachments/assets/76a31213-9ecd-4290-b407-58ffb8d82f48" /> <!-- [screenshots/recordings] --> - [ ] 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. - [ ] 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 gasless sponsorship and transaction publishing paths (including 7702 delegation), which can affect whether transactions are sponsored vs user-paid and could change behavior on supported chains. Changes are scoped to hardware-wallet detection gates with added tests, reducing regression risk. > > **Overview** > Hardware wallet accounts now **opt out of gasless / EIP-7702 sponsorship**, forcing swaps/bridge and confirmations to use the normal *user-pays-gas* path. > > This adds an `accountSupports7702` gate to `TransactionControllerInit` so `Delegation7702PublishHook` and `isEIP7702GasFeeTokensEnabled` only activate for keyrings that support 7702, and updates `useIsGaslessSupported`/`useIsGasIncluded7702Supported` (via new `useIsHardwareWalletForBridge`) to report unsupported for hardware signers. > > Network selection UI (`NetworkSelector`, `NetworkMultiSelectorList`, `CustomNetwork`) now hides the “No network fee” sponsored label for hardware wallets, and a patched `@metamask/bridge-status-controller` waits for approval tx confirmation when required. Tests were added/updated to cover the new hardware-wallet gating behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 83f66fc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com> Co-authored-by: Julien Fontanel <julien.fontanel@consensys.net> Co-authored-by: Frederic HENG <frederic.heng@consensys.net> Co-authored-by: Arafet (CN - Hong Kong) <52028926+arafetbenmakhlouf@users.noreply.github.com> Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
This PR will provide a fix for hardware wallet to gas free network like
Monad and Sei.
Due to currently Hardware wallet is not supported for EIP 7702 gas
sponsorship, and Swap feature is not working for hardware wallet user.
This fix will fall back the Gasless transaction to User pay gas previous
model so that user can still do the swap and sign transaction like
bfore.
This is temporately fix for current version of extensions, and we will
do a proper support in the future.
Similar to extension PR:
MetaMask/metamask-extension#40915
Ticket:
https://consensyssoftware.atlassian.net/jira/software/c/projects/NEB/boards/3738/backlog?selectedIssue=NEB-767
Changelog
CHANGELOG entry: Hardware wallet user will fall back to use
User pay gasfor those Gasless network due to hardware wallet not supported inGasless network like Sei and Monad.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Network list:

Tx flow:



After
Network list:

Tx flow:


Pre-merge author checklist
Docs and MetaMask Mobile
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
Medium Risk
Touches gasless sponsorship and transaction publishing paths
(including 7702 delegation), which can affect whether transactions are
sponsored vs user-paid and could change behavior on supported chains.
Changes are scoped to hardware-wallet detection gates with added tests,
reducing regression risk.
Overview
Hardware wallet accounts now opt out of gasless / EIP-7702
sponsorship, forcing swaps/bridge and confirmations to use the normal
user-pays-gas path.
This adds an
accountSupports7702gate toTransactionControllerInitso
Delegation7702PublishHookandisEIP7702GasFeeTokensEnabledonlyactivate for keyrings that support 7702, and updates
useIsGaslessSupported/useIsGasIncluded7702Supported(via newuseIsHardwareWalletForBridge) to report unsupported for hardwaresigners.
Network selection UI (
NetworkSelector,NetworkMultiSelectorList,CustomNetwork) now hides the “No network fee” sponsored label forhardware wallets, and a patched
@metamask/bridge-status-controllerwaits for approval tx confirmation when required. Tests were
added/updated to cover the new hardware-wallet gating behavior.
Written by Cursor
Bugbot for commit
83f66fc. This will update automatically
on new commits. Configure
here.
Co-authored-by: metamaskbot metamaskbot@users.noreply.github.com
Co-authored-by: Julien Fontanel julien.fontanel@consensys.net
Co-authored-by: Frederic HENG frederic.heng@consensys.net
Co-authored-by: Arafet (CN - Hong Kong) 52028926+arafetbenmakhlouf@users.noreply.github.com
Co-authored-by: tommasini 46944231+tommasini@users.noreply.github.com c4b93de