-
Notifications
You must be signed in to change notification settings - Fork 198
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
including interface for nip07 #403
including interface for nip07 #403
Conversation
Please have it match this interface: https://gitlab.com/soapbox-pub/nostrify/-/blob/main/interfaces/NostrSigner.ts?ref_type=heads Also, take a look at: https://nostrify.dev/sign/ |
Sorry, I missed this in the pile of GitHub notifications before. Looks good, can we merge @alexgleason? |
nip07.ts
Outdated
|
||
export interface Nip07 { | ||
getPublicKey(): Promise<string> | ||
signEvent(event: EventTemplate): Promise<VerifiedEvent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signEvent(event: EventTemplate): Promise<VerifiedEvent> | |
signEvent(event: EventTemplate): Promise<Event> |
An extension won't be able to add our special symbol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is something that I have not understood, can you explain better this suggestion for me?
VerifiedEvent is exported and I use it and other special symbols like NostrEvent and EventTemplate in my apps, and I think that the extension will implement this interface using JavaScript and should return in the Promise a corresponding event with VerifiedEvent interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at the definition of VerifiedEvent. It has [verifiedSymbol]: true
, which is something only nostr-tools can add to the object. An external extension can't do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, I changed it to NostrEvent
…vent returned by the signer
This pull request includes:
I haven't finished testing it yet and it's not ready, but I opened the pull request to advance the code review