AmountConverterUtils class

Utility class for converting amounts between decimal and base units.

Constructors

AmountConverterUtils()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

converAmount({required String baseAmount, required String amount, required int decimals}) → BigInt
Multiplies two decimal amounts and converts the result to base units.
convertDecimals({required BigInt amount, required int from, required int to}) → BigInt
Converts a native asset amount to the chain’s decimal format.
toAmount({required BigInt unit, required int decimals, int? showDecimals = 8}) → String
Converts a base unit (BigInt) to a decimal string.
toUnit({required String amount, required int decimals, bool enforceMaxDecimals = true}) → BigInt
Converts a decimal string to a base unit (BigInt) value.