-
Notifications
You must be signed in to change notification settings - Fork 30
docs: add some comments to the examples #355
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
Conversation
examples/lnclient/paywall.js
Outdated
| console.info(request.invoice.paymentRequest); | ||
| console.info("Waiting for payment..."); | ||
|
|
||
| // register the callback that will get executed once the user has paid the invoice |
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.
| // register the callback that will get executed once the user has paid the invoice | |
| // register the callback that will get executed once the user has paid the invoice. You can unsubscribe manually if the user decides to not pay. |
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.
I am still confused between unsubscribe and close - the close is the disconnect of the websocket, isn't 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.
Yes, that's right for close
unsubscribe is unsubscribing from this single invoice that we are waiting for a payment for (either a nostr subscription for notifications, or a polling fallback)
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.
then let's add that comment to the unsubscribe() function?
because this line will never be reached if the user decides to not pay.
* feat: add simpler LNClient class * chore: make sat units clear, add pay to ln address, fix args order * chore: add LN alias * docs: add wallet service documentation, fix example relay urls * chore: move oauth client code into folder * docs: clean up main README, add WebLN section * feat: extract invoice receiving object into class and add fallback polling, fix exports * chore: move fiat logic to new FiatAmount class * docs: rename * fix: amount type * chore: return invoice objects from lnclient send and receive methods * chore: add sats helper * docs: add basic LNClient documentation * docs: add links to get credentials * chore: add docs github action * fix: typedoc entrypoint * fix: run yarn install before generating docs * chore: fix typedoc warnings * docs: link to typedoc documentation * docs: add splitter This example shows how to receive a payment and split it to other recipients * docs: more logs in examples * fix: undo my test amount * Update examples/lnclient/splitter.js Co-authored-by: Copilot <[email protected]> * docs: make credentials more clear Co-authored-by: Michael Bumann <[email protected]> * docs: make credentials more clear * feat: allow comment and payerdata in LNClient pay method (#356) * feat: allow comment and payerdata in LNClient pay method * fix: apply transaction metadata to all related transaction method types * chore: update example and lnclient docs to pay ln address with extra metadata * docs: add some comments to the examples (#355) * docs: add some comments to the examples * docs: comments * feat: add lnclient receive timeout for ReceiveInvoice class (#357) * chore: remove unnecessary comment * chore: remove unnecessary comment --------- Co-authored-by: Roland <[email protected]> * docs: set specific websocket polyfill version * docs: improve NWA documentation --------- Co-authored-by: Michael Bumann <[email protected]> Co-authored-by: Copilot <[email protected]>
@rolznz how about we just add comment on the
client.close()?