fix: clear gas sponsorship flag for hardware wallet transactions cp-7.77.0#29262
Conversation
…ponsorship This update introduces logic to determine if a transaction originates from a hardware wallet, affecting the display of the "Paid by MetaMask" message. The `isGasFeeSponsored` flag is now conditionally set based on whether the transaction is from a hardware wallet, ensuring accurate representation of gas fee sponsorship in transaction details. Additionally, unit tests have been added to verify this behavior for hardware wallets.
|
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: The PR makes two targeted bug fixes related to gas fee sponsorship ("Paid by MetaMask") display:
SmokeConfirmations: Directly impacted — the confirmation hook SmokeWalletPlatform: The SmokeAccounts: Hardware wallet accounts (QR-based) are specifically affected by the fix — the change ensures HW wallet transactions don't incorrectly show as gas-sponsored. Tests covering hardware wallet account management and usage should validate this behavior. No performance impact expected — these are pure logic/display fixes with no rendering loops, list changes, or data loading modifications. Performance Test Selection: |
|
|
Tested on Android with HW, works as expected on Sei/Mon on Send, Swap, Swap using dapp, failed Swap, failed Send. Not adding the "qa passed" label until it is tested on iOS. |
|
@dawnseeker8 does this change also fix this bug? #29241 |
|
@dawnseeker8 I tested and it does not seem to fix this bug. thats alright, we can perform a follow up fix. |
|
Adding "qa passed" label. Will test it on iOS after the merge. |



Description
Hardware wallet (Ledger/QR) transactions on gas-sponsored networks (MON, SEI) incorrectly showed "Paid by MetaMask" in the activity transaction details. The root cause was twofold:
isGasFeeSponsoredoverride inuseTransactionConfirmonly ran insidehandleSmartTransactionandhandleGasless7702, both of which exit early when noselectedGasFeeTokenis present — which is always the case for HW wallets since gasless is not supported. The flag was never cleared on the persisted transaction metadata.TransactionDetailscomponent passedisGasFeeSponsoredfrom stored transaction data without checking if the account is a hardware wallet.Fix: Moved the
isGasFeeSponsoredoverride to the top ofonConfirmso it runs unconditionally for every transaction, and added anisHardwareAccountguard in the activity list UI (matching the pattern already used in BridgeTransactionDetails).Changelog
CHANGELOG entry: Fixed "Paid by MetaMask" incorrectly showing for hardware wallet transactions on gas-sponsored networks
Related issues
Fixes: #29241
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches transaction confirmation metadata and the activity transaction-details UI; incorrect gating could hide or show sponsorship inappropriately on supported networks, but the change is narrowly scoped and covered by tests.
Overview
Fixes incorrect "Paid by MetaMask" labeling for hardware-wallet transactions by clearing
isGasFeeSponsoredinuseTransactionConfirmwhenever gasless isn’t supported, even when noselectedGasFeeTokenis present.Adds a UI guard in
TransactionDetailsto suppress sponsored-fee display for hardware accounts (based ontxParams.from+isHardwareAccount), and extends unit tests to cover both the confirmation override behavior and the hardware-wallet UI suppression.Reviewed by Cursor Bugbot for commit 60007da. Bugbot is set up for automated code reviews on this repo. Configure here.