Repository navigation
feat(bitcoin): add getMaxSendableAmount client request method - #587
Open
ulissesferreira wants to merge 1 commit into
Open
ulissesferreira wants to merge 1 commit into
ulissesferreira wants to merge 1 commit into
Conversation
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-get-max-sendable-amount
branch
2 times, most recently
from
November 10, 2026 13:16
394ab8a to
ace0c75
Compare
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-get-max-sendable-amount
branch
from
November 10, 2026 13:29
ace0c75 to
da3b581
Compare
ulissesferreira
marked this pull request as ready for review
November 10, 2026 13:36
getMaxSendableAmount client request method
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-get-max-sendable-amount
branch
from
November 11, 2026 10:18
da3b581 to
e27e402
Compare
Base automatically changed from
WPN-2437-bitcoin-onamountinput-fee-aware
to
main
November 12, 2026 12:22
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-get-max-sendable-amount
branch
from
November 12, 2026 15:01
e27e402 to
d4265e3
Compare
ulissesferreira
marked this pull request as draft
November 12, 2026 16:07
stanleyyconsensys
previously approved these changes
Nov 15, 2026
ulissesferreira
marked this pull request as ready for review
November 17, 2026 15:24
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-get-max-sendable-amount
branch
from
November 17, 2026 15:32
d4265e3 to
f81e9a6
Compare
2 of 4 tasks
ulissesferreira
force-pushed
the
WPN-2442-bitcoin-get-max-sendable-amount
branch
from
November 17, 2026 16:25
f81e9a6 to
48b7cd6
Compare
|
This branch was successfully deployed
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.



Explanation
Adds the
getMaxSendableAmountclient request method to the Bitcoin Snap. It returns only{ amount }: the maximum amount that can be entered soonAmountInputpasses, or0when no amount can pass. Fees, balances, and validation errors are intentionally not returned.The value is found with a binary search over the spendable balance. Each candidate is priced through
buildProbePsbt, which uses the sametargetBlocksConfirmationandfallbackFeeRateconfig asonAmountInput, so the result accounts for the real fee at that amount instead of assuming a fixed fee. When no amount is fundable, the result is below the account's dust limit, or every probe reports dust/insufficient funds, it returns0. An invalidtoAddressis a bad request and throws a validation error. The probe is never signed or broadcast.References
Ticket: WPN-2442
Checklist