From 4d1a9aea0f6b234dfe8eb36d398002ccea6a5680 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 24 Jun 2026 22:59:07 -0700 Subject: Allow gifting the whole balance (no-change sweep) via Max MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A gift PSBT commits a sender change output (>= dust), so the entered amount always needed gift + 294 — making it impossible to gift the entire balance. Add a Max toggle on the gift form that builds a no-change sweep: all inputs SIGHASH_NONE, no change output, so the recipient gets the whole balance minus their claim fee. previewGift/buildClaimTx now treat a zero-output PSBT as zero change. A specific-amount gift that can't keep a dust change now points the user to Max instead of failing with a confusing 'not enough funds'. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/i18n.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/i18n.js') diff --git a/src/i18n.js b/src/i18n.js index 83c5ecb..28ee249 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -195,6 +195,9 @@ const STR = { giftAmountLabel: 'Amount to gift', giftAmountInvalid: 'Enter at least {n}.', giftMinNote: 'Minimum {n} at current fees, so it clears dust when claimed.', + giftAllNote: 'Gifts your whole balance; the recipient pays the claim fee.', + giftExceedsBalance: 'That’s more than your balance.', + giftNeedsHeadroom: 'Gift up to {n}, or tap Max to gift your whole balance.', giftAnother: 'Create another', giftSplitExplain: 'This gift would lock {lock} until it’s claimed ({change} of it comes back to you then). You can split a right-sized coin first for about {fee} so only the gift amount stays locked.', giftSplitFirst: 'Split a coin first', -- cgit v1.2.3