2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"rpc" : "fetchinvoice" ,
"title" : "Command for fetch an invoice for an offer" ,
"warning" : "experimental-offers only" ,
"description" : [
"The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice." ,
"" ,
"If **fetchinvoice-noconnect** 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 `option_onion_messages`."
] ,
"request" : {
"required" : [
"offer"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"offer" : {
"type" : "string" ,
"description" : [
"Offer string to get an actual invoice that can be paid."
]
} ,
"amount_msat" : {
"type" : "msat" ,
"description" : [
"Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)."
]
} ,
"quantity" : {
"type" : "u64" ,
"description" : [
"Required if the offer specifies quantity_max, otherwise it is not allowed."
]
} ,
"recurrence_counter" : {
"type" : "u64" ,
"description" : [
"Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series."
]
} ,
"recurrence_start" : {
"type" : "number" ,
"description" : [
"Required if the offer specifies recurrence_base with start_any_period set, otherwise it is not allowed. It indicates what period number to start at."
]
} ,
"recurrence_label" : {
"type" : "string" ,
"description" : [
"Required if recurrence_counter 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."
]
} ,
"timeout" : {
"type" : "number" ,
"description" : [
"If we don't get a reply before this we fail (default, 60 seconds)."
]
} ,
"payer_note" : {
"type" : "string" ,
"description" : [
"To ask the issuer to include in the fetched invoice."
]
doc: fix up missing fields from schemas.
This allows the next patch (which makes the schemas stricter) to not
break our tests.
We add some missing fields (including dev fields, but they're empty and hidden),
and add a few minor clarifications and a spelling fix. Most of these are new
schemas for this release, so no mention in Changelog.
Here is the difference in the man pages:
--- doc/lightning-askrene-inform-channel.7.md.old 2024-10-29 17:33:07.714521584 +1030
+++ doc/lightning-askrene-inform-channel.7.md 2024-10-29 17:42:37.434280109 +1030
@@ -24,6 +24,8 @@
- **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
+- **layer** (string): The name of the layer to apply this change to.
+- **timestamp** (u64): The UNIX timestamp when this constraint was created.
- **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
--- doc/lightning-askrene-listlayers.7.md.old 2024-10-29 17:33:07.716521571 +1030
+++ doc/lightning-askrene-listlayers.7.md 2024-10-29 17:42:37.424280316 +1030
@@ -29,13 +29,16 @@
- **channel\_updates** (array of objects):
+ - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction this update applies to.
+ - **enabled** (boolean, optional): True if this can be used, false otherwise.
- **htlc\_minimum\_msat** (msat, optional): The minimum value allowed in this direction.
- **htlc\_maximum\_msat** (msat, optional): The maximum value allowed in this direction.
- **fee\_base\_msat** (msat, optional): The base fee to apply to use the channel in this direction.
- **fee\_proportional\_millionths** (u32, optional): The proportional fee (in parts per million) to apply to use the channel in this direction.
- - **delay** (u16, optional): The CLTV delay required for this direction.
+ - **cltv\_expiry\_delta** (u16, optional): The CLTV delay required for this direction.
- **constraints** (array of objects):
- **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
+ - **timestamp** (u64, optional): The UNIX timestamp when this constraint was created.
- **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
--- doc/lightning-askrene-listreservations.7.md.old 2024-10-29 17:33:07.719521550 +1030
+++ doc/lightning-askrene-listreservations.7.md 2024-10-29 17:42:37.428280233 +1030
@@ -16,7 +16,7 @@
-On success, an object containing **layers** is returned. It is an array of objects, where each object contains:
+On success, an object containing **reservations** is returned. It is an array of objects, where each object contains:
--- doc/lightning-autoclean-status.7.md.old 2024-10-29 17:33:07.732521462 +1030
+++ doc/lightning-autoclean-status.7.md 2024-10-29 17:42:37.441279965 +1030
@@ -9,7 +9,7 @@
-The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem.
+The **autoclean-status** RPC command tells you about the status of the autoclean plugin, optionally for only one subsystem.
--- doc/lightning-renepay.7.md.old 2024-10-29 17:33:07.927520140 +1030
+++ doc/lightning-renepay.7.md 2024-10-29 17:42:37.996268504 +1030
@@ -58,6 +58,9 @@
- **status** (string) (one of "complete", "pending", "failed"): Status of payment.
+- **bolt11** (string, optional): The bolt11 invoice paid. *(added v23.08)*
+- **bolt12** (string, optional): The bolt12 invoice paid. *(added v23.08)*
+- **groupid** (u64, optional): The groupid used for these payment parts (as can be seen in listsendpays) *(added v23.08)*
- **destination** (pubkey, optional): The final destination of the payment.
--- doc/lightning-sendonion.7.md.old 2024-10-29 17:33:07.937520073 +1030
+++ doc/lightning-sendonion.7.md 2024-10-29 17:42:37.957269309 +1030
@@ -22,7 +22,7 @@
-- **first\_hop** (object): Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute*.:
+- **first\_hop** (object): Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute* (so fields not mentioned here are ignored).:
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `renepay` return fields documented in schema (`bolt11`, `bolt12` and `groupid`)
2024-10-29 17:50:40 +10:30
} ,
"dev_reply_path" : {
"hidden" : true
} ,
"dev_path_use_scidd" : {
"hidden" : true
2024-01-15 13:35:14 -08:00
}
}
} ,
"response" : {
"required" : [
"invoice" ,
"changes"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"invoice" : {
"type" : "string" ,
"description" : [
"The BOLT12 invoice we fetched."
]
} ,
"changes" : {
"type" : "object" ,
"description" : [
"Summary of changes from offer."
] ,
"additionalProperties" : false ,
"required" : [ ] ,
"properties" : {
"description_appended" : {
"type" : "string" ,
"description" : [
"Extra characters appended to the *description* field."
]
} ,
"description" : {
"type" : "string" ,
"description" : [
"A completely replaced *description* field."
]
} ,
"vendor_removed" : {
"type" : "string" ,
"description" : [
"The *vendor* from the offer, which is missing in the invoice."
]
} ,
"vendor" : {
"type" : "string" ,
"description" : [
"A completely replaced *vendor* field."
]
} ,
"amount_msat" : {
"type" : "msat" ,
"description" : [
"The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)."
]
}
}
} ,
"next_period" : {
"type" : "object" ,
"description" : [
"Only for recurring invoices if the next period is under the *recurrence_limit*."
] ,
"additionalProperties" : false ,
"required" : [
"counter" ,
"starttime" ,
"endtime" ,
"paywindow_start" ,
"paywindow_end"
] ,
"properties" : {
"counter" : {
"type" : "u64" ,
"description" : [
"The index of the next period to fetchinvoice."
]
} ,
"starttime" : {
"type" : "u64" ,
"description" : [
"UNIX timestamp that the next period starts."
]
} ,
"endtime" : {
"type" : "u64" ,
"description" : [
"UNIX timestamp that the next period ends."
]
} ,
"paywindow_start" : {
"type" : "u64" ,
"description" : [
"UNIX timestamp of the earliest time that the next invoice can be fetched."
]
} ,
"paywindow_end" : {
"type" : "u64" ,
"description" : [
"UNIX timestamp of the latest time that the next invoice can be fetched."
]
}
}
}
}
} ,
"errors" : [
"The following error codes may occur:" ,
"" ,
"- -1: Catchall nonspecific error." ,
"- 1002: Offer has expired." ,
"- 1003: Cannot find a route to the node making the offer." ,
"- 1004: The node making the offer returned an error message." ,
"- 1005: We timed out trying to fetch an invoice."
] ,
2024-06-20 14:57:02 -07:00
"author" : [
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
] ,
"see_also" : [
"lightning-sendinvoice(7)" ,
"lightning-pay(7)"
] ,
"resources" : [
"Main web site: <https://github.com/ElementsProject/lightning>"
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:fetchinvoice#1" ,
"method" : "fetchinvoice" ,
"params" : {
2024-07-18 00:28:22 -07:00
"offer" : "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqgn3qzs2ge5hx6pqwdskcefpzcssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e" ,
2024-03-27 18:45:18 -07:00
"payer_note" : "Thanks for the fish!"
}
} ,
"response" : {
2024-07-18 00:28:22 -07:00
"invoice" : "lni1qqg9g04gczk9ntk4gsjg3aptwykk2q3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssq38zq9q53nfwd5zqumpd3jjz93pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j5pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84sggztuesttnr6atmya7afycpsvcg0wnzprn58n54lfhf2ragp0jq0e04j9z5dpsku6mnypnx7u3qw35x2grxd9eksgdqnqpz6g3kyz34nfrl7lm6c3rushzxey3a55ecjgs6qp2vz8q78j336kgr6euj6p39a209zw5kpkftk7h9te69vlmjg0arceagpaajague0zsszqk96htpgqn2wsznaas0zfdtf8v97ryz29jrn7rwgs5687ghgq5jusqr99dtx4jdj9nqpep5zxmynegrg6e7rm2l53ur8043h2yqzldyl5vh08h8ssaeq5jrvw9y24kztlwvc4nwagsuqqqqqqqqqqqqqqq9qqqqqqqqqqqqq8fykt06c5sqqqqqpfqyv65yfedgyqrp2s7qpxpjse8q8796qcrr5xwgfkqjue3urd6rs2rt2f68tk0vl2szyugtqggz953rvg9rtxj8lalh43z8epwydjfrmffn3y3p5qz5cywpu09rr4vlqsy2n7vmpn67ltzrj70znp70sk4m530j5vceq6jhk97h7ttzn09sh8m9gecarrt27v2tux8z6rr06sj9h60r05p4vhkhzsp0xf9ea4jgg" ,
2024-03-27 18:45:18 -07:00
"changes" : { }
2024-01-15 13:35:14 -08:00
}
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:fetchinvoice#2" ,
"method" : "fetchinvoice" ,
"params" : {
2024-07-18 00:28:22 -07:00
"offer" : "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqv85ysq2qepk7enxv4j3gqg2zcssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e" ,
"amount_msat" : 2000000 ,
2024-03-27 18:45:18 -07:00
"quantity" : 2
}
} ,
"response" : {
2024-07-18 00:28:22 -07:00
"invoice" : "lni1qqg86u6jfl660zfuk22sexem37r7xq3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy8ssqc0gfqq5pjrdanxvet9zsqs593pqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4j5pqqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy84yqc7sjq9vqgztqssxq2dwgnpqyhz3j68zx5cts28t6aqfgq937wsgvsmfncau3uhz8t05zvqytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82eq2rdjuqaychg3jndvsjrlu6y08aeuh4ytw6f6ak5n24p5n8zmsz2sqgrg3rg89hqfh6n7dfr0fugvq20ehecd3ezc438l6uh4r8epaakn4lsqv4qgr3ks4yxngyflq339lza456xt8uly085umq3gwql3qyfge0ec03dezeg8xulz33ntlj8yd7dcra9564zrsqqqqqqqqqqqqqqq5qqqqqqqqqqqqqayjedltzjqqqqqq9yq3n2s3894qsfwwvj3szk4yplg4fkw68nwzlwyc23457qx6v7xe38znuha72km6a2qv0gfq9syypz6g3kyz34nfrl7lm6c3rushzxey3a55ecjgs6qp2vz8q78j336k0sgz2rxjcsxs6s3lnngq9xeqn9pzy53n50p4ulcdvkx8dye7h8xgxpvjyg928m2txk2knl0zzfl7j82c6lq7xqlx83ey7z4aux9pjp4sp7" ,
2024-03-27 18:45:18 -07:00
"changes" : { }
2024-01-15 13:35:14 -08:00
}
}
]
}