Class TransactionRecord

java.lang.Object
com.hedera.hashgraph.sdk.TransactionRecord

public final class TransactionRecord extends Object
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 Details

    • receipt

      public final TransactionReceipt 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 transactionHash
      The hash of the Transaction that executed (not the hash of any Transaction that failed for having a duplicate TransactionID).
    • consensusTimestamp

      public final Instant consensusTimestamp
      The consensus timestamp (or null if didn't reach consensus yet).
    • transactionId

      public final TransactionId transactionId
      The ID of the transaction this record represents.
    • transactionMemo

      public final String transactionMemo
      The memo that was submitted as part of the transaction (max 100 bytes).
    • transactionFee

      public final Hbar transactionFee
      The actual transaction fee charged, not the original transactionFee value from TransactionBody.
    • contractFunctionResult

      @Nullable public final ContractFunctionResult contractFunctionResult
      Record of the value returned by the smart contract function or constructor.
    • transfers

      public final List<Transfer> 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

      public final Map<TokenId,Map<AccountId,Long>> tokenTransfers
      All fungible token transfers as a result of this transaction as a map
    • tokenTransferList

      public final List<TokenTransfer> tokenTransferList
      All fungible token transfers as a result of this transaction as a list
    • tokenNftTransfers

      public final Map<TokenId,List<TokenNftTransfer>> tokenNftTransfers
      All NFT Token transfers as a result of this transaction
    • scheduleRef

      @Nullable public final ScheduleId scheduleRef
      Reference to the scheduled transaction ID that this transaction record represents
    • assessedCustomFees

      public final List<AssessedCustomFee> assessedCustomFees
      All custom fees that were assessed during a CryptoTransfer, and must be paid if the transaction status resolved to SUCCESS
    • automaticTokenAssociations

      public final List<TokenAssociation> automaticTokenAssociations
      All token associations implicitly created while handling this transaction
    • aliasKey

      @Nullable public final PublicKey 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

      public final List<TransactionRecord> 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

      public final List<TransactionRecord> duplicates
      The records of processing all consensus transaction with the same id as the distinguished record above, in chronological order.
    • parentConsensusTimestamp

      @Nullable public final Instant 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 ethereumHash
      The keccak256 hash of the ethereumData. This field will only be populated for EthereumTransaction.
    • hbarAllowanceAdjustments

      @Deprecated public final List<HbarAllowance> hbarAllowanceAdjustments
      Deprecated.
      An approved allowance of hbar transfers for a spender
    • tokenAllowanceAdjustments

      @Deprecated public final List<TokenAllowance> tokenAllowanceAdjustments
      Deprecated.
      An approved allowance of token transfers for a spender
    • tokenNftAllowanceAdjustments

      @Deprecated public final List<TokenNftAllowance> tokenNftAllowanceAdjustments
      Deprecated.
      An approved allowance of NFT transfers for a spender
    • paidStakingRewards

      public final List<Transfer> paidStakingRewards
      List of accounts with the corresponding staking rewards paid as a result of a transaction.
    • prngBytes

      @Nullable public final com.google.protobuf.ByteString prngBytes
      In the record of a UtilPrng transaction with no output range, a pseudorandom 384-bit string.
    • prngNumber

      @Nullable public final Integer 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 evmAddress
      The 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

      public final List<PendingAirdropRecord> 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 highVolumePricingMultiplier
      A 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

  • 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 protobuf
      children - the list of children
      duplicates - the list of duplicates
      Returns:
      the new transaction record
    • fromProtobuf

      static TransactionRecord fromProtobuf(TransactionRecord transactionRecord)
      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

      public String toString()
      Overrides:
      toString in class Object
    • toBytes

      public byte[] toBytes()
      Create the byte array.
      Returns:
      the byte array representation