mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 21:42:32 +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()
|
static RPCHelpMan validateaddress()
|
||||||
{
|
{
|
||||||
return RPCHelpMan{"validateaddress",
|
return RPCHelpMan{
|
||||||
"\nReturn information about the given bitcoin address.\n",
|
"validateaddress",
|
||||||
{
|
"\nReturn information about the given bitcoin address.\n",
|
||||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to validate"},
|
{
|
||||||
},
|
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to validate"},
|
||||||
RPCResult{
|
},
|
||||||
RPCResult::Type::OBJ, "", "",
|
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::NUM, "index", "index of a potential error"},
|
||||||
{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"},
|
RPCExamples{
|
||||||
{RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program"},
|
HelpExampleCli("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") +
|
||||||
{RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program"},
|
HelpExampleRpc("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"")
|
||||||
{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] + "\"")
|
|
||||||
},
|
|
||||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||||
{
|
{
|
||||||
std::string error_msg;
|
std::string error_msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user