Initial support for nostr wallet connect#96
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Closes #95 |
| name: 'Arcade', | ||
| returnTo: document.location.toString(), | ||
| }) | ||
| await nwc.initNWC() |
There was a problem hiding this comment.
whoot, super cool!
quck feedback:
you should pass the name here to the initNWC function: https://github.com/getAlby/alby-js-sdk/blob/master/README.md#initnwcname-string
nwcURL.current = nwc.getNostrWalletConnectUrl()
await nwc.initNWC({name: "Arcade" });
getNostrWalletConnectUrl returns the walletconnect secret URL. You don't need to pass any parameter there.
the returnTo is not needed with initNWC because initNWC opens the popup and listens for a response and the resolves and closes the popup, so no redirect is needed here.
(And one best practice is it to prompt the user on some interaction and not by default when the page is opened.)
There was a problem hiding this comment.
I've updated code based on your feedback, and it's work like charm 🔥


Add:
(main)/zap/[address]getInvoiceFromAddressfunction to generate invoice with user inputlightning addresssendZapfunction to send zap to specific invoiceChange:
initAlbyfunction, run this function will trigger openNostr Wallet Connectverification page as new tab and returnNostrWalletConnectUrlfor future useFlow:
/albypage, app auto trigger connect to Alby, and openNostr Wallet Connectverification page as new tabZapbutton, app auto generate invoice (fixed 21 sats), then push this invoice tosendPaymentfunction