diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index 8a6adf63f..7a63a110d 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -644,48 +644,7 @@ std::string CreateAsset(std::vector mypubkey,uint64_t txfee,uint64_t as } return(0); } - -UniValue tokencreate(const UniValue& params, bool fHelp) -{ - UniValue result(UniValue::VOBJ); std::string name,description,hex; uint64_t supply; - if ( fHelp || params.size() > 3 || params.size() < 2 ) - throw runtime_error("tokencreate name supply description\n") - name = params[0].get_str(); - supply = atof(params[1].get_str().c_str()) * COIN; - if ( params.size() == 3 ) - description = params[2].get_str(); - hex = CreateAsset(Mypubkey(),0,supply,name,description); - if ( hex.size() > 0 ) - { - result.push_back(Pair("result", "success")); - result.push_back(Pair("hex", hex)); - } else result.push_back(Pair("error", "could create transaction")); -} - -UniValue tokentransfer(const UniValue& params, bool fHelp) -{ - UniValue result(UniValue::VOBJ); - return(result); -} - -UniValue tokenbid(const UniValue& params, bool fHelp) -{ - UniValue result(UniValue::VOBJ); - return(result); -} - -UniValue tokencancelbid(const UniValue& params, bool fHelp) -{ - UniValue result(UniValue::VOBJ); - return(result); -} - -UniValue tokenfillbid(const UniValue& params, bool fHelp) -{ - UniValue result(UniValue::VOBJ); - return(result); -} - + std::string CreateAssetTransfer(std::vector mypubkey,uint64_t txfee,uint256 assetid,std::vectoroutputs,std::vectoramounts) { CMutableTransaction mtx; CPubKey mypk; int32_t i,n; uint64_t CCchange=0,inputs=0,total=0; @@ -761,7 +720,7 @@ std::string FillBuyOffer(std::vector mypubkey,uint64_t txfee,uint256 as SetOrigpubkey(origpubkey,origprice,vintx); fillamount = filltx.vout[fillvout].nValue; mtx.vin.push_back(CTxIn(bidtxid,bidvout,CScript())); - if ( IsAssetvout(tmpprice,tmppubkey,filltx,fillvout,assetid) == fill_amount ) + if ( IsAssetvout(tmpprice,tmppubkey,filltx,fillvout,assetid) == fillamount ) { mtx.vin.push_back(CTxIn(filltxid,fillvout,CScript())); // CC SetFillamounts(paid_amount,remaining_required,bidamount,fillamount,origprice); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 4782842b0..34226e641 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4830,6 +4830,49 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt return(siglen); } +std::string CreateAsset(std::vector mypubkey,uint64_t txfee,uint64_t assetsupply,std::string name,std::string description); + +UniValue tokencreate(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); std::string name,description,hex; uint64_t supply; + if ( fHelp || params.size() > 3 || params.size() < 2 ) + throw runtime_error("tokencreate name supply description\n") + name = params[0].get_str(); + supply = atof(params[1].get_str().c_str()) * COIN; + if ( params.size() == 3 ) + description = params[2].get_str(); + hex = CreateAsset(Mypubkey(),0,supply,name,description); + if ( hex.size() > 0 ) + { + result.push_back(Pair("result", "success")); + result.push_back(Pair("hex", hex)); + } else result.push_back(Pair("error", "could create transaction")); +} + +UniValue tokentransfer(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); + return(result); +} + +UniValue tokenbid(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); + return(result); +} + +UniValue tokencancelbid(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); + return(result); +} + +UniValue tokenfillbid(const UniValue& params, bool fHelp) +{ + UniValue result(UniValue::VOBJ); + return(result); +} + UniValue getbalance64(const UniValue& params, bool fHelp) { set setAddress; vector vecOutputs;