From 348a57004f94dd0f58c4e70769e65ca7ea3f7619 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 1 Aug 2026 19:38:30 -0700 Subject: Simplify: one Lightning path, one balance, fewer features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropped: silent payments (feature, wallet chains, scan worker, indexer config), Boltz submarine/reverse swaps (feature + swap.js + tools), the third-party ark swap bridge (config, client flows, settings card — the ASP's own Lightning send is the one path now), and the Consolidate coins settings action. The NWC pouch is gone with them: background answering now spends the WHOLE ark balance. The IndexedDB record mirrors the real manager state plus the chain-3 keys for its live coins and a change-index window; the worker pays through the ASP exactly like the open app, and the app folds the worker's spends, change, and key allocations back in on connect (additive merge + reconcile against the server). A leftover chain-6 pouch from the short-lived pouch era is swept home automatically using the keys stored in its own record. The stated tradeoff: same-origin script access now reaches the ark balance, not a carve-out — the ark balance is walking-around money, the on-chain wallet's keys are never mirrored, and per-connection NWC budgets remain the enforced ceiling. Bundle: 726KB -> 602KB. Co-Authored-By: Claude Fable 5 --- build.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'build.js') diff --git a/build.js b/build.js index f542533..710aa35 100644 --- a/build.js +++ b/build.js @@ -178,21 +178,6 @@ export async function buildSwNwc({ minify = true } = {}) { return result.outputs[0].text(); } -// The silent-payment scanning worker, bundled separately (its own global scope) -// and embedded as base64 so the single-file app can spawn it from a Blob URL. -export async function buildSpWorker({ minify = true } = {}) { - const result = await Bun.build({ - entrypoints: ['./src/sp-worker.js'], - target: 'browser', - minify, - }); - if (!result.success) { - for (const log of result.logs) console.error(log); - throw new Error('sp-worker bundle failed'); - } - return result.outputs[0].text(); -} - // Optional-feature selection: HAL_FEATURES is a comma list of enabled // features (gifts,swaps,ark,zaps,sp,nwc). Unset means all; "none"/"" means a minimal // on-chain-only wallet. A build plugin swaps src/features/index.js for a @@ -200,7 +185,7 @@ export async function buildSpWorker({ minify = true } = {}) { // feature's code (and its network endpoints) never enters the bundle. // NB order matters and must match src/features/index.js — nwc sits after ark // because it drives ark's headless pay/balance seam. -const ALL_FEATURES = { gifts: 'giftsFeature', swaps: 'swapsFeature', ark: 'arkFeature', zaps: 'zapsFeature', sp: 'spFeature', nwc: 'nwcFeature', sync: 'syncFeature' }; +const ALL_FEATURES = { gifts: 'giftsFeature', ark: 'arkFeature', zaps: 'zapsFeature', nwc: 'nwcFeature', sync: 'syncFeature' }; export function enabledFeatures(spec = process.env.HAL_FEATURES) { if (spec == null) return Object.keys(ALL_FEATURES); @@ -236,10 +221,6 @@ export async function buildHtml({ minify = true, pwa = minify, features = proces let js = await result.outputs[0].text(); // Guard against a literal inside the bundle closing our tag early. js = js.replaceAll(' @@ -255,7 +236,6 @@ ${pwa ? PWA_HEAD : ''}
-${workerB64 ? `` : ''} ${pwa ? SW_REGISTER + '\n' : ''} `; -- cgit v1.2.3