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

110 lines
3.6 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "upgradewallet",
"title": "Command to spend all P2SH-wrapped inputs into a Native Segwit output",
"description": [
"`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address."
],
"request": {
"required": [],
"additionalProperties": false,
"properties": {
"feerate": {
"type": "feerate",
"description": [
"Feerate for the upgrade transaction."
],
"added": "v23.02",
"default": "*opening*"
},
"reservedok": {
"type": "boolean",
"description": [
"Tells the wallet to include all P2SH-wrapped inputs, including reserved ones."
],
"added": "v23.02"
}
}
},
"response": {
"required": [
"upgraded_outs"
],
"additionalProperties": false,
"properties": {
"upgraded_outs": {
"type": "u64",
"description": [
"Count of spent/upgraded UTXOs."
],
"added": "v23.02"
},
"psbt": {
"type": "string",
"description": [
"The PSBT that was finalized and sent."
],
"added": "v23.02"
},
"tx": {
"type": "hex",
"description": [
"The raw transaction which was sent."
],
"added": "v23.02"
},
"txid": {
"type": "txid",
"description": [
"The txid of the **tx**."
],
"added": "v23.02"
}
}
},
"usage": [
"The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.",
"",
"The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys."
],
"author": [
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
],
"see_also": [
"lightning-utxopsbt(7)",
"lightning-reserveinputs(7)",
"lightning-unreserveinputs(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:upgradewallet#1",
"method": "upgradewallet",
"params": {}
},
"response": {
"upgraded_outs": 0
}
},
{
"request": {
"id": "example:upgradewallet#2",
"method": "upgradewallet",
"params": {
"feerate": "urgent",
"reservedok": true
}
},
"response": {
"tx": "0200000001e3148821838724c371613dfe954620b99b689803f29b17e33b85f655afc812170000000000fdffffff0135143101000000002251206c27e1956acfa61e68292c80908880e813450f754132e8a2ac471a86bf1326b566000000",
"txid": "52b8957df7b017c4c187641491b80ca209c52b286eba60afac7292a868fdf9d0",
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQBzAgAAAAEJawGuY9Yx4yHwOdSd9MWwVc46+mVaPVwiwqhZT0H1zQAAAAAA/f///wIALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAh3HE1CgBAAAAF6kUfN+wjm5E/BFSxPQjIl0rcUgkip2HZQAAAAEBIAAtMQEAAAAAF6kUZVco82z+NtAapQ0yNnBEafhKVUCHIgICucDGhE4SpTHJaOVcVQeOwW2b92vpKQ/YfRzKcrSDmhdHMEQCIBsJrbJqp2dLLklUvvheXUy1uu4eIMkebSbbYkQHWItOAiBEuulzciFVMVB7Rkt5eOb53CX5hq7Vq2LbwBHB6ApUTwEBBBYAFNa5adNt/9rZhpGT9mPuSA39xzSIIgYCucDGhE4SpTHJaOVcVQeOwW2b92vpKQ/YfRzKcrSDmhcI1rlp0wAAAAABDiDjFIghg4ckw3FhPf6VRiC5m2iYA/KbF+M7hfZVr8gSFwEPBAAAAAABEAT9////AAEDCDUUMQEAAAAAAQQiUSBsJ+GVas+mHmgpLICQiIDoE0UPdUEy6KKsRxqGvxMmtSEHWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAJAH0I2ZcFAAAAAA==",
"upgraded_outs": 1
}
}
]
}