aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-28 19:33:29 -0700
committerAdam Soltys <[email protected]>2026-08-28 19:33:29 -0700
commit69d7b3d9411741d6b77b59bc35059cc56cc4fb61 (patch)
tree6f1990d794df2abde3328b274fb1c56e027523d1 /src
parent7721a68f6202db562e68226f06319304bb180970 (diff)
downloadcoinosv3-69d7b3d9411741d6b77b59bc35059cc56cc4fb61.tar.gz
coinosv3-69d7b3d9411741d6b77b59bc35059cc56cc4fb61.zip
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
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi
Diffstat (limited to 'src')
-rw-r--r--src/features/ark.js8
-rw-r--r--src/i18n.js1
2 files changed, 9 insertions, 0 deletions
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)',