fix: hide gas sponsorship banner for hardware wallets cp-7.77.0#29898
Conversation
Prevent swap quote sponsorship UI from rendering for hardware wallets, including sponsored-quote and insufficient-balance fallback paths, to align MON/SEI behavior with hardware wallet constraints. Co-authored-by: Cursor <cursoragent@cursor.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. |
|
Tested locally on Android with HW, works as expected, the gas sponsorship label doesn't appear for Sei/Mon network on swap or bridge, no matter which amount is entered. |
|
Adding "qa passed" label. Will test it on iOS after the merge. |
…assertions - Added a new network configuration for the Localhost (chainID: 1337) in `tx-sentinel-networks-map.ts` to support EIP-7702 relay and gasless confirmation tests. - Updated the gas fee assertions in `gas-fee-tokens-eip-7702-sponsored.spec.ts` to check for the visibility of the Gas Fees Details component and improved timeout settings for better test reliability.
- Added tests to `useIsGaslessSupported` to handle scenarios where the sender is a hardware wallet, ensuring correct behavior when smart transactions are enabled. - Updated `gas-fee-tokens-eip-7702-sponsored.spec.ts` to use a dynamic localhost sentinel URL for improved test reliability and consistency across environments. - Refactored mock requests to align with the new URL structure and added additional fields to the simulation request body for better test coverage.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6826b0a. Configure here.
Avoid double-slash paths when interpolating base into /network and /smart-transactions/... so mockttp url.includes matching succeeds.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Changes Analysis:
Tag Selection Rationale:
No other tags are warranted — changes are scoped to confirmations/EIP-7702 gasless flows and bridge gas-sponsored banner logic. Performance Test Selection: |
|




Prevent swap quote sponsorship UI from rendering for hardware wallets, including sponsored-quote and insufficient-balance fallback paths, to align MON/SEI behavior with hardware wallet constraints.
Description
This PR has done following change to fix #29870
Changelog
CHANGELOG entry: Prevent swap quote sponsorship UI from rendering for hardware wallets
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
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
Moderate risk because it changes gating logic for gas sponsorship/gasless support based on hardware-wallet detection and adjusts E2E mocking URLs/network flags, which could affect transaction/confirmation flows if misclassified.
Overview
Prevents gas sponsorship UI/eligibility from applying to hardware wallets by gating
useShouldRenderGasSponsoredBannerbehinduseIsHardwareWalletForBridge, covering both sponsored-quote and insufficient-balance fallback paths.Adds regression coverage ensuring
useIsGaslessSupportedreportsisSupported: falsefor hardware-wallet senders (both Smart Transactions and EIP-7702 relay paths).Stabilizes gasless/EIP-7702 E2E mocks by normalizing Sentinel localhost URLs (no trailing slash), adding a
1337network entry with relay flags, and aligning the sponsored simulation request body/ignore-fields and assertions ingas-fee-tokens-eip-7702-sponsored.spec.ts.Reviewed by Cursor Bugbot for commit 270c6b8. Bugbot is set up for automated code reviews on this repo. Configure here.