-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User metadata raw event #225
Comments
@gzuuus You can use the method |
No, I was trying it already 👍 |
An alternative way would be fetching the event directly. const filter = {
kinds: [0],
authors: [user.pubkey]
}
const p = await ndk.fetchEvent(filter)
p.rawEvent() |
Yes of course, the problem with this approach is that it feels a bit convoluted to fetch the event like that and then set |
@gzuuus sorry it's taken a while. When NDK fetches events it's validating them (verifying signatures) on the way in the door. Is there some other type of verification that you need to do? The way that NDKUserProfile works, it's already storing all the fields it finds in the event content JSON blob, even if they aren't known fields. So I'm not sure if this would actually be beneficial or just mean that we're storing the same data twice. |
Yes, that's great. In my specific use case, I need the complete Kind0 event to store it in my database. Since the event itself is a signed document by the author, it wouldn't require any extra authentication to be added. What I'm missing is having access to this complete signed event. Ideally, all I would need is the event ID and signature to reconstruct it, but there are several factors that make this approach unreliable in NDK. For instance, fetchUserProfile() maps the profile data into a more standardized structure (which is great and very convenient), but this makes it difficult to reliably reconstruct the event from the available information (using the ID and signature). Ultimately, the benefit is that NDK can be better integrated into more custom solutions that go beyond simply displaying data on the client-side. What do you think? Can you think of another solution for this, maybe it could be something optional like a prop for fetUserProfile, for example |
Just updated the pr to make store profile event opt-in |
I was wondering if it would be possible to get the raw event from the user metadata (kind:0). It would be interesting if
fetchUserProfile()
orNDKUser
had a method that would allow you to access the kind:0, so you could validate the event.The text was updated successfully, but these errors were encountered: