Replying to Avatar hzrd149

nostr:npub1cesrkrcuelkxyhvupzm48e8hwn4005w0ya5jyvf9kh75mfegqx0q4kt37c a few weeks back I threw this together as a exercise, It has some bugs with reconnecting and DOS the relay but I liked how the NIP-42 auth turned out and that I was able to write it in <200 lines

https://github.com/hzrd149/applesauce/blob/master/packages/relay/src/relay.ts

I'm not really part of this conversation and I'm distracted by other projects but I still really want to help build a pure rxjs relay connection library 😁

wow, this is looking really good, just found weird req returns "EOSE" | NostrEvent, If I want to listen for "EOSE" I would listen on subscribe({complete: () => {}}) or `finalize` operator, but might going to steal you waitForAuth, I am think I am gonna need it 🤣

Reply to this note

Please Login to reply.

Discussion

REQ don't complete when they receive EOSE, its just a signal that the relay has sent all events but the subscription stays open for new events

Please steal the auth logic, that was the part I spent the most time on :)

Got it, then it makes sense for live subscriptions