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: new NWC deeplink flow to support other relays and wallet pubkeys #297

Merged
merged 6 commits into from
Feb 18, 2025

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Jan 18, 2025

This updated the new client-initiated auth flow to be independent of relays and wallet service pubkeys, by instead receiving the nostr wallet connect string (everything apart from the secret, which is generated locally - and only the pubkey is passed to the auth URL)

Breaking changes

Old initNWC() and withNewSecret are removed.

See changes required in Alby Hub: getAlby/hub#1009

Copy link
Contributor

@Dayvvo Dayvvo left a comment

Choose a reason for hiding this comment

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

Hey @rolznz !! . gone through the code and tested this PR with bitcoin-connect locally. Looks good!

However I have one question. It seems there is no way to call the fromAuthorizationUrl from the NostrWebLNProvider class. Only when using the NwcClient class directly. currently some flows in bitcoin-connect use the NostrWebLNProviderClass , as is suggested for a web app flow. The only way I could test this locally was to use the NwcClient class directly. Is this intentional?

@rolznz
Copy link
Contributor Author

rolznz commented Feb 17, 2025

@Dayvvo awesome! You're right, I see this is an issue since the NostrWeblnProvider then would have to initialize a new NWCClient. I think we need to fix this so we can optionally pass a NWCClient into the NostrWeblnProvider constructor. We could also have a fromAuthorizationUrl method on the NostrWeblnProvider just for convenience that creates a NWCClient and then returns a new NostrWeblnProvider from that NWCClient.

I will try fix this before this PR is merged, thanks!

@rolznz rolznz merged commit a3617c5 into master Feb 18, 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