core-lightning/doc/schemas/lightning-offer.json

222 lines
8.2 KiB
JSON
Raw Normal View History

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "offer",
"title": "Command for accepting payments",
"description": [
"The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.",
"",
"Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)."
],
"request": {
"required": [
"amount"
],
"additionalProperties": false,
"properties": {
"amount": {
"oneOf": [
{
"type": "msat_or_any"
},
{
"type": "currency"
}
],
"description": [
"Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail."
]
},
"description": {
"type": "string",
"description": [
"A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes."
]
},
"issuer": {
"type": "string",
"description": [
"Who is issuing this offer (i.e. you) if appropriate."
]
},
"label": {
"type": "string",
"description": [
"An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer."
]
},
"quantity_max": {
"type": "u64",
"description": [
"Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer."
]
},
"absolute_expiry": {
"type": "u64",
"description": [
"Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer."
]
},
"recurrence": {
"type": "string",
"description": [
"An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, `months` or `years` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`."
]
},
"recurrence_base": {
"type": "integer",
"description": [
"Time in seconds since the first day of 1970 UTC. This indicates when the first period begins; without this, the recurrence periods start from the first invoice."
]
},
"recurrence_paywindow": {
"type": "string",
"description": [
"Argument of form `-time+time[%]`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer."
],
"default": "that payment is allowed during the current and previous periods"
},
"recurrence_limit": {
"type": "u32",
"description": [
"To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer."
]
},
"single_use": {
"type": "boolean",
"description": [
"Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)."
],
"default": "False"
},
"recurrence_start_any_period": {
"added": "v24.02",
"type": "boolean",
"description": [
"This means that the invoice may start by paying during any period; otherwise it must start by paying at the first period. Setting this to false only makes sense if *recurrence_base* was provided. This is encoded in the offer."
],
"default": "True"
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_paths": {
"hidden": true
}
}
},
"response": {
"required": [
"offer_id",
"active",
"single_use",
"bolt12",
"used",
"created"
],
"additionalProperties": false,
"properties": {
"offer_id": {
"type": "hash",
"description": [
"The id of this offer (merkle hash of non-signature fields)."
]
},
"active": {
"type": "boolean",
"enum": [
true
],
"description": [
"Whether this can still be used."
]
},
"single_use": {
"type": "boolean",
"description": [
"Whether this expires as soon as it's paid (reflects the *single_use* parameter)."
]
},
"bolt12": {
"type": "string",
"description": [
"The bolt12 encoding of the offer."
]
},
"used": {
"type": "boolean",
"description": [
"True if an associated invoice has been paid."
]
},
"created": {
"type": "boolean",
"description": [
"False if the offer already existed."
]
},
"label": {
"type": "string",
"description": [
"The (optional) user-specified label."
]
}
}
},
"errors": [
"On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.",
"",
"If the offer already existed, and is still active, that is returned; if it's not active then this call fails.",
"",
"- -1: Catchall nonspecific error.",
"- 1000: Offer with this offer_id already exists (but is not active)."
],
"author": [
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
],
"see_also": [
"lightning-listoffers(7)",
"lightning-disableoffer(7)",
"lightning-invoicerequest(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
2024-03-27 18:45:18 -07:00
"request": {
"id": "example:offer#1",
"method": "offer",
"params": {
"amount": "10000msat",
"description": "Fish sale!"
2024-03-27 18:45:18 -07:00
}
},
"response": {
"offer_id": "offeridl21000002100000210000021000002100000210000021000002100000",
2024-03-27 18:45:18 -07:00
"active": true,
"single_use": false,
"bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
2024-03-27 18:45:18 -07:00
"used": false,
"created": true
}
},
{
2024-03-27 18:45:18 -07:00
"request": {
"id": "example:offer#2",
"method": "offer",
"params": {
"amount": "1000sat",
"description": "Coffee",
"quantity_max": 10
2024-03-27 18:45:18 -07:00
}
},
"response": {
"offer_id": "offeridl22000002200000220000022000002200000220000022000002200000",
2024-03-27 18:45:18 -07:00
"active": true,
"single_use": false,
"bolt12": "lno1qgsq000bolt220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000",
2024-03-27 18:45:18 -07:00
"used": false,
"created": true
}
}
]
}