Package com.norswap.nanoeth.transactions
Class UnsignedTransaction
java.lang.Object
com.norswap.nanoeth.transactions.UnsignedTransaction
- Direct Known Subclasses:
Transaction
public class UnsignedTransaction extends Object
A "normalized transaction", as defined in EIP-1559 (part of the
London
hard fork), which does not include a signature.
Such a transaction can be created from any of the TransactionFormat
.
-
Field Summary
Fields Modifier and Type Field Description AccessList
accessList
Natural
chainId
The ID of the chain on which this transaction was sent (1 for Ethereum mainnet for instance).TransactionFormat
format
The original format of the transaction before normalization.Natural
gasLimit
Maximum amount of gas the sender is willing to spend on this transaction.Natural
maxFeePerGas
Max total amount of Wei the sender is ready to pay per unit of gas consumed.Natural
maxPriorityFeePerGas
Max amount of Wei the sender is ready to pay as a priority fee ("tip") to the miner, per unit of gas consumed.Natural
nonce
Sender nonce at the time the transaction was sent -- which is equal to the number of transaction the sender sent before that point.byte[]
payload
Either the EVM code for account initialisation when deploying a contract (yellowpaper: Ti), or the input data when sending a message call (yellowpaper: Td).Address
to
The address of the recipient of the transaction, or, for contract creation transaction, the empty address.Natural
value
The value in Wei to be transferred to the transaction's recipient, or as an endowment for the newly created contract in the case of contract creation. -
Constructor Summary
Constructors Constructor Description UnsignedTransaction(TransactionFormat format, Natural chainId, Natural nonce, Natural maxFeePerGas, Natural maxPriorityFeePerGas, Natural gasLimit, Address to, Natural value, byte[] payload, AccessList accessList)
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
boolean
isContractCreation()
A transaction is a contract creation if its destination address is empty.Transaction
sign(EthKeyPair keys)
Signs the transaction using the given private key, returning the signed transaction.RLP
signingRLP()
The RLP sequence to sign when signing the transaction.String
toString()
-
Field Details
-
format
The original format of the transaction before normalization. This affects how the transaction's signature is generated. -
chainId
The ID of the chain on which this transaction was sent (1 for Ethereum mainnet for instance).Yellowaper notation: β (beta)
-
nonce
Sender nonce at the time the transaction was sent -- which is equal to the number of transaction the sender sent before that point.Yellowpaper notation: Tn
-
maxFeePerGas
Max total amount of Wei the sender is ready to pay per unit of gas consumed.No yellowpaper notation (not updated for
EthereumVersion.LONDON
). Replacement for the gas price (notation: Tp). -
maxPriorityFeePerGas
Max amount of Wei the sender is ready to pay as a priority fee ("tip") to the miner, per unit of gas consumed. This amount is included inmaxFeePerGas
.No yellowpaper notation (not updated for
EthereumVersion.LONDON
). Replacement for the gas price (notation: Tp). -
gasLimit
Maximum amount of gas the sender is willing to spend on this transaction.Yellowpaper notation: Tg
-
to
The address of the recipient of the transaction, or, for contract creation transaction, the empty address.Yellowpaper notation: Tt
-
value
The value in Wei to be transferred to the transaction's recipient, or as an endowment for the newly created contract in the case of contract creation.yellowpaper notation: Tv
-
payload
public final byte[] payloadEither the EVM code for account initialisation when deploying a contract (yellowpaper: Ti), or the input data when sending a message call (yellowpaper: Td).When making a simple transfer to an EOA (externally owned account), the payload is typically empty, but does not have to be. This is considered to be a message call.
-
accessList
-
-
Constructor Details
-
UnsignedTransaction
public UnsignedTransaction(TransactionFormat format, Natural chainId, Natural nonce, Natural maxFeePerGas, Natural maxPriorityFeePerGas, Natural gasLimit, Address to, Natural value, byte[] payload, AccessList accessList)
-
-
Method Details
-
isContractCreation
public boolean isContractCreation()A transaction is a contract creation if its destination address is empty. -
signingRLP
The RLP sequence to sign when signing the transaction. -
sign
Signs the transaction using the given private key, returning the signed transaction. -
equals
-
hashCode
public int hashCode() -
toString
-