aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-19 05:26:14 +0000
committerAdam Soltys <[email protected]>2025-01-19 05:26:15 +0000
commit1f070f62f38a539337d93465d1180b723aac7726 (patch)
treec82b46d904c5d704949097e84a9b014958a13fab
parent22106c0ce31cc6f412945388098547041a4fa8fa (diff)
downloadcoinos-server-1f070f62f38a539337d93465d1180b723aac7726.tar.gz
coinos-server-1f070f62f38a539337d93465d1180b723aac7726.zip
log zap failures
-rwxr-xr-xbun.lockbbin209762 -> 209762 bytes
-rw-r--r--routes/nostr.ts6
2 files changed, 6 insertions, 0 deletions
diff --git a/bun.lockb b/bun.lockb
index acb87c96..480a5a31 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/routes/nostr.ts b/routes/nostr.ts
index 2b47b834..f1b6a585 100644
--- a/routes/nostr.ts
+++ b/routes/nostr.ts
@@ -265,6 +265,7 @@ export default {
},
async zap(req, res) {
+ try {
const { event } = req.body;
const amount = event.tags.find((t) => t[0] === "amount")[1];
const pubkey = event.tags.find((t) => t[0] === "p")[1];
@@ -273,8 +274,13 @@ export default {
const url = new URL(callback);
url.searchParams.set("amount", (amount * 1000).toString());
url.searchParams.set("nostr", JSON.stringify(event));
+ console.log("URL", url.toString());
const json = await got(url.toString()).json();
res.send(json);
+ } catch(e) {
+ console.log(e);
+ bail(res, e.message);
+ }
},
};