"use strict";
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextInputDiscriminator = exports.BlockIssuanceCreditContextInput = exports.RewardContextInput = exports.CommitmentContextInput = exports.ContextInput = exports.ContextInputType = void 0;
var ContextInputType;
(function (ContextInputType) {
    /**
     * The context input type of a `CommitmentContextInput`.
     */
    ContextInputType[ContextInputType["COMMITMENT"] = 0] = "COMMITMENT";
    /**
     * The context input type of a `BlockIssuanceCreditContextInput`.
     */
    ContextInputType[ContextInputType["BLOCK_ISSUANCE_CREDIT"] = 1] = "BLOCK_ISSUANCE_CREDIT";
    /**
     * The context input type of a `RewardContextInput`.
     */
    ContextInputType[ContextInputType["REWARD"] = 2] = "REWARD";
})(ContextInputType || (ContextInputType = {}));
exports.ContextInputType = ContextInputType;
class ContextInput {
    constructor(type) {
        this.type = type;
    }
}
exports.ContextInput = ContextInput;
/**
 * A Commitment Context Input references a commitment to a certain slot.
 */
class CommitmentContextInput extends ContextInput {
    constructor(commitmentId) {
        super(ContextInputType.COMMITMENT);
        this.commitmentId = commitmentId;
    }
}
exports.CommitmentContextInput = CommitmentContextInput;
/**
 * A Block Issuance Credit (BIC) Context Input provides the VM with context for the value of
 * the BIC vector of a specific slot.
 */
class BlockIssuanceCreditContextInput extends ContextInput {
    constructor(accountId) {
        super(ContextInputType.BLOCK_ISSUANCE_CREDIT);
        this.accountId = accountId;
    }
}
exports.BlockIssuanceCreditContextInput = BlockIssuanceCreditContextInput;
/**
 * A Reward Context Input indicates which transaction Input is claiming Mana rewards.
 */
class RewardContextInput extends ContextInput {
    constructor(index) {
        super(ContextInputType.REWARD);
        this.index = index;
    }
}
exports.RewardContextInput = RewardContextInput;
const ContextInputDiscriminator = {
    property: 'type',
    subTypes: [
        {
            value: CommitmentContextInput,
            name: ContextInputType.COMMITMENT,
        },
        {
            value: BlockIssuanceCreditContextInput,
            name: ContextInputType.BLOCK_ISSUANCE_CREDIT,
        },
        { value: RewardContextInput, name: ContextInputType.REWARD },
    ],
};
exports.ContextInputDiscriminator = ContextInputDiscriminator;
//# sourceMappingURL=context-input.js.map