Skip to main content

Metadata

The Metadata class represents the metadata of an asset. This class is used by all assets.

Properties

PropertyTypeDescription
idIDid of the asset.
nameNameAsset name.
descriptionDescriptionDescription of the asset.
imageImageAsset image.
symbolSymbolAsset symbol.
decimalsDecimalNumber of decimal places of the asset.
attributesAttribute[]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

MethodReturnDescription
toPrimitive()Primitives<Metadata>Gets the primitive representation of the metadata.
inludesKeyValue(key: string, value: string)booleanCheck if the metadata includes a key and a value.
includesAttribute(attribute: Attribute)booleanCheck if the metadata includes an attribute.
hasTraitTypeInAttributes(traitType: string)booleanCheck if the metadata has an attribute type in its attributes.
getAttributeFromTraitType(traitType: string)Attribute or undefinedGets a metadata attribute from an attribute type.

Attributes

The metadata attributes are represented by the Attribute class.

Properties

PropertyTypeDescription
traitTypeTraitTypeAttribute type.
valueStringValueAttribute value.

Methods

MethodReturnDescription
toPrimitive()Primitives<Attribute>Gets the primitive representation of the attribute.