fix: cap send amount pad at available balance#1
Closed
CypherPoet wants to merge 1 commit into
Closed
Conversation
The send number pad now rejects keystrokes that would push the amount above the available sendable balance, reusing the existing over-max block (haptic + error flash) via a dynamic maxAmountOverride. Continue-button validation is unchanged as a backstop. Closes synonymdev#346
This was referenced Jun 5, 2026
Owner
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.
Fixes synonymdev#346
Description
This PR makes the send amount number pad refuse entry above your available balance. Before, you could type any amount and the screen only disabled the Continue button once you went over; now the number pad itself stops you at the maximum you can send, using the same haptic and error flash it already shows at its upper input limit.
The cap follows the selected wallet: spendable on-chain balance minus the network fee for savings, or outbound capacity minus the routing-fee estimate for spending. Tapping the Available label still fills the exact maximum, and the Continue-button validation stays in place as a backstop.
Linked Issues/Tasks
Fixes synonymdev#346
Screenshot / Video
346-onchain-send-cap.mp4
QA Notes
Manual Tests
regression:enter a normal under-balance amount: Continue enabled, proceeds to Confirm.regression:zero available balance -> Amount: pad still accepts input (not frozen), Continue stays disabled.Automated Checks
BitkitTests/NumberPadTests.swift(testMaxAmountOverrideBlocksInputAboveBalance,testClearingMaxAmountOverrideRestoresGlobalCap).BitkitTests/NumberPadTestspasses (24 tests).