aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-28 20:40:36 -0700
committerAdam Soltys <[email protected]>2026-08-28 20:40:36 -0700
commita056ea615498ee62e4180c1e09b3ce0a5a03de0f (patch)
treef5ee8d2e057532465d7c536dd35d8acd3f989c9a
parente66d28a9dfc9727e91b31c81c5766b0fa538a23e (diff)
downloadcoinosv3-a056ea615498ee62e4180c1e09b3ce0a5a03de0f.tar.gz
coinosv3-a056ea615498ee62e4180c1e09b3ce0a5a03de0f.zip
Max learns the ark rail: an ark address gets its own Max button filling the whole spendable Spending balance — free sends mean the maximum really is the balance
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi
-rw-r--r--src/app.js10
-rw-r--r--src/features/ark.js8
2 files changed, 17 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index a8cde9e..77f0c01 100644
--- a/src/app.js
+++ b/src/app.js
@@ -3857,7 +3857,15 @@ function recipientRow(s, r, i) {
},
}),
h('button', { type: 'button', title: t('switchUnit'), onClick: toggleUnit }, unitLabel()),
- single && !featureHook('hideSendControls', r.address) && h('button', { type: 'button', class: s.max ? 'btn-primary' : '', onClick: () => { s.max = !s.max; render(); } }, t('max'))
+ single && !featureHook('hideSendControls', r.address) && h('button', { type: 'button', class: s.max ? 'btn-primary' : '', onClick: () => { s.max = !s.max; render(); } }, t('max')),
+ // features that hide the fee controls (ark) can still offer their own
+ // Max — it fills the amount with that rail's spendable balance
+ single && featureHook('hideSendControls', r.address)
+ ? (() => {
+ const v = featureHook('sendMaxFill', r.address);
+ return v != null ? h('button', { type: 'button', onClick: () => { r.amount = v; s.max = false; render(); } }, t('max')) : null;
+ })()
+ : null
) : null
);
syncCheck();
diff --git a/src/features/ark.js b/src/features/ark.js
index 59c293f..3e614c4 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -2338,6 +2338,14 @@ 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.
+ sendMaxFill(a) {
+ if (!isArkAddress(a)) return null;
+ const sat = arkBalance()?.spendableSat || 0;
+ if (!sat) return null;
+ return ctx.getUnit() === 'sats' ? String(sat) : (sat / 1e8).toFixed(8);
+ },
sendFormNote(a) {
if (!isArkAddress(a)) return null;
maybeReconcile();