mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-01 03:24:41 +01:00
c974fbf0f1
This also adds a `fetchinvoice-noconnect` option to suppress it too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-EXPERIMENTAL: `fetchinvoice` and `sendinvoice` will connect directly if they can't find an onionmessage route. Fixes: #4624
123 lines
3.8 KiB
Groff
Generated
123 lines
3.8 KiB
Groff
Generated
.TH "LIGHTNING-FETCHINVOICE" "7" "" "" "lightning-fetchinvoice"
|
|
.SH NAME
|
|
lightning-fetchinvoice - Command for fetch an invoice for an offer
|
|
.SH SYNOPSIS
|
|
|
|
\fB(WARNING: experimental-offers only)\fR
|
|
|
|
|
|
\fBfetchinvoice\fR \fIoffer\fR [\fImsatoshi\fR] [\fIquantity\fR] [\fIrecurrence_counter\fR] [\fIrecurrence_start\fR] [\fIrecurrence_label\fR] [\fItimeout\fR]
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The \fBfetchinvoice\fR RPC command contacts the issuer of an \fIoffer\fR to get
|
|
an actual invoice that can be paid\. It highlights any changes between the
|
|
offer and the returned invoice\.
|
|
|
|
|
|
If \fBfetchinvoice-noconnect\fR is not specified in the configuation, it
|
|
will connect to the destination in the (currently common!) case where it
|
|
cannot find a route which supports \fBoption_onion_messages\fR\.
|
|
|
|
|
|
The offer must not contain \fIsend_invoice\fR; see \fBlightning-sendinvoice\fR(7)\.
|
|
|
|
|
|
\fImsatoshi\fR is required if the \fIoffer\fR does not specify
|
|
an amount at all, otherwise it is not allowed\.
|
|
|
|
|
|
\fIquantity\fR is is required if the \fIoffer\fR specifies
|
|
\fIquantity_min\fR or \fIquantity_max\fR, otherwise it is not allowed\.
|
|
|
|
|
|
\fIrecurrence_counter\fR is required if the \fIoffer\fR
|
|
specifies \fIrecurrence\fR, otherwise it is not allowed\.
|
|
\fIrecurrence_counter\fR should first be set to 0, and incremented for
|
|
each successive invoice in a given series\.
|
|
|
|
|
|
\fIrecurrence_start\fR is required if the \fIoffer\fR
|
|
specifies \fIrecurrence_base\fR with \fIstart_any_period\fR set, otherwise it
|
|
is not allowed\. It indicates what period number to start at\.
|
|
|
|
|
|
\fIrecurrence_label\fR is required if \fIrecurrence_counter\fR is set, and
|
|
otherwise is not allowed\. It must be the same as prior fetchinvoice
|
|
calls for the same recurrence, as it is used to link them together\.
|
|
|
|
|
|
\fItimeout\fR is an optional timeout; if we don't get a reply before this
|
|
we fail (default, 60 seconds)\.
|
|
|
|
.SH RETURN VALUE
|
|
|
|
On success, an object is returned, containing:
|
|
|
|
.RS
|
|
.IP \[bu]
|
|
\fBinvoice\fR (string): The BOLT12 invoice we fetched
|
|
.IP \[bu]
|
|
\fBchanges\fR (object): Summary of changes from offer:
|
|
.RS
|
|
.IP \[bu]
|
|
\fBdescription_appended\fR (string, optional): extra characters appended to the \fIdescription\fR field\.
|
|
.IP \[bu]
|
|
\fBdescription\fR (string, optional): a completely replaced \fIdescription\fR field
|
|
.IP \[bu]
|
|
\fBvendor_removed\fR (string, optional): The \fIvendor\fR from the offer, which is missing in the invoice
|
|
.IP \[bu]
|
|
\fBvendor\fR (string, optional): a completely replaced \fIvendor\fR field
|
|
.IP \[bu]
|
|
\fBmsat\fR (msat, optional): the amount, if different from the offer amount multiplied by any \fIquantity\fR (or the offer had no amount, or was not in BTC)\.
|
|
|
|
.RE
|
|
|
|
.IP \[bu]
|
|
\fBnext_period\fR (object, optional): Only for recurring invoices if the next period is under the \fIrecurrence_limit\fR:
|
|
.RS
|
|
.IP \[bu]
|
|
\fBcounter\fR (u64): the index of the next period to fetchinvoice
|
|
.IP \[bu]
|
|
\fBstarttime\fR (u64): UNIX timestamp that the next period starts
|
|
.IP \[bu]
|
|
\fBendtime\fR (u64): UNIX timestamp that the next period ends
|
|
.IP \[bu]
|
|
\fBpaywindow_start\fR (u64): UNIX timestamp of the earliest time that the next invoice can be fetched
|
|
.IP \[bu]
|
|
\fBpaywindow_end\fR (u64): UNIX timestamp of the latest time that the next invoice can be fetched
|
|
|
|
.RE
|
|
|
|
|
|
.RE
|
|
|
|
The following error codes may occur:
|
|
|
|
.RS
|
|
.IP \[bu]
|
|
-1: Catchall nonspecific error\.
|
|
.IP \[bu]
|
|
1002: Offer has expired\.
|
|
.IP \[bu]
|
|
1003: Cannot find a route to the node making the offer\.
|
|
.IP \[bu]
|
|
1004: The node making the offer returned an error message\.
|
|
.IP \[bu]
|
|
1005: We timed out trying to fetch an invoice\.
|
|
|
|
.RE
|
|
.SH AUTHOR
|
|
|
|
Rusty Russell \fI<rusty@rustcorp.com.au\fR> is mainly responsible\.
|
|
|
|
.SH SEE ALSO
|
|
|
|
\fBlightning-sendinvoice\fR(7), \fBlightning-pay\fR(7)\.
|
|
|
|
.SH RESOURCES
|
|
|
|
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
|
|
|
|
\" SHA256STAMP:8343ee7fe4d8413760a47a9d2657c4557734fa67af5bfec582daf780828ca675
|