nspv_listtransactions initial

This commit is contained in:
jl777
2019-07-13 01:49:05 -11:00
parent f963001d0b
commit 6cb639c2b7
8 changed files with 202 additions and 3 deletions

View File

@@ -975,6 +975,7 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp)
UniValue NSPV_getinfo_req(int32_t reqht);
UniValue NSPV_login(char *wifstr);
UniValue NSPV_logout();
UniValue NSPV_addresstxids(char *coinaddr,int32_t CCflag);
UniValue NSPV_addressutxos(char *coinaddr,int32_t CCflag);
UniValue NSPV_broadcast(char *hex);
UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis);
@@ -1029,6 +1030,26 @@ UniValue nspv_listunspent(const UniValue& params, bool fHelp)
else throw runtime_error("nspv_listunspent address [isCC]\n");
}
UniValue nspv_listtransactions(const UniValue& params, bool fHelp)
{
int32_t CCflag = 0;
if ( fHelp || params.size() > 2 )
throw runtime_error("nspv_listtransactions address [isCC]\n");
if ( params.size() == 0 )
{
if ( NSPV_address.size() != 0 )
return(NSPV_addresstxids((char *)NSPV_address.c_str(),0));
else throw runtime_error("nspv_listtransactions address [isCC]\n");
}
if ( params.size() >= 1 )
{
if ( params.size() == 2 )
CCflag = atoi((char *)params[1].get_str().c_str());
return(NSPV_addresstxids((char *)params[0].get_str().c_str(),CCflag));
}
else throw runtime_error("nspv_listtransactions address [isCC]\n");
}
UniValue nspv_spentinfo(const UniValue& params, bool fHelp)
{
uint256 txid; int32_t vout;