mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
b327bd30c3
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>
89 lines
2.5 KiB
JSON
89 lines
2.5 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"rpc": "setpsbtversion",
|
|
"title": "Command for setting PSBT version",
|
|
"description": [
|
|
"The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid."
|
|
],
|
|
"request": {
|
|
"required": [
|
|
"psbt",
|
|
"version"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"psbt": {
|
|
"type": "string",
|
|
"description": [
|
|
"The PSBT to change versions."
|
|
]
|
|
},
|
|
"version": {
|
|
"type": "u32",
|
|
"description": [
|
|
"The version to set."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [
|
|
"psbt"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"psbt": {
|
|
"type": "string",
|
|
"description": [
|
|
"A converted PSBT of the requested version."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"errors": [
|
|
"The following error codes may occur:",
|
|
"",
|
|
"- -32602: Parameter missed or malformed."
|
|
],
|
|
"author": [
|
|
"Gregory Sanders <<gsanders87@gmail.com>> is mainly responsible."
|
|
],
|
|
"see_also": [
|
|
"lightning-fundpsbt(7)",
|
|
"lightning-utxopsbt(7)",
|
|
"lightning-signpsbt(7)"
|
|
],
|
|
"resources": [
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:setpsbtversion#1",
|
|
"method": "setpsbtversion",
|
|
"params": {
|
|
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAA==",
|
|
"version": 0
|
|
}
|
|
},
|
|
"response": {
|
|
"psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbbwAAAAAA"
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:setpsbtversion#2",
|
|
"method": "setpsbtversion",
|
|
"params": [
|
|
"cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEDAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQABAwjV3DIAAAAAAAEEIlEgoqAceWUonu5Wtc/N25hWxw+kdsJk0h9xHGppr3dq5AMA",
|
|
2
|
|
]
|
|
},
|
|
"response": {
|
|
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEDAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQABAwjV3DIAAAAAAAEEIlEgoqAceWUonu5Wtc/N25hWxw+kdsJk0h9xHGppr3dq5AMA"
|
|
}
|
|
}
|
|
]
|
|
}
|