From aa7f63516331b1c7c7b7f991430696aa9dc1c022 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 31 Aug 2026 07:54:56 -0700 Subject: Max prices the rail you're standing on: an ark-address recipient viewed from Savings now fills what Savings can actually fund (the board-shaped sweep), not the Spending balance — pressing Max there handed the board panel a number the funding transaction could never cover, which read as fees calculated wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/features/ark.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/features') diff --git a/src/features/ark.js b/src/features/ark.js index 98db559..2ce26b5 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -2638,10 +2638,18 @@ export function arkFeature(ctx) { isSendDest(a) { return isArkAddress(a) && arkAvailable(); }, hideSendControls(a) { return isArkAddress(a); }, // Max for an ark recipient: arkoor sends are free, so the whole - // spendable Spending balance is the honest maximum. + // spendable Spending balance is the honest maximum — WHEN Spending is + // the selected rail. From Savings this destination is either a board + // (your own address — review routes it to the board panel) or a + // wrong-rail send review will bounce; either way the honest maximum is + // what Savings can actually fund. Filling Spending's number here handed + // the board panel an amount Savings couldn't cover, and the user read + // the resulting 'insufficient funds' as a fee miscalculation. sendMaxFill(a) { if (!isArkAddress(a)) return null; - const sat = arkBalance()?.spendableSat || 0; + const sat = ctx.getAccount() === 'spending' + ? (arkBalance()?.spendableSat || 0) + : maxBoardSat(); if (!sat) return null; return ctx.getUnit() === 'sats' ? String(sat) : (sat / 1e8).toFixed(8); }, -- cgit v1.2.3