Skip to content
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

feat: add nip 44 and versioning support #273

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

im-adithya
Copy link
Member

Ready for review

  • This needs the long pending update to nostr-tools v2 as nip44 library doesn't match the latest spec (and hence gives errors as it doesn't match with the Hub's nip-44)
  • For now I added the nip-44 folder so we can test it, in the meantime I'll work on a PR to shift to nostr-tools v2 so we can remove it.

}
}

private selectHighestCompatibleVersion(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is nice, but I am wondering if such a complex algorithm is needed?

What about just:
if the wallet supports version 1.0, use it. Otherwise use 0.0.

As Bumi mentioned:

I do not expect many versions (and rather bigger changes like the switch to nip-44) because too many versions (of a spec) lead to incompatibilities which must be avoided.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I was also thinking about this, but then thought to add this as this is an sdk and can face any possibility... (a weird case where the wallet service info gives "0.5" or "1.1" for example)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we leave it as-is, please add a few tests to cover it

@rolznz
Copy link
Contributor

rolznz commented Nov 30, 2024

This needs the long pending update to nostr-tools v2

@im-adithya this is great! 🚀

please let me know when it's ready for testing.

src/NWCClient.ts Outdated Show resolved Hide resolved
@im-adithya
Copy link
Member Author

Done, ready for testing!

@rolznz
Copy link
Contributor

rolznz commented Jan 3, 2025

EDIT, wrong repository. See getAlby/hub#834 (comment)

"UNSUPPORTED_VERSION",
);
}
this.version = compatibleVersion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the version is 0.0 should we log a warning?

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