"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MINT = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_PAIR = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_SENDER = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_MINT_RECIPIENT = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_DESTINATION_CALLER = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_DESTINATION_DOMAIN = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_AMOUNT = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_MESSAGE_BODY_VERSION = exports.TOKEN_MESSENGER_MINTER_ERROR__MALFORMED_MESSAGE = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_OWNER = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MESSENGER = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MESSENGER_STATE = exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_AUTHORITY = void 0;
exports.getTokenMessengerMinterErrorMessage = getTokenMessengerMinterErrorMessage;
exports.isTokenMessengerMinterError = isTokenMessengerMinterError;
var kit_1 = require("@solana/kit");
var programs_1 = require("../programs");
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_AUTHORITY = 0x1770;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MESSENGER_STATE = 0x1771;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MESSENGER = 0x1772;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_OWNER = 0x1773;
exports.TOKEN_MESSENGER_MINTER_ERROR__MALFORMED_MESSAGE = 0x1774;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_MESSAGE_BODY_VERSION = 0x1775;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_AMOUNT = 0x1776;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_DESTINATION_DOMAIN = 0x1777;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_DESTINATION_CALLER = 0x1778;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_MINT_RECIPIENT = 0x1779;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_SENDER = 0x177a;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_PAIR = 0x177b;
exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MINT = 0x177c;
var tokenMessengerMinterErrorMessages;
if (process.env.NODE_ENV !== "production") {
    tokenMessengerMinterErrorMessages = (_a = {},
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_AMOUNT] = "Invalid amount",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_AUTHORITY] = "Invalid authority",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_DESTINATION_CALLER] = "Invalid destination caller",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_DESTINATION_DOMAIN] = "Invalid destination domain",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_MESSAGE_BODY_VERSION] = "Invalid message body version",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_MINT_RECIPIENT] = "Invalid mint recipient",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_OWNER] = "Invalid owner",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_SENDER] = "Invalid sender",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MESSENGER] = "Invalid token messenger",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MESSENGER_STATE] = "Invalid token messenger state",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_MINT] = "Invalid token mint",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__INVALID_TOKEN_PAIR] = "Invalid token pair",
        _a[exports.TOKEN_MESSENGER_MINTER_ERROR__MALFORMED_MESSAGE] = "Malformed message",
        _a);
}
function getTokenMessengerMinterErrorMessage(code) {
    if (process.env.NODE_ENV !== "production") {
        return tokenMessengerMinterErrorMessages[code];
    }
    return "Error message not available in production bundles.";
}
function isTokenMessengerMinterError(error, transactionMessage, code) {
    return (0, kit_1.isProgramError)(error, transactionMessage, programs_1.TOKEN_MESSENGER_MINTER_PROGRAM_ADDRESS, code);
}
//# sourceMappingURL=tokenMessengerMinter.js.map