core-lightning/doc/schemas/lightning-addpsbtoutput.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

133 lines
4.2 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"added": "v23.11",
"rpc": "addpsbtoutput",
"title": "Command to populate PSBT outputs from the wallet",
"description": [
"`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.",
"",
"This is used to receive funds into the on-chain wallet interactively using PSBTs."
],
"request": {
"required": [
"satoshi"
],
"additionalProperties": false,
"properties": {
"satoshi": {
"type": "sat",
"description": [
"The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*."
]
},
"initialpsbt": {
"type": "string",
"description": [
"Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically."
]
},
"locktime": {
"type": "u32",
"description": [
"If not set, it is set to a recent block height (if no initial psbt is specified)."
]
},
"destination": {
"type": "string",
"description": [
"If it is not set, an internal address is generated."
]
}
}
},
"response": {
"required": [
"psbt",
"estimated_added_weight",
"outnum"
],
"additionalProperties": false,
"properties": {
"psbt": {
"type": "string",
"description": [
"Unsigned PSBT which fulfills the parameters given."
]
},
"estimated_added_weight": {
"type": "u32",
"description": [
"The estimated weight of the added output."
]
},
"outnum": {
"type": "u32",
"description": [
"The 0-based number where the output was placed."
]
}
}
},
"author": [
"Dusty <<@dusty_daemon>> is mainly responsible."
],
"see_also": [
"lightning-fundpsbt(7)",
"lightning-utxopsbt(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"description": [
"Here is a command to make a PSBT with a 1,000,000 sat output that leads to the on-chain wallet:"
],
"request": {
"id": "example:addpsbtoutput#1",
"method": "addpsbtoutput",
"params": {
"satoshi": 1000000,
"locktime": 111
}
},
"response": {
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAA==",
"estimated_added_weight": 172,
"outnum": 0
}
},
{
"request": {
"id": "example:addpsbtoutput#2",
"method": "addpsbtoutput",
"params": [
3333333,
"cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA="
]
},
"response": {
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA=",
"estimated_added_weight": 172,
"outnum": 1
}
},
{
"request": {
"id": "example:addpsbtoutput#3",
"method": "addpsbtoutput",
"params": {
"satoshi": 3333333,
"initialpsbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA=",
"destination": "bcrt1p52spc7t99z0wu444elxahxzkcu86gakzvnfp7ugudf567am2uspsuneuq9"
}
},
"response": {
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEDAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQABAwjV3DIAAAAAAAEEIlEgoqAceWUonu5Wtc/N25hWxw+kdsJk0h9xHGppr3dq5AMA",
"estimated_added_weight": 172,
"outnum": 2
}
}
]
}