/**
 * # Token Wipe Account
 * Administratively burn tokens owned by a single, non-treasury, account.
 *
 * ### Keywords
 * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
 * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
 * document are to be interpreted as described in
 * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in
 * [RFC8174](https://www.ietf.org/rfc/rfc8174).
 */
syntax = "proto3";

package proto;

// SPDX-License-Identifier: Apache-2.0
option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.token">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;

import "services_basic_types.proto";

/**
 * Wipe (administratively burn) tokens held by a non-treasury account.<br/>
 * 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`.<br/>
 * The identified token MUST exist, MUST NOT be deleted,
 * and MUST NOT be paused.<br/>
 * The identified token MUST have a valid `Key` set for the `wipe_key` field,
 * and that key MUST NOT be an empty `KeyList`.<br/>
 * 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.<br/>
 * 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.
 */
message TokenWipeAccountTransactionBody {
    /**
     * A token identifier.
     * <p>
     * This field is REQUIRED.<br/>
     * The identified token MUST exist, MUST NOT be paused, MUST NOT be
     * deleted, and MUST NOT be expired.
     */
    TokenID token = 1;

    /**
     * An account identifier.<br/>
     * This identifies the account from which tokens will be wiped.
     * <p>
     * This field is REQUIRED.<br/>
     * The identified account MUST NOT be deleted or expired.<br/>
     * If the identified token `kyc_key` is set to a valid key, the
     * identified account MUST have "KYC" granted.<br/>
     * The identified account MUST NOT be the `treasury` account for the
     * identified token.
     */
    AccountID account = 2;

    /**
     * An amount of fungible/common tokens to wipe.
     * <p>
     * If the identified token is a non-fungible/unique token type,
     * this value MUST be exactly zero(`0`).<br/>
     * If the identified token type is fungible/common:
     * <ul>
     *   <li>This value SHALL be specified in units of the smallest
     *       denomination possible for the identified token
     *       (<tt>10<sup>-decimals</sup></tt> whole tokens).</li>
     *   <li>This value MUST be strictly less than `Long.MAX_VALUE`.</li>
     *   <li>This value MUST be less than or equal to the current total
     *       supply for the identified token.</li>
     *   <li>This value MUST be less than or equal to the current balance
     *       held by the identified account.</li>
     *   <li>This value MAY be zero(`0`).</li>
     * </ul>
     */
    uint64 amount = 3;

    /**
     * A list of serial numbers to wipe.<br/>
     * The non-fungible/unique tokens with these serial numbers will be
     * destroyed and cannot be recovered or reused.
     * <p>
     * If the identified token type is a fungible/common type, this
     * list MUST be empty.<br/>
     * If the identified token type is non-fungible/unique:
     * <ul>
     *   <li>This list MUST contain at least one entry if the identified token
     *       type is non-fungible/unique.>/li>
     *   <li>This list MUST NOT contain more entries than the current total
     *       supply for the identified token.</li>
     *   <li>Every entry in this list MUST be a valid serial number for the
     *       identified token (i.e. "collection").</li>
     *   <li>Every entry in this list MUST be owned by the
     *       identified account</li>
     *   <li></li>
     * </ul>
     * This list MUST NOT contain more entries than the network configuration
     * value for batch size limit, typically ten(`10`).
     */
    repeated int64 serialNumbers = 4;
}
