From ece2e424fb00a5480b1cf0630ee6c237ec1c170a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 5 Dec 2023 04:05:02 +0000 Subject: logs --- lib/nostr.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/nostr.js') diff --git a/lib/nostr.js b/lib/nostr.js index f75da37c..31fc450b 100644 --- a/lib/nostr.js +++ b/lib/nostr.js @@ -1,4 +1,5 @@ import config from "$config"; +import { l } from "$lib/logging"; import { Relay, RelayPool, calculateId, signId, getPublicKey } from "nostr"; import { broadcast, emit } from "$lib/sockets"; import store from "$lib/store"; @@ -208,7 +209,7 @@ function send(ev, url, opts) { } export async function handleZap(invoice) { - let privkey = nip19.decode(config.nostrKey); + let { data: privkey } = nip19.decode(config.nostrKey); let pubkey = getPublicKey(privkey); let keypair = { privkey, pubkey }; let zapreq = JSON.parse(invoice.description); @@ -260,5 +261,7 @@ export async function handleZap(invoice) { ev.id = await calculateId(ev); ev.sig = await signId(privkey, ev.id); - await Promise.all(relays.map((r) => send(ev, r))); + l("sending receipt", JSON.stringify(ev), relays); + + await Promise.allSettled(relays.map(r => send(ev, r))); } -- cgit v1.2.3