Update a topic

A transaction that updates the properties of an existing topic. This includes the topic memo, admin key, submit key, auto-renew account, and auto rauto-renewenew period.

Topic Properties

Transaction Signing Requirements

  • If an admin key is updated, the transaction must be signed by the pre-update admin key and post-update admin key.

  • If the admin key 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.

Transaction Fees

  • Please see the transaction and query fees table for the base transaction fee

  • Please use the Hedera fee estimator to estimate your transaction fee cost

Methods

 //Create a transaction to add a submit key
TopicUpdateTransaction transaction = new TopicUpdateTransaction()
    .setTopicId(topicId)
    .setSubmitKey(submitKey);

//Sign the transaction with the admin key to authorize the update
TopicUpdateTransaction signTx = transaction.freezeWith(client).sign(adminKey);

//Sign the transaction with the client operator, submit to a Hedera network, get the transaction ID
TransactionResponse txResponse = signTx.execute(client);

//Request the receipt of the transaction
TransactionReceipt receipt = txResponse.getReceipt(client);

//Get the transaction consensus status
Status transactionStatus = receipt.status;

System.out.println("The transaction consensus status is " +transactionStatus);

//v2.0.0

Get transaction values

 //Create a transaction to add a submit key
TopicUpdateTransaction transaction = new TopicUpdateTransaction()
    .setSubmitKey(submitKey);

//Get submit key
transaction.getSubmitKey()

//v2.0.0

Last updated