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()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • format

      public final TransactionFormat format
      The original format of the transaction before normalization. This affects how the transaction's signature is generated.
    • chainId

      public final Natural chainId
      The ID of the chain on which this transaction was sent (1 for Ethereum mainnet for instance).

      Yellowaper notation: β (beta)

    • nonce

      public final 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.

      Yellowpaper notation: Tn

    • maxFeePerGas

      public final Natural 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

      public final 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. This amount is included in maxFeePerGas.

      No yellowpaper notation (not updated for EthereumVersion.LONDON). Replacement for the gas price (notation: Tp).

    • gasLimit

      public final Natural gasLimit
      Maximum amount of gas the sender is willing to spend on this transaction.

      Yellowpaper notation: Tg

    • to

      public final Address to
      The address of the recipient of the transaction, or, for contract creation transaction, the empty address.

      Yellowpaper notation: Tt

    • value

      public final 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.

      yellowpaper notation: Tv

    • payload

      public final 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).

      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

      public final AccessList accessList
  • Constructor Details

  • Method Details

    • isContractCreation

      public boolean isContractCreation()
      A transaction is a contract creation if its destination address is empty.
    • signingRLP

      public RLP signingRLP()
      The RLP sequence to sign when signing the transaction.
    • sign

      public Transaction sign​(EthKeyPair keys)
      Signs the transaction using the given private key, returning the signed transaction.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object