TokenIdentifierType class final

TokenIdentifier type for ESDT token identifiers.

Represents ESDT (eStandard Digital Token) identifiers in format TICKER-hexrandom. Does NOT support EGLD native token.

Example

final type = TokenIdentifierType.type;

// From string identifier
final token1 = type.createValue('WEGLD-bd4d79');
final token2 = type.createValue('USDC-c76f1f');

// From bytes
final bytes = 'MYTOKEN-a1b2c3'.codeUnits;
final token3 = type.createValue(bytes);

// Properties
print(token1.ticker); // "WEGLD"
print(token1.randomPart); // "bd4d79"
print(token1.toBytes()); // UTF-8 encoded bytes

// These throw: invalid format
// final invalid1 = type.createValue('EGLD'); // Use EgldOrEsdtTokenIdentifierType
// final invalid2 = type.createValue('invalid format');
Inheritance
Available extensions
Annotations
  • @immutable

Properties

cardinality TypeCardinality
Type cardinality.
finalinherited
classHierarchy List<String>
Returns full class hierarchy from most specific to most general.
no setteroverride
className String
Returns class name for runtime type identification.
no setteroverride
firstTypeParameter AbiType
Gets first type parameter.
no setterinherited
fullyQualifiedName String
Returns fully qualified name including type parameters.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasMetadata bool
Whether type has metadata attached.
no setterinherited
isDynamic bool
Whether type has dynamic (variable) length.
no setterinherited
isDynamic bool

Available on AbiType, provided by the AbiTypeExtensions extension

Returns whether the type has dynamic length.
no setter
isGeneric bool
Whether type is generic (has type parameters).
no setterinherited
metadata → dynamic
Optional metadata.
finalinherited
name String
Type name (e.g., 'u32', 'Address', 'List').
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sizeInBytes int?
Returns byte size if fixed, null if dynamic.
no setterinherited
typeParameters List<AbiType>
Type parameters for generic types.
finalinherited

Methods

canAcceptValue(dynamic nativeValue) bool
Checks if type can accept the given native value.
inherited
createValue(dynamic nativeValue) TokenIdentifierValue
Creates TokenIdentifierValue from string or bytes.
override
createValueOrThrow<T extends TypedValue>(dynamic nativeValue) → T

Available on AbiType, provided by the AbiTypeOrThrowExtensions extension

Creates a TypedValue from native value and ensures it matches expected type.
equals(AbiType other) bool
Checks type equality based on fully qualified names.
inherited
hasClassOrSuperclass(String name) bool
Checks if instance is or extends the specified class.
inherited
hasExactClass(String name) bool
Checks if instance is exactly the specified class.
inherited
isAssignableFrom(AbiType other) bool
Checks if type can be assigned from other type.
inherited
isValidValue(dynamic value) bool

Available on AbiType, provided by the AbiTypeExtensions extension

Checks if the value is valid for this type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requireType<T extends AbiType>(String message) → T

Available on AbiType, provided by the AbiTypeValidationExtensions extension

Ensures this type is an instance of T, throwing with a custom message if not.
toMap() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

type TokenIdentifierType
Gets the singleton type instance for use in type definitions.
no setter

Static Methods

create(dynamic nativeValue) TokenIdentifierValue
Creates TokenIdentifierValue from string or bytes.