Set Info
The setInfo()
operation allows you to attach custom metadata and define default permissions for an account, such as a token, identifier, or other asset. It's most commonly used to describe assets (e.g., NFTs or tokens) or set defaults for how other users can interact with them.
This operation is part of the builder
and is added to a transaction before publishing.
What You Can Use It For
Naming a token or identifier
Describing its purpose or contents
Embedded metadata, could be optionally signed to prove authenticity
Defining default access permissions
Here's a simplified example used within a transaction builder. You can find a full implementation in the 'Tokenizing Real-World Assets' section of the guide.
builder.setInfo({
name: 'DEMORWA',
description: 'Demo Token for Real World Asset',
metadata: metadata_base64, // base64-encoded JSON with asset info + signature
defaultPermission: new KeetaNet.lib.Permissions(['ACCESS'], [])
}, {
account: token.account // the account you're attaching this info to
});
Explanation of Each Field
name
– A human-readable name for the asset/account (e.g. token symbol).description
– A short description or summary of the asset.metadata
– A base64-encoded string containing structured data. This can include things like signed JSON that links the on-chain token to a real-world asset. The data can also optionally be encrypted.defaultPermission
– A permissions object that controls what other accounts are allowed to do with this entity. E.g. ACCESS permission gives anyone the ability to hold and transfer the asset to others.
Why Use It?
setInfo()
is especially useful for:
Setting up NFTs or tokens that represent real-world assets
Making assets easily discoverable or identifiable
Defining behavior for asset holders without custom logic
Keep in mind that metadata is public and immutable once published as part of a transaction.
Last updated