All Implemented Interfaces:
Comparable<org.apache.tuweni.bytes.Bytes>, org.apache.tuweni.bytes.Bytes, org.apache.tuweni.bytes.Bytes32, UInt256Value<Wei>

public final class Wei extends BaseUInt256Value<Wei>
A unit measure of Wei as used by the Ethereum VM.
  • Field Details

    • ZERO

      public static final Wei ZERO
  • Method Details

    • fromEth

      public static Wei fromEth(long ethValue)
      Return a Wei containing the specified value from an ETH
      Parameters:
      ethValue - the value in eth
      Returns:
      A Wei containing the specified value.
      Throws:
      IllegalArgumentException - If the value is negative.
    • valueOf

      public static Wei valueOf(UInt256 value)
      Return a Wei containing the specified value.
      Parameters:
      value - The value to create a Wei for.
      Returns:
      A Wei containing the specified value.
      Throws:
      IllegalArgumentException - If the value is negative.
    • valueOf

      public static Wei valueOf(long value)
      Return a Wei containing the specified value.
      Parameters:
      value - The value to create a Wei for.
      Returns:
      A Wei containing the specified value.
      Throws:
      IllegalArgumentException - If the value is negative.
    • valueOf

      public static Wei valueOf(BigInteger value)
      Return a Wei containing the specified value.
      Parameters:
      value - The value to create a Wei for.
      Returns:
      A Wei containing the specified value.
      Throws:
      IllegalArgumentException - If the value is negative.