Enum TransactionFormat

java.lang.Object
java.lang.Enum<TransactionFormat>
com.norswap.nanoeth.transactions.TransactionFormat
All Implemented Interfaces:
Serializable, Comparable<TransactionFormat>, Constable

public enum TransactionFormat
extends Enum<TransactionFormat>
List the different possible kind of transaction that can be sent. This includes the various kind of EIP-2718 envelope types (cf. TransactionEnvelopeType) as well as the original and EIP-155 transactions, which predate the introduction of envelope types.
  • Enum Constant Details

    • TX_LEGACY

      public static final TransactionFormat TX_LEGACY
      Original version. Still allowed by most clients, but Geth will be deprecating it for new transactions. See https://blog.ethereum.org/2021/03/03/geth-v1-10-0/#chainid-enforcement
    • TX_EIP_155

      public static final TransactionFormat TX_EIP_155
      Includes chain ID (EIP-155).
    • TX_EIP_2930

      public static final TransactionFormat TX_EIP_2930
      Includes chain ID (EIP-155), access list (EIP-2930). Optional alternative.
    • TX_EIP_1559

      public static final TransactionFormat TX_EIP_1559
      Includes chain ID (EIP-155), access list (EIP-2930). Replaces gas price by gas fee and tips (EIP-1559). Optional alternative.
  • Field Details

    • type

      public final byte type
      A number representing the envelope type of the transaction, or 0 if the transaction format precedes the introduction of envelop types by EIP-2718.

      The value of this field is one of the constants in TransactionEnvelopeType.

  • Method Details

    • values

      public static TransactionFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TransactionFormat valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • findFormat

      public static TransactionFormat findFormat​(int type, Natural v) throws IllegalArgumentException
      Determines the transaction format from the envelope type (use TransactionEnvelopeType.ENVELOPE_TYPE_NONE if there is envelope type) and the signature v value.
      Throws:
      IllegalArgumentException - if either the envelope type or the v value are illegal.