-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: master
Are you sure you want to change the base?
Conversation
@im-adithya we also need to remove the ability to export the connection secret (for everyone) since it might have superuser permissions |
Hmmm, so we remove for all kinds of wallets then? |
For NWA we should support scanning a QR code too (e.g. see bitcoin connect) |
const nwcClient = useAppStore.getState().nwcClient; | ||
if (!nwcClient) { | ||
throw new Error("NWC client not connected"); | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
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
There was a problem hiding this comment.
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 😅
}&relay=${nwcClient.relayUrl}`, | ||
); | ||
} | ||
setRedirectCountdown(5); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
This implements the deep linking flow to create connections as described in nostr-protocol/nips#1777
Requires
feat: NWA js-sdk#298Feat: NWA auth for self-hosted hubs hub#1016Component for budgets (+ methods if we wish to do that as well)Will do in a follow-up (Add option to choosebudget_renewal
andmax_amount
in NWA flow #288)Screenshots
Screens to be improved in follow-ups
Deeplink Demo
ScreenRecording_02-19-2025.14-46-14_1.MP4