BigNumber class

Many operations in Ethereum operate on numbers which are outside the range of safe values to use in JavaScript.

A BigNumber is an object which safely allows mathematical operations on numbers of any magnitude.

Most operations which need to return a value will return a BigNumber and parameters which accept values will generally accept them.

Available extensions
Annotations
  • @JS("BigNumber")

Constructors

BigNumber.new()

Properties

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

Available on BigNumber, provided by the BigNumberExtension extension

Convert JS BigNumber to Dart BigInt.
no setter
toDouble double

Available on BigNumber, provided by the BigNumberExtension extension

Convert JS BigNumber to Dart double.
no setter
toInt int

Available on BigNumber, provided by the BigNumberExtension extension

Convert JS BigNumber to Dart int.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toHexString() String
Returns the value of BigNumber as a base-16, 0x-prefixed DataHexString.
toNumber() num
Returns the value of BigNumber as a JavaScript value.
toString() String
Returns the value of BigNumber as a base-10 string.
override

Operators

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

Static Methods

from(String num) BigNumber
The constructor of BigNumber cannot be called directly. Instead, Use the static BigNumber.from.