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: NWA + NWC deep linking #272

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

feat: NWA + NWC deep linking #272

wants to merge 20 commits into from

Conversation

im-adithya
Copy link
Member

@im-adithya im-adithya commented Feb 19, 2025

This implements the deep linking flow to create connections as described in nostr-protocol/nips#1777

Requires

Screenshots

Screens to be improved in follow-ups

Deeplink Demo

ScreenRecording_02-19-2025.14-46-14_1.MP4

@im-adithya im-adithya requested a review from rolznz February 19, 2025 09:17
@rolznz
Copy link
Contributor

rolznz commented Feb 21, 2025

@im-adithya we also need to remove the ability to export the connection secret (for everyone) since it might have superuser permissions

@im-adithya
Copy link
Member Author

Hmmm, so we remove for all kinds of wallets then?

@reneaaron reneaaron marked this pull request as draft February 24, 2025 14:40
@rolznz
Copy link
Contributor

rolznz commented Feb 26, 2025

For NWA we should support scanning a QR code too (e.g. see bitcoin connect)

@getAlby getAlby deleted a comment from rolznz Feb 26, 2025
@rolznz rolznz marked this pull request as ready for review February 28, 2025 09:21
const nwcClient = useAppStore.getState().nwcClient;
if (!nwcClient) {
throw new Error("NWC client not connected");
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We will already have the nip47capabilities of the wallet (and create_connection can't also be edited so we don't even have that problem here (since we don't update the nip47capabilities and stick to the ones we got on fetching the first time)) so should we check for that here or even before so the user is not betrayed xD after all these steps?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can do it as a follow-up too but I think it's good if we can show a screen for those scanning NWAs with their old Alby Go connections with a message to reconnect with their Hubs cc @stackingsaunter

Copy link
Contributor

Choose a reason for hiding this comment

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

@im-adithya

We will already have the nip47capabilities of the wallet (and create_connection can't also be edited so we don't even have that problem here (since we don't update the nip47capabilities and stick to the ones we got on fetching the first time)) so should we check for that here or even before so the user is not betrayed xD after all these steps?

Sorry, I don't understand your comment here. I understand we don't need to do get_info.

But we also have this page so the user should immediately see it if their connection doesn't support it

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup sorry I meant this

I don't understand your comment here

(unrelated to this PR) I was wondering if we should keep updating that wallet.nwcCapabilities on a regular basis since the user might have updated the permissions. But here we don't have to think about that since superuser permission can't be added later.

Other parts in the comment you can ignore, I didn't see this unsupported screen then 😅

@im-adithya
Copy link
Member Author

(Follow-up) If the app isn't requesting any budget the design looks very bad atm

}&relay=${nwcClient.relayUrl}`,
);
}
setRedirectCountdown(5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we artificially delay the flow by 5 seconds, I wonder if it's too much. What is the reasoning here?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was actually to finish the Tick animation lol, but this can be lesser, or do you think we should not care about the animation and switch instantly?

@im-adithya im-adithya changed the title feat: nwc deep linking feat: NWA + NWC deep linking Feb 28, 2025
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