FUNCTION
register_asset
function register_asset(name: text, symbol: text, decimals: integer, blockchain_rid: byte_array, icon_url: text, type: text): assetRegisters a new asset on this chain. It's marked as Unsafe, as it allows creating entities and its usage must be restricted to ensure disk usage doesn't grow indefinitely. The starting supply will be 0.
Throws if the input parameters are invalid. Common cases include:
blockchain_ridis not 32 bytes long- strings are longer than 1024 characters
- type is empty
- uniqueness resolver is longer than 1024 bytes
- decimals is not in the accepted range [0, 78] (inclusive)
icon_urlis not a valid URL
Can only be called from an operation.
Parameters
- name — the name of the asset
- symbol — the symbol of the asset
- decimals — the decimals of the asset
- blockchain_rid — the RID of the asset issuing blockchain
- icon_url — the URL of the asset icon
- type — the type of the asset, defaults to
ASSET_TYPE_FT4
© 2024 Chromia