Conversation
Contributor
Author
j0ntz
force-pushed
the
jon/full-balance-send-warning
branch
from
September 10, 2026 00:35
5abc3e6 to
b3102a5
Compare
j0ntz
marked this pull request as ready for review
September 10, 2026 00:35
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
j0ntz
force-pushed
the
jon/full-balance-send-warning
branch
from
September 10, 2026 00:50
b3102a5 to
e4fed2a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e4fed2a. Configure here.
A wallet that holds tokens needs its gas asset to move them. Both SendScene2 and SwapConfirmationScene now check the wallet's leftover gas against the pending transaction's own fee, and show a warning modal with a cancel path when the wallet would be left unable to pay one more fee. Also covers a token-less wallet swapping its whole gas balance into a token on that same wallet.
j0ntz
force-pushed
the
jon/full-balance-send-warning
branch
from
September 10, 2026 01:00
e4fed2a to
f0cb504
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.











Description
A wallet that holds tokens needs its gas asset to move them. Nothing stops a user from
max-sending or max-swapping the whole gas balance, which strands every token left behind.
This adds a warning modal that fires before the transaction is signed, in both the send
and the swap flow:
src/util/stuckFundsWarning.tsdecides whether the pending transaction leaves thesource wallet without enough gas to move what stays. The threshold is the
transaction's own fee: a wallet that cannot afford one more transaction of the same
size counts as drained.
src/components/modals/StuckFundsWarningModal.tsxshows a plainButtonsModal(warning border, Continue Anyway / Cancel) and resolves to a boolean.
SendScene2.handleSliderCompletegates every send path (ramps, gift cards, FIO, scan,wallet list, transfer modal all funnel through
send2).SwapConfirmationScene.handleSlideCompletegates swaps, where the real from-amount andnetwork fee are known.
Two cases fire the warning, per the task's acceptance criteria:
of the gas asset.
the gas needed to move it out.
UTXO chains cannot hit either case, so their behavior is unchanged.
Two cases are deliberately excluded, both raised in review:
toNativeAmountback into the leftover-gas figure, so it does not warn.emptying the last token does not warn about tokens that will not be there.
The swap scene's terms-modal expiry deferral was generalized to cover any blocking modal,
so a quote cannot expire and close behind the warning while it is up.
Asana: https://app.asana.com/0/1215088146871429/1209102990528561
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have: