aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/ark.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-01 11:44:43 -0700
committerAdam Soltys <[email protected]>2026-08-01 11:44:43 -0700
commitd561d4110c7b484bee077678b8469188a3541753 (patch)
tree7b4ce64345cdc2a0081dcdb24a82d3a608b507a2 /src/features/ark.js
parent0319e2fd392fc7e8569fbb6a88a6a1dd65e9d539 (diff)
downloadcoinosv3-d561d4110c7b484bee077678b8469188a3541753.tar.gz
coinosv3-d561d4110c7b484bee077678b8469188a3541753.zip
Wake hal for wallet-connect requests while it is closed
Step 3, first half. Android Chrome freezes backgrounded PWAs and closes their relay sockets, so a phone with hal "open" answers nothing — which is what made Amethyst spin. Push is the only way to reach a frozen app. - service worker gains a `push` handler. It deliberately does NOT spend: if a window is open it nudges it to re-listen, otherwise it raises a notification that opens hal on tap. Putting a spend path in the worker is the remaining half and wants its own testing. - hal-side: request permission, subscribe with the notifier's VAPID key, and register its service pubkeys with nwcpush.coinos.io. Turning it off deregisters, unsubscribes, and clears the pouch — no reason to leave spendable keys where a worker can read them if nothing will. - a Settings toggle, and the ark feature exposes the ASP context the pouch record needs. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features/ark.js')
-rw-r--r--src/features/ark.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index 18baef6..9621c4b 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -1661,6 +1661,12 @@ export function arkFeature(ctx) {
return { invoice: a.invoice, paymentHash: a.paymentHash, amountSat };
},
arkMovements() { const s = arkStateNow(); return s ? (s.movements || []) : []; },
+ // endpoints + server identity for the NWC pouch record
+ arkPouchContext() {
+ const cfg = getArkConfig();
+ if (!cfg || !ark || !ark.info) return null;
+ return { arkUrl: cfg.ark, esploraUrl: cfg.esplora, network: getNetwork(), serverPubkey: ark.info.serverPubkey };
+ },
// An npub pasted into Send becomes an ark zap (needs the nostr seam from
// the sync feature and a connected-able ark). A bolt11 is handled here
// only in builds without the swaps feature (whose matcher runs first and