java.lang.Object
com.hedera.hashgraph.sdk.TransactionRecord
The complete record for a transaction on Hedera that has reached consensus.
This is not-free to request and is available for 1 hour after a transaction reaches consensus.
A TransactionReceipt can be thought of as a light-weight record which is free to ask for if you just
need what it contains. A receipt however lasts for only 180 seconds.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal PublicKeyIn the record of an internal CryptoCreate transaction triggered by a user transaction with a (previously unused) alias, the new account's alias.final List<AssessedCustomFee> All custom fees that were assessed during a CryptoTransfer, and must be paid if the transaction status resolved to SUCCESSfinal List<TokenAssociation> All token associations implicitly created while handling this transactionfinal List<TransactionRecord> The records of processing all child transaction spawned by the transaction with the given top-level id, in consensus order.final InstantThe consensus timestamp (or null if didn't reach consensus yet).final ContractFunctionResultRecord of the value returned by the smart contract function or constructor.final List<TransactionRecord> The records of processing all consensus transaction with the same id as the distinguished record above, in chronological order.final com.google.protobuf.ByteStringThe keccak256 hash of the ethereumData.final com.google.protobuf.ByteStringThe new default EVM address of the account created by this transaction.final List<HbarAllowance> Deprecated.final longA pricing multiplier for high-volume entity creation.List of accounts with the corresponding staking rewards paid as a result of a transaction.final InstantIn the record of an internal transaction, the consensus timestamp of the user transaction that spawned it.final List<PendingAirdropRecord> A list of pending token airdrops.final com.google.protobuf.ByteStringIn the record of a UtilPrng transaction with no output range, a pseudorandom 384-bit string.final IntegerIn the record of a PRNG transaction with an output range, the output of a PRNG whose input was a 384-bit string.final TransactionReceiptThe status (reach consensus, or failed, or is unknown) and the ID of any new account/file/instance created.final ScheduleIdReference to the scheduled transaction ID that this transaction record representsfinal List<TokenAllowance> Deprecated.final List<TokenNftAllowance> Deprecated.final Map<TokenId, List<TokenNftTransfer>> All NFT Token transfers as a result of this transactionfinal List<TokenTransfer> All fungible token transfers as a result of this transaction as a listAll fungible token transfers as a result of this transaction as a mapfinal HbarThe actual transaction fee charged, not the original transactionFee value from TransactionBody.final com.google.protobuf.ByteStringThe hash of the Transaction that executed (not the hash of any Transaction that failed for having a duplicate TransactionID).final TransactionIdThe ID of the transaction this record represents.final StringThe memo that was submitted as part of the transaction (max 100 bytes).All hbar transfers as a result of this transaction, such as fees, or transfers performed by the transaction, or by a smart contract it calls, or by the creation of threshold records that it triggers. -
Constructor Summary
ConstructorsConstructorDescriptionTransactionRecord(TransactionReceipt transactionReceipt, com.google.protobuf.ByteString transactionHash, Instant consensusTimestamp, TransactionId transactionId, String transactionMemo, long transactionFee, ContractFunctionResult contractFunctionResult, List<Transfer> transfers, Map<TokenId, Map<AccountId, Long>> tokenTransfers, List<TokenTransfer> tokenTransferList, Map<TokenId, List<TokenNftTransfer>> tokenNftTransfers, ScheduleId scheduleRef, List<AssessedCustomFee> assessedCustomFees, List<TokenAssociation> automaticTokenAssociations, PublicKey aliasKey, List<TransactionRecord> children, List<TransactionRecord> duplicates, Instant parentConsensusTimestamp, com.google.protobuf.ByteString ethereumHash, List<Transfer> paidStakingRewards, com.google.protobuf.ByteString prngBytes, Integer prngNumber, com.google.protobuf.ByteString evmAddress, List<PendingAirdropRecord> pendingAirdropRecords, long highVolumePricingMultiplier) -
Method Summary
Modifier and TypeMethodDescriptionstatic TransactionRecordfromBytes(byte[] bytes) Create a transaction record from a byte array.(package private) static TransactionRecordfromProtobuf(TransactionRecord transactionRecord) Create a transaction record from a protobuf.(package private) static TransactionRecordfromProtobuf(TransactionRecord transactionRecord, List<TransactionRecord> children, List<TransactionRecord> duplicates, TransactionId transactionId) Create a transaction record from a protobuf.byte[]toBytes()Create the byte array.(package private) TransactionRecordCreate the protobuf.toString()validateReceiptStatus(boolean shouldValidate) Validate the transaction status in the receipt.
-
Field Details
-
receipt
The status (reach consensus, or failed, or is unknown) and the ID of any new account/file/instance created. -
transactionHash
public final com.google.protobuf.ByteString transactionHashThe hash of the Transaction that executed (not the hash of any Transaction that failed for having a duplicate TransactionID). -
consensusTimestamp
The consensus timestamp (or null if didn't reach consensus yet). -
transactionId
The ID of the transaction this record represents. -
transactionMemo
The memo that was submitted as part of the transaction (max 100 bytes). -
transactionFee
The actual transaction fee charged, not the original transactionFee value from TransactionBody. -
contractFunctionResult
Record of the value returned by the smart contract function or constructor. -
transfers
All hbar transfers as a result of this transaction, such as fees, or transfers performed by the transaction, or by a smart contract it calls, or by the creation of threshold records that it triggers. -
tokenTransfers
All fungible token transfers as a result of this transaction as a map -
tokenTransferList
All fungible token transfers as a result of this transaction as a list -
tokenNftTransfers
All NFT Token transfers as a result of this transaction -
scheduleRef
Reference to the scheduled transaction ID that this transaction record represents -
assessedCustomFees
All custom fees that were assessed during a CryptoTransfer, and must be paid if the transaction status resolved to SUCCESS -
automaticTokenAssociations
All token associations implicitly created while handling this transaction -
aliasKey
In the record of an internal CryptoCreate transaction triggered by a user transaction with a (previously unused) alias, the new account's alias. -
children
The records of processing all child transaction spawned by the transaction with the given top-level id, in consensus order. Always empty if the top-level status is UNKNOWN. -
duplicates
The records of processing all consensus transaction with the same id as the distinguished record above, in chronological order. -
parentConsensusTimestamp
In the record of an internal transaction, the consensus timestamp of the user transaction that spawned it. -
ethereumHash
public final com.google.protobuf.ByteString ethereumHashThe keccak256 hash of the ethereumData. This field will only be populated for EthereumTransaction. -
hbarAllowanceAdjustments
Deprecated.An approved allowance of hbar transfers for a spender -
tokenAllowanceAdjustments
Deprecated.An approved allowance of token transfers for a spender -
tokenNftAllowanceAdjustments
Deprecated.An approved allowance of NFT transfers for a spender -
paidStakingRewards
List of accounts with the corresponding staking rewards paid as a result of a transaction. -
prngBytes
@Nullable public final com.google.protobuf.ByteString prngBytesIn the record of a UtilPrng transaction with no output range, a pseudorandom 384-bit string. -
prngNumber
In the record of a PRNG transaction with an output range, the output of a PRNG whose input was a 384-bit string. -
evmAddress
public final com.google.protobuf.ByteString evmAddressThe new default EVM address of the account created by this transaction. This field is populated only when the EVM address is not specified in the related transaction body. -
pendingAirdropRecords
A list of pending token airdrops. Each pending airdrop represents a single requested transfer from a sending account to a recipient account. These pending transfers are issued unilaterally by the sending account, and MUST be claimed by the recipient account before the transfer MAY complete. A sender MAY cancel a pending airdrop before it is claimed. An airdrop transaction SHALL emit a pending airdrop when the recipient has no available automatic association slots available or when the recipient has set `receiver_sig_required`. -
highVolumePricingMultiplier
public final long highVolumePricingMultiplierA pricing multiplier for high-volume entity creation.If the transaction that produced this record was flagged as high-volume, this field SHALL contain the pricing multiplier applied to the transaction fee.
If the transaction was not flagged as high-volume, this field SHALL be zero.
-
-
Constructor Details
-
TransactionRecord
TransactionRecord(TransactionReceipt transactionReceipt, com.google.protobuf.ByteString transactionHash, Instant consensusTimestamp, TransactionId transactionId, String transactionMemo, long transactionFee, @Nullable ContractFunctionResult contractFunctionResult, List<Transfer> transfers, Map<TokenId, Map<AccountId, Long>> tokenTransfers, List<TokenTransfer> tokenTransferList, Map<TokenId, List<TokenNftTransfer>> tokenNftTransfers, @Nullable ScheduleId scheduleRef, List<AssessedCustomFee> assessedCustomFees, List<TokenAssociation> automaticTokenAssociations, @Nullable PublicKey aliasKey, List<TransactionRecord> children, List<TransactionRecord> duplicates, @Nullable Instant parentConsensusTimestamp, com.google.protobuf.ByteString ethereumHash, List<Transfer> paidStakingRewards, @Nullable com.google.protobuf.ByteString prngBytes, @Nullable Integer prngNumber, com.google.protobuf.ByteString evmAddress, List<PendingAirdropRecord> pendingAirdropRecords, long highVolumePricingMultiplier)
-
-
Method Details
-
fromProtobuf
static TransactionRecord fromProtobuf(TransactionRecord transactionRecord, List<TransactionRecord> children, List<TransactionRecord> duplicates, @Nullable TransactionId transactionId) Create a transaction record from a protobuf.- Parameters:
transactionRecord- the protobufchildren- the list of childrenduplicates- the list of duplicates- Returns:
- the new transaction record
-
fromProtobuf
Create a transaction record from a protobuf.- Parameters:
transactionRecord- the protobuf- Returns:
- the new transaction record
-
fromBytes
public static TransactionRecord fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a transaction record from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new transaction record
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
validateReceiptStatus
public TransactionRecord validateReceiptStatus(boolean shouldValidate) throws ReceiptStatusException 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
TransactionRecord toProtobuf()Create the protobuf.- Returns:
- the protobuf representation
-
toString
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-