Why Nostr? What is Njump?
2024-01-14 21:42:00

samuelralak on Nostr: ...

https://www.apolloqa.org/questions/6e3dc618-f3a8-4d88-9056-a9f43e6d8c25?eventId=2a12d989a24e649aaa8ea3fa23d2f40c146bafcc45e3a1aca3fad52106421f4e
I am working on implementing zaps on my NOSTR client using the [Nost Dev Kit](https://github.com/nostr-dev-kit/ndk), so far I have been able to successfully generate lightning invoices with the NDKEvent.zap method. The next step would be to generate a receipt `kind 9735 `; however, according to the [NIP-57](https://github.com/nostr-protocol/nips/blob/master/57.md), the receipt isn't definitive proof that the invoice was paid. Now, I need client to perform the following steps:
- Check if the user has a connected wallet. If not, prompt the user to connect their wallet.
- Pay the invoice when the wallet is successfully connected.
- Publish kind 9735 upon successful payment.

Similar flows can be seen on clients like habla.news, coracle.social and flockstr

I've been going through [NIP-47](https://github.com/nostr-protocol/nips/blob/master/47.md) and checking the code/documentation on `alby-js-sdk`, but I'm still a bit confused on how to put all these pieces together. Any guidance or code examples would be greatly appreciated!
Author Public Key
npub18rl8k26jzhjq572k3ys93z6csmtzz7jr2uxz3s9r9cmtzg3wjq0q4z92mq