Class EthereumTransactionDataEip1559

java.lang.Object
com.hedera.hashgraph.sdk.EthereumTransactionData
com.hedera.hashgraph.sdk.EthereumTransactionDataEip1559

public class EthereumTransactionDataEip1559 extends EthereumTransactionData
The ethereum transaction data, in the format defined in EIP-1559
  • Field Details

    • TYPE_BYTE

      static final int TYPE_BYTE
      The EIP-2718 transaction type prefix.
      See Also:
    • chainId

      public byte[] chainId
      ID of the chain
    • nonce

      public byte[] nonce
      Transaction's nonce
    • maxPriorityGas

      public byte[] maxPriorityGas
      An 'optional' additional fee in Ethereum that is paid directly to miners in order to incentivize them to include your transaction in a block. Not used in Hedera
    • maxGas

      public byte[] maxGas
      The maximum amount, in tinybars, that the payer of the hedera transaction is willing to pay to complete the transaction
    • gasLimit

      public byte[] gasLimit
      The amount of gas available for the transaction
    • to

      public byte[] to
      The receiver of the transaction
    • value

      public byte[] value
      The transaction value
    • accessList

      public byte[] accessList
      specifies an array of addresses and storage keys that the transaction plans to access
    • recoveryId

      public byte[] recoveryId
      recovery parameter used to ease the signature verification
    • r

      public byte[] r
      The R value of the signature
    • s

      public byte[] s
      The S value of the signature
  • Constructor Details

    • EthereumTransactionDataEip1559

      public EthereumTransactionDataEip1559()
      Constructor for building an unsigned EIP-1559 transaction. All fields are initialized to empty byte arrays and should be populated via the setters before signing.
    • EthereumTransactionDataEip1559

      EthereumTransactionDataEip1559(byte[] chainId, byte[] nonce, byte[] maxPriorityGas, byte[] maxGas, byte[] gasLimit, byte[] to, byte[] value, byte[] callData, byte[] accessList, byte[] recoveryId, byte[] r, byte[] s)
  • Method Details

    • fromBytes

      public static EthereumTransactionDataEip1559 fromBytes(byte[] bytes)
      Convert a byte array to an ethereum transaction data.
      Parameters:
      bytes - the byte array
      Returns:
      the ethereum transaction data
    • toUnsignedRlp

      byte[] toUnsignedRlp()
      RLP-encode the unsigned payload (9 fields through the access list).
    • toBytes

      public byte[] toBytes()
      Description copied from class: EthereumTransactionData
      Serialize the ethereum transaction data into bytes using RLP
      Specified by:
      toBytes in class EthereumTransactionData
      Returns:
      the serialized transaction as a byte array
    • sign

      public byte[] sign(PrivateKey privateKey)
      Description copied from class: EthereumTransactionData
      Sign this transaction body with the given ECDSA private key, populating the signature fields (r, s and the recovery id / v), and return the resulting signed RLP encoding.
      Specified by:
      sign in class EthereumTransactionData
      Parameters:
      privateKey - the ECDSA secp256k1 key to sign with
      Returns:
      the signed RLP-encoded transaction
    • getChainId

      public long getChainId()
      Returns:
      the chain id as a number
    • setChainId

      public EthereumTransactionDataEip1559 setChainId(long chainId)
      Parameters:
      chainId - the chain id as a number
      Returns:
      this
    • getChainIdBytes

      public byte[] getChainIdBytes()
      Returns:
      the raw chain id bytes
    • setChainIdBytes

      public EthereumTransactionDataEip1559 setChainIdBytes(byte[] chainId)
      Parameters:
      chainId - the raw chain id bytes
      Returns:
      this
    • getNonce

      public long getNonce()
      Returns:
      the nonce as a number
    • setNonce

      public EthereumTransactionDataEip1559 setNonce(long nonce)
      Parameters:
      nonce - the nonce as a number
      Returns:
      this
    • getNonceBytes

      public byte[] getNonceBytes()
      Returns:
      the raw nonce bytes
    • setNonceBytes

      public EthereumTransactionDataEip1559 setNonceBytes(byte[] nonce)
      Parameters:
      nonce - the raw nonce bytes
      Returns:
      this
    • getMaxPriorityGas

      public long getMaxPriorityGas()
      Returns:
      the max priority gas as a number
    • setMaxPriorityGas

      public EthereumTransactionDataEip1559 setMaxPriorityGas(long maxPriorityGas)
      Parameters:
      maxPriorityGas - the max priority gas as a number
      Returns:
      this
    • getMaxPriorityGasBytes

      public byte[] getMaxPriorityGasBytes()
      Returns:
      the raw max priority gas bytes
    • setMaxPriorityGasBytes

      public EthereumTransactionDataEip1559 setMaxPriorityGasBytes(byte[] maxPriorityGas)
      Parameters:
      maxPriorityGas - the raw max priority gas bytes
      Returns:
      this
    • getMaxGas

      public long getMaxGas()
      Returns:
      the max gas as a number
    • setMaxGas

      public EthereumTransactionDataEip1559 setMaxGas(long maxGas)
      Parameters:
      maxGas - the max gas as a number
      Returns:
      this
    • getMaxGasBytes

      public byte[] getMaxGasBytes()
      Returns:
      the raw max gas bytes
    • setMaxGasBytes

      public EthereumTransactionDataEip1559 setMaxGasBytes(byte[] maxGas)
      Parameters:
      maxGas - the raw max gas bytes
      Returns:
      this
    • getGasLimit

      public long getGasLimit()
      Returns:
      the gas limit as a number
    • setGasLimit

      public EthereumTransactionDataEip1559 setGasLimit(long gasLimit)
      Parameters:
      gasLimit - the gas limit as a number
      Returns:
      this
    • getGasLimitBytes

      public byte[] getGasLimitBytes()
      Returns:
      the raw gas limit bytes
    • setGasLimitBytes

      public EthereumTransactionDataEip1559 setGasLimitBytes(byte[] gasLimit)
      Parameters:
      gasLimit - the raw gas limit bytes
      Returns:
      this
    • getTo

      public byte[] getTo()
      Returns:
      the receiver address
    • setTo

      public EthereumTransactionDataEip1559 setTo(byte[] to)
      Parameters:
      to - the receiver address
      Returns:
      this
    • getValue

      public BigInteger getValue()
      Returns:
      the transaction value as a number
    • setValue

      public EthereumTransactionDataEip1559 setValue(BigInteger value)
      Parameters:
      value - the transaction value as a number
      Returns:
      this
    • getValueBytes

      public byte[] getValueBytes()
      Returns:
      the raw transaction value bytes
    • setValueBytes

      public EthereumTransactionDataEip1559 setValueBytes(byte[] value)
      Parameters:
      value - the raw transaction value bytes
      Returns:
      this
    • getCallData

      public byte[] getCallData()
      Returns:
      the call data
    • setCallData

      public EthereumTransactionDataEip1559 setCallData(byte[] callData)
      Parameters:
      callData - the call data
      Returns:
      this
    • getAccessListItems

      public List<AccessListItem> getAccessListItems()
      Returns:
      the access list items decoded from the accessList bytes
    • setAccessListItems

      public EthereumTransactionDataEip1559 setAccessListItems(List<AccessListItem> accessListItems)
      Parameters:
      accessListItems - the access list items (encoded into the accessList bytes)
      Returns:
      this
    • addAccessListItem

      public EthereumTransactionDataEip1559 addAccessListItem(AccessListItem accessListItem)
      Append a single access list item.
      Parameters:
      accessListItem - the item to add
      Returns:
      this
    • getRecoveryId

      public long getRecoveryId()
      Returns:
      the recovery id as a number
    • setRecoveryId

      public EthereumTransactionDataEip1559 setRecoveryId(long recoveryId)
      Parameters:
      recoveryId - the recovery id as a number
      Returns:
      this
    • getRecoveryIdBytes

      public byte[] getRecoveryIdBytes()
      Returns:
      the raw recovery id bytes
    • setRecoveryIdBytes

      public EthereumTransactionDataEip1559 setRecoveryIdBytes(byte[] recoveryId)
      Parameters:
      recoveryId - the raw recovery id bytes
      Returns:
      this
    • getR

      public byte[] getR()
      Returns:
      the R value of the signature
    • setR

      public EthereumTransactionDataEip1559 setR(byte[] r)
      Parameters:
      r - the R value of the signature
      Returns:
      this
    • getS

      public byte[] getS()
      Returns:
      the S value of the signature
    • setS

      public EthereumTransactionDataEip1559 setS(byte[] s)
      Parameters:
      s - the S value of the signature
      Returns:
      this
    • toString

      public String toString()
      Description copied from class: EthereumTransactionData
      Serialize the ethereum transaction data into a string
      Specified by:
      toString in class EthereumTransactionData
      Returns:
      the serialized transaction as a string