TokenAmount class

Token Amount

Inheritance

Constructors

TokenAmount.new({required BigInt amount, required u8 decimals, required String uiAmountString})
The token balance of an SPL Token account.
const
TokenAmount.fromJson(Map<String, dynamic> json)
Creates an instance of this class from the constructor parameters defined in the json object.
factory

Properties

amount BigInt
The raw balance without decimals, a u64.
final
decimals u8
The number of base 10 digits to the right of the decimal place.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uiAmountString String
The balance as a string, using mint-prescribed decimals.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serialises this class into a JSON object.
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

tryFromJson(Map<String, dynamic>? json) TokenAmount?
Creates an instance of this class from the constructor parameters defined in the json object.
override