mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
rpc: Properly document gettxout return value
Can be reviewed with --ignore-all-space
This commit is contained in:
parent
56f06a9863
commit
faa2059547
1 changed files with 23 additions and 24 deletions
|
@ -1100,30 +1100,29 @@ static RPCHelpMan gettxoutsetinfo()
|
|||
static RPCHelpMan gettxout()
|
||||
{
|
||||
return RPCHelpMan{"gettxout",
|
||||
"\nReturns details about an unspent transaction output.\n",
|
||||
{
|
||||
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
|
||||
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
|
||||
{"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."},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"},
|
||||
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
|
||||
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
|
||||
{RPCResult::Type::OBJ, "scriptPubKey", "",
|
||||
{
|
||||
{RPCResult::Type::STR_HEX, "asm", ""},
|
||||
{RPCResult::Type::STR_HEX, "hex", ""},
|
||||
{RPCResult::Type::NUM, "reqSigs", "Number of required signatures"},
|
||||
{RPCResult::Type::STR_HEX, "type", "The type, eg pubkeyhash"},
|
||||
{RPCResult::Type::ARR, "addresses", "array of bitcoin addresses",
|
||||
{{RPCResult::Type::STR, "address", "bitcoin address"}}},
|
||||
}},
|
||||
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
|
||||
}},
|
||||
RPCExamples{
|
||||
"\nReturns details about an unspent transaction output.\n",
|
||||
{
|
||||
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
|
||||
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
|
||||
{"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."},
|
||||
},
|
||||
{
|
||||
RPCResult{"If the UTXO was not found", RPCResult::Type::NONE, "", ""},
|
||||
RPCResult{"Otherwise", RPCResult::Type::OBJ, "", "", {
|
||||
{RPCResult::Type::STR_HEX, "bestblock", "The hash of the block at the tip of the chain"},
|
||||
{RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
|
||||
{RPCResult::Type::STR_AMOUNT, "value", "The transaction value in " + CURRENCY_UNIT},
|
||||
{RPCResult::Type::OBJ, "scriptPubKey", "", {
|
||||
{RPCResult::Type::STR_HEX, "asm", ""},
|
||||
{RPCResult::Type::STR_HEX, "hex", ""},
|
||||
{RPCResult::Type::NUM, "reqSigs", "Number of required signatures"},
|
||||
{RPCResult::Type::STR_HEX, "type", "The type, eg pubkeyhash"},
|
||||
{RPCResult::Type::ARR, "addresses", "array of bitcoin addresses", {{RPCResult::Type::STR, "address", "bitcoin address"}}},
|
||||
}},
|
||||
{RPCResult::Type::BOOL, "coinbase", "Coinbase or not"},
|
||||
}},
|
||||
},
|
||||
RPCExamples{
|
||||
"\nGet unspent transactions\n"
|
||||
+ HelpExampleCli("listunspent", "") +
|
||||
"\nView the details\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue