Rest of client side low level rpc, incl messages

This commit is contained in:
jl777
2019-07-04 00:29:18 -11:00
parent 146ccc202f
commit 591185a0b3
4 changed files with 172 additions and 34 deletions

View File

@@ -976,6 +976,9 @@ UniValue NSPV_getinfo_json();
UniValue NSPV_login(char *wifstr);
UniValue NSPV_addressutxos(char *coinaddr);
UniValue NSPV_spentinfo(uint256 txid,int32_t vout);
UniValue NSPV_notarizations(int32_t height);
UniValue NSPV_hdrsproof(int32_t prevheight,int32_t nextheight);
UniValue NSPV_txproof(uint256 txid,int32_t vout);
uint256 Parseuint256(const char *hexstr);
extern std::string NSPV_address;
@@ -1012,3 +1015,31 @@ UniValue nspv_spentinfo(const UniValue& params, bool fHelp)
return(NSPV_spentinfo(txid,vout));
}
UniValue nspv_notarizations(const UniValue& params, bool fHelp)
{
int32_t height;
if ( fHelp || params.size() != 1 )
throw runtime_error("nspv_notarizations height\n");
height = atoi((char *)params[0].get_str().c_str());
return(NSPV_notarizations(height));
}
UniValue nspv_hdrsproof(const UniValue& params, bool fHelp)
{
int32_t prevheight,nextheight;
if ( fHelp || params.size() != 2 )
throw runtime_error("nspv_proof prevheight nextheight\n");
prevheight = atoi((char *)params[0].get_str().c_str());
nextheight = atoi((char *)params[0].get_str().c_str());
return(NSPV_proof(prevheight,nextheight));
}
UniValue nspv_txproof(const UniValue& params, bool fHelp)
{
uint256 txid; int32_t height;
if ( fHelp || params.size() != 2 )
throw runtime_error("nspv_txproof txid height\n");
txid = Parseuint256((char *)params[0].get_str().c_str());
height = atoi((char *)params[1].get_str().c_str());
return(NSPV_txproof(txid,vout));
}