Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 95 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( | ||||
RPCHelpMan{"importprivkey", | RPCHelpMan{ | ||||
"importprivkey", | |||||
"\nAdds a private key (as returned by dumpprivkey) to " | "\nAdds a private key (as returned by dumpprivkey) to " | ||||
"your wallet. Requires a new wallet backup.\n", | "your wallet. Requires a new wallet backup.\n" | ||||
"Hint: use importmulti to import more than one private key.\n", | |||||
{ | { | ||||
{"privkey", RPCArg::Type::STR, false}, | {"privkey", RPCArg::Type::STR, /* opt */ false, | ||||
{"label", RPCArg::Type::STR, true}, | /* default_val */ "", "The private key (see dumpprivkey)"}, | ||||
{"rescan", RPCArg::Type::BOOL, true}, | {"label", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ | |||||
"current label if address exists, otherwise \"\"", | |||||
"An optional label"}, | |||||
{"rescan", RPCArg::Type::BOOL, /* opt */ true, | |||||
/* default_val */ "true", | |||||
"Rescan the wallet for transactions"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"Hint: use importmulti to import more than one private key.\n" | |||||
"\nArguments:\n" | |||||
"1. \"privkey\" (string, required) The private key (see " | |||||
"dumpprivkey)\n" | |||||
"2. \"label\" (string, optional, default=\"\") An " | |||||
"optional label\n" | |||||
"3. rescan (boolean, optional, default=true) Rescan " | |||||
"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, " | ||||
"during that time, other rpc calls\n" | "during that time, other rpc calls\n" | ||||
"may report that the imported key exists but related transactions " | "may report that the imported key exists but related transactions " | ||||
"are still missing, leading to temporarily incorrect/bogus " | "are still missing, leading to temporarily incorrect/bogus " | ||||
"balances and unspent outputs until rescan completes.\n" | "balances and unspent outputs until rescan completes.\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nDump a private key\n" + | "\nDump a private key\n" + | ||||
HelpExampleCli("dumpprivkey", "\"myaddress\"") + | HelpExampleCli("dumpprivkey", "\"myaddress\"") + | ||||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | UniValue importaddress(const Config &config, const JSONRPCRequest &request) { | ||||
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( | ||||
RPCHelpMan{"importaddress", | RPCHelpMan{"importaddress", | ||||
"\nAdds an address or script (in hex) that can be " | "\nAdds an address or script (in hex) that can be " | ||||
"watched as if it were in your wallet but cannot be " | "watched as if it were in your wallet but cannot be " | ||||
"used to spend. Requires a new wallet backup.\n", | "used to spend. Requires a new wallet backup.\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, false}, | {"address", RPCArg::Type::STR, /* opt */ false, | ||||
{"label", RPCArg::Type::STR, true}, | /* default_val */ "", | ||||
{"rescan", RPCArg::Type::BOOL, true}, | "The Bitcoin address (or hex-encoded script)"}, | ||||
{"p2sh", RPCArg::Type::BOOL, true}, | {"label", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "\"\"", "An optional label"}, | |||||
{"rescan", RPCArg::Type::BOOL, /* opt */ true, | |||||
/* default_val */ "true", | |||||
"Rescan the wallet for transactions"}, | |||||
{"p2sh", RPCArg::Type::BOOL, /* opt */ true, | |||||
/* default_val */ "false", | |||||
"Add the P2SH version of the script as well"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nArguments:\n" | |||||
"1. \"address\" (string, required) The Bitcoin address " | |||||
"(or hex-encoded script)\n" | |||||
"2. \"label\" (string, optional, default=\"\") An " | |||||
"optional label\n" | |||||
"3. rescan (boolean, optional, default=true) Rescan " | |||||
"the wallet for transactions\n" | |||||
"4. p2sh (boolean, optional, default=false) Add " | |||||
"the P2SH version of the script as well\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, " | ||||
"during that time, other rpc calls\n" | "during that time, other rpc calls\n" | ||||
"may report that the imported address exists but related " | "may report that the imported address exists but related " | ||||
"transactions are still missing, leading to temporarily " | "transactions are still missing, leading to temporarily " | ||||
"incorrect/bogus balances and unspent outputs until rescan " | "incorrect/bogus balances and unspent outputs until rescan " | ||||
"completes.\n" | "completes.\n" | ||||
"If you have the full public key, you should call importpubkey " | "If you have the full public key, you should call importpubkey " | ||||
"instead of this.\n" | "instead of this.\n" | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | UniValue importprunedfunds(const Config &config, | ||||
const JSONRPCRequest &request) { | 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() != 2) { | if (request.fHelp || request.params.size() != 2) { | ||||
throw std::runtime_error( | throw std::runtime_error(RPCHelpMan{ | ||||
RPCHelpMan{"importprunedfunds", | "importprunedfunds", | ||||
"\nImports funds without rescan. Corresponding address " | "\nImports funds without rescan. Corresponding address or script " | ||||
"or script must previously be included in wallet. Aimed " | "must previously be included in wallet. Aimed towards pruned " | ||||
"towards pruned wallets. The end-user is responsible to " | "wallets. The end-user is responsible to import additional " | ||||
"import additional transactions that subsequently spend " | "transactions that subsequently spend the imported outputs or " | ||||
"the imported outputs or rescan after the point in the " | "rescan after the point in the blockchain the transaction is " | ||||
"blockchain the transaction is included.\n", | "included.\n", | ||||
{ | { | ||||
{"rawtransaction", RPCArg::Type::STR_HEX, false}, | {"rawtransaction", RPCArg::Type::STR_HEX, /* opt */ false, | ||||
{"txoutproof", RPCArg::Type::STR_HEX, false}, | /* default_val */ "", | ||||
}} | "A raw transaction in hex funding an already-existing " | ||||
.ToString() + | "address in wallet"}, | ||||
"\nArguments:\n" | {"txoutproof", RPCArg::Type::STR_HEX, /* opt */ false, | ||||
"1. \"rawtransaction\" (string, required) A raw transaction in hex " | /* default_val */ "", | ||||
"funding an already-existing address in wallet\n" | "The hex output from gettxoutproof that contains the " | ||||
"2. \"txoutproof\" (string, required) The hex output from " | "transaction"}, | ||||
"gettxoutproof that contains the transaction\n"); | }}.ToString()); | ||||
} | } | ||||
CMutableTransaction tx; | CMutableTransaction tx; | ||||
if (!DecodeHexTx(tx, request.params[0].get_str())) { | if (!DecodeHexTx(tx, request.params[0].get_str())) { | ||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); | ||||
} | } | ||||
uint256 txid = tx.GetId(); | uint256 txid = tx.GetId(); | ||||
CWalletTx wtx(pwallet, MakeTransactionRef(std::move(tx))); | CWalletTx wtx(pwallet, MakeTransactionRef(std::move(tx))); | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | UniValue removeprunedfunds(const Config &config, | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"removeprunedfunds", | "removeprunedfunds", | ||||
"\nDeletes the specified transaction from the wallet. Meant " | "\nDeletes the specified transaction from the wallet. Meant " | ||||
"for use with pruned wallets and as a companion to " | "for use with pruned wallets and as a companion to " | ||||
"importprunedfunds. This will affect wallet balances.\n", | "importprunedfunds. This will affect wallet balances.\n", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, false}, | {"txid", RPCArg::Type::STR_HEX, /* opt */ false, | ||||
/* default_val */ "", | |||||
"The hex-encoded id of the transaction you are deleting"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nArguments:\n" | |||||
"1. \"txid\" (string, required) The hex-encoded id of " | |||||
"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" + | ||||
HelpExampleRpc("removeprunedfunds", | HelpExampleRpc("removeprunedfunds", | ||||
"\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166" | "\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166" | ||||
"eae7628734ea0a5\"")); | "eae7628734ea0a5\"")); | ||||
Show All 30 Lines | UniValue importpubkey(const Config &config, const JSONRPCRequest &request) { | ||||
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( | ||||
RPCHelpMan{"importpubkey", | RPCHelpMan{"importpubkey", | ||||
"\nAdds a public key (in hex) that can be watched as if " | "\nAdds a public key (in hex) that can be watched as if " | ||||
"it were in your wallet but cannot be used to spend. " | "it were in your wallet but cannot be used to spend. " | ||||
"Requires a new wallet backup.\n", | "Requires a new wallet backup.\n", | ||||
{ | { | ||||
{"pubkey", RPCArg::Type::STR, false}, | {"pubkey", RPCArg::Type::STR, /* opt */ false, | ||||
{"label", RPCArg::Type::STR, true}, | /* default_val */ "", "The hex-encoded public key"}, | ||||
{"rescan", RPCArg::Type::BOOL, true}, | {"label", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "\"\"", "An optional label"}, | |||||
{"rescan", RPCArg::Type::BOOL, /* opt */ true, | |||||
/* default_val */ "true", | |||||
"Rescan the wallet for transactions"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nArguments:\n" | |||||
"1. \"pubkey\" (string, required) The hex-encoded public " | |||||
"key\n" | |||||
"2. \"label\" (string, optional, default=\"\") An " | |||||
"optional label\n" | |||||
"3. rescan (boolean, optional, default=true) Rescan " | |||||
"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, " | ||||
"during that time, other rpc calls\n" | "during that time, other rpc calls\n" | ||||
"may report that the imported pubkey exists but related " | "may report that the imported pubkey exists but related " | ||||
"transactions are still missing, leading to temporarily " | "transactions are still missing, leading to temporarily " | ||||
"incorrect/bogus balances and unspent outputs until rescan " | "incorrect/bogus balances and unspent outputs until rescan " | ||||
"completes.\n" | "completes.\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nImport a public key with rescan\n" + | "\nImport a public key with rescan\n" + | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | UniValue importwallet(const Config &config, const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"importwallet", | "importwallet", | ||||
"\nImports keys from a wallet dump file (see dumpwallet). " | "\nImports keys from a wallet dump file (see dumpwallet). " | ||||
"Requires a new wallet backup to include imported keys.\n", | "Requires a new wallet backup to include imported keys.\n", | ||||
{ | { | ||||
{"filename", RPCArg::Type::STR, false}, | {"filename", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", "The wallet file"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nArguments:\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 181 Lines • ▼ Show 20 Lines | UniValue dumpprivkey(const Config &config, const JSONRPCRequest &request) { | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{"dumpprivkey", | 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}, | {"address", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", | |||||
"The bitcoin address for the private key"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nArguments:\n" | |||||
"1. \"address\" (string, required) The bitcoin address for the " | |||||
"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\"") + | ||||
HelpExampleRpc("dumpprivkey", "\"myaddress\"")); | HelpExampleRpc("dumpprivkey", "\"myaddress\"")); | ||||
} | } | ||||
Show All 25 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( | ||||
RPCHelpMan{"dumpwallet", | RPCHelpMan{ | ||||
"dumpwallet", | |||||
"\nDumps all wallet keys in a human-readable format to " | "\nDumps all wallet keys in a human-readable format to " | ||||
"a server-side file. This does not allow overwriting " | "a server-side file. This does not allow overwriting " | ||||
"existing files.\n" | "existing files.\n" | ||||
"Imported scripts are included in the dumpsfile, but " | "Imported scripts are included in the dumpsfile, but " | ||||
"corresponding addresses may not be added automatically " | "corresponding addresses may not be added automatically " | ||||
"by importwallet.\n" | "by importwallet.\n" | ||||
"Note that if your wallet contains keys which are not " | "Note that if your wallet contains keys which are not " | ||||
"derived from your HD seed (e.g. imported keys), these " | "derived from your HD seed (e.g. imported keys), these " | ||||
"are not covered by\n" | "are not covered by\n" | ||||
"only backing up the seed itself, and must be backed up " | "only backing up the seed itself, and must be backed up " | ||||
"too (e.g. ensure you back up the whole dumpfile).\n", | "too (e.g. ensure you back up the whole dumpfile).\n", | ||||
{ | { | ||||
{"filename", RPCArg::Type::STR, false}, | {"filename", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", | |||||
"The filename with path (either absolute or relative to " | |||||
"bitcoind)"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nArguments:\n" | |||||
"1. \"filename\" (string, required) The filename with path " | |||||
"(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" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("dumpwallet", "\"test\"") + | HelpExampleCli("dumpwallet", "\"test\"") + | ||||
HelpExampleRpc("dumpwallet", "\"test\"")); | HelpExampleRpc("dumpwallet", "\"test\"")); | ||||
▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Lines | UniValue importmulti(const Config &config, const JSONRPCRequest &mainRequest) { | ||||
if (mainRequest.fHelp || mainRequest.params.size() < 1 || | if (mainRequest.fHelp || mainRequest.params.size() < 1 || | ||||
mainRequest.params.size() > 2) { | mainRequest.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"importmulti", | "importmulti", | ||||
"\nImport addresses/scripts (with private or public keys, " | "\nImport addresses/scripts (with private or public keys, " | ||||
"redeem script (P2SH)), rescanning all addresses in " | "redeem script (P2SH)), rescanning all addresses in " | ||||
"one-shot-only (rescan can be disabled via options). Requires " | "one-shot-only (rescan can be disabled via options). Requires " | ||||
"a new wallet backup.\n\n", | "a new wallet backup.\n", | ||||
{ | { | ||||
{"requests", | {"requests", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | |||||
/* default_val */ "", | |||||
"Data to be imported", | |||||
{ | { | ||||
{"", | |||||
RPCArg::Type::OBJ, | |||||
{ | { | ||||
"", | |||||
RPCArg::Type::OBJ, | |||||
/* opt */ false, | |||||
/* default_val */ "", | |||||
"", | |||||
{ | { | ||||
{"scriptPubKey", RPCArg::Type::STR, false}, | {"scriptPubKey", | ||||
{"timestamp", RPCArg::Type::NUM, false}, | RPCArg::Type::STR, | ||||
{"redeemscript", RPCArg::Type::STR, true}, | /* opt */ false, | ||||
/* default_val */ "", | |||||
"Type of scriptPubKey (string for script, " | |||||
"json for address)", | |||||
/* oneline_description */ "", | |||||
{"\"<script>\" | { \"address\":\"<address>\" " | |||||
"}", | |||||
"string / json"}}, | |||||
{"timestamp", | |||||
RPCArg::Type::NUM, | |||||
/* opt */ false, | |||||
/* default_val */ "", | |||||
"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" | |||||
" " | |||||
" key will determine how " | |||||
"far back blockchain rescans need to begin " | |||||
"for missing wallet transactions.\n" | |||||
" " | |||||
" \"now\" can be specified " | |||||
"to bypass scanning, for keys which are " | |||||
"known to never have been used, and\n" | |||||
" " | |||||
" 0 can be specified to " | |||||
"scan the entire blockchain. Blocks up to 2 " | |||||
"hours before the earliest key\n" | |||||
" " | |||||
" creation time of all keys " | |||||
"being imported by the importmulti call will " | |||||
"be scanned.", | |||||
/* oneline_description */ "", | |||||
{"timestamp | \"now\"", "integer / string"}}, | |||||
{"redeemscript", RPCArg::Type::STR, | |||||
/* opt */ true, /* default_val */ "", | |||||
"Allowed only if the scriptPubKey is a P2SH " | |||||
"or P2SH-P2WSH address/scriptPubKey"}, | |||||
{"pubkeys", | {"pubkeys", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | /* opt */ true, | ||||
{"pubkey", RPCArg::Type::STR, false}, | /* default_val */ "", | ||||
}, | "Array of strings giving pubkeys that must " | ||||
true}, | "occur in the output or redeemscript", | ||||
{ | |||||
{"pubKey", RPCArg::Type::STR, | |||||
/* opt */ false, /* default_val */ "", | |||||
""}, | |||||
}}, | |||||
{"keys", | {"keys", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | /* opt */ true, | ||||
{"key", RPCArg::Type::STR, false}, | /* default_val */ "", | ||||
"Array of strings giving private keys whose " | |||||
"corresponding public keys must occur in the " | |||||
"output or redeemscript", | |||||
{ | |||||
{"key", RPCArg::Type::STR, | |||||
/* opt */ false, /* default_val */ "", | |||||
""}, | |||||
}}, | |||||
{"internal", RPCArg::Type::BOOL, | |||||
/* opt */ true, /* default_val */ "false", | |||||
"Stating whether matching outputs should be " | |||||
"treated as not incoming payments aka " | |||||
"change"}, | |||||
{"watchonly", RPCArg::Type::BOOL, | |||||
/* opt */ true, /* default_val */ "false", | |||||
"Stating whether matching outputs should be " | |||||
"considered watched even when they're not " | |||||
"spendable, only allowed if keys are empty"}, | |||||
{"label", RPCArg::Type::STR, /* opt */ true, | |||||
/* default_val */ "''", | |||||
"Label to assign to the address, only " | |||||
"allowed with internal=false"}, | |||||
}, | }, | ||||
true}, | |||||
{"internal", RPCArg::Type::BOOL, true}, | |||||
{"watchonly", RPCArg::Type::BOOL, true}, | |||||
{"label", RPCArg::Type::STR, true}, | |||||
}, | }, | ||||
}, | }, | ||||
false}, | |||||
}, | |||||
false, | |||||
"\"requests\""}, | "\"requests\""}, | ||||
{"options", | {"options", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | |||||
/* default_val */ "", | |||||
"", | |||||
{ | { | ||||
{"rescan", RPCArg::Type::BOOL, true}, | {"rescan", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "true", | |||||
"Stating if should rescan the blockchain after all " | |||||
"imports"}, | |||||
}, | }, | ||||
true, | |||||
"\"options\""}, | "\"options\""}, | ||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"Arguments:\n" | |||||
"1. requests (array, required) Data to be imported\n" | |||||
" [ (array of json objects)\n" | |||||
" {\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" | |||||
" 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" | |||||
" " | |||||
"\"now\" can be specified to bypass scanning, for keys which are " | |||||
"known to never have been used, and\n" | |||||
" 0 " | |||||
"can be specified to scan the entire blockchain. Blocks up to 2 " | |||||
"hours before the earliest key\n" | |||||
" " | |||||
"creation time of all keys being imported by the importmulti call " | |||||
"will be scanned.\n" | |||||
" \"redeemscript\": \"<script>\" , " | |||||
"(string, optional) Allowed only if the scriptPubKey is a P2SH " | |||||
"address or a P2SH scriptPubKey\n" | |||||
" \"pubkeys\": [\"<pubKey>\", ... ] , " | |||||
"(array, optional) Array of strings giving pubkeys that must occur " | |||||
"in the output or redeemscript\n" | |||||
" \"keys\": [\"<key>\", ... ] , " | |||||
"(array, optional) Array of strings giving private keys whose " | |||||
"corresponding public keys must occur in the output or " | |||||
"redeemscript\n" | |||||
" \"internal\": <true> , " | |||||
"(boolean, optional, default: false) Stating whether matching " | |||||
"outputs should be treated as not incoming payments aka change\n" | |||||
" \"watchonly\": <true> , " | |||||
"(boolean, optional, default: false) Stating whether matching " | |||||
"outputs should be considered watched even when they're not " | |||||
"spendable, only allowed if keys are empty\n" | |||||
" \"label\": <label> , " | |||||
"(string, optional, default: '') Label to assign to the address, " | |||||
"only allowed with internal=false\n" | |||||
" }\n" | |||||
" ,...\n" | |||||
" ]\n" | |||||
"2. options (json, optional)\n" | |||||
" {\n" | |||||
" \"rescan\": <false>, (boolean, optional, default: " | |||||
"true) Stating if should rescan the blockchain after all imports\n" | |||||
" }\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, " | ||||
"during that time, other rpc calls\n" | "during that time, other rpc calls\n" | ||||
"may report that the imported keys, addresses or scripts exists " | "may report that the imported keys, addresses or scripts exists " | ||||
"but related transactions are still missing.\n" | "but related transactions are still missing.\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli( | HelpExampleCli( | ||||
"importmulti", | "importmulti", | ||||
"'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, " | "'[{ \"scriptPubKey\": { \"address\": \"<my address>\" }, " | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |