/**
 * 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
 */
var _a;
import { isProgramError, } from "@solana/kit";
import { MESSAGE_TRANSMITTER_PROGRAM_ADDRESS } from "../programs";
/** InvalidAuthority: Invalid authority */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_AUTHORITY = 0x1770; // 6000
/** ProgramPaused: Instruction is not allowed at this time */
export var MESSAGE_TRANSMITTER_ERROR__PROGRAM_PAUSED = 0x1771; // 6001
/** InvalidMessageTransmitterState: Invalid message transmitter state */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_MESSAGE_TRANSMITTER_STATE = 0x1772; // 6002
/** InvalidSignatureThreshold: Invalid signature threshold */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_THRESHOLD = 0x1773; // 6003
/** SignatureThresholdAlreadySet: Signature threshold already set */
export var MESSAGE_TRANSMITTER_ERROR__SIGNATURE_THRESHOLD_ALREADY_SET = 0x1774; // 6004
/** InvalidOwner: Invalid owner */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_OWNER = 0x1775; // 6005
/** InvalidPauser: Invalid pauser */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_PAUSER = 0x1776; // 6006
/** InvalidAttesterManager: Invalid attester manager */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTER_MANAGER = 0x1777; // 6007
/** InvalidAttester: Invalid attester */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTER = 0x1778; // 6008
/** AttesterAlreadyEnabled: Attester already enabled */
export var MESSAGE_TRANSMITTER_ERROR__ATTESTER_ALREADY_ENABLED = 0x1779; // 6009
/** TooFewEnabledAttesters: Too few enabled attesters */
export var MESSAGE_TRANSMITTER_ERROR__TOO_FEW_ENABLED_ATTESTERS = 0x177a; // 6010
/** SignatureThresholdTooLow: Signature threshold is too low */
export var MESSAGE_TRANSMITTER_ERROR__SIGNATURE_THRESHOLD_TOO_LOW = 0x177b; // 6011
/** AttesterAlreadyDisabled: Attester already disabled */
export var MESSAGE_TRANSMITTER_ERROR__ATTESTER_ALREADY_DISABLED = 0x177c; // 6012
/** MessageBodyLimitExceeded: Message body exceeds max size */
export var MESSAGE_TRANSMITTER_ERROR__MESSAGE_BODY_LIMIT_EXCEEDED = 0x177d; // 6013
/** InvalidDestinationCaller: Invalid destination caller */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_DESTINATION_CALLER = 0x177e; // 6014
/** InvalidRecipient: Invalid message recipient */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_RECIPIENT = 0x177f; // 6015
/** SenderNotPermitted: Sender is not permitted */
export var MESSAGE_TRANSMITTER_ERROR__SENDER_NOT_PERMITTED = 0x1780; // 6016
/** InvalidSourceDomain: Invalid source domain */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_SOURCE_DOMAIN = 0x1781; // 6017
/** InvalidDestinationDomain: Invalid destination domain */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_DESTINATION_DOMAIN = 0x1782; // 6018
/** InvalidMessageVersion: Invalid message version */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_MESSAGE_VERSION = 0x1783; // 6019
/** InvalidUsedNoncesAccount: Invalid used nonces account */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_USED_NONCES_ACCOUNT = 0x1784; // 6020
/** InvalidRecipientProgram: Invalid recipient program */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_RECIPIENT_PROGRAM = 0x1785; // 6021
/** InvalidNonce: Invalid nonce */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_NONCE = 0x1786; // 6022
/** NonceAlreadyUsed: Nonce already used */
export var MESSAGE_TRANSMITTER_ERROR__NONCE_ALREADY_USED = 0x1787; // 6023
/** MessageTooShort: Message is too short */
export var MESSAGE_TRANSMITTER_ERROR__MESSAGE_TOO_SHORT = 0x1788; // 6024
/** MalformedMessage: Malformed message */
export var MESSAGE_TRANSMITTER_ERROR__MALFORMED_MESSAGE = 0x1789; // 6025
/** InvalidSignatureOrderOrDupe: Invalid signature order or dupe */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_ORDER_OR_DUPE = 0x178a; // 6026
/** InvalidAttesterSignature: Invalid attester signature */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTER_SIGNATURE = 0x178b; // 6027
/** InvalidAttestationLength: Invalid attestation length */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTATION_LENGTH = 0x178c; // 6028
/** InvalidSignatureRecoveryId: Invalid signature recovery ID */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_RECOVERY_ID = 0x178d; // 6029
/** InvalidSignatureSValue: Invalid signature S value */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_S_VALUE = 0x178e; // 6030
/** InvalidMessageHash: Invalid message hash */
export var MESSAGE_TRANSMITTER_ERROR__INVALID_MESSAGE_HASH = 0x178f; // 6031
var messageTransmitterErrorMessages;
if (process.env.NODE_ENV !== "production") {
    messageTransmitterErrorMessages = (_a = {},
        _a[MESSAGE_TRANSMITTER_ERROR__ATTESTER_ALREADY_DISABLED] = "Attester already disabled",
        _a[MESSAGE_TRANSMITTER_ERROR__ATTESTER_ALREADY_ENABLED] = "Attester already enabled",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTATION_LENGTH] = "Invalid attestation length",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTER] = "Invalid attester",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTER_MANAGER] = "Invalid attester manager",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_ATTESTER_SIGNATURE] = "Invalid attester signature",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_AUTHORITY] = "Invalid authority",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_DESTINATION_CALLER] = "Invalid destination caller",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_DESTINATION_DOMAIN] = "Invalid destination domain",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_MESSAGE_HASH] = "Invalid message hash",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_MESSAGE_TRANSMITTER_STATE] = "Invalid message transmitter state",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_MESSAGE_VERSION] = "Invalid message version",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_NONCE] = "Invalid nonce",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_OWNER] = "Invalid owner",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_PAUSER] = "Invalid pauser",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_RECIPIENT] = "Invalid message recipient",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_RECIPIENT_PROGRAM] = "Invalid recipient program",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_ORDER_OR_DUPE] = "Invalid signature order or dupe",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_RECOVERY_ID] = "Invalid signature recovery ID",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_S_VALUE] = "Invalid signature S value",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_SIGNATURE_THRESHOLD] = "Invalid signature threshold",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_SOURCE_DOMAIN] = "Invalid source domain",
        _a[MESSAGE_TRANSMITTER_ERROR__INVALID_USED_NONCES_ACCOUNT] = "Invalid used nonces account",
        _a[MESSAGE_TRANSMITTER_ERROR__MALFORMED_MESSAGE] = "Malformed message",
        _a[MESSAGE_TRANSMITTER_ERROR__MESSAGE_BODY_LIMIT_EXCEEDED] = "Message body exceeds max size",
        _a[MESSAGE_TRANSMITTER_ERROR__MESSAGE_TOO_SHORT] = "Message is too short",
        _a[MESSAGE_TRANSMITTER_ERROR__NONCE_ALREADY_USED] = "Nonce already used",
        _a[MESSAGE_TRANSMITTER_ERROR__PROGRAM_PAUSED] = "Instruction is not allowed at this time",
        _a[MESSAGE_TRANSMITTER_ERROR__SENDER_NOT_PERMITTED] = "Sender is not permitted",
        _a[MESSAGE_TRANSMITTER_ERROR__SIGNATURE_THRESHOLD_ALREADY_SET] = "Signature threshold already set",
        _a[MESSAGE_TRANSMITTER_ERROR__SIGNATURE_THRESHOLD_TOO_LOW] = "Signature threshold is too low",
        _a[MESSAGE_TRANSMITTER_ERROR__TOO_FEW_ENABLED_ATTESTERS] = "Too few enabled attesters",
        _a);
}
export function getMessageTransmitterErrorMessage(code) {
    if (process.env.NODE_ENV !== "production") {
        return messageTransmitterErrorMessages[code];
    }
    return "Error message not available in production bundles.";
}
export function isMessageTransmitterError(error, transactionMessage, code) {
    return isProgramError(error, transactionMessage, MESSAGE_TRANSMITTER_PROGRAM_ADDRESS, code);
}
//# sourceMappingURL=messageTransmitter.js.map