Skip to content

Asset

Source

Simple token model.

Types: AssetId = string, Assets = Map<AssetId, Asset>.

Constructor

ts
new Asset(id: string, name: string, decimals?: number)

Parameters:

NameTypeRequiredDescription
idstringYesUnique asset identifier.
namestringYesHuman-readable asset name.
decimalsnumberNoDecimal precision. Defaults to ASI_DECIMALS (8).

Methods

ts
getId(): string        // Returns the asset identifier
getName(): string      // Returns the asset name
getDecimals(): number  // Returns the decimal precision

ASI:Chain DevNet - Development Network