Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
"1. \"address\" (string, required) The bitcoin " | "1. \"address\" (string, required) The bitcoin " | ||||
"address to validate\n" | "address to validate\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"isvalid\" : true|false, (boolean) If the address is " | " \"isvalid\" : true|false, (boolean) If the address is " | ||||
"valid or not. If not, this is the only property returned.\n" | "valid or not. If not, this is the only property returned.\n" | ||||
" \"address\" : \"address\", (string) The bitcoin address " | " \"address\" : \"address\", (string) The bitcoin address " | ||||
"validated\n" | "validated\n" | ||||
" \"scriptPubKey\" : \"hex\", (string) The hex encoded " | " \"scriptPubKey\" : \"hex\", (string) The hex-encoded " | ||||
"scriptPubKey generated by the address\n" | "scriptPubKey generated by the address\n" | ||||
" \"isscript\" : true|false, (boolean) If the key is a " | " \"isscript\" : true|false, (boolean) If the key is a " | ||||
"script\n" | "script\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("validateaddress", | HelpExampleCli("validateaddress", | ||||
"\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + | "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + | ||||
HelpExampleRpc("validateaddress", | HelpExampleRpc("validateaddress", | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
"\nCreate a multisig address from 2 public keys\n" + | "\nCreate a multisig address from 2 public keys\n" + | ||||
HelpExampleCli("createmultisig", | HelpExampleCli("createmultisig", | ||||
"2 " | "2 " | ||||
"\"[" | "\"[" | ||||
"\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd3" | "\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd3" | ||||
"42cf11ae157a7ace5fd\\\"," | "42cf11ae157a7ace5fd\\\"," | ||||
"\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e1" | "\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e1" | ||||
"7e107ef3f6aa5a61626\\\"]\"") + | "7e107ef3f6aa5a61626\\\"]\"") + | ||||
"\nAs a json rpc call\n" + | "\nAs a JSON-RPC call\n" + | ||||
HelpExampleRpc("createmultisig", | HelpExampleRpc("createmultisig", | ||||
"2, " | "2, " | ||||
"\"[" | "\"[" | ||||
"\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd3" | "\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd3" | ||||
"42cf11ae157a7ace5fd\\\"," | "42cf11ae157a7ace5fd\\\"," | ||||
"\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e1" | "\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e1" | ||||
"7e107ef3f6aa5a61626\\\"]\""); | "7e107ef3f6aa5a61626\\\"]\""); | ||||
throw std::runtime_error(msg); | throw std::runtime_error(msg); | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 3) { | ||||
"\nCreate the signature\n" + | "\nCreate the signature\n" + | ||||
HelpExampleCli( | HelpExampleCli( | ||||
"signmessage", | "signmessage", | ||||
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"") + | "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"") + | ||||
"\nVerify the signature\n" + | "\nVerify the signature\n" + | ||||
HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | ||||
"XX\" \"signature\" \"my " | "XX\" \"signature\" \"my " | ||||
"message\"") + | "message\"") + | ||||
"\nAs json rpc\n" + | "\nAs a JSON-RPC call\n" + | ||||
HelpExampleRpc("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | HelpExampleRpc("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | ||||
"XX\", \"signature\", \"my " | "XX\", \"signature\", \"my " | ||||
"message\"")); | "message\"")); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
std::string strAddress = request.params[0].get_str(); | std::string strAddress = request.params[0].get_str(); | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 2) { | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nCreate the signature\n" + | "\nCreate the signature\n" + | ||||
HelpExampleCli("signmessagewithprivkey", | HelpExampleCli("signmessagewithprivkey", | ||||
"\"privkey\" \"my message\"") + | "\"privkey\" \"my message\"") + | ||||
"\nVerify the signature\n" + | "\nVerify the signature\n" + | ||||
HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | ||||
"XX\" \"signature\" \"my " | "XX\" \"signature\" \"my " | ||||
"message\"") + | "message\"") + | ||||
"\nAs json rpc\n" + | "\nAs a JSON-RPC call\n" + | ||||
HelpExampleRpc("signmessagewithprivkey", | HelpExampleRpc("signmessagewithprivkey", | ||||
"\"privkey\", \"my message\"")); | "\"privkey\", \"my message\"")); | ||||
} | } | ||||
std::string strPrivkey = request.params[0].get_str(); | std::string strPrivkey = request.params[0].get_str(); | ||||
std::string strMessage = request.params[1].get_str(); | std::string strMessage = request.params[1].get_str(); | ||||
CKey key = DecodeSecret(strPrivkey); | CKey key = DecodeSecret(strPrivkey); | ||||
▲ Show 20 Lines • Show All 292 Lines • Show Last 20 Lines |