|
36 | 36 |
|
37 | 37 | static RPCHelpMan validateaddress()
|
38 | 38 | {
|
39 |
| - return RPCHelpMan{"validateaddress", |
40 |
| - "\nReturn information about the given bitcoin address.\n", |
41 |
| - { |
42 |
| - {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to validate"}, |
43 |
| - }, |
44 |
| - RPCResult{ |
45 |
| - RPCResult::Type::OBJ, "", "", |
| 39 | + return RPCHelpMan{ |
| 40 | + "validateaddress", |
| 41 | + "\nReturn information about the given bitcoin address.\n", |
| 42 | + { |
| 43 | + {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address to validate"}, |
| 44 | + }, |
| 45 | + RPCResult{ |
| 46 | + RPCResult::Type::OBJ, "", "", |
| 47 | + { |
| 48 | + {RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"}, |
| 49 | + {RPCResult::Type::STR, "address", /* optional */ true, "The bitcoin address validated"}, |
| 50 | + {RPCResult::Type::STR_HEX, "scriptPubKey", /* optional */ true, "The hex-encoded scriptPubKey generated by the address"}, |
| 51 | + {RPCResult::Type::BOOL, "isscript", /* optional */ true, "If the key is a script"}, |
| 52 | + {RPCResult::Type::BOOL, "iswitness", /* optional */ true, "If the address is a witness address"}, |
| 53 | + {RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program"}, |
| 54 | + {RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program"}, |
| 55 | + {RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"}, |
| 56 | + {RPCResult::Type::ARR, "error_locations", /*optional=*/true, "Indices of likely error locations in address, if known (e.g. Bech32 errors)", |
46 | 57 | {
|
47 |
| - {RPCResult::Type::BOOL, "isvalid", "If the address is valid or not"}, |
48 |
| - {RPCResult::Type::STR, "address", /* optional */ true, "The bitcoin address validated"}, |
49 |
| - {RPCResult::Type::STR_HEX, "scriptPubKey", /* optional */ true, "The hex-encoded scriptPubKey generated by the address"}, |
50 |
| - {RPCResult::Type::BOOL, "isscript", /* optional */ true, "If the key is a script"}, |
51 |
| - {RPCResult::Type::BOOL, "iswitness", /* optional */ true, "If the address is a witness address"}, |
52 |
| - {RPCResult::Type::NUM, "witness_version", /* optional */ true, "The version number of the witness program"}, |
53 |
| - {RPCResult::Type::STR_HEX, "witness_program", /* optional */ true, "The hex value of the witness program"}, |
54 |
| - {RPCResult::Type::STR, "error", /* optional */ true, "Error message, if any"}, |
55 |
| - {RPCResult::Type::ARR, "error_locations", "Indices of likely error locations in address, if known (e.g. Bech32 errors)", |
56 |
| - { |
57 |
| - {RPCResult::Type::NUM, "index", "index of a potential error"}, |
58 |
| - }}, |
59 |
| - } |
60 |
| - }, |
61 |
| - RPCExamples{ |
62 |
| - HelpExampleCli("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") + |
63 |
| - HelpExampleRpc("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") |
64 |
| - }, |
| 58 | + {RPCResult::Type::NUM, "index", "index of a potential error"}, |
| 59 | + }}, |
| 60 | + } |
| 61 | + }, |
| 62 | + RPCExamples{ |
| 63 | + HelpExampleCli("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") + |
| 64 | + HelpExampleRpc("validateaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") |
| 65 | + }, |
65 | 66 | [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
66 | 67 | {
|
67 | 68 | std::string error_msg;
|
|
0 commit comments