Metadata
The Metadata
class represents the metadata of an asset. This class is used by all assets.
Properties
Property | Type | Description |
---|---|---|
id | ID | id of the asset. |
name | Name | Asset name. |
description | Description | Description of the asset. |
image | Image | Asset image. |
symbol | Symbol | Asset symbol. |
decimals | Decimal | Number of decimal places of the asset. |
attributes | Attribute[] | Asset attributes. |
JavaScript Symbol
The asset's symbol is represented by the Symbol
class. This class is used by all assets. It should not be confused with the JavaScript Symbol
data type.
Methods
Method | Return | Description |
---|---|---|
toPrimitive() | Primitives<Metadata> | Gets the primitive representation of the metadata. |
inludesKeyValue(key: string, value: string) | boolean | Check if the metadata includes a key and a value. |
includesAttribute(attribute: Attribute) | boolean | Check if the metadata includes an attribute. |
hasTraitTypeInAttributes(traitType: string) | boolean | Check if the metadata has an attribute type in its attributes. |
getAttributeFromTraitType(traitType: string) | Attribute or undefined | Gets a metadata attribute from an attribute type. |
Attributes
The metadata attributes are represented by the Attribute
class.
Properties
Property | Type | Description |
---|---|---|
traitType | TraitType | Attribute type. |
value | StringValue | Attribute value. |
Methods
Method | Return | Description |
---|---|---|
toPrimitive() | Primitives<Attribute> | Gets the primitive representation of the attribute. |