java.lang.Object
com.hedera.hashgraph.sdk.Executable<EthereumTransaction,Transaction,TransactionResponse,TransactionResponse>
com.hedera.hashgraph.sdk.Transaction<EthereumTransaction>
com.hedera.hashgraph.sdk.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.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the FileId of the call databyte[]Gets the raw Ethereum transactionGets the maximum amount that the payer of the hedera transaction is willing to pay to complete the transaction.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.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.setEthereumData(byte[] ethereumData) Sets the raw Ethereum transaction (RLP encoded type 0, 1, and 2).setMaxGasAllowanceHbar(Hbar maxGasAllowanceHbar) Sets the maximum amount that the payer of the hedera transaction is willing to pay to complete the transaction.(package private) voidvalidateChecksums(Client client) Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, freezeWith, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
EthereumTransaction
public EthereumTransaction()Constructor -
EthereumTransaction
EthereumTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
EthereumTransaction
EthereumTransaction(TransactionBody txBody)
-
-
Method Details
-
getEthereumData
public byte[] getEthereumData()Gets the raw Ethereum transaction- Returns:
- the raw Ethereum transaction
-
setEthereumData
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
Gets the FileId of the call data- Returns:
- the FileId of the call data
-
setCallDataFileId
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
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
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:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<EthereumTransaction,Transaction, TransactionResponse, TransactionResponse>
-
onFreeze
Description copied from class:TransactionCalled inTransaction.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:
onFreezein classTransaction<EthereumTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<EthereumTransaction>
-
validateChecksums
- Specified by:
validateChecksumsin classTransaction<EthereumTransaction>- Throws:
BadEntityIdException
-