wip rpc for nullifiers
This commit is contained in:
@@ -667,6 +667,7 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
{ "wallet", "z_listoperationids", &z_listoperationids, true },
|
{ "wallet", "z_listoperationids", &z_listoperationids, true },
|
||||||
{ "wallet", "z_getnewaddress", &z_getnewaddress, true },
|
{ "wallet", "z_getnewaddress", &z_getnewaddress, true },
|
||||||
{ "wallet", "z_listaddresses", &z_listaddresses, true },
|
{ "wallet", "z_listaddresses", &z_listaddresses, true },
|
||||||
|
{ "wallet", "z_listnullifiers", &z_listnullifiers, true },
|
||||||
{ "wallet", "z_exportkey", &z_exportkey, true },
|
{ "wallet", "z_exportkey", &z_exportkey, true },
|
||||||
{ "wallet", "z_importkey", &z_importkey, true },
|
{ "wallet", "z_importkey", &z_importkey, true },
|
||||||
{ "wallet", "z_exportviewingkey", &z_exportviewingkey, true },
|
{ "wallet", "z_exportviewingkey", &z_exportviewingkey, true },
|
||||||
|
|||||||
@@ -3743,6 +3743,34 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp, const CPubKey& mypk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UniValue z_listnullifiers(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||||
|
{
|
||||||
|
if (!EnsureWalletIsAvailable(fHelp))
|
||||||
|
return NullUniValue;
|
||||||
|
|
||||||
|
if (fHelp || params.size() > 1)
|
||||||
|
throw runtime_error(
|
||||||
|
"z_listaddresses ( includeWatchonly )\n"
|
||||||
|
"\nReturns the list of Sprout and Sapling shielded addresses belonging to the wallet.\n"
|
||||||
|
"\nArguments:\n"
|
||||||
|
"1. includeWatchonly (bool, optional, default=false) Also include watchonly addresses (see 'z_importviewingkey')\n"
|
||||||
|
"\nResult:\n"
|
||||||
|
"[ (json array of string)\n"
|
||||||
|
" \"zaddr\" (string) a zaddr belonging to the wallet\n"
|
||||||
|
" ,...\n"
|
||||||
|
"]\n"
|
||||||
|
"\nExamples:\n"
|
||||||
|
+ HelpExampleCli("z_listaddresses", "")
|
||||||
|
+ HelpExampleRpc("z_listaddresses", "")
|
||||||
|
);
|
||||||
|
|
||||||
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
|
UniValue ret(UniValue::VARR);
|
||||||
|
for (auto nullifier: Nullifiers){
|
||||||
|
ret.push_back(EncodePaymentAddress(addr));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
UniValue z_listaddresses(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
UniValue z_listaddresses(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||||
{
|
{
|
||||||
@@ -3752,7 +3780,7 @@ UniValue z_listaddresses(const UniValue& params, bool fHelp, const CPubKey& mypk
|
|||||||
if (fHelp || params.size() > 1)
|
if (fHelp || params.size() > 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"z_listaddresses ( includeWatchonly )\n"
|
"z_listaddresses ( includeWatchonly )\n"
|
||||||
"\nReturns the list of Sprout and Sapling shielded addresses belonging to the wallet.\n"
|
"\nReturns the list of Sapling shielded addresses belonging to the wallet.\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. includeWatchonly (bool, optional, default=false) Also include watchonly addresses (see 'z_importviewingkey')\n"
|
"1. includeWatchonly (bool, optional, default=false) Also include watchonly addresses (see 'z_importviewingkey')\n"
|
||||||
"\nResult:\n"
|
"\nResult:\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user