Last active
September 22, 2024 15:46
-
-
Save SamSamskies/0088e7a14f3df37550c796481b54d0fe to your computer and use it in GitHub Desktop.
Revisions
-
SamSamskies revised this gist
Sep 22, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const pool = new SimplePool() const relays = ['wss://nostr.mutinywallet.com'] const events = await pool.list(relays, [{ kinds: [1, 6, 30023], authors: ['604e96e099936a104883958b040b47672e0f048c98ac793f37ffe4c720279eb2'], limit: 256 }]) -
SamSamskies created this gist
Sep 22, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ import 'websocket-polyfill' import {SimplePool, finishEvent, nip19} from 'nostr-tools' import 'dotenv/config' const privateKey = nip19.decode(process.env.NOSTR_NSEC).data; const pool = new SimplePool() const relays = ['wss://nostr.mutinywallet.com'] const events = await pool.list(relays, [{ kinds: [30023], authors: ['604e96e099936a104883958b040b47672e0f048c98ac793f37ffe4c720279eb2'], limit: 256 }]) const tags = events.map(({id}) => ["e", id]) const event = { kind: 5, created_at: Math.floor(Date.now() / 1000), tags, content: '#thepoofening', } const signedEvent = finishEvent(event, privateKey) const pubs = pool.publish(relays, signedEvent) await Promise.all(pubs) console.log(JSON.stringify(signedEvent, null, 2)) console.log(events.length) process.exit(0)