"use strict";
/**
 * This code was AUTOGENERATED using the codama library.
 * Please DO NOT EDIT THIS FILE, instead use visitors
 * to add features, then rerun codama to update it.
 *
 * @see https://github.com/codama-idl/codama
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_AMOUNT = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__BURN_AMOUNT_EXCEEDED = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_CONTROLLER = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_PAUSER = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_LOCAL_TOKEN_STATE = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_PAIR_STATE = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__PROGRAM_PAUSED = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_MINTER_STATE = exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_AUTHORITY = void 0;
exports.getTokenMessengerMinterV2ErrorMessage = getTokenMessengerMinterV2ErrorMessage;
exports.isTokenMessengerMinterV2Error = isTokenMessengerMinterV2Error;
const kit_1 = require("@solana/kit");
const programs_1 = require("../programs");
/** InvalidAuthority: Invalid authority */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_AUTHORITY = 0x1770; // 6000
/** InvalidTokenMinterState: Invalid token minter state */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_MINTER_STATE = 0x1771; // 6001
/** ProgramPaused: Instruction is not allowed at this time */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__PROGRAM_PAUSED = 0x1772; // 6002
/** InvalidTokenPairState: Invalid token pair state */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_PAIR_STATE = 0x1773; // 6003
/** InvalidLocalTokenState: Invalid local token state */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_LOCAL_TOKEN_STATE = 0x1774; // 6004
/** InvalidPauser: Invalid pauser */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_PAUSER = 0x1775; // 6005
/** InvalidTokenController: Invalid token controller */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_CONTROLLER = 0x1776; // 6006
/** BurnAmountExceeded: Burn amount exceeded */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__BURN_AMOUNT_EXCEEDED = 0x1777; // 6007
/** InvalidAmount: Invalid amount */
exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_AMOUNT = 0x1778; // 6008
let tokenMessengerMinterV2ErrorMessages;
if (process.env.NODE_ENV !== 'production') {
    tokenMessengerMinterV2ErrorMessages = {
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__BURN_AMOUNT_EXCEEDED]: `Burn amount exceeded`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_AMOUNT]: `Invalid amount`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_AUTHORITY]: `Invalid authority`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_LOCAL_TOKEN_STATE]: `Invalid local token state`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_PAUSER]: `Invalid pauser`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_CONTROLLER]: `Invalid token controller`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_MINTER_STATE]: `Invalid token minter state`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__INVALID_TOKEN_PAIR_STATE]: `Invalid token pair state`,
        [exports.TOKEN_MESSENGER_MINTER_V2_ERROR__PROGRAM_PAUSED]: `Instruction is not allowed at this time`,
    };
}
function getTokenMessengerMinterV2ErrorMessage(code) {
    if (process.env.NODE_ENV !== 'production') {
        return tokenMessengerMinterV2ErrorMessages[code];
    }
    return 'Error message not available in production bundles.';
}
function isTokenMessengerMinterV2Error(error, transactionMessage, code) {
    return (0, kit_1.isProgramError)(error, transactionMessage, programs_1.TOKEN_MESSENGER_MINTER_V2_PROGRAM_ADDRESS, code);
}
