From 5b23470f5d9ec7ee7cc33c2b4b936ddd24fa17cc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 14 Aug 2026 01:13:47 -0700 Subject: Money leaving while you're not looking gets a notification: NWC pays from the worker or a hidden tab announce themselves — amount, fee, and which app asked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv --- src/nwc-respond.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/nwc-respond.js') diff --git a/src/nwc-respond.js b/src/nwc-respond.js index 258b7e7..bd75360 100644 --- a/src/nwc-respond.js +++ b/src/nwc-respond.js @@ -280,5 +280,14 @@ export async function respondFromBg(data, { result: { preimage: a.preimage, fees_paid: (a.feeSat || 0) * 1000 }, }); log(`paid ${a.amountSat || dec.amountSat} sat via the ASP from the background mirror`); - return true; + // Money left while the app was closed — that always deserves a heads-up, + // whether it was a zap from a nostr app or any other connected spender. + const paidSat = a.amountSat || dec.amountSat; + const feeNote = a.feeSat ? ` (+${a.feeSat} fee)` : ''; + return { + notify: { + title: 'Payment sent', tag: 'nwc-sent', + body: `-${paidSat.toLocaleString()} sats${feeNote} via ${conn.name || 'a connected app'}`, + }, + }; } -- cgit v1.2.3