Package com.norswap.nanoeth.transactions
Enum 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.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description TX_EIP_155
Includes chain ID (EIP-155).TX_EIP_1559
Includes chain ID (EIP-155), access list (EIP-2930).TX_EIP_2930
Includes chain ID (EIP-155), access list (EIP-2930).TX_LEGACY
Original version. -
Field Summary
Fields Modifier and Type Field Description 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. -
Method Summary
Modifier and Type Method Description static TransactionFormat
findFormat(int type, Natural v)
Determines the transaction format from the envelope type (useTransactionEnvelopeType.ENVELOPE_TYPE_NONE
if there is envelope type) and the signaturev
value.static TransactionFormat
valueOf(String name)
Returns the enum constant of this type with the specified name.static TransactionFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
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
Includes chain ID (EIP-155). -
TX_EIP_2930
Includes chain ID (EIP-155), access list (EIP-2930). Optional alternative. -
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 typeA 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
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
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 nameNullPointerException
- if the argument is null
-
findFormat
Determines the transaction format from the envelope type (useTransactionEnvelopeType.ENVELOPE_TYPE_NONE
if there is envelope type) and the signaturev
value.- Throws:
IllegalArgumentException
- if either the envelope type or thev
value are illegal.
-