invoice --receipt waits for payment - #1
Merged
Merged
Conversation
Pay via ndebit already returns settlement. This is for invoices paid some other way: print the bolt11, hold the socket, then print ok or the preimage. Co-authored-by: Cursor <cursoragent@cursor.com>
--receipt holds the socket while someone else pays; 1.7.1 asks the relay again if that connection drops mid-wait. Co-authored-by: Cursor <cursoragent@cursor.com>
1.7.1 re-subscribe can replay the invoice; that is not a payment. Still needs SDK 1.7.2 so the wait is not closed on that replay. Co-authored-by: Cursor <cursoragent@cursor.com>
Exit codes are independent of stderr, but a status line on stderr is still noise for scripts. The process staying up after the bolt11 is the wait. Co-authored-by: Cursor <cursoragent@cursor.com>
1.7.1 treated a replayed invoice as paid. 1.7.2 only closes on { res: ok }.
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clinkctl invoice --receiptprints the bolt11, then stays until{ res: ok }.--json --receiptwrites two objects: invoice, then receipt.payis unchanged — ndebit is already the closed loop.@shocknet/clink-sdkto ^1.7.2 so a replayed invoice is not treated as paid.Test plan
clinkctl invoice --amount 21prints bolt11 and exits 0--receipton 1.7.2 prints bolt11 and is still waiting after 30s (nook)--json --receiptprints the invoice JSON and stays (no second object)