aboutsummaryrefslogtreecommitdiffstats
path: root/src/sw-nwc.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 /src/sw-nwc.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 'src/sw-nwc.js')
-rw-r--r--src/sw-nwc.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sw-nwc.js b/src/sw-nwc.js
index db57b99..8267b6b 100644
--- a/src/sw-nwc.js
+++ b/src/sw-nwc.js
@@ -1,9 +1,10 @@
// Service-worker side of background NWC. Bundled by build.js and appended to
// the generated sw.js, replacing the notify-only push handler: a push now
-// first tries to ANSWER the request from the pouch (see nwc-respond.js), and
-// only falls back to the wake-the-user notification when it can't.
+// first tries to ANSWER the request from the background state mirror (see
+// nwc-respond.js), and only falls back to the wake-the-user notification
+// when it can't.
-import { respondFromPouch } from './nwc-respond.js';
+import { respondFromBg } from './nwc-respond.js';
const NOTIFIER = 'https://nwcpush.coinos.io';
@@ -21,7 +22,7 @@ self.addEventListener('push', (e) => {
}
let handled = false;
try {
- handled = await respondFromPouch(data, {
+ handled = await respondFromBg(data, {
notifier: NOTIFIER,
log: (m) => console.log('[sw-nwc]', m),
});