@@ -1100,30 +1100,29 @@ static RPCHelpMan gettxoutsetinfo()
1100
1100
static RPCHelpMan gettxout ()
1101
1101
{
1102
1102
return RPCHelpMan{" gettxout" ,
1103
- " \n Returns details about an unspent transaction output.\n " ,
1104
- {
1105
- {" txid" , RPCArg::Type::STR, RPCArg::Optional::NO, " The transaction id" },
1106
- {" n" , RPCArg::Type::NUM, RPCArg::Optional::NO, " vout number" },
1107
- {" include_mempool" , RPCArg::Type::BOOL, /* default */ " true" , " Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear." },
1108
- },
1109
- RPCResult{
1110
- RPCResult::Type::OBJ, " " , " " ,
1111
- {
1112
- {RPCResult::Type::STR_HEX, " bestblock" , " The hash of the block at the tip of the chain" },
1113
- {RPCResult::Type::NUM, " confirmations" , " The number of confirmations" },
1114
- {RPCResult::Type::STR_AMOUNT, " value" , " The transaction value in " + CURRENCY_UNIT},
1115
- {RPCResult::Type::OBJ, " scriptPubKey" , " " ,
1116
- {
1117
- {RPCResult::Type::STR_HEX, " asm" , " " },
1118
- {RPCResult::Type::STR_HEX, " hex" , " " },
1119
- {RPCResult::Type::NUM, " reqSigs" , " Number of required signatures" },
1120
- {RPCResult::Type::STR_HEX, " type" , " The type, eg pubkeyhash" },
1121
- {RPCResult::Type::ARR, " addresses" , " array of bitcoin addresses" ,
1122
- {{RPCResult::Type::STR, " address" , " bitcoin address" }}},
1123
- }},
1124
- {RPCResult::Type::BOOL, " coinbase" , " Coinbase or not" },
1125
- }},
1126
- RPCExamples{
1103
+ " \n Returns details about an unspent transaction output.\n " ,
1104
+ {
1105
+ {" txid" , RPCArg::Type::STR, RPCArg::Optional::NO, " The transaction id" },
1106
+ {" n" , RPCArg::Type::NUM, RPCArg::Optional::NO, " vout number" },
1107
+ {" include_mempool" , RPCArg::Type::BOOL, /* default */ " true" , " Whether to include the mempool. Note that an unspent output that is spent in the mempool won't appear." },
1108
+ },
1109
+ {
1110
+ RPCResult{" If the UTXO was not found" , RPCResult::Type::NONE, " " , " " },
1111
+ RPCResult{" Otherwise" , RPCResult::Type::OBJ, " " , " " , {
1112
+ {RPCResult::Type::STR_HEX, " bestblock" , " The hash of the block at the tip of the chain" },
1113
+ {RPCResult::Type::NUM, " confirmations" , " The number of confirmations" },
1114
+ {RPCResult::Type::STR_AMOUNT, " value" , " The transaction value in " + CURRENCY_UNIT},
1115
+ {RPCResult::Type::OBJ, " scriptPubKey" , " " , {
1116
+ {RPCResult::Type::STR_HEX, " asm" , " " },
1117
+ {RPCResult::Type::STR_HEX, " hex" , " " },
1118
+ {RPCResult::Type::NUM, " reqSigs" , " Number of required signatures" },
1119
+ {RPCResult::Type::STR_HEX, " type" , " The type, eg pubkeyhash" },
1120
+ {RPCResult::Type::ARR, " addresses" , " array of bitcoin addresses" , {{RPCResult::Type::STR, " address" , " bitcoin address" }}},
1121
+ }},
1122
+ {RPCResult::Type::BOOL, " coinbase" , " Coinbase or not" },
1123
+ }},
1124
+ },
1125
+ RPCExamples{
1127
1126
" \n Get unspent transactions\n "
1128
1127
+ HelpExampleCli (" listunspent" , " " ) +
1129
1128
" \n View the details\n "
@@ -2137,59 +2136,64 @@ class CoinsViewScanReserver
2137
2136
static RPCHelpMan scantxoutset ()
2138
2137
{
2139
2138
return RPCHelpMan{" scantxoutset" ,
2140
- " \n EXPERIMENTAL warning: this call may be removed or changed in future releases.\n "
2141
- " \n Scans the unspent transaction output set for entries that match certain output descriptors.\n "
2142
- " Examples of output descriptors are:\n "
2143
- " addr(<address>) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)\n "
2144
- " raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts\n "
2145
- " combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey\n "
2146
- " pkh(<pubkey>) P2PKH outputs for the given pubkey\n "
2147
- " sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys\n "
2148
- " \n In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one\n "
2149
- " or more path elements separated by \" /\" , and optionally ending in \" /*\" (unhardened), or \" /*'\" or \" /*h\" (hardened) to specify all\n "
2150
- " unhardened or hardened child keys.\n "
2151
- " In the latter case, a range needs to be specified by below if different from 1000.\n "
2152
- " For more information on output descriptors, see the documentation in the doc/descriptors.md file.\n " ,
2139
+ " \n EXPERIMENTAL warning: this call may be removed or changed in future releases.\n "
2140
+ " \n Scans the unspent transaction output set for entries that match certain output descriptors.\n "
2141
+ " Examples of output descriptors are:\n "
2142
+ " addr(<address>) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)\n "
2143
+ " raw(<hex script>) Outputs whose scriptPubKey equals the specified hex scripts\n "
2144
+ " combo(<pubkey>) P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey\n "
2145
+ " pkh(<pubkey>) P2PKH outputs for the given pubkey\n "
2146
+ " sh(multi(<n>,<pubkey>,<pubkey>,...)) P2SH-multisig outputs for the given threshold and pubkeys\n "
2147
+ " \n In the above, <pubkey> either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one\n "
2148
+ " or more path elements separated by \" /\" , and optionally ending in \" /*\" (unhardened), or \" /*'\" or \" /*h\" (hardened) to specify all\n "
2149
+ " unhardened or hardened child keys.\n "
2150
+ " In the latter case, a range needs to be specified by below if different from 1000.\n "
2151
+ " For more information on output descriptors, see the documentation in the doc/descriptors.md file.\n " ,
2152
+ {
2153
+ {" action" , RPCArg::Type::STR, RPCArg::Optional::NO, " The action to execute\n "
2154
+ " \" start\" for starting a scan\n "
2155
+ " \" abort\" for aborting the current scan (returns true when abort was successful)\n "
2156
+ " \" status\" for progress report (in %) of the current scan" },
2157
+ {" scanobjects" , RPCArg::Type::ARR, RPCArg::Optional::OMITTED, " Array of scan objects. Required for \" start\" action\n "
2158
+ " Every scan object is either a string descriptor or an object:" ,
2159
+ {
2160
+ {" descriptor" , RPCArg::Type::STR, RPCArg::Optional::OMITTED, " An output descriptor" },
2161
+ {" " , RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, " An object with output descriptor and metadata" ,
2153
2162
{
2154
- {" action" , RPCArg::Type::STR, RPCArg::Optional::NO, " The action to execute\n "
2155
- " \" start\" for starting a scan\n "
2156
- " \" abort\" for aborting the current scan (returns true when abort was successful)\n "
2157
- " \" status\" for progress report (in %) of the current scan" },
2158
- {" scanobjects" , RPCArg::Type::ARR, RPCArg::Optional::OMITTED, " Array of scan objects. Required for \" start\" action\n "
2159
- " Every scan object is either a string descriptor or an object:" ,
2160
- {
2161
- {" descriptor" , RPCArg::Type::STR, RPCArg::Optional::OMITTED, " An output descriptor" },
2162
- {" " , RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, " An object with output descriptor and metadata" ,
2163
- {
2164
- {" desc" , RPCArg::Type::STR, RPCArg::Optional::NO, " An output descriptor" },
2165
- {" range" , RPCArg::Type::RANGE, /* default */ " 1000" , " The range of HD chain indexes to explore (either end or [begin,end])" },
2166
- },
2167
- },
2168
- },
2163
+ {" desc" , RPCArg::Type::STR, RPCArg::Optional::NO, " An output descriptor" },
2164
+ {" range" , RPCArg::Type::RANGE, /* default */ " 1000" , " The range of HD chain indexes to explore (either end or [begin,end])" },
2165
+ }},
2166
+ },
2169
2167
" [scanobjects,...]" },
2170
- },
2171
- RPCResult{
2172
- RPCResult::Type::OBJ, " " , " " ,
2168
+ },
2169
+ {
2170
+ RPCResult{" When action=='abort'" , RPCResult::Type::BOOL, " " , " " },
2171
+ RPCResult{" When action=='status' and no scan is in progress" , RPCResult::Type::NONE, " " , " " },
2172
+ RPCResult{" When action=='status' and scan is in progress" , RPCResult::Type::OBJ, " " , " " ,
2173
+ {
2174
+ {RPCResult::Type::NUM, " progress" , " The scan progress" },
2175
+ }},
2176
+ RPCResult{" When action=='start'" , RPCResult::Type::OBJ, " " , " " , {
2177
+ {RPCResult::Type::BOOL, " success" , " Whether the scan was completed" },
2178
+ {RPCResult::Type::NUM, " txouts" , " The number of unspent transaction outputs scanned" },
2179
+ {RPCResult::Type::NUM, " height" , " The current block height (index)" },
2180
+ {RPCResult::Type::STR_HEX, " bestblock" , " The hash of the block at the tip of the chain" },
2181
+ {RPCResult::Type::ARR, " unspents" , " " ,
2182
+ {
2183
+ {RPCResult::Type::OBJ, " " , " " ,
2173
2184
{
2174
- {RPCResult::Type::BOOL, " success" , " Whether the scan was completed" },
2175
- {RPCResult::Type::NUM, " txouts" , " The number of unspent transaction outputs scanned" },
2176
- {RPCResult::Type::NUM, " height" , " The current block height (index)" },
2177
- {RPCResult::Type::STR_HEX, " bestblock" , " The hash of the block at the tip of the chain" },
2178
- {RPCResult::Type::ARR, " unspents" , " " ,
2179
- {
2180
- {RPCResult::Type::OBJ, " " , " " ,
2181
- {
2182
- {RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
2183
- {RPCResult::Type::NUM, " vout" , " The vout value" },
2184
- {RPCResult::Type::STR_HEX, " scriptPubKey" , " The script key" },
2185
- {RPCResult::Type::STR, " desc" , " A specialized descriptor for the matched scriptPubKey" },
2186
- {RPCResult::Type::STR_AMOUNT, " amount" , " The total amount in " + CURRENCY_UNIT + " of the unspent output" },
2187
- {RPCResult::Type::NUM, " height" , " Height of the unspent transaction output" },
2188
- }},
2189
- }},
2190
- {RPCResult::Type::STR_AMOUNT, " total_amount" , " The total amount of all found unspent outputs in " + CURRENCY_UNIT},
2185
+ {RPCResult::Type::STR_HEX, " txid" , " The transaction id" },
2186
+ {RPCResult::Type::NUM, " vout" , " The vout value" },
2187
+ {RPCResult::Type::STR_HEX, " scriptPubKey" , " The script key" },
2188
+ {RPCResult::Type::STR, " desc" , " A specialized descriptor for the matched scriptPubKey" },
2189
+ {RPCResult::Type::STR_AMOUNT, " amount" , " The total amount in " + CURRENCY_UNIT + " of the unspent output" },
2190
+ {RPCResult::Type::NUM, " height" , " Height of the unspent transaction output" },
2191
2191
}},
2192
- RPCExamples{" " },
2192
+ }},
2193
+ {RPCResult::Type::STR_AMOUNT, " total_amount" , " The total amount of all found unspent outputs in " + CURRENCY_UNIT},
2194
+ }},
2195
+ },
2196
+ RPCExamples{" " },
2193
2197
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
2194
2198
{
2195
2199
RPCTypeCheck (request.params , {UniValue::VSTR, UniValue::VARR});
0 commit comments