aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-31 07:54:56 -0700
committerAdam Soltys <[email protected]>2026-08-31 07:54:56 -0700
commitaa7f63516331b1c7c7b7f991430696aa9dc1c022 (patch)
tree9bccb4ced1a501b7c23da3e24144110def39258b /src
parentf517cb23fa37b15922c8ad333952df09847ce8b6 (diff)
downloadcoinosv3-aa7f63516331b1c7c7b7f991430696aa9dc1c022.tar.gz
coinosv3-aa7f63516331b1c7c7b7f991430696aa9dc1c022.zip
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
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src')
-rw-r--r--src/features/ark.js12
1 files changed, 10 insertions, 2 deletions
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);
},