Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 820 Lines • ▼ Show 20 Lines | UniValue dumpprivkey(const Config &config, const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"dumpprivkey", | "dumpprivkey", | ||||
"Reveals the private key corresponding to 'address'.\n" | "Reveals the private key corresponding to 'address'.\n" | ||||
"Then the importprivkey can be used with this output\n", | "Then the importprivkey can be used with this output\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The bitcoin address for the private key"}, | "The bitcoin address for the private key"}, | ||||
}, | }, | ||||
RPCResult{"\"key\" (string) The private key\n"}, | RPCResult{RPCResult::Type::STR, "key", "The private key"}, | ||||
RPCExamples{HelpExampleCli("dumpprivkey", "\"myaddress\"") + | RPCExamples{HelpExampleCli("dumpprivkey", "\"myaddress\"") + | ||||
HelpExampleCli("importprivkey", "\"mykey\"") + | HelpExampleCli("importprivkey", "\"mykey\"") + | ||||
HelpExampleRpc("dumpprivkey", "\"myaddress\"")}, | HelpExampleRpc("dumpprivkey", "\"myaddress\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
LegacyScriptPubKeyMan &spk_man = EnsureLegacyScriptPubKeyMan(*wallet); | LegacyScriptPubKeyMan &spk_man = EnsureLegacyScriptPubKeyMan(*wallet); | ||||
Show All 36 Lines | RPCHelpMan{ | ||||
"your HD seed (e.g. imported keys), these are not covered by\n" | "your HD seed (e.g. imported keys), these are not covered by\n" | ||||
"only backing up the seed itself, and must be backed up too (e.g. " | "only backing up the seed itself, and must be backed up too (e.g. " | ||||
"ensure you back up the whole dumpfile).\n", | "ensure you back up the whole dumpfile).\n", | ||||
{ | { | ||||
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, | {"filename", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The filename with path (either absolute or relative to " | "The filename with path (either absolute or relative to " | ||||
"bitcoind)"}, | "bitcoind)"}, | ||||
}, | }, | ||||
RPCResult{"{ (json object)\n" | RPCResult{RPCResult::Type::OBJ, | ||||
" \"filename\" : { (string) The filename with full " | "", | ||||
"absolute path\n" | "", | ||||
"}\n"}, | { | ||||
{RPCResult::Type::STR, "filename", | |||||
"The filename with full absolute path"}, | |||||
}}, | |||||
RPCExamples{HelpExampleCli("dumpwallet", "\"test\"") + | RPCExamples{HelpExampleCli("dumpwallet", "\"test\"") + | ||||
HelpExampleRpc("dumpwallet", "\"test\"")}, | HelpExampleRpc("dumpwallet", "\"test\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
CWallet &wallet = *pwallet; | CWallet &wallet = *pwallet; | ||||
LegacyScriptPubKeyMan &spk_man = EnsureLegacyScriptPubKeyMan(wallet); | LegacyScriptPubKeyMan &spk_man = EnsureLegacyScriptPubKeyMan(wallet); | ||||
▲ Show 20 Lines • Show All 759 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
RPCArg::Optional::OMITTED_NAMED_ARG, | RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
"", | "", | ||||
{ | { | ||||
{"rescan", RPCArg::Type::BOOL, /* default */ "true", | {"rescan", RPCArg::Type::BOOL, /* default */ "true", | ||||
"Stating if should rescan the blockchain after all imports"}, | "Stating if should rescan the blockchain after all imports"}, | ||||
}, | }, | ||||
"\"options\""}, | "\"options\""}, | ||||
}, | }, | ||||
RPCResult{"\nResponse is an array with the same size as the input " | RPCResult{RPCResult::Type::ARR, | ||||
"that has the execution result :\n" | "", | ||||
" [{\"success\": true}, {\"success\": true, " | "Response is an array with the same size as the input that " | ||||
"\"warnings\": [\"Ignoring irrelevant private key\"]}, " | "has the execution result", | ||||
"{\"success\": false, \"error\": {\"code\": -1, " | { | ||||
"\"message\": \"Internal Server Error\"}}, ...]\n"}, | {RPCResult::Type::OBJ, | ||||
"", | |||||
"", | |||||
{ | |||||
{RPCResult::Type::BOOL, "success", ""}, | |||||
{RPCResult::Type::ARR, | |||||
"warnings", | |||||
/* optional */ true, | |||||
"", | |||||
{ | |||||
{RPCResult::Type::STR, "", ""}, | |||||
}}, | |||||
{RPCResult::Type::OBJ, | |||||
"error", | |||||
/* optional */ true, | |||||
"", | |||||
{ | |||||
{RPCResult::Type::ELISION, "", "JSONRPC error"}, | |||||
}}, | |||||
}}, | |||||
}}, | |||||
RPCExamples{ | RPCExamples{ | ||||
HelpExampleCli( | HelpExampleCli( | ||||
"importmulti", | "importmulti", | ||||
"'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, " | "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, " | ||||
"\"timestamp\":1455191478 }, " | "\"timestamp\":1455191478 }, " | ||||
"{ \"scriptPubKey\": { \"address\": \"<my 2nd address>\" " | "{ \"scriptPubKey\": { \"address\": \"<my 2nd address>\" " | ||||
"}, " | "}, " | ||||
"\"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + | "\"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |