aboutsummaryrefslogtreecommitdiffstats
path: root/lib/nostr.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-01 11:36:35 -0800
committerAdam Soltys <[email protected]>2023-12-01 11:36:35 -0800
commit7709c1efde9a1f3078171ee56985cd25511d6f7b (patch)
treecd996eaaa860cdb3d7da688e0ad4c5ec7bae1a0c /lib/nostr.js
parent826c7b361c93905c4725755038d398221530051d (diff)
downloadcoinos-server-7709c1efde9a1f3078171ee56985cd25511d6f7b.tar.gz
coinos-server-7709c1efde9a1f3078171ee56985cd25511d6f7b.zip
biome formatter
Diffstat (limited to 'lib/nostr.js')
-rw-r--r--lib/nostr.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/nostr.js b/lib/nostr.js
index f352c020..f75da37c 100644
--- a/lib/nostr.js
+++ b/lib/nostr.js
@@ -11,7 +11,7 @@ export let pool;
export let fillPool = () => {
pool = RelayPool(config.relays);
- pool.on("open", relay => {
+ pool.on("open", (relay) => {
if (relay.url.includes(config.nostr)) coinos = relay;
relay.subscribe("live", { limit: 1 });
});
@@ -113,7 +113,7 @@ export let q = async (
let done = { [sub]: [] };
- let check = s => {
+ let check = (s) => {
let elapsed = Date.now() - start;
if (rejected) return true;
if (
@@ -168,7 +168,7 @@ export let q = async (
let seen = [];
-let getUser = async pubkey => {
+let getUser = async (pubkey) => {
let id = await g(`user:${pubkey}`);
let user = await g(`user:${id}`);
return (
@@ -218,7 +218,7 @@ export async function handleZap(invoice) {
}
let ptags = zapreq.tags.filter(
- t => t && t.length && t.length >= 2 && t[0] === "p"
+ (t) => t && t.length && t.length >= 2 && t[0] === "p"
);
if (ptags.length !== 1) {
@@ -226,7 +226,7 @@ export async function handleZap(invoice) {
}
let etags = zapreq.tags.filter(
- t => t && t.length && t.length >= 2 && t[0] === "e"
+ (t) => t && t.length && t.length >= 2 && t[0] === "e"
);
if (!(etags.length === 0 || etags.length === 1)) {
@@ -234,14 +234,14 @@ export async function handleZap(invoice) {
}
let relays_tag = zapreq.tags.find(
- t => t && t.length && t.length >= 2 && t[0] === "relays"
+ (t) => t && t.length && t.length >= 2 && t[0] === "relays"
);
if (!relays_tag) {
fail(`No relays tag found`);
}
- let relays = relays_tag.slice(1).filter(r => r && r.startsWith("ws"));
+ let relays = relays_tag.slice(1).filter((r) => r && r.startsWith("ws"));
let etag = etags.length > 0 && etags[0];
let ptag = ptags[0];
@@ -260,5 +260,5 @@ 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)));
+ await Promise.all(relays.map((r) => send(ev, r)));
}