TokenIdentifierValue class final
TokenIdentifier value.
Holds an ESDT token identifier with validation and parsing utilities. Provides access to ticker and random parts.
Example
final value = TokenIdentifierValue('WEGLD-bd4d79');
print(value.identifier); // "WEGLD-bd4d79"
print(value.ticker); // "WEGLD"
print(value.randomPart); // "bd4d79"
print(value.length); // 12
final bytes = value.toBytes(); // UTF-8 encoded
final fromBytes = TokenIdentifierValue.fromBytes(bytes);
- Inheritance
-
- Object
- TypedValue
- TokenIdentifierValue
- Available extensions
- Annotations
-
- @immutable
Constructors
- TokenIdentifierValue(String identifier)
- Creates TokenIdentifier value.
-
TokenIdentifierValue.fromBytes(List<
int> bytes) -
Creates TokenIdentifier from UTF-8 bytes.
factory
Properties
-
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
- hashCode → int
-
The hash code for this object.
no setterinherited
- identifier → String
-
Token identifier string.
final
- length → int
-
Returns the length of the identifier string.
no setter
- nativeValue → String
-
Returns native Dart representation of this value.
no setteroverride
- randomPart → String?
-
Random part (after dash).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- ticker → String
-
Ticker part (before dash).
no setter
- type → AbiType
-
Value type.
finalinherited
Methods
-
asOrNull<
T extends TypedValue> () → T? -
Available on TypedValue, provided by the TypedValueExtensions extension
Attempts to cast this value to typeT, returning null if the cast fails. -
asOrThrow<
T extends TypedValue> () → T -
Available on TypedValue, provided by the TypedValueExtensions extension
Casts this value to typeTwith a clear error message if the cast fails. -
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requireValueType<
T extends TypedValue> (String message) → T -
Available on TypedValue, provided by the TypedValueValidationExtensions extension
Ensures this value is an instance ofT, throwing with a custom message if not. -
toBytes(
) → List< int> -
Converts to byte representation.
override
-
toHex(
) → String -
Converts to hex string using nested encoding (fixed-width).
inherited
-
toString(
) → String -
A string representation of this object.
override
-
toTopBytes(
) → List< int> -
Converts to bytes using top-level encoding (variable-width).
inherited
-
toTopHex(
) → String -
Converts to hex string using top-level encoding (variable-width).
inherited
-
valueEquals(
TypedValue other) → bool -
Checks value equality.
inherited
-
valueOf(
) → dynamic -
Returns native value (alias for nativeValue).
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited