forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlightning-upgradewallet.json
110 lines (110 loc) · 3.54 KB
/
lightning-upgradewallet.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"$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 <<[email protected]>> 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": "02000000000101upgd20000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000",
"txid": "txidupgrade200000200000200000200000200000200000200000200000200000",
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000",
"upgraded_outs": 1
}
}
]
}