diff options
| author | Adam Soltys <[email protected]> | 2025-02-11 20:07:21 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-11 20:07:21 -0800 |
| commit | eb3c2aad4cef9b86294bc9a13a36da4918529209 (patch) | |
| tree | 33c58529ee50bf875620a5a33d97e8ab57b673ae /lib/payments.ts | |
| parent | 004ac3ccbfb6a12227a81d6e0dc0beaf9a740827 (diff) | |
| download | coinos-server-eb3c2aad4cef9b86294bc9a13a36da4918529209.tar.gz coinos-server-eb3c2aad4cef9b86294bc9a13a36da4918529209.zip | |
nwc notifications
Diffstat (limited to 'lib/payments.ts')
| -rw-r--r-- | lib/payments.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/payments.ts b/lib/payments.ts index c35c3795..a150e50c 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -5,7 +5,7 @@ import { generate } from "$lib/invoices"; import ln from "$lib/ln"; import { err, l, warn } from "$lib/logging"; import { handleZap } from "$lib/nostr"; -import { notify } from "$lib/notifications"; +import { notify, nwcNotify } from "$lib/notifications"; import { SATS, btc, @@ -144,6 +144,7 @@ export const debit = async ({ l(user.username, "sent", type, amount); //emit(user.id, "payment", p); + if (![types.lightning, types.bolt12].includes(type)) nwcNotify(p, user); return p; }; @@ -283,6 +284,7 @@ export const completePayment = async (inv, p, user) => { } } + nwcNotify(p); notify(p, user, withdrawal); l(username, "received", p.type, p.amount); callWebhook(inv, p); @@ -821,6 +823,7 @@ const finalize = async (r, p) => { await db.sRem("pending", p.hash); l("payment completed", p.id, r.payment_preimage); + nwcNotify(p); const maxfee = p.fee; const { amount_msat } = await ln.decode(p.hash); |
