Skip to content

Rename signEvent to getSignature #195

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

Merged
merged 2 commits into from
Apr 24, 2023
Merged

Conversation

alexgleason
Copy link
Collaborator

The existing signEvent function is named incorrectly. It should be called getSignature, which matches its partner function getEventHash. This is because it returns a string instead of a signed event. Even NIP-07's window.nostr.signEvent function is correct, returning the signed event, but the one in this repo isn't.

This is a breaking change, but I think it's needed. The name of this function interferes with actual signEvent implementations.

@fiatjaf
Copy link
Collaborator

fiatjaf commented Apr 23, 2023

I agree with you, but I'm afraid this will break too much. Maybe we should keep both for a while and change the docs and add a deprecation notice or something, then remove it after 6 months?

@alexgleason
Copy link
Collaborator Author

Good call. I updated the branch and restored the signEvent function with a deprecation warning.

@fiatjaf fiatjaf merged commit 278cdda into nbd-wtf:master Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants