Class TokenWipeTransaction


public class TokenWipeTransaction extends Transaction<TokenWipeTransaction>
Wipe (administratively burn) tokens held by a non-treasury account.
On success, the requested tokens will be removed from the identified account and the token supply will be reduced by the amount "wiped". This transaction MUST be signed by the token `wipe_key`.
The identified token MUST exist, MUST NOT be deleted, and MUST NOT be paused.
The identified token MUST have a valid `Key` set for the `wipe_key` field, and that key MUST NOT be an empty `KeyList`.
The identified account MUST exist, MUST NOT be deleted, MUST be associated to the identified token, MUST NOT be frozen for the identified token, MUST NOT be the token `treasury`, and MUST hold a balance for the token or the specific serial numbers provided.
This transaction SHOULD provide a value for `amount` or `serialNumbers`, but MUST NOT set both fields. ### Block Stream Effects The new total supply for the wiped token type SHALL be recorded.
  • Constructor Details

    • TokenWipeTransaction

      public TokenWipeTransaction()
      Constructor.
    • TokenWipeTransaction

      TokenWipeTransaction(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
    • TokenWipeTransaction

      TokenWipeTransaction(TransactionBody txBody)
      Constructor.
      Parameters:
      txBody - protobuf TransactionBody
  • Method Details

    • getTokenId

      @Nullable public TokenId getTokenId()
      Extract the token id.
      Returns:
      the token id
    • setTokenId

      public TokenWipeTransaction setTokenId(TokenId tokenId)
      A token identifier.

      This field is REQUIRED.
      The identified token MUST exist, MUST NOT be paused, MUST NOT be deleted, and MUST NOT be expired.

      Parameters:
      tokenId - the token id
      Returns:
      this
    • getAccountId

      @Nullable public AccountId getAccountId()
      Extract the account id.
      Returns:
      the account id
    • setAccountId

      public TokenWipeTransaction setAccountId(AccountId accountId)
      An account identifier.
      This identifies the account from which tokens will be wiped.

      This field is REQUIRED.
      The identified account MUST NOT be deleted or expired.
      If the identified token `kyc_key` is set to a valid key, the identified account MUST have "KYC" granted.
      The identified account MUST NOT be the `treasury` account for the identified token.

      Parameters:
      accountId - the account id
      Returns:
      this
    • getAmount

      public long getAmount()
      Extract the amount.
      Returns:
      the amount
    • setAmount

      public TokenWipeTransaction setAmount(@Nonnegative long amount)
      An amount of fungible/common tokens to wipe.

      If the identified token is a non-fungible/unique token type, this value MUST be exactly zero(`0`).
      If the identified token type is fungible/common:

      • This value SHALL be specified in units of the smallest denomination possible for the identified token (10-decimals whole tokens).
      • This value MUST be strictly less than `Long.MAX_VALUE`.
      • This value MUST be less than or equal to the current total supply for the identified token.
      • This value MUST be less than or equal to the current balance held by the identified account.
      • This value MAY be zero(`0`).
      Parameters:
      amount - the amount
      Returns:
      this
    • getSerials

      public List<Long> getSerials()
      Extract the list of serial numbers.
      Returns:
      the list of serial numbers
    • setSerials

      public TokenWipeTransaction setSerials(List<Long> serials)
      A list of serial numbers to wipe.
      The non-fungible/unique tokens with these serial numbers will be destroyed and cannot be recovered or reused.

      If the identified token type is a fungible/common type, this list MUST be empty.
      If the identified token type is non-fungible/unique:

      • This list MUST contain at least one entry if the identified token type is non-fungible/unique.>/li>
      • This list MUST NOT contain more entries than the current total supply for the identified token.
      • Every entry in this list MUST be a valid serial number for the identified token (i.e. "collection").
      • Every entry in this list MUST be owned by the identified account
      This list MUST NOT contain more entries than the network configuration value for batch size limit, typically ten(`10`).
      Parameters:
      serials - the list of serial numbers
      Returns:
      this
    • addSerial

      public TokenWipeTransaction addSerial(@Nonnegative long serial)
      Add a serial number to the list of serial numbers.
      Parameters:
      serial - the serial number to add
      Returns:
      this
    • initFromTransactionBody

      void initFromTransactionBody()
      Initialize from the transaction body.
    • build

      Build the transaction body.
      Returns:
      TokenWipeAccountTransactionBody
    • validateChecksums

      void validateChecksums(Client client) throws BadEntityIdException
      Specified by:
      validateChecksums in class Transaction<TokenWipeTransaction>
      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<TokenWipeTransaction,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<TokenWipeTransaction>
    • 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<TokenWipeTransaction>