tokens airdrop RPC

This commit is contained in:
blackjok3r
2019-05-09 19:18:10 +08:00
parent ffbb7a92f2
commit 113d3c779f
5 changed files with 97 additions and 0 deletions

View File

@@ -5656,6 +5656,19 @@ UniValue payments_airdrop(const UniValue& params, bool fHelp)
return(PaymentsAirdrop(cp,(char *)params[0].get_str().c_str()));
}
UniValue payments_airdroptokens(const UniValue& params, bool fHelp)
{
struct CCcontract_info *cp,C;
if ( fHelp || params.size() != 1 )
throw runtime_error("paymentsairdrop \"[%22tokenid%22,lockedblocks,minamount,mintoaddress,top,bottom,fixedFlag,%22excludePubKey%22,...,%22excludePubKeyN%22]\"\n");
if ( ensure_CCrequirements(EVAL_PAYMENTS) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
const CKeyStore& keystore = *pwalletMain;
LOCK2(cs_main, pwalletMain->cs_wallet);
cp = CCinit(&C,EVAL_PAYMENTS);
return(PaymentsAirdropTokens(cp,(char *)params[0].get_str().c_str()));
}
UniValue payments_info(const UniValue& params, bool fHelp)
{
struct CCcontract_info *cp,C;