If there is no adminKey, the only authorized update (available to anyone) is to extend the expirationTime. Otherwise transaction must be signed by the adminKey.
If an adminKey is updated, the transaction must be signed by the pre-update adminKey and post-update adminKey.
If a new autoRenewAccount is specified (not just being removed), that account must also sign the transaction.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddCustomFee(CustomFixedFee customFixedFee) Adds fixed fee to assess when a message is submitted to the new topic.addFeeExemptKey(Key feeExemptKey) Adds a key that will be exempt from paying fees.(package private) ConsensusUpdateTopicTransactionBody.Builderbuild()Build the transaction body.Clear the admin key for this topic.Clear the auto renew account ID for this topic.clearAutoRenewAccountId(AccountId autoRenewAccountId) Deprecated.Clears fixed fees.Clears all keys that will be exempt from paying fees.Clear the submit key for this topic.Clear the memo for this topic.Extract the admin key.Extract the auto renew account id.Extract the auto renew period.Returns the fixed fees to assess when a message is submitted to the new topic.Returns the keys that will be exempt from paying fees.Returns the key which allows updates to the new topic’s fees.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.Extract the submit key.Extract the topic id.Extract the topic memo.(package private) voidInitialize from the transaction body.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.setAdminKey(Key adminKey) Updated access control for modification of the topic.setAutoRenewAccountId(AccountId autoRenewAccountId) An updated ID for the account to be charged renewal fees at the topic's `expirationTime` to extend the lifetime of the topic.setAutoRenewPeriod(Duration autoRenewPeriod) setCustomFees(List<CustomFixedFee> customFees) Sets the fixed fees to assess when a message is submitted to the new topic.setExpirationTime(Duration expirationTime) setExpirationTime(Instant expirationTime) Sets the effective consensus timestamp at (and after) which all consensus transactions and queries will fail.setFeeExemptKeys(List<Key> feeExemptKeys) Sets the keys that will be exempt from paying fees.setFeeScheduleKey(Key feeScheduleKey) Sets the key which allows updates to the new topic’s fees.setSubmitKey(Key submitKey) Updated access control for message submission to the topic.setTopicId(TopicId topicId) The topic ID specifying the topic to update.setTopicMemo(String memo) An updated memo to be associated with this topic.(package private) voidvalidateChecksums(Client client) Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, freezeWith, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
TopicUpdateTransaction
public TopicUpdateTransaction()Constructor. -
TopicUpdateTransaction
TopicUpdateTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) Constructor.- Parameters:
txs- Compound list of transaction id's list of (AccountId, Transaction) records- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
TopicUpdateTransaction
TopicUpdateTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getTopicId
Extract the topic id.- Returns:
- the topic id
-
setTopicId
The topic ID specifying the topic to update.A topic with this ID MUST exist and MUST NOT be deleted.
This value is REQUIRED.- Parameters:
topicId- The TopicId to be set- Returns:
this
-
getTopicMemo
Extract the topic memo.- Returns:
- the topic memo
-
setTopicMemo
An updated memo to be associated with this topic.If this value is set, the current `adminKey` for the topic MUST sign this transaction.
This value, if set, SHALL be encoded UTF-8 and SHALL NOT exceed 100 bytes when so encoded.- Parameters:
memo- The memo to be set- Returns:
this
-
clearTopicMemo
Clear the memo for this topic.- Returns:
this
-
getAdminKey
Extract the admin key.- Returns:
- the admin key
-
setAdminKey
Updated access control for modification of the topic.If this field is set, that key and the previously set key MUST both sign this transaction.
If this value is an empty `KeyList`, the prior key MUST sign this transaction, and the topic SHALL be immutable after this transaction completes, except for expiration and renewal.- Parameters:
adminKey- The Key to be set- Returns:
this
-
clearAdminKey
Clear the admin key for this topic.- Returns:
this
-
getSubmitKey
Extract the submit key.- Returns:
- the submit key
-
setSubmitKey
Updated access control for message submission to the topic.If this value is set, the current `adminKey` for the topic MUST sign this transaction.
If this value is set to an empty `KeyList`, the `submitKey` for the topic will be unset after this transaction completes. When the `submitKey` is unset, any account may submit a message on the topic, without restriction.- Parameters:
submitKey- The Key to be set- Returns:
this
-
clearSubmitKey
Clear the submit key for this topic.- Returns:
this
-
getAutoRenewPeriod
Extract the auto renew period.- Returns:
- the auto renew period
-
setAutoRenewPeriod
-
getAutoRenewAccountId
Extract the auto renew account id.- Returns:
- the auto renew account id
-
setAutoRenewAccountId
An updated ID for the account to be charged renewal fees at the topic's `expirationTime` to extend the lifetime of the topic.If this value is set and not the "sentinel account", the referenced account MUST sign this transaction.
If this value is set, the current `adminKey` for the topic MUST sign this transaction.
If this value is set to the "sentinel account", which is `0.0.0`, the `autoRenewAccount` SHALL be removed from the topic.- Parameters:
autoRenewAccountId- The AccountId to be set for auto renewal- Returns:
this
-
clearAutoRenewAccountId
Deprecated.UseclearAutoRenewAccountId()Clear the auto renew account ID for this topic.
- Parameters:
autoRenewAccountId- The AccountId to be cleared for auto renewal- Returns:
this
-
clearAutoRenewAccountId
Clear the auto renew account ID for this topic.- Returns:
this
-
getExpirationTime
- Returns:
- Expiration time
-
setExpirationTime
Sets the effective consensus timestamp at (and after) which all consensus transactions and queries will fail. The expirationTime may be no longer than MAX_AUTORENEW_PERIOD (8000001 seconds) from the consensus timestamp of this transaction. On topics with no adminKey, extending the expirationTime is the only updateTopic option allowed on the topic.- Parameters:
expirationTime- the new expiration time- Returns:
this
-
setExpirationTime
-
getFeeScheduleKey
Returns the key which allows updates to the new topic’s fees.- Returns:
- feeScheduleKey
-
setFeeScheduleKey
Sets the key which allows updates to the new topic’s fees.- Parameters:
feeScheduleKey- the feeScheduleKey- Returns:
this
-
clearFeeScheduleKey
-
getFeeExemptKeys
Returns the keys that will be exempt from paying fees.- Returns:
- {List of feeExemptKeys}
-
setFeeExemptKeys
Sets the keys that will be exempt from paying fees.- Parameters:
feeExemptKeys- List of feeExemptKeys- Returns:
this
-
clearFeeExemptKeys
Clears all keys that will be exempt from paying fees.- Returns:
this
-
addFeeExemptKey
Adds a key that will be exempt from paying fees.- Parameters:
feeExemptKey- key- Returns:
this
-
getCustomFees
Returns the fixed fees to assess when a message is submitted to the new topic.- Returns:
- {List of CustomFixedFee}
-
setCustomFees
Sets the fixed fees to assess when a message is submitted to the new topic.- Parameters:
customFees- List of CustomFixedFee customFees- Returns:
this
-
clearCustomFees
Clears fixed fees.- Returns:
this
-
addCustomFee
Adds fixed fee to assess when a message is submitted to the new topic.- Parameters:
customFixedFee- {CustomFixedFee} customFee- Returns:
this
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
build
Build the transaction body.- Returns:
ConsensusUpdateTopicTransactionBody
-
validateChecksums
- Specified by:
validateChecksumsin classTransaction<TopicUpdateTransaction>- Throws:
BadEntityIdException
-
getMethodDescriptor
io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<TopicUpdateTransaction,Transaction, TransactionResponse, TransactionResponse>
-
onFreeze
Description copied from class:TransactionCalled inTransaction.freezeWith(Client)just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.- Specified by:
onFreezein classTransaction<TopicUpdateTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<TopicUpdateTransaction>
-
clearAutoRenewAccountId()