adamritter / nostr-relaypool-ts

A Nostr RelayPool implementation in TypeScript using only nostr-tools library as a dependency
https://www.npmjs.com/package/nostr-relaypool
MIT License
63 stars 17 forks source link

NIP-42 #39

Closed npub1zenn0 closed 1 year ago

npub1zenn0 commented 1 year ago

NIP-42 was added to nostr-tools. Would be nice to have it here too.

It works about as follows:

import { nip42 } from 'nostr-tools';

relay.on('auth', challenge => nip42.authenticate({ relay, challenge, sign }))

Thoughts on best approaches here? Probably like .onauth since there is .onnotice etc. already? I didn't check any code here yet, thought I'd open up an issue first.

adamritter commented 1 year ago

Sure, sounds great, if you like it and works for your program, I'd be happy to merge a pull request that implements it.