Skip to content

feat: add NWC Wallet Service#346

Merged
rolznz merged 7 commits into
masterfrom
feat/nwc-wallet-service
Apr 1, 2025
Merged

feat: add NWC Wallet Service#346
rolznz merged 7 commits into
masterfrom
feat/nwc-wallet-service

Conversation

@rolznz

@rolznz rolznz commented Mar 29, 2025

Copy link
Copy Markdown
Member

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

@bumi bumi left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Member 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

rolznz commented Apr 1, 2025

Copy link
Copy Markdown
Member Author

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

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