Class TransactionReceipt

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

public final class TransactionReceipt extends Object
The consensus result for a transaction, which might not be currently known, or may succeed or fail.
  • Field Details

    • transactionId

      @Nullable public final TransactionId transactionId
      The transaction's ID
    • status

      public final Status status
      Whether the transaction succeeded or failed (or is unknown).
    • exchangeRate

      public final ExchangeRate exchangeRate
      The exchange rate of Hbars to cents (USD).
    • nextExchangeRate

      public final ExchangeRate nextExchangeRate
      Next exchange rate which will take effect when current rate expires
    • accountId

      @Nullable public final AccountId accountId
      The account ID, if a new account was created.
    • fileId

      @Nullable public final FileId fileId
      The file ID, if a new file was created.
    • contractId

      @Nullable public final ContractId contractId
      The contract ID, if a new contract was created.
    • topicId

      @Nullable public final TopicId topicId
      The topic ID, if a new topic was created.
    • tokenId

      @Nullable public final TokenId tokenId
      The token ID, if a new token was created.
    • topicSequenceNumber

      @Nullable public final Long topicSequenceNumber
      Updated sequence number for a consensus service topic. Set for TopicMessageSubmitTransaction.
    • topicRunningHash

      @Nullable public final com.google.protobuf.ByteString topicRunningHash
      Updated running hash for a consensus service topic. Set for TopicMessageSubmitTransaction.
    • totalSupply

      public final Long 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

      @Nullable public final ScheduleId scheduleId
      In the receipt of a ScheduleCreate, the id of the newly created Scheduled Entity
    • scheduledTransactionId

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

      public final List<Long> 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 nodeId
      In 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 registeredNodeId
      The 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

      public final List<TransactionReceipt> duplicates
      The receipts of processing all transactions with the given id, in consensus time order.
    • children

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

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

      public static TransactionReceipt fromProtobuf(TransactionReceipt transactionReceipt)
      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

      public TransactionReceipt validateStatus(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

      TransactionReceipt 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