tuweni / org.apache.tuweni.units.ethereum / Wei

Wei

class Wei : BaseUInt256Value<Wei> (source)

A unit measure of Wei as used by the Ethereum VM.

Functions

valueOf

static fun valueOf(value: UInt256): Wei
static fun valueOf(value: Long): Wei
static fun valueOf(value: BigInteger): Wei

Return a Wei containing the specified value.

Inherited Functions

add

open fun add(value: T): T
open fun add(value: Long): Topen fun add(value: UInt256): T

Returns a value that is (this + value).

addMod

open fun addMod(value: T, modulus: UInt256): T
open fun addMod(value: Long, modulus: UInt256): T
open fun addMod(value: Long, modulus: Long): Topen fun addMod(value: UInt256, modulus: UInt256): T

Returns a value equivalent to ((this + value) mod modulus).

compareTo

open fun compareTo(other: T): Intopen fun compareTo(other: UInt256): Int

Compare two UInt256 values.

divide

open fun divide(value: T): T
open fun divide(value: Long): Topen fun divide(value: UInt256): T

Returns a value that is (this / value).

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

mod

open fun mod(modulus: UInt256): T
open fun mod(modulus: Long): T

multiply

open fun multiply(value: T): T
open fun multiply(value: Long): Topen fun multiply(value: UInt256): T

Returns a value that is (this * value).

multiplyMod

open fun multiplyMod(value: T, modulus: UInt256): T
open fun multiplyMod(value: Long, modulus: UInt256): T
open fun multiplyMod(value: Long, modulus: Long): Topen fun multiplyMod(value: UInt256, modulus: UInt256): T

Returns a value that is ((this * value) mod modulus).

pow

open fun pow(exponent: UInt256): T
open fun pow(exponent: Long): T

subtract

open fun subtract(value: T): T
open fun subtract(value: Long): Topen fun subtract(value: UInt256): T

Returns a value that is (this - value).

toBytes

open fun toBytes(): Bytes32

toMinimalBytes

open fun toMinimalBytes(): Bytes

toString

open fun toString(): String

toUInt256

open fun toUInt256(): UInt256