Class TopicUpdateTransaction


public final class TopicUpdateTransaction extends Transaction<TopicUpdateTransaction>
Update a topic.

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.

  • Constructor Details

    • TopicUpdateTransaction

      public TopicUpdateTransaction()
      Constructor.
    • TopicUpdateTransaction

      TopicUpdateTransaction(LinkedHashMap<TransactionId,LinkedHashMap<AccountId,Transaction>> txs) throws com.google.protobuf.InvalidProtocolBufferException
      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

      @Nullable public TopicId getTopicId()
      Extract the topic id.
      Returns:
      the topic id
    • setTopicId

      public TopicUpdateTransaction setTopicId(TopicId topicId)
      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

      @Nullable public String getTopicMemo()
      Extract the topic memo.
      Returns:
      the topic memo
    • setTopicMemo

      public TopicUpdateTransaction setTopicMemo(String memo)
      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

      public TopicUpdateTransaction clearTopicMemo()
      Clear the memo for this topic.
      Returns:
      this
    • getAdminKey

      @Nullable public Key getAdminKey()
      Extract the admin key.
      Returns:
      the admin key
    • setAdminKey

      public TopicUpdateTransaction setAdminKey(Key adminKey)
      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

      public TopicUpdateTransaction clearAdminKey()
      Clear the admin key for this topic.
      Returns:
      this
    • getSubmitKey

      @Nullable public Key getSubmitKey()
      Extract the submit key.
      Returns:
      the submit key
    • setSubmitKey

      public TopicUpdateTransaction setSubmitKey(Key submitKey)
      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

      public TopicUpdateTransaction clearSubmitKey()
      Clear the submit key for this topic.
      Returns:
      this
    • getAutoRenewPeriod

      @Nullable public Duration getAutoRenewPeriod()
      Extract the auto renew period.
      Returns:
      the auto renew period
    • setAutoRenewPeriod

      public TopicUpdateTransaction setAutoRenewPeriod(Duration autoRenewPeriod)
    • getAutoRenewAccountId

      @Nullable public AccountId getAutoRenewAccountId()
      Extract the auto renew account id.
      Returns:
      the auto renew account id
    • setAutoRenewAccountId

      public TopicUpdateTransaction 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.

      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 public TopicUpdateTransaction clearAutoRenewAccountId(AccountId autoRenewAccountId)
      Deprecated.
      Use clearAutoRenewAccountId()

      Clear the auto renew account ID for this topic.

      Parameters:
      autoRenewAccountId - The AccountId to be cleared for auto renewal
      Returns:
      this
    • clearAutoRenewAccountId

      public TopicUpdateTransaction clearAutoRenewAccountId()
      Clear the auto renew account ID for this topic.
      Returns:
      this
    • getExpirationTime

      @Nullable public Instant getExpirationTime()
      Returns:
      Expiration time
    • setExpirationTime

      public TopicUpdateTransaction setExpirationTime(Instant expirationTime)
      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

      public TopicUpdateTransaction setExpirationTime(Duration expirationTime)
    • getFeeScheduleKey

      public Key getFeeScheduleKey()
      Returns the key which allows updates to the new topic’s fees.
      Returns:
      feeScheduleKey
    • setFeeScheduleKey

      public TopicUpdateTransaction setFeeScheduleKey(Key feeScheduleKey)
      Sets the key which allows updates to the new topic’s fees.
      Parameters:
      feeScheduleKey - the feeScheduleKey
      Returns:
      this
    • clearFeeScheduleKey

      public TopicUpdateTransaction clearFeeScheduleKey()
    • getFeeExemptKeys

      public List<Key> getFeeExemptKeys()
      Returns the keys that will be exempt from paying fees.
      Returns:
      {List of feeExemptKeys}
    • setFeeExemptKeys

      public TopicUpdateTransaction setFeeExemptKeys(List<Key> feeExemptKeys)
      Sets the keys that will be exempt from paying fees.
      Parameters:
      feeExemptKeys - List of feeExemptKeys
      Returns:
      this
    • clearFeeExemptKeys

      public TopicUpdateTransaction clearFeeExemptKeys()
      Clears all keys that will be exempt from paying fees.
      Returns:
      this
    • addFeeExemptKey

      public TopicUpdateTransaction addFeeExemptKey(Key feeExemptKey)
      Adds a key that will be exempt from paying fees.
      Parameters:
      feeExemptKey - key
      Returns:
      this
    • getCustomFees

      public List<CustomFixedFee> getCustomFees()
      Returns the fixed fees to assess when a message is submitted to the new topic.
      Returns:
      {List of CustomFixedFee}
    • setCustomFees

      public TopicUpdateTransaction setCustomFees(List<CustomFixedFee> customFees)
      Sets the fixed fees to assess when a message is submitted to the new topic.
      Parameters:
      customFees - List of CustomFixedFee customFees
      Returns:
      this
    • clearCustomFees

      public TopicUpdateTransaction clearCustomFees()
      Clears fixed fees.
      Returns:
      this
    • addCustomFee

      public TopicUpdateTransaction addCustomFee(CustomFixedFee customFixedFee)
      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

      void validateChecksums(Client client) throws BadEntityIdException
      Specified by:
      validateChecksums in class Transaction<TopicUpdateTransaction>
      Throws:
      BadEntityIdException
    • getMethodDescriptor

      io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()
      Description copied from class: Executable
      Called to direct the invocation of the query to the appropriate gRPC service.
      Specified by:
      getMethodDescriptor in class Executable<TopicUpdateTransaction,Transaction,TransactionResponse,TransactionResponse>
    • onFreeze

      void onFreeze(TransactionBody.Builder bodyBuilder)
      Description copied from class: Transaction
      Called in Transaction.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:
      onFreeze in class Transaction<TopicUpdateTransaction>
    • onScheduled

      void onScheduled(SchedulableTransactionBody.Builder scheduled)
      Description copied from class: Transaction
      Called in Transaction.schedule() when converting transaction into a scheduled version.
      Specified by:
      onScheduled in class Transaction<TopicUpdateTransaction>