/**
 * # Token Reject
 * Messages used to implement a transaction to reject a token type from an
 * 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";

/**
 * Reject undesired token(s).<br/>
 * Transfer one or more token balances held by the requesting account to the
 * treasury for each token type.
 *
 * Each transfer SHALL be one of the following
 * - A single non-fungible/unique token.
 * - The full balance held for a fungible/common token.
 * A single `tokenReject` transaction SHALL support a maximum
 * of 10 transfers.<br/>
 * A token that is `pause`d MUST NOT be rejected.<br/>
 * If the `owner` account is `frozen` with respect to the identified token(s)
 * the token(s) MUST NOT be rejected.<br/>
 * The `payer` for this transaction, and `owner` if set, SHALL NOT be charged
 * any custom fees or other fees beyond the `tokenReject` transaction fee.
 *
 * ### Block Stream Effects
 * - Each successful transfer from `payer` to `treasury` SHALL be recorded in
 *   the `token_transfer_list` for the transaction record.
 */
message TokenRejectTransactionBody {
    /**
     * An account identifier.<br/>
     * This OPTIONAL field identifies the account holding the
     * tokens to be rejected.
     * <p>
     * If set, this account MUST sign this transaction.
     * If not set, the `payer` for this transaction SHALL be the effective
     * `owner` for this transaction.
     */
    AccountID owner = 1;

    /**
     * A list of one or more token rejections.
     * <p>
     * On success each rejected token serial number or balance SHALL be
     * transferred from the requesting account to the treasury account for
     * that token type.<br/>
     * After rejection the requesting account SHALL continue to be associated
     * with the token.<br/>
     * If dissociation is desired then a separate `TokenDissociate` transaction
     * MUST be submitted to remove the association.<br/>
     * This list MUST contain at least one (1) entry and MUST NOT contain more
     * than ten (10) entries.
     */
    repeated TokenReference rejections = 2;
}

/**
 * A union token identifier.
 *
 * Identify a fungible/common token type, or a single
 * non-fungible/unique token serial.
 */
message TokenReference {
    oneof token_identifier {
        /**
         * A fungible/common token type.
         */
        TokenID fungible_token = 1;

        /**
         * A single specific serialized non-fungible/unique token.
         */
        NftID nft = 2;
    }
}
