diff options
| author | Adam Soltys <[email protected]> | 2025-01-18 21:26:41 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-18 21:26:41 -0800 |
| commit | 0fab410e8ba26ec2edf0810e129eeee0c6b42385 (patch) | |
| tree | c8d3e27320c0c6c4912d13ebb1f2a51719a0b413 | |
| parent | 1f070f62f38a539337d93465d1180b723aac7726 (diff) | |
| download | coinos-server-0fab410e8ba26ec2edf0810e129eeee0c6b42385.tar.gz coinos-server-0fab410e8ba26ec2edf0810e129eeee0c6b42385.zip | |
prettier
| -rw-r--r-- | routes/nostr.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/routes/nostr.ts b/routes/nostr.ts index f1b6a585..0cf4a95e 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -266,19 +266,19 @@ 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]; - const content = JSON.stringify(await getProfile(pubkey)); - const callback = await getZapEndpoint({ content } as Event); - const url = new URL(callback); - url.searchParams.set("amount", (amount * 1000).toString()); - url.searchParams.set("nostr", JSON.stringify(event)); + const { event } = req.body; + const amount = event.tags.find((t) => t[0] === "amount")[1]; + const pubkey = event.tags.find((t) => t[0] === "p")[1]; + const content = JSON.stringify(await getProfile(pubkey)); + const callback = await getZapEndpoint({ content } as Event); + 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(); + const json = await got(url.toString()).json(); - res.send(json); - } catch(e) { + res.send(json); + } catch (e) { console.log(e); bail(res, e.message); } |
