mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-22 22:48:57 +02:00
doc: Document optional result fields in validateaddress
Can be reviewed with --ignore-all-space --word-diff-regex=.
This commit is contained in:
parent
faee2656a8
commit
fab6c43b40
@ -36,32 +36,33 @@
|
||||
|
||||
static RPCHelpMan validateaddress()
|
||||
{
|
||||
return RPCHelpMan{"validateaddress",
|
||||
"\nReturn information about the given bitcoin address.\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to validate"},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
return RPCHelpMan{
|
||||
"validateaddress",
|
||||
"\nReturn information about the given bitcoin address.\n",
|
||||
{
|
||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to validate"},
|
||||
},
|
||||
RPCResult{
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
{
|
||||
{RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"},
|
||||
{RPCResult::Type::STR, "address", /* optional */ true, "The bitcoin address validated"},
|
||||
{RPCResult::Type::STR_HEX, "scriptPubKey", /* optional */ true, "The hex-encoded scriptPubKey generated by the address"},
|
||||
{RPCResult::Type::BOOL, "isscript", /* optional */ true, "If the key is a script"},
|
||||
{RPCResult::Type::BOOL, "iswitness", /* optional */ true, "If the address is a witness address"},
|
||||
{RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program"},
|
||||
{RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program"},
|
||||
{RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"},
|
||||
{RPCResult::Type::ARR, "error_locations", /*optional=*/true, "Indices of likely error locations in address, if known (e.g. Bech32 errors)",
|
||||
{
|
||||
{RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"},
|
||||
{RPCResult::Type::STR, "address", /* optional */ true, "The bitcoin address validated"},
|
||||
{RPCResult::Type::STR_HEX, "scriptPubKey", /* optional */ true, "The hex-encoded scriptPubKey generated by the address"},
|
||||
{RPCResult::Type::BOOL, "isscript", /* optional */ true, "If the key is a script"},
|
||||
{RPCResult::Type::BOOL, "iswitness", /* optional */ true, "If the address is a witness address"},
|
||||
{RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program"},
|
||||
{RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program"},
|
||||
{RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"},
|
||||
{RPCResult::Type::ARR, "error_locations", "Indices of likely error locations in address, if known (e.g. Bech32 errors)",
|
||||
{
|
||||
{RPCResult::Type::NUM, "index", "index of a potential error"},
|
||||
}},
|
||||
}
|
||||
},
|
||||
RPCExamples{
|
||||
HelpExampleCli("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") +
|
||||
HelpExampleRpc("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"")
|
||||
},
|
||||
{RPCResult::Type::NUM, "index", "index of a potential error"},
|
||||
}},
|
||||
}
|
||||
},
|
||||
RPCExamples{
|
||||
HelpExampleCli("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") +
|
||||
HelpExampleRpc("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"")
|
||||
},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
std::string error_msg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user