i built this out of relayer and go-nostr you can build other things off the libraries in there
they have handy names...
realy.lol/event
realy.lol/envelopes/okenvelope
the data structures differ a lot, there is almost no strings anywhere, in some cases i've used generics to make it easy to assemble lists of arbitrary types that commute (eg string/bytes, integers, etc)