Skip to content

Conversation

@bumi
Copy link
Contributor

@bumi bumi commented Apr 7, 2025

@rolznz how about we just add comment on the client.close() ?

console.info(request.invoice.paymentRequest);
console.info("Waiting for payment...");

// register the callback that will get executed once the user has paid the invoice
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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.

Copy link
Contributor Author

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?

Copy link
Contributor

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)

Copy link
Contributor Author

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.

@bumi bumi requested a review from rolznz April 7, 2025 19:55
@rolznz rolznz merged commit 03c3e90 into feat/lnclient Apr 9, 2025
3 checks passed
rolznz added a commit that referenced this pull request Apr 11, 2025
* 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]>
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.

3 participants