Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | UniValue importprivkey(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 3) { | request.params.size() > 3) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"importprivkey \"privkey\" ( \"label\" ) ( rescan )\n" | RPCHelpMan{"importprivkey", | ||||
"\nAdds a private key (as returned by dumpprivkey) to your wallet. " | "\nAdds a private key (as returned by dumpprivkey) to " | ||||
"Requires a new wallet backup.\n" | "your wallet. " | ||||
Fabien: Fix layout | |||||
"Requires a new wallet backup.\n", | |||||
{ | |||||
{"privkey", RPCArg::Type::STR, false}, | |||||
{"label", RPCArg::Type::STR, true}, | |||||
{"rescan", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"Hint: use importmulti to import more than one private key.\n" | "Hint: use importmulti to import more than one private key.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"privkey\" (string, required) The private key (see " | "1. \"privkey\" (string, required) The private key (see " | ||||
"dumpprivkey)\n" | "dumpprivkey)\n" | ||||
"2. \"label\" (string, optional, default=\"\") An " | "2. \"label\" (string, optional, default=\"\") An " | ||||
"optional label\n" | "optional label\n" | ||||
"3. rescan (boolean, optional, default=true) Rescan " | "3. rescan (boolean, optional, default=true) Rescan " | ||||
"the wallet for transactions\n" | "the wallet for transactions\n" | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
UniValue abortrescan(const Config &config, const JSONRPCRequest &request) { | UniValue abortrescan(const Config &config, const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 0) { | if (request.fHelp || request.params.size() > 0) { | ||||
throw std::runtime_error("abortrescan\n" | throw std::runtime_error( | ||||
RPCHelpMan{"abortrescan", | |||||
"\nStops current wallet rescan triggered by " | "\nStops current wallet rescan triggered by " | ||||
"an RPC call, e.g. by an importprivkey call.\n" | "an RPC call, e.g. by an importprivkey call.\n", | ||||
{}} | |||||
.ToString() + | |||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nImport a private key\n" + | "\nImport a private key\n" + | ||||
HelpExampleCli("importprivkey", "\"mykey\"") + | HelpExampleCli("importprivkey", "\"mykey\"") + | ||||
"\nAbort the running wallet rescan\n" + | "\nAbort the running wallet rescan\n" + | ||||
HelpExampleCli("abortrescan", "") + | HelpExampleCli("abortrescan", "") + "\nAs a JSON-RPC call\n" + | ||||
"\nAs a JSON-RPC call\n" + | |||||
HelpExampleRpc("abortrescan", "")); | HelpExampleRpc("abortrescan", "")); | ||||
} | } | ||||
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) { | if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) { | ||||
return false; | return false; | ||||
} | } | ||||
pwallet->AbortRescan(); | pwallet->AbortRescan(); | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | UniValue importaddress(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 4) { | request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"importaddress \"address\" ( \"label\" rescan p2sh )\n" | RPCHelpMan{"importaddress", | ||||
"\nAdds an address or script (in hex) that can be watched as if it " | "\nAdds an address or script (in hex) that can be " | ||||
"were in your wallet but cannot be used to spend. Requires a new " | "watched as if it " | ||||
FabienUnsubmitted Not Done Inline ActionsFix layout Fabien: Fix layout | |||||
"wallet backup.\n" | "were in your wallet but cannot be used to spend. " | ||||
"Requires a new " | |||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"wallet backup.\n", | |||||
{ | |||||
{"address", RPCArg::Type::STR, false}, | |||||
{"label", RPCArg::Type::STR, true}, | |||||
{"rescan", RPCArg::Type::BOOL, true}, | |||||
{"p2sh", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The Bitcoin address " | "1. \"address\" (string, required) The Bitcoin address " | ||||
"(or hex-encoded script)\n" | "(or hex-encoded script)\n" | ||||
"2. \"label\" (string, optional, default=\"\") An " | "2. \"label\" (string, optional, default=\"\") An " | ||||
"optional label\n" | "optional label\n" | ||||
"3. rescan (boolean, optional, default=true) Rescan " | "3. rescan (boolean, optional, default=true) Rescan " | ||||
"the wallet for transactions\n" | "the wallet for transactions\n" | ||||
"4. p2sh (boolean, optional, default=false) Add " | "4. p2sh (boolean, optional, default=false) Add " | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | UniValue importprunedfunds(const Config &config, | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 2) { | if (request.fHelp || request.params.size() != 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"importprunedfunds \"rawtransaction\" \"txoutproof\"\n" | RPCHelpMan{ | ||||
"\nImports funds without rescan. Corresponding address or script " | "importprunedfunds", | ||||
"\nImports funds without rescan. Corresponding address or " | |||||
"script " | |||||
FabienUnsubmitted Not Done Inline ActionsFix layout Fabien: Fix layout | |||||
"must previously be included in wallet. Aimed towards pruned " | "must previously be included in wallet. Aimed towards pruned " | ||||
"wallets. The end-user is responsible to import additional " | "wallets. The end-user is responsible to import additional " | ||||
"transactions that subsequently spend the imported outputs or " | "transactions that subsequently spend the imported outputs or " | ||||
"rescan after the point in the blockchain the transaction is " | "rescan after the point in the blockchain the transaction is " | ||||
"included.\n" | "included.\n", | ||||
{ | |||||
{"rawtransaction", RPCArg::Type::STR_HEX, false}, | |||||
{"txoutproof", RPCArg::Type::STR_HEX, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"rawtransaction\" (string, required) A raw transaction in hex " | "1. \"rawtransaction\" (string, required) A raw transaction in hex " | ||||
"funding an already-existing address in wallet\n" | "funding an already-existing address in wallet\n" | ||||
"2. \"txoutproof\" (string, required) The hex output from " | "2. \"txoutproof\" (string, required) The hex output from " | ||||
"gettxoutproof that contains the transaction\n"); | "gettxoutproof that contains the transaction\n"); | ||||
} | } | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | UniValue removeprunedfunds(const Config &config, | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"removeprunedfunds \"txid\"\n" | RPCHelpMan{"removeprunedfunds", | ||||
"\nDeletes the specified transaction from the wallet. Meant for " | "\nDeletes the specified transaction from the wallet. " | ||||
"use with pruned wallets and as a companion to importprunedfunds. " | "Meant for " | ||||
FabienUnsubmitted Not Done Inline ActionsDitp Fabien: Ditp | |||||
"This will affect wallet balances.\n" | "use with pruned wallets and as a companion to " | ||||
"importprunedfunds. " | |||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"This will affect wallet balances.\n", | |||||
{ | |||||
{"txid", RPCArg::Type::STR_HEX, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"txid\" (string, required) The hex-encoded id of " | "1. \"txid\" (string, required) The hex-encoded id of " | ||||
"the transaction you are deleting\n" | "the transaction you are deleting\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("removeprunedfunds", "\"a8d0c0184dde994a09ec054286f1" | HelpExampleCli("removeprunedfunds", "\"a8d0c0184dde994a09ec054286f1" | ||||
"ce581bebf46446a512166eae762873" | "ce581bebf46446a512166eae762873" | ||||
"4ea0a5\"") + | "4ea0a5\"") + | ||||
"\nAs a JSON-RPC call\n" + | "\nAs a JSON-RPC call\n" + | ||||
Show All 28 Lines | UniValue importpubkey(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 4) { | request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"importpubkey \"pubkey\" ( \"label\" rescan )\n" | RPCHelpMan{"importpubkey", | ||||
"\nAdds a public key (in hex) that can be watched as if it were in " | "\nAdds a public key (in hex) that can be watched as if " | ||||
"your wallet but cannot be used to spend. Requires a new wallet " | "it were in " | ||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"backup.\n" | "your wallet but cannot be used to spend. Requires a " | ||||
"new wallet " | |||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"backup.\n", | |||||
{ | |||||
{"pubkey", RPCArg::Type::STR, false}, | |||||
{"label", RPCArg::Type::STR, true}, | |||||
{"rescan", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"pubkey\" (string, required) The hex-encoded public " | "1. \"pubkey\" (string, required) The hex-encoded public " | ||||
"key\n" | "key\n" | ||||
"2. \"label\" (string, optional, default=\"\") An " | "2. \"label\" (string, optional, default=\"\") An " | ||||
"optional label\n" | "optional label\n" | ||||
"3. rescan (boolean, optional, default=true) Rescan " | "3. rescan (boolean, optional, default=true) Rescan " | ||||
"the wallet for transactions\n" | "the wallet for transactions\n" | ||||
"\nNote: This call can take minutes to complete if rescan is true, " | "\nNote: This call can take minutes to complete if rescan is true, " | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | UniValue importwallet(const Config &config, const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"importwallet \"filename\"\n" | RPCHelpMan{"importwallet", | ||||
"\nImports keys from a wallet dump file (see dumpwallet). Requires " | "\nImports keys from a wallet dump file (see " | ||||
"a new wallet backup to include imported keys.\n" | "dumpwallet). Requires " | ||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"a new wallet backup to include imported keys.\n", | |||||
{ | |||||
{"filename", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"filename\" (string, required) The wallet file\n" | "1. \"filename\" (string, required) The wallet file\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nDump the wallet\n" + | "\nDump the wallet\n" + | ||||
HelpExampleCli("dumpwallet", "\"test\"") + "\nImport the wallet\n" + | HelpExampleCli("dumpwallet", "\"test\"") + "\nImport the wallet\n" + | ||||
HelpExampleCli("importwallet", "\"test\"") + | HelpExampleCli("importwallet", "\"test\"") + | ||||
"\nImport using the json rpc call\n" + | "\nImport using the json rpc call\n" + | ||||
HelpExampleRpc("importwallet", "\"test\"")); | HelpExampleRpc("importwallet", "\"test\"")); | ||||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | UniValue dumpprivkey(const Config &config, const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"dumpprivkey \"address\"\n" | RPCHelpMan{"dumpprivkey", | ||||
"\nReveals the private key corresponding to 'address'.\n" | "\nReveals 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, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The bitcoin address for the " | "1. \"address\" (string, required) The bitcoin address for the " | ||||
"private key\n" | "private key\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"\"key\" (string) The private key\n" | "\"key\" (string) The private key\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("dumpprivkey", "\"myaddress\"") + | HelpExampleCli("dumpprivkey", "\"myaddress\"") + | ||||
HelpExampleCli("importprivkey", "\"mykey\"") + | HelpExampleCli("importprivkey", "\"mykey\"") + | ||||
Show All 28 Lines | UniValue dumpwallet(const Config &config, const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"dumpwallet \"filename\"\n" | RPCHelpMan{ | ||||
"dumpwallet", | |||||
"\nDumps all wallet keys in a human-readable format to a " | "\nDumps all wallet keys in a human-readable format to a " | ||||
"server-side file. This does not allow overwriting existing " | "server-side file. This does not allow overwriting existing " | ||||
"files.\n" | "files.\n" | ||||
"Imported scripts are included in the dumpsfile, but corresponding " | "Imported scripts are included in the dumpsfile, but " | ||||
"corresponding " | |||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"addresses may not be added automatically by importwallet.\n" | "addresses may not be added automatically by importwallet.\n" | ||||
"Note that if your wallet contains keys which are not derived from " | "Note that if your wallet contains keys which are not derived " | ||||
"from " | |||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"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 " | ||||
"ensure you back up the whole dumpfile).\n" | "(e.g. " | ||||
FabienUnsubmitted Not Done Inline ActionsDito Fabien: Dito | |||||
"ensure you back up the whole dumpfile).\n", | |||||
{ | |||||
{"filename", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"filename\" (string, required) The filename with path " | "1. \"filename\" (string, required) The filename with path " | ||||
"(either absolute or relative to bitcoind)\n" | "(either absolute or relative to bitcoind)\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{ (json object)\n" | "{ (json object)\n" | ||||
" \"filename\" : { (string) The filename with full " | " \"filename\" : { (string) The filename with full " | ||||
"absolute path\n" | "absolute path\n" | ||||
"}\n" | "}\n" | ||||
▲ Show 20 Lines • Show All 512 Lines • ▼ Show 20 Lines | |||||
UniValue importmulti(const Config &config, const JSONRPCRequest &mainRequest) { | UniValue importmulti(const Config &config, const JSONRPCRequest &mainRequest) { | ||||
std::shared_ptr<CWallet> const wallet = | std::shared_ptr<CWallet> const wallet = | ||||
GetWalletForJSONRPCRequest(mainRequest); | GetWalletForJSONRPCRequest(mainRequest); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, mainRequest.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, mainRequest.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
FabienUnsubmitted Not Done Inline ActionsPlease check if this is still required (core removes it). The long line below should really be split. Fabien: Please check if this is still required (core removes it). The long line below should really be… | |||||
if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) { | if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"importmulti \"requests\" ( \"options\" )\n" | RPCHelpMan{"importmulti", | ||||
"\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n\n" | "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n\n", | ||||
{ | |||||
{"requests", RPCArg::Type::ARR, | |||||
{ | |||||
{"", RPCArg::Type::OBJ, | |||||
{ | |||||
{ | |||||
{"scriptPubKey", RPCArg::Type::STR, false}, | |||||
{"timestamp", RPCArg::Type::NUM, false}, | |||||
{"redeemscript", RPCArg::Type::STR, true}, | |||||
{"witnessscript", RPCArg::Type::STR, true}, | |||||
FabienUnsubmitted Not Done Inline ActionsRemove. Fabien: Remove.
`pubkeys` and `keys` arrays are missing (also on core, idk why ?). | |||||
{"internal", RPCArg::Type::BOOL, true}, | |||||
{"watchonly", RPCArg::Type::BOOL, true}, | |||||
{"label", RPCArg::Type::STR, true}, | |||||
}, | |||||
}, | |||||
false}, | |||||
}, | |||||
false, "\"requests\""}, | |||||
{"options", RPCArg::Type::OBJ, | |||||
{ | |||||
{"rescan", RPCArg::Type::BOOL, true}, | |||||
}, | |||||
true, "\"options\""}, | |||||
}} | |||||
.ToString() + | |||||
"Arguments:\n" | "Arguments:\n" | ||||
"1. requests (array, required) Data to be imported\n" | "1. requests (array, required) Data to be imported\n" | ||||
" [ (array of json objects)\n" | " [ (array of json objects)\n" | ||||
" {\n" | " {\n" | ||||
" \"scriptPubKey\": \"<script>\" | { \"address\":\"<address>\" }, (string / json, required) Type of scriptPubKey (string for script, json for address)\n" | " \"scriptPubKey\": \"<script>\" | { \"address\":\"<address>\" }, (string / json, required) Type of scriptPubKey (string for script, json for address)\n" | ||||
" \"timestamp\": timestamp | \"now\" , (integer / string, required) Creation time of the key in seconds since epoch (Jan 1 1970 GMT),\n" | " \"timestamp\": timestamp | \"now\" , (integer / string, required) Creation time of the key in seconds since epoch (Jan 1 1970 GMT),\n" | ||||
" or the string \"now\" to substitute the current synced blockchain time. The timestamp of the oldest\n" | " or the string \"now\" to substitute the current synced blockchain time. The timestamp of the oldest\n" | ||||
" key will determine how far back blockchain rescans need to begin for missing wallet transactions.\n" | " key will determine how far back blockchain rescans need to begin for missing wallet transactions.\n" | ||||
Show All 19 Lines | if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) { | ||||
HelpExampleCli("importmulti", "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, \"timestamp\":1455191478 }, " | HelpExampleCli("importmulti", "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, \"timestamp\":1455191478 }, " | ||||
"{ \"scriptPubKey\": { \"address\": \"<my 2nd address>\" }, \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + | "{ \"scriptPubKey\": { \"address\": \"<my 2nd address>\" }, \"label\": \"example 2\", \"timestamp\": 1455191480 }]'") + | ||||
HelpExampleCli("importmulti", "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, \"timestamp\":1455191478 }]' '{ \"rescan\": false}'") + | HelpExampleCli("importmulti", "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, \"timestamp\":1455191478 }]' '{ \"rescan\": false}'") + | ||||
"\nResponse is an array with the same size as the input that has the execution result :\n" | "\nResponse is an array with the same size as the input that has the execution result :\n" | ||||
" [{ \"success\": true } , { \"success\": false, \"error\": { \"code\": -1, \"message\": \"Internal Server Error\"} }, ... ]\n"); | " [{ \"success\": true } , { \"success\": false, \"error\": { \"code\": -1, \"message\": \"Internal Server Error\"} }, ... ]\n"); | ||||
} | } | ||||
// clang-format on | |||||
FabienUnsubmitted Not Done Inline ActionsIf you keep the clang-format off, you need to keep this one as well. Fabien: If you keep the `clang-format off`, you need to keep this one as well. | |||||
RPCTypeCheck(mainRequest.params, {UniValue::VARR, UniValue::VOBJ}); | RPCTypeCheck(mainRequest.params, {UniValue::VARR, UniValue::VOBJ}); | ||||
const UniValue &requests = mainRequest.params[0]; | const UniValue &requests = mainRequest.params[0]; | ||||
// Default options | // Default options | ||||
bool fRescan = true; | bool fRescan = true; | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |
Fix layout