41 size_t msglen = message.length();
42 if (msglen == 46 || msglen == 64) {
51 bool fNotIPFS =
false;
52 if (message.substr(0, 2) !=
"Qm") {
58 if (fNotIPFS && !
IsHex(message))
69 for (
auto input : transaction.
tx->vin) {
77 _(
"Unable to get coin to verify restricted asset transfer from address")));
84 _(
"Restricted asset transfer from address that has been frozen")));
95 return AreAssetsDeployed() ?
"" :
"\nTHIS COMMAND IS NOT YET ACTIVE!\nhttps://github.com/RavenProject/rips/blob/master/rip-0002.mediawiki\n";
118 default:
return "UNKNOWN";
126 if (!currentActiveAssetCache)
132 if (!currentActiveAssetCache->GetAssetMetaDataIfExists(asset_name, assetData))
136 units = assetData.
units;
158 std::string assetError =
"";
174 std::string change_address =
"";
191 if (change_address ==
"") {
193 std::string strFailReason;
200 std::pair<int, std::string>
error;
201 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
204 vTransfers.emplace_back(std::make_pair(
CAssetTransfer(tag_name, 1 * COIN), change_address));
207 std::vector< std::pair<CNullAssetTxData, std::string> > vecAssetData;
208 vecAssetData.push_back(std::make_pair(
CNullAssetTxData(tag_name, flag), address));
241 std::string assetError =
"";
257 std::string change_address =
"";
272 if (change_address ==
"") {
274 std::string strFailReason;
281 std::pair<int, std::string>
error;
282 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
286 vTransfers.emplace_back(std::make_pair(
CAssetTransfer(restricted_name.substr(1, restricted_name.size()) +
OWNER_TAG, 1 * COIN), change_address));
289 std::vector< std::pair<CNullAssetTxData, std::string> > vecAssetData;
290 vecAssetData.push_back(std::make_pair(
CNullAssetTxData(restricted_name.substr(0, restricted_name.size()), flag), address));
323 std::string assetError =
"";
333 std::string change_address =
"";
348 if (change_address ==
"") {
350 std::string strFailReason;
357 std::pair<int, std::string>
error;
358 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
362 vTransfers.emplace_back(std::make_pair(
CAssetTransfer(restricted_name.substr(1, restricted_name.size()) +
OWNER_TAG, 1 * COIN), change_address));
365 std::vector<CNullAssetTxData> vecGlobalAssetData;
366 vecGlobalAssetData.push_back(
CNullAssetTxData(restricted_name.substr(0, restricted_name.size()), flag));
386 throw std::runtime_error(
387 "issue \"asset_name\" qty \"( to_address )\" \"( change_address )\" ( units ) ( reissuable ) ( has_ipfs ) \"( ipfs_hash )\"\n" 389 "\nIssue an asset, subasset or unique asset.\n" 390 "Asset name must not conflict with any existing asset.\n" 391 "Unit as the number of decimals precision for the asset (0 for whole units (\"1\"), 8 for max precision (\"1.00000000\")\n" 392 "Reissuable is true/false for whether additional units can be issued by the original issuer.\n" 393 "If issuing a unique asset these values are required (and will be defaulted to): qty=1, units=0, reissuable=false.\n" 396 "1. \"asset_name\" (string, required) a unique name\n" 397 "2. \"qty\" (numeric, optional, default=1) the number of units to be issued\n" 398 "3. \"to_address\" (string), optional, default=\"\"), address asset will be sent to, if it is empty, address will be generated for you\n" 399 "4. \"change_address\" (string), optional, default=\"\"), address the the rvn change will be sent to, if it is empty, change address will be generated for you\n" 400 "5. \"units\" (integer, optional, default=0, min=0, max=8), the number of decimals precision for the asset (0 for whole units (\"1\"), 8 for max precision (\"1.00000000\")\n" 401 "6. \"reissuable\" (boolean, optional, default=true (false for unique assets)), whether future reissuance is allowed\n" 402 "7. \"has_ipfs\" (boolean, optional, default=false), whether ifps hash is going to be added to the asset\n" 403 "8. \"ipfs_hash\" (string, optional but required if has_ipfs = 1), an ipfs hash or a txid hash once RIP5 is activated\n" 406 "\"txid\" (string) The transaction id\n" 411 +
HelpExampleCli(
"issue",
"\"ASSET_NAME\" 1000 \"myaddress\" \"changeaddress\" 4")
412 +
HelpExampleCli(
"issue",
"\"ASSET_NAME\" 1000 \"myaddress\" \"changeaddress\" 2 true")
413 +
HelpExampleCli(
"issue",
"\"ASSET_NAME\" 1000 \"myaddress\" \"changeaddress\" 8 false true QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E")
414 +
HelpExampleCli(
"issue",
"\"ASSET_NAME/SUB_ASSET\" 1000 \"myaddress\" \"changeaddress\" 2 true")
431 std::string assetError =
"";
450 std::string address =
"";
454 if (!address.empty()) {
461 std::string strAccount;
479 std::string change_address =
"";
482 if (!change_address.empty()) {
486 std::string(
"Invalid Change Address: Invalid Raven address: ") + change_address);
499 bool has_ipfs =
false;
504 std::string ipfs_hash =
"";
505 bool fMessageCheck =
false;
507 fMessageCheck =
true;
512 int64_t expireTime = 0;
533 std::pair<int, std::string>
error;
555 throw std::runtime_error(
556 "issueunique \"root_name\" [asset_tags] ( [ipfs_hashes] ) \"( to_address )\" \"( change_address )\"\n" 558 "\nIssue unique asset(s).\n" 559 "root_name must be an asset you own.\n" 560 "An asset will be created for each element of asset_tags.\n" 561 "If provided ipfs_hashes must be the same length as asset_tags.\n" 562 "Five (5) RVN will be burned for each asset created.\n" 565 "1. \"root_name\" (string, required) name of the asset the unique asset(s) are being issued under\n" 566 "2. \"asset_tags\" (array, required) the unique tag for each asset which is to be issued\n" 567 "3. \"ipfs_hashes\" (array, optional) ipfs hashes or txid hashes corresponding to each supplied tag (should be same size as \"asset_tags\")\n" 568 "4. \"to_address\" (string, optional, default=\"\"), address assets will be sent to, if it is empty, address will be generated for you\n" 569 "5. \"change_address\" (string, optional, default=\"\"), address the the rvn change will be sent to, if it is empty, change address will be generated for you\n" 572 "\"txid\" (string) The transaction id\n" 575 +
HelpExampleCli(
"issueunique",
"\"MY_ASSET\" \'[\"primo\",\"secundo\"]\'")
576 +
HelpExampleCli(
"issueunique",
"\"MY_ASSET\" \'[\"primo\",\"secundo\"]\' \'[\"first_hash\",\"second_hash\"]\'")
592 std::string assetError =
"";
601 if (!assetTags.
isArray() || assetTags.
size() < 1) {
606 if (!ipfsHashes.
isNull()) {
612 std::string address =
"";
616 if (!address.empty()) {
623 std::string strAccount;
641 std::string changeAddress =
"";
644 if (!changeAddress.empty()) {
648 std::string(
"Invalid Change Address: Invalid Raven address: ") + changeAddress);
652 std::vector<CNewAsset> assets;
653 for (
int i = 0; i < (int)assetTags.
size(); i++) {
654 std::string tag = assetTags[i].
get_str();
673 assets.push_back(asset);
679 std::pair<int, std::string>
error;
686 if (!
CreateAssetTransaction(pwallet, crtl, assets, address, error, transaction, reservekey, nRequiredFee))
702 return "_This rpc call is not functional unless -assetindex is enabled. To enable, please run the wallet with -assetindex, this will require a reindex to occur";
706 throw std::runtime_error(
707 "listassetbalancesbyaddress \"address\" (onlytotal) (count) (start)\n" 709 "\nReturns a list of all asset balances for an address.\n" 712 "1. \"address\" (string, required) a raven address\n" 713 "2. \"onlytotal\" (boolean, optional, default=false) when false result is just a list of assets balances -- when true the result is just a single number representing the number of assets\n" 714 "3. \"count\" (integer, optional, default=50000, MAX=50000) truncates results to include only the first _count_ assets found\n" 715 "4. \"start\" (integer, optional, default=0) results skip over the first _start_ assets found (if negative it skips back from the end)\n" 719 " (asset_name) : (quantity),\n" 725 +
HelpExampleCli(
"listassetbalancesbyaddress",
"\"myaddress\" false 2 0")
726 +
HelpExampleCli(
"listassetbalancesbyaddress",
"\"myaddress\" true")
738 bool fOnlyTotal =
false;
742 size_t count = INT_MAX;
758 std::vector<std::pair<std::string, CAmount> > vecAssetAmounts;
759 int nTotalEntries = 0;
760 if (!
passetsdb->
AddressDir(vecAssetAmounts, nTotalEntries, fOnlyTotal, address, count, start))
765 return nTotalEntries;
769 for (
auto& pair : vecAssetAmounts) {
779 throw std::runtime_error(
780 "getassetdata \"asset_name\"\n" 782 "\nReturns assets metadata if that asset exists\n" 785 "1. \"asset_name\" (string, required) the name of the asset\n" 790 " amount: (number),\n" 791 " units: (number),\n" 792 " reissuable: (number),\n" 793 " has_ipfs: (number),\n" 794 " ipfs_hash: (hash), (only if has_ipfs = 1 and that data is a ipfs hash)\n" 795 " txid_hash: (hash), (only if has_ipfs = 1 and that data is a txid hash)\n" 796 " verifier_string: (string)\n" 811 if (currentActiveAssetCache) {
813 if (!currentActiveAssetCache->GetAssetMetaDataIfExists(asset_name, asset))
831 if (currentActiveAssetCache->GetAssetVerifierStringIfExists(asset.
strName, verifier)) {
841 template <
class Iter,
class Incr>
844 size_t remaining(std::distance(curr, end));
849 std::advance(curr, n);
855 throw std::runtime_error(
856 "listmyassets \"( asset )\" ( verbose ) ( count ) ( start ) (confs) \n" 858 "\nReturns a list of all asset that are owned by this wallet\n" 861 "1. \"asset\" (string, optional, default=\"*\") filters results -- must be an asset name or a partial asset name followed by '*' ('*' matches all trailing characters)\n" 862 "2. \"verbose\" (boolean, optional, default=false) when false results only contain balances -- when true results include outpoints\n" 863 "3. \"count\" (integer, optional, default=ALL) truncates results to include only the first _count_ assets found\n" 864 "4. \"start\" (integer, optional, default=0) results skip over the first _start_ assets found (if negative it skips back from the end)\n" 865 "5. \"confs\" (integet, optional, default=0) results are skipped if they don't have this number of confirmations\n" 867 "\nResult (verbose=false):\n" 869 " (asset_name): balance,\n" 873 "\nResult (verbose=true):\n" 877 " \"balance\": balance,\n" 883 " \"amount\": amount\n" 906 std::string filter =
"*";
913 bool verbose =
false;
917 size_t count = INT_MAX;
935 std::map<std::string, CAmount> balances;
936 std::map<std::string, std::vector<COutput> > outputs;
941 else if (filter.back() ==
'*') {
942 std::vector<std::string> assetNames;
955 auto bal = balances.begin();
959 safe_advance(bal, balances.end(), balances.size() + start);
966 for (; bal != end && bal != balances.end(); bal++) {
971 for (
auto const& out : outputs.at(bal->first)) {
973 tempOut.
push_back(Pair(
"txid", out.tx->GetHash().GetHex()));
974 tempOut.
push_back(Pair(
"vout", (
int)out.i));
979 auto it = pwallet->
mapWallet.find(out.tx->GetHash());
984 CTxOut txOut = wtx->
tx->vout[out.i];
985 std::string strAddress;
1005 std::string assetName;
1016 asset.
push_back(Pair(
"outpoints", outpoints));
1017 result.push_back(Pair(bal->first, asset));
1021 for (; bal != end && bal != balances.end(); bal++) {
1031 return "_This rpc call is not functional unless -assetindex is enabled. To enable, please run the wallet with -assetindex, this will require a reindex to occur";
1035 throw std::runtime_error(
1036 "listaddressesbyasset \"asset_name\" (onlytotal) (count) (start)\n" 1038 "\nReturns a list of all address that own the given asset (with balances)" 1039 "\nOr returns the total size of how many address own the given asset" 1042 "1. \"asset_name\" (string, required) name of asset\n" 1043 "2. \"onlytotal\" (boolean, optional, default=false) when false result is just a list of addresses with balances -- when true the result is just a single number representing the number of addresses\n" 1044 "3. \"count\" (integer, optional, default=50000, MAX=50000) truncates results to include only the first _count_ assets found\n" 1045 "4. \"start\" (integer, optional, default=0) results skip over the first _start_ assets found (if negative it skips back from the end)\n" 1049 " (address): balance,\n" 1054 +
HelpExampleCli(
"listaddressesbyasset",
"\"ASSET_NAME\" false 2 0")
1062 bool fOnlyTotal =
false;
1066 size_t count = INT_MAX;
1079 return "_Not a valid asset name";
1082 std::vector<std::pair<std::string, CAmount> > vecAddressAmounts;
1083 int nTotalEntries = 0;
1089 return nTotalEntries;
1093 for (
auto& pair : vecAddressAmounts) {
1104 throw std::runtime_error(
1105 "transfer \"asset_name\" qty \"to_address\" \"message\" expire_time \"change_address\"\n" 1107 "\nTransfers a quantity of an owned asset to a given address" 1110 "1. \"asset_name\" (string, required) name of asset\n" 1111 "2. \"qty\" (numeric, required) number of assets you want to send to the address\n" 1112 "3. \"to_address\" (string, required) address to send the asset to\n" 1113 "4. \"message\" (string, optional) Once RIP5 is voted in ipfs hash or txid hash to send along with the transfer\n" 1114 "5. \"expire_time\" (numeric, optional) UTC timestamp of when the message expires\n" 1115 "6. \"change_address\" (string, optional, default = \"\") the transaction change will be sent to this address\n" 1124 +
HelpExampleCli(
"transfer",
"\"ASSET_NAME\" 20 \"address\" \"\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\" 15863654")
1125 +
HelpExampleCli(
"transfer",
"\"ASSET_NAME\" 20 \"address\" \"\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\" 15863654")
1151 bool fMessageCheck =
false;
1152 std::string message =
"";
1155 if (!message.empty())
1156 fMessageCheck =
true;
1159 int64_t expireTime = 0;
1160 if (!message.empty()) {
1166 if (!message.empty() || expireTime > 0) {
1175 std::string change_address =
"";
1179 if (!change_address.empty()) {
1187 std::pair<int, std::string>
error;
1188 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
1192 vTransfers.emplace_back(std::make_pair(transfer, to_address));
1221 throw std::runtime_error(
1222 "transferfromaddresses \"asset_name\" [\"from_addresses\"] qty \"to_address\" \"message\" expire_time\n" 1224 "\nTransfer a quantity of an owned asset in specific address(es) to a given address" 1227 "1. \"asset_name\" (string, required) name of asset\n" 1228 "2. \"from_addresses\" (array, required) list of from addresses to send from\n" 1229 "3. \"qty\" (numeric, required) number of assets you want to send to the address\n" 1230 "4. \"to_address\" (string, required) address to send the asset to\n" 1231 "5. \"message\" (string, optional) Once RIP5 is voted in ipfs hash or txid hash to send along with the transfer\n" 1232 "6. \"expire_time\" (numeric, optional) UTC timestamp of when the message expires\n" 1241 +
HelpExampleCli(
"transferfromaddresses",
"\"ASSET_NAME\" \'[\"fromaddress1\", \"fromaddress2\"]\' 20 \"to_address\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\" 154652365")
1242 +
HelpExampleRpc(
"transferfromaddresses",
"\"ASSET_NAME\" \'[\"fromaddress1\", \"fromaddress2\"]\' 20 \"to_address\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\" 154652365")
1259 if (!from_addresses.
isArray() || from_addresses.
size() < 1) {
1263 std::set<std::string> setFromDestinations;
1266 for (
int i = 0; i < (int) from_addresses.
size(); i++) {
1267 std::string address = from_addresses[i].
get_str();
1272 setFromDestinations.insert(address);
1279 bool fMessageCheck =
false;
1280 std::string message =
"";
1282 fMessageCheck =
true;
1286 int64_t expireTime = 0;
1287 if (!message.empty()) {
1296 std::pair<int, std::string>
error;
1297 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
1305 std::map<std::string, std::vector<COutput> > mapAssetCoins;
1308 if (!mapAssetCoins.count(asset_name)) {
1313 for (
const auto& out : mapAssetCoins.at(asset_name)) {
1322 std::vector<COutPoint> outs;
1349 throw std::runtime_error(
1350 "transferfromaddress \"asset_name\" \"from_address\" qty \"to_address\" \"message\" expire_time\n" 1352 "\nTransfer a quantity of an owned asset in a specific address to a given address" 1355 "1. \"asset_name\" (string, required) name of asset\n" 1356 "2. \"from_address\" (string, required) address that the asset will be transferred from\n" 1357 "3. \"qty\" (numeric, required) number of assets you want to send to the address\n" 1358 "4. \"to_address\" (string, required) address to send the asset to\n" 1359 "5. \"message\" (string, optional) Once RIP5 is voted in ipfs hash or txid hash to send along with the transfer\n" 1360 "6. \"expire_time\" (numeric, optional) UTC timestamp of when the message expires\n" 1369 +
HelpExampleCli(
"transferfromaddress",
"\"ASSET_NAME\" \"fromaddress\" 20 \"address\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\", 156545652")
1370 +
HelpExampleRpc(
"transferfromaddress",
"\"ASSET_NAME\" \"fromaddress\" 20 \"address\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\", 156545652")
1397 bool fMessageCheck =
false;
1398 std::string message =
"";
1400 fMessageCheck =
true;
1404 int64_t expireTime = 0;
1405 if (!message.empty()) {
1414 std::pair<int, std::string>
error;
1415 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
1423 std::map<std::string, std::vector<COutput> > mapAssetCoins;
1426 if (!mapAssetCoins.count(asset_name)) {
1431 for (
const auto& out : mapAssetCoins.at(asset_name)) {
1440 std::vector<COutPoint> outs;
1468 throw std::runtime_error(
1469 "reissue \"asset_name\" qty \"to_address\" \"change_address\" ( reissuable ) ( new_unit) \"( new_ipfs )\" \n" 1471 "\nReissues a quantity of an asset to an owned address if you own the Owner Token" 1472 "\nCan change the reissuable flag during reissuance" 1473 "\nCan change the ipfs hash during reissuance" 1476 "1. \"asset_name\" (string, required) name of asset that is being reissued\n" 1477 "2. \"qty\" (numeric, required) number of assets to reissue\n" 1478 "3. \"to_address\" (string, required) address to send the asset to\n" 1479 "4. \"change_address\" (string, optional) address that the change of the transaction will be sent to\n" 1480 "5. \"reissuable\" (boolean, optional, default=true), whether future reissuance is allowed\n" 1481 "6. \"new_unit\" (numeric, optional, default=-1), the new units that will be associated with the asset\n" 1482 "6. \"new_ifps\" (string, optional, default=\"\"), whether to update the current ipfshash or txid once RIP5 is active\n" 1485 "\"txid\" (string) The transaction id\n" 1489 +
HelpExampleRpc(
"reissue",
"\"ASSET_NAME\" 20 \"address\" \"change_address\" \"true\" 8 \"Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u\"")
1508 std::string changeAddress =
"";
1512 bool reissuable =
true;
1522 std::string newipfs =
"";
1523 bool fMessageCheck =
false;
1526 fMessageCheck =
true;
1531 int64_t expireTime = 0;
1539 std::pair<int, std::string>
error;
1551 std::string strError =
"";
1568 throw std::runtime_error(
1569 "listassets \"( asset )\" ( verbose ) ( count ) ( start )\n" 1571 "\nReturns a list of all assets\n" 1572 "\nThis could be a slow/expensive operation as it reads from the database\n" 1575 "1. \"asset\" (string, optional, default=\"*\") filters results -- must be an asset name or a partial asset name followed by '*' ('*' matches all trailing characters)\n" 1576 "2. \"verbose\" (boolean, optional, default=false) when false result is just a list of asset names -- when true results are asset name mapped to metadata\n" 1577 "3. \"count\" (integer, optional, default=ALL) truncates results to include only the first _count_ assets found\n" 1578 "4. \"start\" (integer, optional, default=0) results skip over the first _start_ assets found (if negative it skips back from the end)\n" 1580 "\nResult (verbose=false):\n" 1586 "\nResult (verbose=true):\n" 1590 " amount: (number),\n" 1591 " units: (number),\n" 1592 " reissuable: (number),\n" 1593 " has_ipfs: (number),\n" 1594 " ipfs_hash: (hash) (only if has_ipfs = 1 and data is a ipfs hash)\n" 1595 " ipfs_hash: (hash) (only if has_ipfs = 1 and data is a txid hash)\n" 1611 std::string filter =
"*";
1618 bool verbose =
false;
1622 size_t count = INT_MAX;
1634 std::vector<CDatabasedAssetData> assets;
1641 for (
auto data : assets) {
1650 detail.
push_back(Pair(
"block_height", data.nHeight));
1651 detail.
push_back(Pair(
"blockhash", data.blockHash.GetHex()));
1671 throw std::runtime_error(
1677 " uxto cache size:\n" 1678 " asset total (exclude dirty):\n" 1679 " asset address map:\n" 1680 " asset address balance:\n" 1681 " my unspent asset:\n" 1683 " asset metadata map:\n" 1684 " asset metadata list (est):\n" 1685 " dirty cache (est):\n" 1696 if (!currentActiveAssetCache)
1709 info.
push_back(Pair(
"asset total (exclude dirty)", (
int)currentActiveAssetCache->DynamicMemoryUsage()));
1713 descendants.
push_back(Pair(
"asset address balance", (
int)memusage::DynamicUsage(currentActiveAssetCache->mapAssetsAddressAmount)));
1714 descendants.
push_back(Pair(
"reissue data", (
int)memusage::DynamicUsage(currentActiveAssetCache->mapReissuedAssetData)));
1717 info.
push_back(Pair(
"asset data", descendants));
1718 info.
push_back(Pair(
"asset metadata map", (
int)memusage::DynamicUsage(
passetsCache->GetItemsMap())));
1719 info.
push_back(Pair(
"asset metadata list (est)", (
int)
passetsCache->GetItemsList().size() * (32 + 80)));
1720 info.
push_back(Pair(
"dirty cache (est)", (
int)currentActiveAssetCache->GetCacheSize()));
1721 info.
push_back(Pair(
"dirty cache V2 (est)", (
int)currentActiveAssetCache->GetCacheSizeV2()));
1730 throw std::runtime_error(
1731 "addtagtoaddress tag_name to_address (change_address)\n" 1733 "\nAssign a tag to a address\n" 1736 "1. \"tag_name\" (string, required) the name of the tag you are assigning to the address\n" 1737 "2. \"to_address\" (string, required) the address that will be assigned the tag\n" 1738 "3. \"change_address\" (string, optional) The change address for the qualifier token to be sent to\n" 1741 "\"txid\" (string) The transaction id\n" 1746 +
HelpExampleCli(
"addtagtoaddress",
"\"#TAG\" \"to_address\" \"change_address\"")
1747 +
HelpExampleRpc(
"addtagtoaddress",
"\"#TAG\" \"to_address\" \"change_address\"")
1757 throw std::runtime_error(
1758 "removetagfromaddress tag_name to_address (change_address)\n" 1760 "\nRemove a tag from a address\n" 1763 "1. \"tag_name\" (string, required) the name of the tag you are removing from the address\n" 1764 "2. \"to_address\" (string, required) the address that the tag will be removed from\n" 1765 "3. \"change_address\" (string, optional) The change address for the qualifier token to be sent to\n" 1768 "\"txid\" (string) The transaction id\n" 1771 +
HelpExampleCli(
"removetagfromaddress",
"\"#TAG\" \"to_address\"")
1772 +
HelpExampleRpc(
"removetagfromaddress",
"\"#TAG\" \"to_address\"")
1773 +
HelpExampleCli(
"removetagfromaddress",
"\"#TAG\" \"to_address\" \"change_address\"")
1774 +
HelpExampleRpc(
"removetagfromaddress",
"\"#TAG\" \"to_address\" \"change_address\"")
1784 throw std::runtime_error(
1785 "freezeaddress asset_name address (change_address)\n" 1787 "\nFreeze an address from transferring a restricted asset\n" 1790 "1. \"asset_name\" (string, required) the name of the restricted asset you want to freeze\n" 1791 "2. \"address\" (string, required) the address that will be frozen\n" 1792 "3. \"change_address\" (string, optional) The change address for the owner token of the restricted asset\n" 1795 "\"txid\" (string) The transaction id\n" 1798 +
HelpExampleCli(
"freezeaddress",
"\"$RESTRICTED_ASSET\" \"address\"")
1799 +
HelpExampleRpc(
"freezeaddress",
"\"$RESTRICTED_ASSET\" \"address\"")
1800 +
HelpExampleCli(
"freezeaddress",
"\"$RESTRICTED_ASSET\" \"address\" \"change_address\"")
1801 +
HelpExampleRpc(
"freezeaddress",
"\"$RESTRICTED_ASSET\" \"address\" \"change_address\"")
1811 throw std::runtime_error(
1812 "unfreezeaddress asset_name address (change_address)\n" 1814 "\nUnfreeze an address from transferring a restricted asset\n" 1817 "1. \"asset_name\" (string, required) the name of the restricted asset you want to unfreeze\n" 1818 "2. \"address\" (string, required) the address that will be unfrozen\n" 1819 "3. \"change_address\" (string, optional) The change address for the owner token of the restricted asset\n" 1822 "\"txid\" (string) The transaction id\n" 1825 +
HelpExampleCli(
"unfreezeaddress",
"\"$RESTRICTED_ASSET\" \"address\"")
1826 +
HelpExampleRpc(
"unfreezeaddress",
"\"$RESTRICTED_ASSET\" \"address\"")
1827 +
HelpExampleCli(
"unfreezeaddress",
"\"$RESTRICTED_ASSET\" \"address\" \"change_address\"")
1828 +
HelpExampleRpc(
"unfreezeaddress",
"\"$RESTRICTED_ASSET\" \"address\" \"change_address\"")
1838 throw std::runtime_error(
1839 "freezerestrictedasset asset_name (change_address)\n" 1841 "\nFreeze all trading for a specific restricted asset\n" 1844 "1. \"asset_name\" (string, required) the name of the restricted asset you want to unfreeze\n" 1845 "2. \"change_address\" (string, optional) The change address for the owner token of the restricted asset\n" 1848 "\"txid\" (string) The transaction id\n" 1851 +
HelpExampleCli(
"freezerestrictedasset",
"\"$RESTRICTED_ASSET\"")
1852 +
HelpExampleRpc(
"freezerestrictedasset",
"\"$RESTRICTED_ASSET\"")
1853 +
HelpExampleCli(
"freezerestrictedasset",
"\"$RESTRICTED_ASSET\" \"change_address\"")
1854 +
HelpExampleRpc(
"freezerestrictedasset",
"\"$RESTRICTED_ASSET\" \"change_address\"")
1864 throw std::runtime_error(
1865 "unfreezerestrictedasset asset_name (change_address)\n" 1867 "\nUnfreeze all trading for a specific restricted asset\n" 1870 "1. \"asset_name\" (string, required) the name of the restricted asset you want to unfreeze\n" 1871 "2. \"change_address\" (string, optional) The change address for the owner token of the restricted asset\n" 1874 "\"txid\" (string) The transaction id\n" 1877 +
HelpExampleCli(
"unfreezerestrictedasset",
"\"$RESTRICTED_ASSET\"")
1878 +
HelpExampleRpc(
"unfreezerestrictedasset",
"\"$RESTRICTED_ASSET\"")
1879 +
HelpExampleCli(
"unfreezerestrictedasset",
"\"$RESTRICTED_ASSET\" \"change_address\"")
1880 +
HelpExampleRpc(
"unfreezerestrictedasset",
"\"$RESTRICTED_ASSET\" \"change_address\"")
1890 throw std::runtime_error(
1891 "listtagsforaddress address\n" 1893 "\nList all tags assigned to an address\n" 1896 "1. \"address\" (string, required) the address to list tags for\n" 1900 "\"tag_name\", (string) The tag name\n" 1919 std::vector<std::string> qualifiers;
1927 for (
auto item : qualifiers) {
1937 throw std::runtime_error(
1938 "listaddressesfortag tag_name\n" 1940 "\nList all addresses that have been assigned a given tag\n" 1943 "1. \"tag_name\" (string, required) the tag asset name to search for\n" 1947 "\"address\", (string) The address\n" 1965 std::vector<std::string> addresses;
1973 for (
auto item : addresses) {
1983 throw std::runtime_error(
1984 "listaddressrestrictions address\n" 1986 "\nList all assets that have frozen this address\n" 1989 "1. \"address\" (string), required) the address to list restrictions for\n" 1993 "\"asset_name\", (string) The restriction name\n" 2012 std::vector<std::string> restrictions;
2019 for (
auto item : restrictions) {
2029 throw std::runtime_error(
2030 "listglobalrestrictions\n" 2032 "\nList all global restricted assets\n" 2037 "\"asset_name\", (string) The asset name\n" 2049 std::vector<std::string> restrictions;
2056 for (
auto item : restrictions) {
2066 throw std::runtime_error(
2067 "getverifierstring restricted_name\n" 2069 "\nRetrieve the verifier string that belongs to the given restricted asset\n" 2072 "1. \"restricted_name\" (string, required) the asset_name\n" 2075 "\"verifier_string\", (string) The verifier for the asset\n" 2101 throw std::runtime_error(
2102 "checkaddresstag address tag_name\n" 2104 "\nChecks to see if an address has the given tag\n" 2107 "1. \"address\" (string, required) the RVN address to search\n" 2108 "1. \"tag_name\" (string, required) the tag to search\n" 2111 "\"true/false\", (boolean) If the address has the tag\n" 2142 throw std::runtime_error(
2143 "checkaddressrestriction address restricted_name\n" 2145 "\nChecks to see if an address has been frozen by the given restricted asset\n" 2148 "1. \"address\" (string, required) the RVN address to search\n" 2149 "1. \"restricted_name\" (string, required) the restricted asset to search\n" 2152 "\"true/false\", (boolean) If the address is frozen\n" 2155 +
HelpExampleCli(
"checkaddressrestriction",
"\"address\" \"restricted_name\"")
2156 +
HelpExampleRpc(
"checkaddressrestriction",
"\"address\" \"restricted_name\"")
2182 throw std::runtime_error(
2183 "checkglobalrestriction restricted_name\n" 2185 "\nChecks to see if a restricted asset is globally frozen\n" 2188 "1. \"restricted_name\" (string, required) the restricted asset to search\n" 2191 "\"true/false\", (boolean) If the restricted asset is frozen globally\n" 2194 +
HelpExampleCli(
"checkglobalrestriction",
"\"restricted_name\"")
2195 +
HelpExampleRpc(
"checkglobalrestriction",
"\"restricted_name\"")
2215 throw std::runtime_error(
2216 "issuerestrictedasset \"asset_name\" qty \"verifier\" \"to_address\" \"( change_address )\" (units) ( reissuable ) ( has_ipfs ) \"( ipfs_hash )\"\n" 2218 "\nIssue a restricted asset.\n" 2219 "Restricted asset names must not conflict with any existing restricted asset.\n" 2220 "Restricted assets have units set to 0.\n" 2221 "Reissuable is true/false for whether additional assets can be created and if the verifier string can be changed\n" 2224 "1. \"asset_name\" (string, required) a unique name, starts with '$'\n" 2225 "2. \"qty\" (numeric, required) the number of assets to be issued\n" 2226 "3. \"verifier\" (string, required) the KYC string that is evaluated when restricted asset transfers are made\n" 2227 "4. \"to_address\" (string, required), address asset will be sent to, this address must obey the verifier rules\n" 2228 "5. \"change_address\" (string, optional, default=\"\"), address the the rvn change will be sent to, if it is empty, change address will be generated for you\n" 2229 "6. \"units\" (integer, optional, default=0, min=0, max=8), the number of decimals precision for the asset (0 for whole units (\"1\"), 8 for max precision (\"1.00000000\")\n" 2230 "7. \"reissuable\" (boolean, optional, default=true (false for unique assets)), whether future reissuance is allowed\n" 2231 "8. \"has_ipfs\" (boolean, optional, default=false), whether ifps hash is going to be added to the asset\n" 2232 "9. \"ipfs_hash\" (string, optional but required if has_ipfs = 1), an ipfs hash or a txid hash once RIP5 is activated\n" 2235 "\"txid\" (string) The transaction id\n" 2238 +
HelpExampleCli(
"issuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"#KYC & !#AML\" \"myaddress\"")
2239 +
HelpExampleCli(
"issuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"#KYC & !#AML\" \"myaddress\"")
2240 +
HelpExampleCli(
"issuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"#KYC & !#AML\" \"myaddress\" \"changeaddress\" 5")
2241 +
HelpExampleCli(
"issuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"#KYC & !#AML\" \"myaddress\" \"changeaddress\" 8 true")
2242 +
HelpExampleCli(
"issuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"#KYC & !#AML\" \"myaddress\" \"changeaddress\" 0 false true QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E")
2258 std::string assetError =
"";
2280 std::string strError =
"";
2285 std::string change_address =
"";
2288 if (!change_address.empty()) {
2292 std::string(
"Invalid Change Address: Invalid Raven address: ") + change_address);
2300 if (units < MIN_UNIT || units >
MAX_UNIT)
2304 bool reissuable =
true;
2308 bool has_ipfs =
false;
2313 std::string ipfs_hash =
"";
2314 bool fMessageCheck =
false;
2316 fMessageCheck =
true;
2321 int64_t expireTime = 0;
2332 std::pair<int, std::string>
error;
2340 if (!
CreateAssetTransaction(pwallet, crtl, asset, to_address, error, transaction, reservekey, nRequiredFee, &verifierStripped))
2356 throw std::runtime_error(
2357 "reissuerestrictedasset \"asset_name\" qty to_address ( change_verifier ) ( \"new_verifier\" ) \"( to_address )\" \"( change_address )\" ( new_unit ) ( reissuable ) \"( ipfs_hash )\"\n" 2359 "\nReissue a already created restricted\n" 2360 "Reissuable is true/false for whether additional asset quantity can be created, an changing the verifier string\n" 2363 "1. \"asset_name\" (string, required) a unique name, starts with '$'\n" 2364 "2. \"qty\" (numeric, required) the number of assets to be issued\n" 2365 "3. \"to_address\" (string, required) address asset will be sent to, this address must have the verifier string requirements\n" 2366 "4. \"change_verifier\" (boolean, optional, default=false) If the verifier string will get changed\n" 2367 "5. \"verifier\" (string, optional, default=\"\") the KYC string that is evaluated when restricted asset transfers are made\n" 2368 "6. \"change_address\" (string, optional, default=\"\"), address the the rvn change will be sent to, if it is empty, change address will be generated for you\n" 2369 "7. \"new_unit\" (numeric, optional, default=-1), the new units that will be associated with the asset\n" 2370 "8. \"reissuable\" (boolean, optional, default=true (false for unique assets)), whether future reissuance is allowed\n" 2371 "9. \"ipfs_hash\" (string, optional but required if has_ipfs = 1), an ipfs hash or a txid hash once RIP5 is activated\n" 2374 "\"txid\" (string) The transaction id\n" 2377 +
HelpExampleCli(
"reissuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"myaddress\" true \"KYC && !AML\"")
2378 +
HelpExampleCli(
"reissuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"myaddress\" true \"KYC && !AML\" ")
2379 +
HelpExampleCli(
"reissuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"myaddress\" true \"KYC && !AML\" \"changeaddress\"")
2380 +
HelpExampleCli(
"reissuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"myaddress\" true \"KYC && !AML\" \"changeaddress\" true")
2381 +
HelpExampleCli(
"reissuerestrictedasset",
"\"$ASSET_NAME\" 1000 \"myaddress\" false \"\" \"changeaddress\" -1 false true QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E")
2397 std::string assetError =
"";
2415 bool fChangeVerifier =
false;
2419 std::string verifier_string =
"";
2423 std::string change_address =
"";
2429 std::string(
"Invalid Change Address: Invalid Raven address: ") + change_address);
2437 if (newUnits < -1 || newUnits >
MAX_UNIT)
2440 bool reissuable =
true;
2444 std::string new_ipfs_data =
"";
2445 bool fMessageCheck =
false;
2448 fMessageCheck =
true;
2453 int64_t expireTime = 0;
2464 std::pair<int, std::string>
error;
2472 if (!
CreateReissueAssetTransaction(pwallet, crtl, reissueAsset, to_address, error, transaction, reservekey, nRequiredFee, fChangeVerifier ? &verifierStripped :
nullptr))
2475 std::string strError =
"";
2492 throw std::runtime_error(
2493 "transferqualifier \"qualifier_name\" qty \"to_address\" (\"change_address\") (\"message\") (expire_time) \n" 2495 "\nTransfer a qualifier asset owned by this wallet to the given address" 2498 "1. \"qualifier_name\" (string, required) name of qualifier asset\n" 2499 "2. \"qty\" (numeric, required) number of assets you want to send to the address\n" 2500 "3. \"to_address\" (string, required) address to send the asset to\n" 2501 "4. \"change_address\" (string, optional, default = \"\") the transaction change will be sent to this address\n" 2502 "5. \"message\" (string, optional) Once RIP5 is voted in ipfs hash or txid hash to send along with the transfer\n" 2503 "6. \"expire_time\" (numeric, optional) UTC timestamp of when the message expires\n" 2512 +
HelpExampleCli(
"transferqualifier",
"\"#QUALIFIER\" 20 \"to_address\" \"\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\" 15863654")
2513 +
HelpExampleCli(
"transferqualifier",
"\"#QUALIFIER\" 20 \"to_address\" \"change_address\" \"QmTqu3Lk3gmTsQVtjU7rYYM37EAW4xNmbuEAp2Mjr4AV7E\" 15863654")
2539 std::string change_address =
"";
2555 bool fMessageCheck =
false;
2556 std::string message =
"";
2558 fMessageCheck =
true;
2562 int64_t expireTime = 0;
2563 if (!message.empty()) {
2572 std::pair<int, std::string>
error;
2573 std::vector< std::pair<CAssetTransfer, std::string> >vTransfers;
2577 vTransfers.emplace_back(std::make_pair(transfer, to_address));
2603 throw std::runtime_error(
2604 "isvalidverifierstring verifier_string\n" 2606 "\nChecks to see if the given verifier string is valid\n" 2609 "1. \"verifier_string\" (string, required) the verifier string to check\n" 2612 "\"xxxxxxx\", (string) If the verifier string is valid, and the reason\n" 2627 std::string strError;
2632 return _(
"Valid Verifier");
2640 {
"assets",
"issue", &
issue, {
"asset_name",
"qty",
"to_address",
"change_address",
"units",
"reissuable",
"has_ipfs",
"ipfs_hash"} },
2641 {
"assets",
"issueunique", &
issueunique, {
"root_name",
"asset_tags",
"ipfs_hashes",
"to_address",
"change_address"}},
2643 {
"assets",
"getassetdata", &
getassetdata, {
"asset_name"}},
2644 {
"assets",
"listmyassets", &
listmyassets, {
"asset",
"verbose",
"count",
"start",
"confs"}},
2645 {
"assets",
"listaddressesbyasset", &
listaddressesbyasset, {
"asset_name",
"onlytotal",
"count",
"start"}},
2646 {
"assets",
"transferfromaddress", &
transferfromaddress, {
"asset_name",
"from_address" "qty",
"to_address",
"message",
"expire_time"}},
2647 {
"assets",
"transferfromaddresses", &
transferfromaddresses, {
"asset_name",
"from_addresses" "qty",
"to_address",
"message",
"expire_time"}},
2648 {
"assets",
"transfer", &
transfer, {
"asset_name",
"qty",
"to_address",
"message",
"expire_time",
"change_address"}},
2649 {
"assets",
"reissue", &
reissue, {
"asset_name",
"qty",
"to_address",
"change_address",
"reissuable",
"new_unit",
"new_ipfs"}},
2650 {
"assets",
"listassets", &
listassets, {
"asset",
"verbose",
"count",
"start"}},
2653 {
"restricted assets",
"transferqualifier", &
transferqualifier, {
"qualifier_name",
"qty",
"to_address",
"change_address",
"message",
"expire_time"}},
2654 {
"restricted assets",
"issuerestrictedasset", &
issuerestrictedasset, {
"asset_name",
"qty",
"verifier",
"to_address",
"change_address",
"units",
"reissuable",
"has_ipfs",
"ipfs_hash"} },
2655 {
"restricted assets",
"reissuerestrictedasset", &
reissuerestrictedasset, {
"asset_name",
"qty",
"change_verifier",
"new_verifier",
"to_address",
"change_address",
"new_unit",
"reissuable",
"ipfs_hash"}},
2656 {
"restricted assets",
"addtagtoaddress", &
addtagtoaddress, {
"tag_name",
"to_address",
"change_address"}},
2657 {
"restricted assets",
"removetagfromaddress", &
removetagfromaddress, {
"tag_name",
"to_address",
"change_address"}},
2658 {
"restricted assets",
"freezeaddress", &
freezeaddress, {
"asset_name",
"address",
"change_address"}},
2659 {
"restricted assets",
"unfreezeaddress", &
unfreezeaddress, {
"asset_name",
"address",
"change_address"}},
2660 {
"restricted assets",
"freezerestrictedasset", &
freezerestrictedasset, {
"asset_name",
"change_address"}},
2661 {
"restricted assets",
"unfreezerestrictedasset", &
unfreezerestrictedasset, {
"asset_name",
"change_address"}},
2666 {
"restricted assets",
"getverifierstring", &
getverifierstring, {
"restricted_name"}},
2667 {
"restricted assets",
"checkaddresstag", &
checkaddresstag, {
"address",
"tag_name"}},
2676 for (
unsigned int vcidx = 0; vcidx <
ARRAYLEN(commands); vcidx++)
#define OWNER_ASSET_AMOUNT
#define UNIQUE_ASSET_AMOUNT
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
bool CheckIssueDataTx(const CTxOut &txOut)
issue asset scripts to make sure script meets the standards
bool CreateAssetTransaction(CWallet *pwallet, CCoinControl &coinControl, const CNewAsset &asset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string)
Creates new asset issuance transaction.
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
#define UNIQUE_ASSET_UNITS
Keypool ran out, call keypoolrefill first.
Raven RPC command dispatcher.
const Coin & AccessCoin(const COutPoint &output) const
Return a reference to Coin in the cache, or a pruned one if not found.
UniValue listassetbalancesbyaddress(const JSONRPCRequest &request)
bool ContextualCheckReissueAsset(CAssetsCache *assetCache, const CReissueAsset &reissue_asset, std::string &strError, const CTransaction &tx)
void CheckIPFSTxidMessage(const std::string &message, int64_t expireTime)
CLRUCache< std::string, int8_t > * passetsQualifierCache
Global variable that points to the asset address qualifier LRU Cache (protected by cs_main) ...
bool CheckOwnerDataTx(const CTxOut &txOut)
bool CheckForGlobalRestriction(const std::string &restricted_name, bool fSkipTempCache=false)
Return true if the restricted asset is globally freezing trading.
CCriticalSection cs_wallet
bool CreateTransferAssetTransaction(CWallet *pwallet, const CCoinControl &coinControl, const std::vector< std::pair< CAssetTransfer, std::string > >vTransfers, const std::string &changeAddress, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::vector< std::pair< CNullAssetTxData, std::string > > *nullAssetTxData, std::vector< CNullAssetTxData > *nullGlobalRestrictionData)
Create a transfer asset transaction.
UniValue getcacheinfo(const JSONRPCRequest &request)
CRestrictedDB * prestricteddb
Global variable that points to the active restricted asset database (protected by cs_main) ...
bool EnsureWalletIsAvailable(CWallet *const pwallet, bool avoidException)
bool AssetFromScript(const CScript &scriptPubKey, CNewAsset &assetNew, std::string &strAddress)
bool TransferAssetFromScript(const CScript &scriptPubKey, CAssetTransfer &assetTransfer, std::string &strAddress)
Get specific asset type metadata from the given scripts.
UniValue removetagfromaddress(const JSONRPCRequest &request)
CCriticalSection cs_main
Global state.
size_t DynamicMemoryUsage() const
Calculate the size of the cache (in bytes)
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
CTxOut out
unspent transaction output
CTxDestination DecodeDestination(const std::string &str)
bool GetAddressQualifiers(std::string &address, std::vector< std::string > &qualifiers)
UniValue listmyassets(const JSONRPCRequest &request)
UniValue issue(const JSONRPCRequest &request)
const std::string & get_str() const
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
int64_t get_int64() const
UniValue unfreezerestrictedasset(const JSONRPCRequest &request)
UniValue ValueFromAmount(const CAmount &amount, const int8_t units)
CAssetsDB * passetsdb
RVN START.
bool ReissueAssetFromScript(const CScript &scriptPubKey, CReissueAsset &reissue, std::string &strAddress)
UniValue UpdateAddressTag(const JSONRPCRequest &request, const int8_t &flag)
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
UniValue listglobalrestrictions(const JSONRPCRequest &request)
UniValue UpdateGlobalRestrictedAsset(const JSONRPCRequest &request, const int8_t &flag)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
#define QUALIFIER_ASSET_MAX_AMOUNT
Invalid, missing or duplicate parameter.
UniValue isvalidverifierstring(const JSONRPCRequest &request)
CLRUCache< std::string, int8_t > * passetsRestrictionCache
Global variable that points to the asset address restriction LRU Cache (protected by cs_main) ...
bool GetAssetData(const CScript &script, CAssetOutputEntry &data)
UniValue listaddressesfortag(const JSONRPCRequest &request)
int64_t CAmount
Amount in corbies (Can be negative)
bool CheckTransferOwnerTx(const CTxOut &txOut)
General error during transaction or block submission.
bool SetAddressBook(const CTxDestination &address, const std::string &strName, const std::string &purpose)
bool AreMessagingDeployed()
CCoinsViewCache * pcoinsTip
Global variable that points to the active CCoinsView (protected by cs_main)
bool IsAssetNameValid(const std::string &name, AssetType &assetType, std::string &error)
#define UNIQUE_ASSETS_REISSUABLE
void safe_advance(Iter &curr, const Iter &end, Incr n)
UniValue transferfromaddresses(const JSONRPCRequest &request)
std::string DecodeAssetData(std::string encoded)
Decode and Encode IPFS hashes, or OIP hashes.
UniValue issueunique(const JSONRPCRequest &request)
bool push_back(const UniValue &val)
bool AssetDir(std::vector< CDatabasedAssetData > &assets, const std::string filter, const size_t count, const long start)
UniValue UnitValueFromAmount(const CAmount &amount, const std::string asset_name)
bool AreAssetsDeployed()
RVN START.
UniValue transfer(const JSONRPCRequest &request)
CAssetsCache * GetCurrentAssetCache()
UniValue checkglobalrestriction(const JSONRPCRequest &request)
CTxDestination destChange
std::map< std::string, uint256 > mapReissuedAssets
An encapsulated public key.
bool IsHex(const std::string &str)
void RegisterAssetRPCCommands(CRPCTable &t)
Register asset RPC commands.
bool CreateNewChangeAddress(CReserveKey &reservekey, CKeyID &keyID, std::string &strFailReason)
RVN START.
UniValue getassetdata(const JSONRPCRequest &request)
bool OwnerAssetFromScript(const CScript &scriptPubKey, std::string &assetName, std::string &strAddress)
An output of a transaction.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
CAmount AmountFromValue(const UniValue &value)
UniValue listaddressesbyasset(const JSONRPCRequest &request)
An outpoint - a combination of a transaction hash and an index n into its vout.
CLRUCache< std::string, int8_t > * passetsGlobalRestrictionCache
Global variable that points to the global asset restriction LRU Cache (protected by cs_main) ...
bool SendAssetTransaction(CWallet *pwallet, CWalletTx &transaction, CReserveKey &reserveKey, std::pair< int, std::string > &error, std::string &txid)
Send any type of asset transaction to the network.
UniValue issuerestrictedasset(const JSONRPCRequest &request)
UniValue getverifierstring(const JSONRPCRequest &request)
UniValue reissuerestrictedasset(const JSONRPCRequest &request)
std::string GetUniqueAssetName(const std::string &parent, const std::string &tag)
Build a unique asset buy giving the root name, and the tag name (ROOT, TAG) => ROOT::TAG.
std::string AssetActivationWarning()
std::string GetStrippedVerifierString(const std::string &verifier)
A transaction with a bunch of additional info that only the owner cares about.
bool GetQualifierAddresses(std::string &qualifier, std::vector< std::string > &addresses)
UniValue listassets(const JSONRPCRequest &request)
bool AreRestrictedAssetsDeployed()
void ListSelectedAssets(std::vector< COutPoint > &vOutpoints) const
void AvailableAssets(std::map< std::string, std::vector< COutput > > &mapAssetCoins, bool fOnlySafe=true, const CCoinControl *coinControl=nullptr, const CAmount &nMinimumAmount=1, const CAmount &nMaximumAmount=MAX_MONEY, const CAmount &nMinimumSumAmount=MAX_MONEY, const uint64_t &nMaximumCount=0, const int &nMinDepth=0, const int &nMaxDepth=9999999) const
Helper function that calls AvailableCoinsAll, used for transfering assets.
CAssetsCache * passets
Global variable that point to the active assets (protected by cs_main)
UniValue freezerestrictedasset(const JSONRPCRequest &request)
UniValue transferqualifier(const JSONRPCRequest &request)
std::string EncodeDestination(const CTxDestination &dest)
void CheckRestrictedAssetTransferInputs(const CWalletTx &transaction, const std::string &asset_name)
A key allocated from the key pool.
UniValue listaddressrestrictions(const JSONRPCRequest &request)
UniValue UpdateAddressRestriction(const JSONRPCRequest &request, const int8_t &flag)
bool CreateReissueAssetTransaction(CWallet *pwallet, CCoinControl &coinControl, const CReissueAsset &reissueAsset, const std::string &address, std::pair< int, std::string > &error, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRequired, std::string *verifier_string)
Create a reissue asset transaction.
bool TopUpKeyPool(unsigned int kpSize=0)
bool GetAllMyAssetBalances(std::map< std::string, std::vector< COutput > > &outputs, std::map< std::string, CAmount > &amounts, const int confirmations, const std::string &prefix)
sets balances with the total quantity of each owned asset
UniValue checkaddressrestriction(const JSONRPCRequest &request)
bool GetGlobalRestrictions(std::vector< std::string > &restrictions)
std::string verifier_string
std::map< uint256, std::string > mapReissuedTx
bool CheckForAddressQualifier(const std::string &qualifier_name, const std::string &address, bool fSkipTempCache=false)
Return true if the address has the given qualifier assigned to it.
A reference to a CKey: the Hash160 of its serialized public key.
bool ContextualCheckVerifierString(CAssetsCache *cache, const std::string &verifier, const std::string &check_address, std::string &strError, bool fWithTags)
bool GetAddressRestrictions(std::string &address, std::vector< std::string > &restrictions)
UniValue listtagsforaddress(const JSONRPCRequest &request)
bool AddressDir(std::vector< std::pair< std::string, CAmount > > &vecAssetAmount, int &totalEntries, const bool &fGetTotal, const std::string &address, const size_t count, const long start)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
std::string RestrictedActivationWarning()
bool IsAssetNameAQualifier(const std::string &name)
Check if an asset is a qualifier asset or sub qualifier.
UniValue freezeaddress(const JSONRPCRequest &request)
const UniValue NullUniValue
CWallet * GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
bool error(const char *fmt, const Args &... args)
UniValue unfreezeaddress(const JSONRPCRequest &request)
std::map< uint256, CWalletTx > mapWallet
bool GetKeyFromPool(CPubKey &key, bool internal=false)
Standard JSON-RPC 2.0 errors.
UniValue JSONRPCError(int code, const std::string &message)
bool GetAssetVerifierStringIfExists(const std::string &name, CNullAssetTxVerifierString &verifier, bool fSkipTempCache=false)
Returns true if the Asset Verifier String was found for an asset_name, if fSkipTempCache is true...
bool CheckForAddressRestriction(const std::string &restricted_name, const std::string &address, bool fSkipTempCache=false)
Return true if the address is marked as frozen.
CLRUCache< std::string, CDatabasedAssetData > * passetsCache
Global variable that point to the assets metadata LRU Cache (protected by cs_main) ...
bool AssetAddressDir(std::vector< std::pair< std::string, CAmount > > &vecAddressAmount, int &totalEntries, const bool &fGetTotal, const std::string &assetName, const size_t count, const long start)
std::string AssetTypeToString(AssetType &assetType)
CTxDestination destination
UniValue transferfromaddress(const JSONRPCRequest &request)
void SelectAsset(const COutPoint &output)
std::string EncodeAssetData(std::string decoded)
bool IsUniqueTagValid(const std::string &tag)
Check if an unique tagname is valid.
UniValue addtagtoaddress(const JSONRPCRequest &request)
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
bool CheckReissueDataTx(const CTxOut &txOut)
UniValue reissue(const JSONRPCRequest &request)
bool IsAssetNameAnRestricted(const std::string &name)
Check if an asset is a restricted asset.
void EnsureWalletIsUnlocked(CWallet *const pwallet)
bool IsAssetNameAnOwner(const std::string &name)
Check if an asset is an owner.
UniValue checkaddresstag(const JSONRPCRequest &request)