Get asset metadata
Get metadata of a specific asset.

Example - Asset Registry & Token Registry

1
const asset = 'IYzTSjJg4I3hvUaRXrihRm9+mSEShenPK8l8uKUOD3o=';
2
3
client.api.getAssetMetadata(asset, function(err, registry_unit) {
4
if (err) return console.error(err);
5
client.api.getJoint(registry_unit.metadata_unit, function(err, result) {
6
if (err) return console.error(err);
7
const metadata = result.joint.unit.messages.find(item => item.app == 'data');
8
console.log(registry_unit, metadata ? metadata.payload : null);
9
});
10
});
Copied!

Returns

1
{
2
metadata_unit: "0xXOuaP5e3z38TF5ooNtDhmwNkh1i21rBWDvrrxKt0U=",
3
registry_address: "AM6GTUKENBYA54FYDAKX2VLENFZIMXWG",
4
suffix: null
5
}
6
{
7
asset: "IYzTSjJg4I3hvUaRXrihRm9+mSEShenPK8l8uKUOD3o=",
8
decimals: 0,
9
name: "WCG Point by Byteball",
10
shortName: "WCG Point",
11
issuer: "Byteball",
12
ticker: "WCG",
13
description: "WCG Point is a honorific token, a recognition of contributing to World Community Grid projects. The token is not transferable, therefore, it cannot be sold and the balance reflects a lifetime contribution to WCG. Some services might choose to offer a privilege to users with large balance of this token."
14
}
Copied!

Example - Token Registry only

1
const registry = 'O6H6ZIFI57X3PLTYHOCVYPP5A553CYFQ';
2
const asset = 'fAmGezsOuWr6TEkUmKA6zYDZUUzeE0j95pvPgIcgTkM=';
3
const symbol = 'TONY';
4
5
client.api.getSymbolByAsset(registry, asset).then(console.log);
6
client.api.getAssetBySymbol(registry, symbol).then(console.log);
Copied!

Returns

1
TONY
2
fAmGezsOuWr6TEkUmKA6zYDZUUzeE0j95pvPgIcgTkM=
Copied!

Learn more

Last modified 7mo ago