Skip to content

Conversation

@rolznz
Copy link
Contributor

@rolznz rolznz commented Mar 29, 2025

This makes it much easier for wallets to add support for NWC, by not having to implement the lower-level NWC spec such as encrypting/decrypting and publishing events, subscribing to the relay etc.

TODOs:

  • add documentation
  • re-connection seems to not be working properly?
  • add missing (non-multi) methods

@rolznz rolznz requested review from bumi and im-adithya March 29, 2025 04:53
Copy link
Contributor

@bumi bumi left a comment

Choose a reason for hiding this comment

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

that looks like a nice and helpful wrapper!

do I read it correct that for each user/wallet I would need to call the subscribe function?

relay: Relay;
relayUrl: string;

constructor(options: NewNWCWalletServiceOptions) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why does the wallet service not also have the keypair?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do I read it correct that for each user/wallet I would need to call the subscribe function?

Yes, this is the reason. So that each connection can have unique keypairs, like we do in Alby Hub now

@rolznz rolznz requested review from im-adithya and removed request for im-adithya April 1, 2025 09:53
@rolznz
Copy link
Contributor Author

rolznz commented Apr 1, 2025

Merging for now and will add documentation in a follow-up PR to not cause conflicts with #344

@rolznz rolznz merged commit 58b8783 into master Apr 1, 2025
3 checks passed
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