java.lang.Object
com.hedera.hashgraph.sdk.TransactionReceipt
The consensus result for a transaction, which might not be currently
known, or may succeed or fail.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AccountIdThe account ID, if a new account was created.final List<TransactionReceipt> The receipts (if any) of all child transactions spawned by the transaction with the given top-level id, in consensus order.final ContractIdThe contract ID, if a new contract was created.final List<TransactionReceipt> The receipts of processing all transactions with the given id, in consensus time order.final ExchangeRateThe exchange rate of Hbars to cents (USD).final FileIdThe file ID, if a new file was created.final ExchangeRateNext exchange rate which will take effect when current rate expiresfinal longIn the receipt of a NodeCreate, NodeUpdate, NodeDelete, the id of the newly created node.final longThe identifier of a newly created RegisteredNode.final TransactionIdIn the receipt of a ScheduleCreate or ScheduleSign that resolves to SUCCESS, the TransactionID that should be used to query for the receipt or record of the relevant scheduled transactionfinal ScheduleIdIn the receipt of a ScheduleCreate, the id of the newly created Scheduled EntityIn the receipt of a TokenMint for tokens of type NON_FUNGIBLE_UNIQUE, the serial numbers of the newly created NFTsfinal StatusWhether the transaction succeeded or failed (or is unknown).final TokenIdThe token ID, if a new token was created.final TopicIdThe topic ID, if a new topic was created.final com.google.protobuf.ByteStringUpdated running hash for a consensus service topic.final LongUpdated sequence number for a consensus service topic.final LongIn the receipt of TokenMint, TokenWipe, TokenBurn, For fungible tokens - the current total supply of this token.final TransactionIdThe transaction's ID -
Constructor Summary
ConstructorsConstructorDescriptionTransactionReceipt(TransactionId transactionId, Status status, ExchangeRate exchangeRate, ExchangeRate nextExchangeRate, AccountId accountId, FileId fileId, ContractId contractId, TopicId topicId, TokenId tokenId, Long topicSequenceNumber, com.google.protobuf.ByteString topicRunningHash, Long totalSupply, ScheduleId scheduleId, TransactionId scheduledTransactionId, List<Long> serials, long nodeId, long registeredNodeId, List<TransactionReceipt> duplicates, List<TransactionReceipt> children) -
Method Summary
Modifier and TypeMethodDescriptionstatic TransactionReceiptfromBytes(byte[] bytes) Create a transaction receipt from a byte array.static TransactionReceiptfromProtobuf(TransactionReceipt transactionReceipt) Create a transaction receipt from a protobuf.(package private) static TransactionReceiptfromProtobuf(TransactionReceipt transactionReceipt, TransactionId transactionId) (package private) static TransactionReceiptfromProtobuf(TransactionReceipt transactionReceipt, List<TransactionReceipt> duplicates, List<TransactionReceipt> children, TransactionId transactionId) Create transaction receipt from protobuf.byte[]toBytes()Create the byte array.(package private) TransactionReceiptCreate the protobuf.toString()validateStatus(boolean shouldValidate) Validate the transaction status in the receipt.
-
Field Details
-
transactionId
The transaction's ID -
status
Whether the transaction succeeded or failed (or is unknown). -
exchangeRate
The exchange rate of Hbars to cents (USD). -
nextExchangeRate
Next exchange rate which will take effect when current rate expires -
accountId
The account ID, if a new account was created. -
fileId
The file ID, if a new file was created. -
contractId
The contract ID, if a new contract was created. -
topicId
The topic ID, if a new topic was created. -
tokenId
The token ID, if a new token was created. -
topicSequenceNumber
Updated sequence number for a consensus service topic. Set forTopicMessageSubmitTransaction. -
topicRunningHash
@Nullable public final com.google.protobuf.ByteString topicRunningHashUpdated running hash for a consensus service topic. Set forTopicMessageSubmitTransaction. -
totalSupply
In the receipt of TokenMint, TokenWipe, TokenBurn, For fungible tokens - the current total supply of this token. For non fungible tokens - the total number of NFTs issued for a given tokenID -
scheduleId
In the receipt of a ScheduleCreate, the id of the newly created Scheduled Entity -
scheduledTransactionId
In the receipt of a ScheduleCreate or ScheduleSign that resolves to SUCCESS, the TransactionID that should be used to query for the receipt or record of the relevant scheduled transaction -
serials
In the receipt of a TokenMint for tokens of type NON_FUNGIBLE_UNIQUE, the serial numbers of the newly created NFTs -
nodeId
public final long nodeIdIn the receipt of a NodeCreate, NodeUpdate, NodeDelete, the id of the newly created node. An affected node identifier.
This value SHALL be set following a `createNode` transaction.
This value SHALL be set following a `updateNode` transaction.
This value SHALL be set following a `deleteNode` transaction.
This value SHALL NOT be set following any other transaction. -
registeredNodeId
public final long registeredNodeIdThe identifier of a newly created RegisteredNode.This value SHALL be set following a `createRegisteredNode` transaction.
This value SHALL NOT be set following any other transaction.
This value SHALL be unique within a given network. -
duplicates
The receipts of processing all transactions with the given id, in consensus time order. -
children
The receipts (if any) of all child transactions spawned by the transaction with the given top-level id, in consensus order. Always empty if the top-level status is UNKNOWN.
-
-
Constructor Details
-
TransactionReceipt
TransactionReceipt(@Nullable TransactionId transactionId, Status status, ExchangeRate exchangeRate, ExchangeRate nextExchangeRate, @Nullable AccountId accountId, @Nullable FileId fileId, @Nullable ContractId contractId, @Nullable TopicId topicId, @Nullable TokenId tokenId, @Nullable Long topicSequenceNumber, @Nullable com.google.protobuf.ByteString topicRunningHash, Long totalSupply, @Nullable ScheduleId scheduleId, @Nullable TransactionId scheduledTransactionId, List<Long> serials, long nodeId, long registeredNodeId, List<TransactionReceipt> duplicates, List<TransactionReceipt> children)
-
-
Method Details
-
fromProtobuf
static TransactionReceipt fromProtobuf(TransactionReceipt transactionReceipt, List<TransactionReceipt> duplicates, List<TransactionReceipt> children, @Nullable TransactionId transactionId) Create transaction receipt from protobuf.- Parameters:
transactionReceipt- the protobufduplicates- list of duplicateschildren- list of children- Returns:
- the new transaction receipt
-
fromProtobuf
Create a transaction receipt from a protobuf.- Parameters:
transactionReceipt- the protobuf- Returns:
- the new transaction receipt
-
fromProtobuf
static TransactionReceipt fromProtobuf(TransactionReceipt transactionReceipt, @Nullable TransactionId transactionId) -
fromBytes
public static TransactionReceipt fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a transaction receipt from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new transaction receipt
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
validateStatus
Validate the transaction status in the receipt.- Parameters:
shouldValidate- Whether to perform transaction status validation- Returns:
this- Throws:
ReceiptStatusException- when shouldValidate is true and the transaction status is not SUCCESS
-
toProtobuf
TransactionReceipt toProtobuf()Create the protobuf.- Returns:
- the protobuf representation
-
toString
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-