java.lang.Object
com.hedera.hashgraph.sdk.Executable<TransactionReceiptQuery,Query,Response,TransactionReceipt>
com.hedera.hashgraph.sdk.Query<TransactionReceipt,TransactionReceiptQuery>
com.hedera.hashgraph.sdk.TransactionReceiptQuery
public final class TransactionReceiptQuery
extends Query<TransactionReceipt,TransactionReceiptQuery>
Get the receipt of a transaction, given its transaction ID.
Once a transaction reaches consensus, then information about whether it succeeded or failed will be available until the end of the receipt period.
This query is free.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Query
paymentTransactionId, paymentTransactionsFields 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 TypeMethodDescription(package private) ExecutionStategetExecutionState(Status status, Response response) Default implementation, may be overridden in subclasses (especially for query case).booleanShould the children be included?booleanShould duplicates be included?Called to direct the invocation of the query to the appropriate gRPC service.Extract the transaction id.(package private) booleanDoes this query require a payment?(package private) QueryHeadermapRequestHeader(Query request) The derived class should access its request header and return.(package private) TransactionReceiptmapResponse(Response response, AccountId nodeId, Query request) Called after receiving the query response from Hedera.(package private) ResponseHeadermapResponseHeader(Response response) The derived class should access its response header and return.(package private) StatusmapResponseStatus(Response response) (package private) voidonMakeRequest(Query.Builder queryBuilder, QueryHeader header) Called inQuery.makeRequest()just before the query is built.setIncludeChildren(boolean value) Whether the response should include the records of any child transactions spawned by the top-level transaction with the given transactionID.setIncludeDuplicates(boolean value) Whether records of processing duplicate transactions should be returned along with the record of processing the first consensus transaction with the given id whose status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE or, if no such record exists, the record of processing the first transaction to reach consensus with the given transaction id.setTransactionId(TransactionId transactionId) Set the ID of the transaction for which the receipt is being requested.(package private) voidvalidateChecksums(Client client) Validate the checksums.Methods inherited from class com.hedera.hashgraph.sdk.Query
getCost, getCost, getCostAsync, getCostAsync, getCostAsync, getCostAsync, getCostAsync, getCostAsync, getOperatorFromClient, getPaymentTransaction, getPaymentTransactionId, makeRequest, onExecute, onExecuteAsync, setMaxQueryPayment, setPaymentTransactionId, setQueryPayment, toStringMethods 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, isBatchedAndNotBatchTransaction, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodeAccountIds, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
TransactionReceiptQuery
public TransactionReceiptQuery()Constructor.
-
-
Method Details
-
getTransactionIdInternal
Extract the transaction id.- Overrides:
getTransactionIdInternalin classQuery<TransactionReceipt,TransactionReceiptQuery> - Returns:
- the transaction id
-
setTransactionId
Set the ID of the transaction for which the receipt is being requested.- Parameters:
transactionId- The TransactionId to be set- Returns:
this
-
getIncludeChildren
public boolean getIncludeChildren()Should the children be included?- Returns:
- should children be included
-
setIncludeChildren
Whether the response should include the records of any child transactions spawned by the top-level transaction with the given transactionID.- Parameters:
value- The value that includeChildren should be set to; true to include children, false to exclude- Returns:
this
-
getIncludeDuplicates
public boolean getIncludeDuplicates()Should duplicates be included?- Returns:
- should duplicates be included
-
setIncludeDuplicates
Whether records of processing duplicate transactions should be returned along with the record of processing the first consensus transaction with the given id whose status was neither INVALID_NODE_ACCOUNT nor INVALID_PAYER_SIGNATURE or, if no such record exists, the record of processing the first transaction to reach consensus with the given transaction id.- Parameters:
value- The value that includeDuplicates should be set to; true to include duplicates, false to exclude- Returns:
this
-
isPaymentRequired
boolean isPaymentRequired()Description copied from class:QueryDoes this query require a payment?- Overrides:
isPaymentRequiredin classQuery<TransactionReceipt,TransactionReceiptQuery> - Returns:
- does this query require a payment
-
validateChecksums
Description copied from class:QueryValidate the checksums.- Specified by:
validateChecksumsin classQuery<TransactionReceipt,TransactionReceiptQuery> - Throws:
BadEntityIdException
-
onMakeRequest
Description copied from class:QueryCalled inQuery.makeRequest()just before the query is built. The intent is for the derived class to assign their data variant to the query.- Specified by:
onMakeRequestin classQuery<TransactionReceipt,TransactionReceiptQuery>
-
mapResponseStatus
- Overrides:
mapResponseStatusin classQuery<TransactionReceipt,TransactionReceiptQuery>
-
mapResponse
Description copied from class:ExecutableCalled after receiving the query response from Hedera. The derived class should map into its output type.- Specified by:
mapResponsein classExecutable<TransactionReceiptQuery,Query, Response, TransactionReceipt>
-
mapRequestHeader
Description copied from class:QueryThe derived class should access its request header and return.- Specified by:
mapRequestHeaderin classQuery<TransactionReceipt,TransactionReceiptQuery>
-
mapResponseHeader
Description copied from class:QueryThe derived class should access its response header and return.- Specified by:
mapResponseHeaderin classQuery<TransactionReceipt,TransactionReceiptQuery>
-
getMethodDescriptor
Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<TransactionReceiptQuery,Query, Response, TransactionReceipt>
-
getExecutionState
Description copied from class:ExecutableDefault implementation, may be overridden in subclasses (especially for query case). Called just after receiving the query response from Hedera. By default it triggers a retry when the pre-check status isBUSY.- Overrides:
getExecutionStatein classExecutable<TransactionReceiptQuery,Query, Response, TransactionReceipt>
-