aboutsummaryrefslogtreecommitdiffstats
path: root/build.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-01 19:38:30 -0700
committerAdam Soltys <[email protected]>2026-08-01 19:38:30 -0700
commit348a57004f94dd0f58c4e70769e65ca7ea3f7619 (patch)
tree5f8cd2930abd9c1e05bb7c18e0bec239780281ef /build.js
parent9196f4804851a87c8356418b1c4cade6e87c54ba (diff)
downloadcoinosv3-348a57004f94dd0f58c4e70769e65ca7ea3f7619.tar.gz
coinosv3-348a57004f94dd0f58c4e70769e65ca7ea3f7619.zip
Simplify: one Lightning path, one balance, fewer features
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 <[email protected]>
Diffstat (limited to 'build.js')
-rw-r--r--build.js22
1 files changed, 1 insertions, 21 deletions
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 </script> inside the bundle closing our tag early.
js = js.replaceAll('</script', '<\\/script');
- // The silent-payment scan worker only ships when the sp feature does.
- const workerB64 = enabledFeatures(features).includes('sp')
- ? Buffer.from(await buildSpWorker({ minify })).toString('base64')
- : '';
const css = await Bun.file('./src/style.css').text();
return `<!doctype html>
@@ -255,7 +236,6 @@ ${pwa ? PWA_HEAD : ''}<style>${css}</style>
</head>
<body>
<div id="app"></div>
-${workerB64 ? `<script>globalThis.__SP_WORKER__=${JSON.stringify(workerB64)}</script>` : ''}
<script>${js}</script>
${pwa ? SW_REGISTER + '\n' : ''}</body>
</html>`;