core-lightning/doc/schemas/lightning-preapproveinvoice.json
Rusty Russell b327bd30c3 doc: fix all JSON schemas to enforce no additional properties.
Without this, we have hardly any enforcement.  This is why the schema
mistake fixed in the previous patches weren't spotted immediately.

The hard work was done by:

```
$ for f in lightning-*.json; do grep -v '^  "additionalProperties": false,' $f | bagto $f; done
$ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done
$ make fmt-schemas
```

Then checking where 'additionalProperties: true' had been turned to
false (we deliberately use it in some places where there are if
statements in the schema, or occasionally where there can be arbitrary
fields).

[Including doc/rpc-schema-draft.json update by Shahana]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-10-30 15:39:12 +10:30

68 lines
2.6 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"added": "v23.02",
"rpc": "preapproveinvoice",
"title": "Ask the HSM to preapprove an invoice (low-level)",
"description": [
"The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.",
"",
"Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.",
"",
"By default, the HSM will approve all **preapproveinvoice** requests.",
"",
"If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.",
"",
"If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment."
],
"request": {
"required": [
"bolt11"
],
"additionalProperties": false,
"properties": {
"bolt11": {
"type": "string",
"description": [
"Bolt11 invoice to submit to the HSM to check."
],
"added": "v23.02"
}
}
},
"response": {
"additionalProperties": false,
"properties": {}
},
"author": [
"Ken Sedgwick <<ken@bonsai.com>> is mainly responsible."
],
"see_also": [
"lightning-pay(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:preapproveinvoice#1",
"method": "preapproveinvoice",
"params": {
"bolt11": "lnbcrt1230n1pn2s38psp5jf2zk7py4wmutyq4pdr6783egft24nkyhfrxegrzzqnef2matw2qpp5rf5zgqyexdt7q5ean83cvcjuc3jafn8etm3c0za6xldwcyllvffqdqlv3jhxcmjd9c8g6t0dcsxjmnktakrydqcqp9rzjqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qqq0vqqqqgqqyqqqqqpqqqqqzsqqc9qxpqysgq8nn5qkcp9xl5u7dlqamdys6e6yc0ngyqe676cqajnwax6657verj7at5gvdqu6nk3l0wcagq4muyhqqms4t0t9sfvyazpga5eywj6uqpyc409e"
}
},
"response": {}
},
{
"request": {
"id": "example:preapproveinvoice#2",
"method": "preapproveinvoice",
"params": [
"lnbcrt1240n1pn2s38psp5ufjqj6kuxlvl65xue9p06ulyvwf9sm0utxlch59d0ynl05778vwspp5qlacxkrdmc2p50yl8lsl75pwmlhve2ret2yd2f34z7jfs7yffwvqdqlv3jhxcmjd9c8g6t0dcsxjmnktakrydgcqp9rzjqdwjkyvjm7apxnssu4qgwhfkd67ghs6n6k48v6uqczgt88p6tky96qqq0vqqqqgqqyqqqqqpqqqqqzsqqc9qxpqysgqkml60qaytvnd08p57w7enuna95s7cqej8cfuvsgjzpeq9u83s0hqh60667nrp40qkqxkdu36z8wqtmac5z3208rwyn0q2pv56sgz5dcp9mn5hc"
]
},
"response": {}
}
]
}