Class TransactionID.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<TransactionID,TransactionID.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<TransactionID,TransactionID.Builder>
com.hedera.hashgraph.sdk.proto.TransactionID.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, TransactionIDOrBuilder, Cloneable
Enclosing class:
TransactionID

public static final class TransactionID.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<TransactionID,TransactionID.Builder> implements TransactionIDOrBuilder
 *
 A transaction identifier.<br/>
 This is used for retrieving receipts and records for a transaction
 and internally by the network for detecting when duplicate transactions are
 submitted.

 A transaction may be processed more reliably by submitting it to
 several nodes, each with a different node account, but all with the same
 TransactionID. Then, the transaction will take effect when the first of all
 those nodes submits the transaction and it reaches consensus. The other
 transactions SHALL NOT be executed (and SHALL result in a
 `DUPLICATE_TRANSACTION` response).<br/>
 Multiple submission increase reliability on the assumption that an error in,
 for example, network connectivity will not affect all nodes equally. Latency
 might be slightly lower, if one node is handling intake significantly slower
 than others, for example. The base transaction fee is required for each
 submission, however, so the total fees charged are significantly higher when
 using this approach.

 ### Requirements
 Each transaction identifier MUST be unique.<br/>
 Multiple transactions MAY be submitted with the same transaction
 identifier, but all except the first SHALL be rejected as duplicate
 transactions.<br/>
 An identifier MUST specify a `payer` account to be charged all fees
 associated with the transaction.<br/>
 The `payer` account MUST exist and MUST have sufficient HBAR to pay all
 transaction fees.<br/>
 An identifier MUST specify a "valid start time".<br/>
 The "valid start time" MUST be strictly _earlier_ than the current
 network consensus time when submitted.<br/>
 The "valid start time" MUST NOT be more than `transaction.maxValidDuration`
 seconds before the current network consensus time when submitted.<br/>
 A client-submitted transaction MUST NOT set the `scheduled` flag.

 ### Additional Notes

 Additional items applicable to Scheduled Transactions:

 - The ID of a Scheduled Transaction, once executed, SHALL inherit both
 `transactionValidStart` and `accountID` from the `ScheduleCreate`
 transaction that created the schedule.
 - The `scheduled` property SHALL be set for Scheduled Transactions.
 
Protobuf type proto.TransactionID
  • Method Details

    • hasTransactionValidStart

      public boolean hasTransactionValidStart()
       *
       A timestamp for the transaction start time.<br/>
       This is the earliest expected start time for this transaction.
       <p>
       This value MUST be strictly less than `consensusTimestamp` when the
       transaction is submitted.
       
      .proto.Timestamp transactionValidStart = 1;
      Specified by:
      hasTransactionValidStart in interface TransactionIDOrBuilder
      Returns:
      Whether the transactionValidStart field is set.
    • getTransactionValidStart

      public Timestamp getTransactionValidStart()
       *
       A timestamp for the transaction start time.<br/>
       This is the earliest expected start time for this transaction.
       <p>
       This value MUST be strictly less than `consensusTimestamp` when the
       transaction is submitted.
       
      .proto.Timestamp transactionValidStart = 1;
      Specified by:
      getTransactionValidStart in interface TransactionIDOrBuilder
      Returns:
      The transactionValidStart.
    • setTransactionValidStart

      public TransactionID.Builder setTransactionValidStart(Timestamp value)
       *
       A timestamp for the transaction start time.<br/>
       This is the earliest expected start time for this transaction.
       <p>
       This value MUST be strictly less than `consensusTimestamp` when the
       transaction is submitted.
       
      .proto.Timestamp transactionValidStart = 1;
    • setTransactionValidStart

      public TransactionID.Builder setTransactionValidStart(Timestamp.Builder builderForValue)
       *
       A timestamp for the transaction start time.<br/>
       This is the earliest expected start time for this transaction.
       <p>
       This value MUST be strictly less than `consensusTimestamp` when the
       transaction is submitted.
       
      .proto.Timestamp transactionValidStart = 1;
    • mergeTransactionValidStart

      public TransactionID.Builder mergeTransactionValidStart(Timestamp value)
       *
       A timestamp for the transaction start time.<br/>
       This is the earliest expected start time for this transaction.
       <p>
       This value MUST be strictly less than `consensusTimestamp` when the
       transaction is submitted.
       
      .proto.Timestamp transactionValidStart = 1;
    • clearTransactionValidStart

      public TransactionID.Builder clearTransactionValidStart()
       *
       A timestamp for the transaction start time.<br/>
       This is the earliest expected start time for this transaction.
       <p>
       This value MUST be strictly less than `consensusTimestamp` when the
       transaction is submitted.
       
      .proto.Timestamp transactionValidStart = 1;
    • hasAccountID

      public boolean hasAccountID()
       *
       An Account identifier.
       <p>
       The identified account SHALL pay transaction fees for this transaction.
       
      .proto.AccountID accountID = 2;
      Specified by:
      hasAccountID in interface TransactionIDOrBuilder
      Returns:
      Whether the accountID field is set.
    • getAccountID

      public AccountID getAccountID()
       *
       An Account identifier.
       <p>
       The identified account SHALL pay transaction fees for this transaction.
       
      .proto.AccountID accountID = 2;
      Specified by:
      getAccountID in interface TransactionIDOrBuilder
      Returns:
      The accountID.
    • setAccountID

      public TransactionID.Builder setAccountID(AccountID value)
       *
       An Account identifier.
       <p>
       The identified account SHALL pay transaction fees for this transaction.
       
      .proto.AccountID accountID = 2;
    • setAccountID

      public TransactionID.Builder setAccountID(AccountID.Builder builderForValue)
       *
       An Account identifier.
       <p>
       The identified account SHALL pay transaction fees for this transaction.
       
      .proto.AccountID accountID = 2;
    • mergeAccountID

      public TransactionID.Builder mergeAccountID(AccountID value)
       *
       An Account identifier.
       <p>
       The identified account SHALL pay transaction fees for this transaction.
       
      .proto.AccountID accountID = 2;
    • clearAccountID

      public TransactionID.Builder clearAccountID()
       *
       An Account identifier.
       <p>
       The identified account SHALL pay transaction fees for this transaction.
       
      .proto.AccountID accountID = 2;
    • getScheduled

      public boolean getScheduled()
       *
       A scheduled transaction flag.<br/>
       If set, this transaction represents the execution of a Schedule after
       all necessary signatures are gathered.
       <p>
       This flag MUST NOT be set in a user-submitted transaction.
       
      bool scheduled = 3;
      Specified by:
      getScheduled in interface TransactionIDOrBuilder
      Returns:
      The scheduled.
    • setScheduled

      public TransactionID.Builder setScheduled(boolean value)
       *
       A scheduled transaction flag.<br/>
       If set, this transaction represents the execution of a Schedule after
       all necessary signatures are gathered.
       <p>
       This flag MUST NOT be set in a user-submitted transaction.
       
      bool scheduled = 3;
      Parameters:
      value - The scheduled to set.
      Returns:
      This builder for chaining.
    • clearScheduled

      public TransactionID.Builder clearScheduled()
       *
       A scheduled transaction flag.<br/>
       If set, this transaction represents the execution of a Schedule after
       all necessary signatures are gathered.
       <p>
       This flag MUST NOT be set in a user-submitted transaction.
       
      bool scheduled = 3;
      Returns:
      This builder for chaining.
    • getNonce

      public int getNonce()
       *
       An identifier for an internal transaction.<br/>
       An internal transaction is one that was spawned as part of handling a
       user transaction. These internal transactions share the
       transactionValidStart and accountID of the user transaction, so a nonce
       is necessary to give them a unique TransactionID.
       <p>
       An example is when a "parent" ContractCreate or ContractCall transaction
       calls one or more HTS precompiled contracts; each of the "child"
       transactions spawned for a precompile has a transaction id with a
       different nonce.
       <p>
       This value MUST be unset for user-submitted transactions.
       
      int32 nonce = 4;
      Specified by:
      getNonce in interface TransactionIDOrBuilder
      Returns:
      The nonce.
    • setNonce

      public TransactionID.Builder setNonce(int value)
       *
       An identifier for an internal transaction.<br/>
       An internal transaction is one that was spawned as part of handling a
       user transaction. These internal transactions share the
       transactionValidStart and accountID of the user transaction, so a nonce
       is necessary to give them a unique TransactionID.
       <p>
       An example is when a "parent" ContractCreate or ContractCall transaction
       calls one or more HTS precompiled contracts; each of the "child"
       transactions spawned for a precompile has a transaction id with a
       different nonce.
       <p>
       This value MUST be unset for user-submitted transactions.
       
      int32 nonce = 4;
      Parameters:
      value - The nonce to set.
      Returns:
      This builder for chaining.
    • clearNonce

      public TransactionID.Builder clearNonce()
       *
       An identifier for an internal transaction.<br/>
       An internal transaction is one that was spawned as part of handling a
       user transaction. These internal transactions share the
       transactionValidStart and accountID of the user transaction, so a nonce
       is necessary to give them a unique TransactionID.
       <p>
       An example is when a "parent" ContractCreate or ContractCall transaction
       calls one or more HTS precompiled contracts; each of the "child"
       transactions spawned for a precompile has a transaction id with a
       different nonce.
       <p>
       This value MUST be unset for user-submitted transactions.
       
      int32 nonce = 4;
      Returns:
      This builder for chaining.