core-lightning/doc/schemas/lightning-upgradewallet.json
2024-08-09 23:56:45 -07:00

110 lines
3.6 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"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": [],
"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"
],
"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
}
}
]
}