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-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescription* An Account identifier.* An identifier for an internal transaction.<br/> An internal transaction is one that was spawned as part of handling a user transaction.* A scheduled transaction flag.<br/> If set, this transaction represents the execution of a Schedule after all necessary signatures are gathered.* A timestamp for the transaction start time.<br/> This is the earliest expected start time for this transaction.* An Account identifier.intgetNonce()* An identifier for an internal transaction.<br/> An internal transaction is one that was spawned as part of handling a user transaction.boolean* A scheduled transaction flag.<br/> If set, this transaction represents the execution of a Schedule after all necessary signatures are gathered.* A timestamp for the transaction start time.<br/> This is the earliest expected start time for this transaction.boolean* An Account identifier.boolean* A timestamp for the transaction start time.<br/> This is the earliest expected start time for this transaction.mergeAccountID(AccountID value) * An Account identifier.* A timestamp for the transaction start time.<br/> This is the earliest expected start time for this transaction.setAccountID(AccountID value) * An Account identifier.setAccountID(AccountID.Builder builderForValue) * An Account identifier.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.setScheduled(boolean value) * A scheduled transaction flag.<br/> If set, this transaction represents the execution of a Schedule after all necessary signatures are gathered.* A timestamp for the transaction start time.<br/> This is the earliest expected start time for this transaction.setTransactionValidStart(Timestamp.Builder builderForValue) * A timestamp for the transaction start time.<br/> This is the earliest expected start time for this transaction.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
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:
hasTransactionValidStartin interfaceTransactionIDOrBuilder- Returns:
- Whether the transactionValidStart field is set.
-
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:
getTransactionValidStartin interfaceTransactionIDOrBuilder- Returns:
- The transactionValidStart.
-
setTransactionValidStart
* 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
* 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
* 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
* 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:
hasAccountIDin interfaceTransactionIDOrBuilder- Returns:
- Whether the accountID field is set.
-
getAccountID
* An Account identifier. <p> The identified account SHALL pay transaction fees for this transaction.
.proto.AccountID accountID = 2;- Specified by:
getAccountIDin interfaceTransactionIDOrBuilder- Returns:
- The accountID.
-
setAccountID
* An Account identifier. <p> The identified account SHALL pay transaction fees for this transaction.
.proto.AccountID accountID = 2; -
setAccountID
* An Account identifier. <p> The identified account SHALL pay transaction fees for this transaction.
.proto.AccountID accountID = 2; -
mergeAccountID
* An Account identifier. <p> The identified account SHALL pay transaction fees for this transaction.
.proto.AccountID accountID = 2; -
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:
getScheduledin interfaceTransactionIDOrBuilder- Returns:
- The scheduled.
-
setScheduled
* 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
* 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:
getNoncein interfaceTransactionIDOrBuilder- Returns:
- The nonce.
-
setNonce
* 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
* 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.
-