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 ++++++++ src/i18n.js | 1 + 2 files changed, 9 insertions(+) (limited to 'src') 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' }, diff --git a/src/i18n.js b/src/i18n.js index 4eeca92..a0a251d 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -199,6 +199,7 @@ const STR = { onbBoardTitle: 'Top up Spending', onbBoardBody: 'Move some sats from Savings into Spending — payments there are instant, with no mining fees.', topUpFromSavings: 'Top up from Savings', + arkUniUneconomical: 'A trustless on-chain exit would cost about {fee} sats in mining fees — more than the {n} sats it would move, so it isn’t offered. For a balance this size, send it out over Lightning instead: no mining fees at all.', arkUniFallbackBody: 'The server didn’t cooperate, but your money can still move without it: your whole Spending balance exits to Savings on-chain. It takes about a day, and roughly {fee} sats of mining fees will be paid from Savings. Funds land in Savings — send them on from there once it completes.', arkUniFallbackShort: 'Savings holds {have} sats — about {need} sats are needed for the mining fees. Top up Savings first.', arkUniFallbackBtn: 'Exit to Savings ({fee} sats in fees)', -- cgit v1.2.3