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

124 lines
6.1 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "openchannel_signed",
"title": "Command to conclude a channel open",
"description": [
"`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.",
"",
"This command should be called after `openchannel_update` returns *commitments_secured* `true`.",
"",
"This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer."
],
"request": {
"required": [
"channel_id",
"signed_psbt"
],
"additionalProperties": false,
"properties": {
"channel_id": {
"type": "hash",
"description": [
"Id of the channel."
]
},
"signed_psbt": {
"type": "string",
"description": [
"The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT."
]
}
}
},
"response": {
"required": [
"channel_id",
"tx",
"txid"
],
"additionalProperties": false,
"properties": {
"channel_id": {
"type": "hash",
"description": [
"The channel id of the channel."
]
},
"tx": {
"type": "hex",
"description": [
"The funding transaction."
]
},
"txid": {
"type": "txid",
"description": [
"The txid of the **tx**."
]
}
}
},
"errors": [
"On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:",
"",
"- -32602: If the given parameters are wrong.",
"- -1: Catchall nonspecific error.",
"- 303: Funding transaction broadcast failed.",
"- 305: Peer is not connected.",
"- 309: PSBT missing required fields.",
"- 311: Unknown channel id.",
"- 312: Channel in an invalid state"
],
"author": [
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
],
"see_also": [
"lightning-openchannel_init(7)",
"lightning-openchannel_update(7)",
"lightning-openchannel_abort(7)",
"lightning-openchannel_bump(7)",
"lightning-fundchannel_start(7)",
"lightning-fundchannel_complete(7)",
"lightning-fundchannel(7)",
"lightning-fundpsbt(7)",
"lightning-utxopsbt(7)",
"lightning-multifundchannel(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:openchannel_signed#1",
"method": "openchannel_signed",
"params": {
"channel_id": "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
"signed_psbt": "cHNidP8BAgQCAAAAAQMEmAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQBxAgAAAAGXS8Ixc7e8qbBg2sEqvRuxWOjtaaPnTU9q9ZGbFfV3LAAAAAAA/f///wJ6H/TSAAAAABYAFJq4HdQFbYJVeXL2XWxTpoyZUCr4AMLrCwAAAAAWABQDz+yHFeH0BKNuwBHkI4+GMp+QnJcAAAABAR8AwusLAAAAABYAFAPP7IcV4fQEo27AEeQjj4Yyn5CcIgICRz15z0oQ57qDTAJqrEPqGLCn+3Xs2lGEv6+oxGYV9rdHMEQCIHlCL2oKhnYn6hhaUG8+V+8D6GHFlI61OM507VB6aBwoAiACA2d5TnCdlJ1j2rF/EIHkxl3W0hBp3QqweO7hEul9aQEiBgJHPXnPShDnuoNMAmqsQ+oYsKf7dezaUYS/r6jEZhX2twgDz+yHAAAAAAEOILMFPNMIQ2TqCB0v5X8scJh4eVEhwcG3I1h2iff11Pu/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCEArDQdItNjSAAEDCEFZ3AsAAAAAAQQiUSA74Tflo81LdhBFqIwHKNMkNRg28E7Vnf2jebjYRkZStyEHE0cioCqqq2UZ2npxQi9Q6DXNZheODM6F4GjHHS3XScEJAG/ctUwEAAAADPwJbGlnaHRuaW5nAQgwkgFDAVpmeAABAwhAQg8AAAAAAAEEIgAgybxcBjyu+/emx4FEB7Vie0+BqLVuy+kyxoL5y6wNGd8M/AlsaWdodG5pbmcBCI9GsPn+O/M0AA=="
}
},
"response": {
"tx": "02000000000101b3053cd3084364ea081d2fe57f2c709878795121c1c1b723587689f7f5d4fbbf0100000000fdffffff024159dc0b000000002251203be137e5a3cd4b761045a88c0728d324351836f04ed59dfda379b8d8464652b740420f0000000000220020c9bc5c063caefbf7a6c7814407b5627b4f81a8b56ecbe932c682f9cbac0d19df02473044022079422f6a0a867627ea185a506f3e57ef03e861c5948eb538ce74ed507a681c280220020367794e709d949d63dab17f1081e4c65dd6d21069dd0ab078eee112e97d69012102473d79cf4a10e7ba834c026aac43ea18b0a7fb75ecda5184bfafa8c46615f6b798000000",
"txid": "ed994900569f2fddca6d86675f2e2247000197ee69aa53348e63e16fbaf39409",
"channel_id": "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5"
}
},
{
"request": {
"id": "example:openchannel_signed#2",
"method": "openchannel_signed",
"params": [
"b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
"cHNidP8BAgQCAAAAAQMEmAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQBxAgAAAAGXS8Ixc7e8qbBg2sEqvRuxWOjtaaPnTU9q9ZGbFfV3LAAAAAAA/f///wJ6H/TSAAAAABYAFJq4HdQFbYJVeXL2XWxTpoyZUCr4AMLrCwAAAAAWABQDz+yHFeH0BKNuwBHkI4+GMp+QnJcAAAABAR8AwusLAAAAABYAFAPP7IcV4fQEo27AEeQjj4Yyn5CcIgICRz15z0oQ57qDTAJqrEPqGLCn+3Xs2lGEv6+oxGYV9rdHMEQCIA8+zCzZ59t2OEFHWefZeTypY89RRQ8dMQCjtGWw6gskAiArELH1MvjW6j1G1CKnLZdV+/oabLDU48ingGSPFDOYxwEiBgJHPXnPShDnuoNMAmqsQ+oYsKf7dezaUYS/r6jEZhX2twgDz+yHAAAAAAEOILMFPNMIQ2TqCB0v5X8scJh4eVEhwcG3I1h2iff11Pu/AQ8EAQAAAAEQBP3///8M/AlsaWdodG5pbmcBCMEUdbrta/BqAAEDCICEHgAAAAAAAQQiACDJvFwGPK7796bHgUQHtWJ7T4GotW7L6TLGgvnLrA0Z3wz8CWxpZ2h0bmluZwEI3UQ/haFLESAAAQMIYg3NCwAAAAABBCJRIMkYPt6RIfPG/RSYgixHp2AnMidmnJCVCIQ7rFu9gT9oIQeffk+gJsmVIxDZ8UKPKgJB9CLvaUr9xqOEogpzJx1hbAkAEioNzwUAAAAM/AlsaWdodG5pbmcBCPN/JmOnjFW4AA=="
]
},
"response": {
"tx": "02000000000101b3053cd3084364ea081d2fe57f2c709878795121c1c1b723587689f7f5d4fbbf0100000000fdffffff0280841e0000000000220020c9bc5c063caefbf7a6c7814407b5627b4f81a8b56ecbe932c682f9cbac0d19df620dcd0b00000000225120c9183ede9121f3c6fd1498822c47a760273227669c909508843bac5bbd813f680247304402200f3ecc2cd9e7db7638414759e7d9793ca963cf51450f1d3100a3b465b0ea0b2402202b10b1f532f8d6ea3d46d422a72d9755fbfa1a6cb0d4e3c8a780648f143398c7012102473d79cf4a10e7ba834c026aac43ea18b0a7fb75ecda5184bfafa8c46615f6b798000000",
"txid": "7a4823c20358d585b69e17fff3964aa0e36a31afe0c357145c83b384f97f9098",
"channel_id": "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5"
}
}
]
}