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

NWC-only mode? #89

Closed
futurepaul opened this issue Oct 24, 2023 · 5 comments · Fixed by #140
Closed

NWC-only mode? #89

futurepaul opened this issue Oct 24, 2023 · 5 comments · Fixed by #140

Comments

@futurepaul
Copy link

I'd like to use this button for getting an NWC string but don't want my app to have to know all about webLN as well. is there a way to put this into "nwc only" mode so it gets NWC strings from alby and mutiny but doesn't do any other protocols?

@rolznz
Copy link
Collaborator

rolznz commented Oct 26, 2023

Hi @futurepaul, thanks for reporting.

Similar to #11 - I will close it for now

@rolznz
Copy link
Collaborator

rolznz commented Oct 27, 2023

@futurepaul this should be possible now with passing the filters="nwc" attribute to the button or modal. (in version 2.3.1)

@rolznz rolznz reopened this Oct 28, 2023
@rolznz
Copy link
Collaborator

rolznz commented Oct 28, 2023

@futurepaul we currently don't have a public interface for getting the NWC string because Bitcoin Connect only exposes the WebLN interface. You can get it from the webln object that is added to the window once the connection is connected, but I'll keep this open until we find a better way to expose that (and how NWC in general fits in with Bitcoin Connect which was originally focused on WebLN)

@rolznz
Copy link
Collaborator

rolznz commented Oct 30, 2023

Currently the NWC string is available at window.webln.nostrWalletConnectUrl after connecting but this is not publicly exposed / part of the webln spec. This is a problem is shown in the ZapPlanner PR to add Bitcoin Connect - we need a nice way to expose additional capabilities outside of webln that is not biased to just NWC but also supports other connector capabilities CC @bumi @reneaaron

@rolznz rolznz mentioned this issue Dec 5, 2023
21 tasks
@rolznz
Copy link
Collaborator

rolznz commented Dec 5, 2023

This will be solved in the next major version of Bitcoin Connect (#140):

import { WebLNProviders, requestProvider } from "@getalby/bitcoin-connect";

const provider = await requestProvider();

if (provider instanceof WebLNProviders.NostrWebLNProvider) {
  // do something with provider.nostrWalletConnectUrl;
}

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 a pull request may close this issue.

2 participants