CurrencyAmount class

Inheritance
Implementers

Constructors

CurrencyAmount(Currency currency, BigInt numerator, {BigInt? denominator})
CurrencyAmount.fromFractionalAmount(Currency currency, BigInt numerator, BigInt denominator)
Construct a currency amount with a denominator that is not equal to 1 @param currency the currency @param numerator the numerator of the fractional token amount @param denominator the denominator of the fractional token amount
factory
CurrencyAmount.fromRawAmount(Currency currency, BigInt rawAmount)
Returns a new currency amount instance from the unitless amount of token, i.e. the raw amount @param currency the currency in the amount @param rawAmount the raw token or ether amount
factory

Properties

currency Currency
getter/setter pair
decimalScale BigInt
getter/setter pair
denominator BigInt
getter/setter pairinherited
hashCode int
The hash code for this object.
no setteroverride
numerator BigInt
getter/setter pairinherited
raw BigInt
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Fraction otherParsed) Fraction
inherited
asFraction() Fraction
Helper method for converting any super class back to a fraction
inherited
divide(Fraction otherParsed) Fraction
inherited
equalTo(Fraction otherParsed) bool
inherited
greaterThan(Fraction otherParsed) bool
inherited
invert() Fraction
inherited
lessThan(Fraction otherParsed) bool
inherited
multiply(Fraction otherParsed) Fraction
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
quotient() BigInt
inherited
remainder() Fraction
inherited
subtract(Fraction otherParsed) Fraction
inherited
toExact({NumberFormat? format}) String
toFixed({int? decimalPlaces, NumberFormat? format, RoundingMode rounding = RoundingMode.roundDown}) String
toFixedNative(int decimalPlaces, {NumberFormat? format, RoundingMode? rounding}) String
inherited
toSignificant({int significantDigits = 6, NumberFormat? format, RoundingMode rounding = RoundingMode.roundDown}) String
toSignificantNative(int significantDigits, {NumberFormat? format, RoundingMode? rounding}) String
inherited
toString() String
A string representation of this object.
inherited
tryParseFraction(BigInt fractionish) Fraction
inherited

Operators

operator *(covariant CurrencyAmount other) CurrencyAmount
operator +(covariant CurrencyAmount other) CurrencyAmount
operator -(covariant CurrencyAmount other) CurrencyAmount
operator /(covariant CurrencyAmount other) CurrencyAmount
operator ==(covariant CurrencyAmount other) bool
The equality operator.
override

Static Methods

ether(BigInt amount) CurrencyAmount
Helper that calls the constructor with the ETHER currency @param amount ether amount in wei