Class EthereumTransaction


public class EthereumTransaction extends Transaction<EthereumTransaction>
A transaction in Ethereum format.
Make an Ethereum transaction "call" with all data in Ethereum formats, including the contract alias. Call data may be in the transaction, or stored within an Hedera File. The caller MAY offer additional gas above what is offered in the call data, but MAY be charged up to 80% of that value if the amount required is less than this "floor" amount. ### Block Stream Effects An `EthereumOutput` message SHALL be emitted for each transaction.
  • Constructor Details

  • Method Details

    • getEthereumData

      public byte[] getEthereumData()
      Gets the raw Ethereum transaction
      Returns:
      the raw Ethereum transaction
    • setEthereumData

      public EthereumTransaction setEthereumData(byte[] ethereumData)
      Sets the raw Ethereum transaction (RLP encoded type 0, 1, and 2). Complete unless the callDataFileId is set.
      Parameters:
      ethereumData - raw ethereum transaction bytes
      Returns:
      this
    • getCallDataFileId

      @Nullable public FileId getCallDataFileId()
      Gets the FileId of the call data
      Returns:
      the FileId of the call data
    • setCallDataFileId

      public EthereumTransaction setCallDataFileId(FileId fileId)
      For large transactions (for example contract create) this should be used to set the FileId of an HFS file containing the callData of the ethereumData. The data in the ethereumData will be re-written with the callData element as a zero length string with the original contents in the referenced file at time of execution. The ethereumData will need to be "rehydrated" with the callData for signature validation to pass.
      Parameters:
      fileId - File ID of an HFS file containing the callData
      Returns:
      this
    • getMaxGasAllowanceHbar

      public Hbar getMaxGasAllowanceHbar()
      Gets the maximum amount that the payer of the hedera transaction is willing to pay to complete the transaction.
      Returns:
      the max gas allowance
    • setMaxGasAllowanceHbar

      public EthereumTransaction setMaxGasAllowanceHbar(Hbar maxGasAllowanceHbar)
      Sets the maximum amount that the payer of the hedera transaction is willing to pay to complete the transaction.
      Ordinarily the account with the ECDSA alias corresponding to the public key that is extracted from the ethereum_data signature is responsible for fees that result from the execution of the transaction. If that amount of authorized fees is not sufficient then the payer of the transaction can be charged, up to but not exceeding this amount. If the ethereum_data transaction authorized an amount that was insufficient then the payer will only be charged the amount needed to make up the difference. If the gas price in the transaction was set to zero then the payer will be assessed the entire fee.
      Parameters:
      maxGasAllowanceHbar - the maximum gas allowance
      Returns:
      this
    • getMethodDescriptor

      io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()
      Description copied from class: Executable
      Called to direct the invocation of the query to the appropriate gRPC service.
      Specified by:
      getMethodDescriptor in class Executable<EthereumTransaction,Transaction,TransactionResponse,TransactionResponse>
    • onFreeze

      void onFreeze(TransactionBody.Builder bodyBuilder)
      Description copied from class: Transaction
      Called in Transaction.freezeWith(Client) just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.
      Specified by:
      onFreeze in class Transaction<EthereumTransaction>
    • onScheduled

      void onScheduled(SchedulableTransactionBody.Builder scheduled)
      Description copied from class: Transaction
      Called in Transaction.schedule() when converting transaction into a scheduled version.
      Specified by:
      onScheduled in class Transaction<EthereumTransaction>
    • validateChecksums

      void validateChecksums(Client client) throws BadEntityIdException
      Specified by:
      validateChecksums in class Transaction<EthereumTransaction>
      Throws:
      BadEntityIdException