"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.MessageTransmitterV2Instruction = exports.MessageTransmitterV2Account = exports.MESSAGE_TRANSMITTER_V2_PROGRAM_ADDRESS = void 0;
exports.identifyMessageTransmitterV2Account = identifyMessageTransmitterV2Account;
exports.identifyMessageTransmitterV2Instruction = identifyMessageTransmitterV2Instruction;
const kit_1 = require("@solana/kit");
exports.MESSAGE_TRANSMITTER_V2_PROGRAM_ADDRESS = 'CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC';
var MessageTransmitterV2Account;
(function (MessageTransmitterV2Account) {
    MessageTransmitterV2Account[MessageTransmitterV2Account["MessageSent"] = 0] = "MessageSent";
    MessageTransmitterV2Account[MessageTransmitterV2Account["MessageTransmitter"] = 1] = "MessageTransmitter";
    MessageTransmitterV2Account[MessageTransmitterV2Account["UsedNonce"] = 2] = "UsedNonce";
})(MessageTransmitterV2Account || (exports.MessageTransmitterV2Account = MessageTransmitterV2Account = {}));
function identifyMessageTransmitterV2Account(account) {
    const data = 'data' in account ? account.data : account;
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([131, 100, 133, 56, 166, 225, 151, 60])), 0)) {
        return MessageTransmitterV2Account.MessageSent;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([71, 40, 180, 142, 19, 203, 35, 252])), 0)) {
        return MessageTransmitterV2Account.MessageTransmitter;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([212, 222, 157, 252, 130, 71, 179, 238])), 0)) {
        return MessageTransmitterV2Account.UsedNonce;
    }
    throw new Error('The provided account could not be identified as a messageTransmitterV2 account.');
}
var MessageTransmitterV2Instruction;
(function (MessageTransmitterV2Instruction) {
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["AcceptOwnership"] = 0] = "AcceptOwnership";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["DisableAttester"] = 1] = "DisableAttester";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["EnableAttester"] = 2] = "EnableAttester";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["Initialize"] = 3] = "Initialize";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["IsNonceUsed"] = 4] = "IsNonceUsed";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["Pause"] = 5] = "Pause";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["ReceiveMessage"] = 6] = "ReceiveMessage";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["ReclaimEventAccount"] = 7] = "ReclaimEventAccount";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["SendMessage"] = 8] = "SendMessage";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["SetMaxMessageBodySize"] = 9] = "SetMaxMessageBodySize";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["SetSignatureThreshold"] = 10] = "SetSignatureThreshold";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["TransferOwnership"] = 11] = "TransferOwnership";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["Unpause"] = 12] = "Unpause";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["UpdateAttesterManager"] = 13] = "UpdateAttesterManager";
    MessageTransmitterV2Instruction[MessageTransmitterV2Instruction["UpdatePauser"] = 14] = "UpdatePauser";
})(MessageTransmitterV2Instruction || (exports.MessageTransmitterV2Instruction = MessageTransmitterV2Instruction = {}));
function identifyMessageTransmitterV2Instruction(instruction) {
    const data = 'data' in instruction ? instruction.data : instruction;
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([172, 23, 43, 13, 238, 213, 85, 150])), 0)) {
        return MessageTransmitterV2Instruction.AcceptOwnership;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([61, 171, 131, 95, 172, 15, 227, 229])), 0)) {
        return MessageTransmitterV2Instruction.DisableAttester;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([2, 11, 193, 115, 5, 148, 4, 198])), 0)) {
        return MessageTransmitterV2Instruction.EnableAttester;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([175, 175, 109, 31, 13, 152, 155, 237])), 0)) {
        return MessageTransmitterV2Instruction.Initialize;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([144, 72, 107, 148, 35, 218, 31, 187])), 0)) {
        return MessageTransmitterV2Instruction.IsNonceUsed;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([211, 22, 221, 251, 74, 121, 193, 47])), 0)) {
        return MessageTransmitterV2Instruction.Pause;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([38, 144, 127, 225, 31, 225, 238, 25])), 0)) {
        return MessageTransmitterV2Instruction.ReceiveMessage;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([94, 198, 180, 159, 131, 236, 15, 174])), 0)) {
        return MessageTransmitterV2Instruction.ReclaimEventAccount;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([57, 40, 34, 178, 189, 10, 65, 26])), 0)) {
        return MessageTransmitterV2Instruction.SendMessage;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([168, 178, 8, 117, 217, 167, 219, 31])), 0)) {
        return MessageTransmitterV2Instruction.SetMaxMessageBodySize;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([163, 19, 154, 168, 82, 209, 214, 219])), 0)) {
        return MessageTransmitterV2Instruction.SetSignatureThreshold;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([65, 177, 215, 73, 53, 45, 99, 47])), 0)) {
        return MessageTransmitterV2Instruction.TransferOwnership;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([169, 144, 4, 38, 10, 141, 188, 255])), 0)) {
        return MessageTransmitterV2Instruction.Unpause;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([175, 245, 178, 104, 85, 179, 71, 16])), 0)) {
        return MessageTransmitterV2Instruction.UpdateAttesterManager;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([140, 171, 211, 132, 57, 201, 16, 254])), 0)) {
        return MessageTransmitterV2Instruction.UpdatePauser;
    }
    throw new Error('The provided instruction could not be identified as a messageTransmitterV2 instruction.');
}
