From 69d7b3d9411741d6b77b59bc35059cc56cc4fb61 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 28 Aug 2026 19:33:29 -0700 Subject: An exit dearer than its cargo is not an option: when the trustless road would cost more than it moves, the fallback says so plainly and points at Lightning — the road with no mining fees — instead of offering an 8,486-sat ticket for 928 sats of passenger 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_019eA8JRq9Wr7z2fRQk99HLi --- src/features/ark.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/features') diff --git a/src/features/ark.js b/src/features/ark.js index 81e3351..269cfb9 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -1874,6 +1874,14 @@ export function arkFeature(ctx) { if (!ui.arkError || ui.arkBusy === 'offboard' || !ark) return null; let feeEst = 0; try { feeEst = estimateExitFeeSat(ark); } catch {} + const balance = arkBalance()?.spendableSat || 0; + // A trustless exit that costs more than it moves isn't an option, + // it's a trap — say so, and point at the road that actually fits a + // small balance: Lightning carries no mining fees at all. + if (feeEst >= balance) { + return h('div', { class: 'col', style: 'gap:8px;border-top:1px solid var(--border,rgba(128,128,128,.2));padding-top:10px' }, + h('div', { class: 'small muted' }, t('arkUniUneconomical', { fee: fmtAmount(feeEst), n: fmtAmount(balance) }))); + } const savings = wallet.spendable || 0; const short = savings < feeEst; return h('div', { class: 'col', style: 'gap:8px;border-top:1px solid var(--border,rgba(128,128,128,.2));padding-top:10px' }, -- cgit v1.2.3