fix: sponsored hardware wallet send max native#29864
Conversation
|
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. |
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 361be96. Configure here.
2167a71 to
9d8f577
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The PR modifies two confirmation hooks:
SmokeConfirmations is selected because:
SmokeSwap is selected because:
No other tags are needed — the changes are scoped to gas fee calculation hooks within the confirmations domain and don't touch browser, accounts, network management, staking, identity, or other areas. Performance Test Selection: |
|




Description
On sponsored networks, the "send max native" feature wrongly tries to send 100% of user's balance on Hardware Wallets despite Gas Sponsorship being disabled for those. This creates an out of gas situation.
The PR restores the legacy behavior of the "max" button for such specific cases (HW + gas sponsorship + send max native).
Changelog
CHANGELOG entry: sponsored hardware wallet send max native
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/NEB-1132?atlOrigin=eyJpIjoiYjFiZWVkNWJlMTI5NDk5NmE4OTA2NTM5NjkzM2RlMzQiLCJwIjoiaiJ9
Manual testing steps
Non-reg on regular accounts to check that sending max on SEI still sends the full balance - not Monad because of the 10 MON constraint.
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
Changes fee and max-send calculations for gas sponsorship, which can affect how much users attempt to send and what fees are displayed; incorrect logic could reintroduce out-of-gas or under-send behavior on sponsored networks.
Overview
Updates gas sponsorship handling to only apply when the app confirms gasless/sponsorship is actually supported.
In
useFeeCalculations, sponsored transactions now show0fees only whenuseIsGaslessSupported().isSupportedis true; otherwise normal fee/max-fee computation is used, with tests covering both cases.In
usePercentageAmount, hardware-wallet accounts are treated as not gas-sponsored even on sponsored networks, restoring legacy “send max native” behavior (subtracting estimated gas) to prevent out-of-gas sends; tests add coverage for the HW-sponsored-network scenario.Reviewed by Cursor Bugbot for commit 9d8f577. Bugbot is set up for automated code reviews on this repo. Configure here.