A transaction that updates the properties of an existing topic. This includes the topic memo, admin key, submit key, auto renew account, and auto renew period.
Field | Description |
Topic ID | Update the topic ID |
Admin Key | Set a new admin key that authorizes update topic and delete topic transactions. |
Submit Key | Set a new submit key for a topic that authorizes sending messages to this topic. |
Topic Memo | Set a new short publicly visible memo on the new topic and is stored with the topic. (100 bytes) |
Auto Renew Account | Set a new auto renew account ID for this topic (once autoRenew functionality is supported by HAPI). |
Auto Renew Period | Set a new auto renew period for this topic (once autoRenew functionality is supported by HAPI). |
Transaction Signing Requirements
If an adminKey is updated, the transaction must be signed by the pre-update adminKey and post-update adminKey.
If the adminKey was set during the creation of the topic, the admin key must sign the transaction to update any of the topic's properties
If no adminKey was defined during the creation of the topic, you can only extend the expirationTime.
Constructor | Description |
| Initializes the TopicUpdateTransaction object |
new TopicUpdateTransaction()
Method | Type | Requirements |
| Key | Optional |
| Key | Optional |
| Instant | Optional |
| String | Optional |
| AccountId | Optional |
| Duration | Optional |
| ​ | Optional |
| ​ | Optional |
| ​ | Optional |
| ​ | Optional |
Java//Create a transaction to add a submit keyTopicUpdateTransaction transaction = new TopicUpdateTransaction().setSubmitKey(submitKey);​//Sign the transaction with the admin key to authorize the updateTopicUpdateTransaction signTx = transaction.freezeWith(client).sign(adminKey);​//Sign the transaction with the client operator, submit to a Hedera network, get the transaction IDTransactionResponse txResponse = signTx.execute(client);​//Request the receipt of the transactionTransactionReceipt receipt = txResponse.getReceipt(client);​//Get the transaction consensus statusStatus transactionStatus = receipt.status;​System.out.println("The transaction consensus status is " +transactionStatus);​//v2.0.0
JavaScript//Create a transaction to add a submit keyconst transaction = await new TopicUpdateTransaction().setSubmitKey(submitKey.freezeWith(client);​//Sign the transaction with the admin key to authorize the updateconst signTx = await transaction.sign(adminKey);//Sign with the client operator private key and submit to a Hedera networkconst txResponse = await signTx.execute(client);​//Request the receipt of the transactionconst receipt = await txResponse.getReceipt(client);​//Get the transaction consensus statusconst transactionStatus = receipt.status;​console.log("The transaction consensus status is " +transactionStatus);​//v2.0.0
Go//Create the transactiontransaction := hedera.NewTopicUpdateTransaction()SetTopicMemo("new memo)​//Sign with the client operator private key and submit the transaction to a Hedera networktxResponse, err := transaction.FreezeWith(client).Sign(adminkey)Execute(client)​if err != nil {panic(err)}​//Request the receipt of the transactionreceipt, err := txResponse.GetReceipt(client)​if err != nil {panic(err)}​//Get the transaction consensus statustransactionStatus := receipt.Status​fmt.Printf("The transaction consensus status is %v\n", transactionStatus)//v2.0.0
Constructor | Description |
| Initializes the ConsensusTopicUpdateTransaction object |
new ConsensusTopicUpdateTransaction()
Method | Type | Requirements |
| TopicId | Required |
| Key | Optional |
| Key | Optional |
| Instant | Optional |
| String | Optional |
| AccountId | Optional |
| Duration | Optional |
| ​ | Optional |
| ​ | Optional |
| ​ | Optional |
| ​ | Optional |
Java//Create a transaction to add a submit keyConsensusTopicUpdateTransaction transaction = new ConsensusTopicUpdateTransaction().setSubmitKey(submitKey);​//Sign the transaction with the admin key to authorize the updateConsensusTopicUpdateTransaction signTx = transaction.build(client).sign(adminKey);​//Sign the transaction with the client operator, submit to a Hedera network, get the transaction IDTransactionId txId = signTx.execute(client);​//Request the receipt of the transactionTransactionReceipt receipt = txId.getReceipt(client);​//Get the transaction consensus statusStatus transactionStatus = receipt.status;​System.out.println("The transaction consensus status is " +transactionStatus);​//v1.3.2
JavaScript//Create a transaction to add a submit keyconst transaction = await new ConsensusTopicUpdateTransaction().setSubmitKey(submitKey).build(client);​//Sign the transaction with the admin key to authorize the updateconst signTx = await transaction.sign(adminKey);​//Sign the transaction with the client operator, submit to a Hedera network, get the transaction IDconst txId = await signTx.execute(client);​//Request the receipt of the transactionconst receipt = await txId.getReceipt(client);​//Get the transaction consensus statusconst transactionStatus = receipt.status;​console.log("The transaction consensus status is " +transactionStatus);​//v1.4.4
Method | Type | Requirements |
| TopicId | Optional |
| Key | Optional |
| Key | Optional |
| String | Optional |
| AccountId | Disabled |
| Duration | Disabled |
Java//Create a transaction to add a submit keyTopicUpdateTransaction transaction = new TopicUpdateTransaction().setSubmitKey(submitKey);​//Get submit keytransaction.getSubmitKey()​//v2.0.0
JavaScript//Create a transaction to add a submit keyconst transaction = new TopicUpdateTransaction().setSubmitKey(submitKey);​//Get submit keytransaction.getSubmitKey()​//v2.0.0
Go//Create the transactiontransaction := hedera.NewTopicUpdateTransaction()SetSubmitKey()​transaction := transaction.GetSubmitKey()​//v2.0.0