"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.SponsoredCctpSrcPeripheryInstruction = exports.SponsoredCctpSrcPeripheryAccount = exports.SPONSORED_CCTP_SRC_PERIPHERY_PROGRAM_ADDRESS = void 0;
exports.identifySponsoredCctpSrcPeripheryAccount = identifySponsoredCctpSrcPeripheryAccount;
exports.identifySponsoredCctpSrcPeripheryInstruction = identifySponsoredCctpSrcPeripheryInstruction;
const kit_1 = require("@solana/kit");
exports.SPONSORED_CCTP_SRC_PERIPHERY_PROGRAM_ADDRESS = 'CPr4bRvkVKcSCLyrQpkZrRrwGzQeVAXutFU8WupuBLXq';
var SponsoredCctpSrcPeripheryAccount;
(function (SponsoredCctpSrcPeripheryAccount) {
    SponsoredCctpSrcPeripheryAccount[SponsoredCctpSrcPeripheryAccount["MessageSent"] = 0] = "MessageSent";
    SponsoredCctpSrcPeripheryAccount[SponsoredCctpSrcPeripheryAccount["MinimumDeposit"] = 1] = "MinimumDeposit";
    SponsoredCctpSrcPeripheryAccount[SponsoredCctpSrcPeripheryAccount["RentClaim"] = 2] = "RentClaim";
    SponsoredCctpSrcPeripheryAccount[SponsoredCctpSrcPeripheryAccount["State"] = 3] = "State";
    SponsoredCctpSrcPeripheryAccount[SponsoredCctpSrcPeripheryAccount["UsedNonce"] = 4] = "UsedNonce";
})(SponsoredCctpSrcPeripheryAccount || (exports.SponsoredCctpSrcPeripheryAccount = SponsoredCctpSrcPeripheryAccount = {}));
function identifySponsoredCctpSrcPeripheryAccount(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 SponsoredCctpSrcPeripheryAccount.MessageSent;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([218, 139, 120, 202, 3, 12, 233, 65])), 0)) {
        return SponsoredCctpSrcPeripheryAccount.MinimumDeposit;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([13, 5, 183, 82, 60, 122, 72, 11])), 0)) {
        return SponsoredCctpSrcPeripheryAccount.RentClaim;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([216, 146, 107, 94, 104, 75, 182, 177])), 0)) {
        return SponsoredCctpSrcPeripheryAccount.State;
    }
    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 SponsoredCctpSrcPeripheryAccount.UsedNonce;
    }
    throw new Error('The provided account could not be identified as a sponsoredCctpSrcPeriphery account.');
}
var SponsoredCctpSrcPeripheryInstruction;
(function (SponsoredCctpSrcPeripheryInstruction) {
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["DepositForBurn"] = 0] = "DepositForBurn";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["GetUsedNonceCloseInfo"] = 1] = "GetUsedNonceCloseInfo";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["Initialize"] = 2] = "Initialize";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["ReclaimEventAccount"] = 3] = "ReclaimEventAccount";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["ReclaimUsedNonceAccount"] = 4] = "ReclaimUsedNonceAccount";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["RepayRentFundDebt"] = 5] = "RepayRentFundDebt";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["SetCurrentTime"] = 6] = "SetCurrentTime";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["SetMinimumDepositAmount"] = 7] = "SetMinimumDepositAmount";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["SetSigner"] = 8] = "SetSigner";
    SponsoredCctpSrcPeripheryInstruction[SponsoredCctpSrcPeripheryInstruction["WithdrawRentFund"] = 9] = "WithdrawRentFund";
})(SponsoredCctpSrcPeripheryInstruction || (exports.SponsoredCctpSrcPeripheryInstruction = SponsoredCctpSrcPeripheryInstruction = {}));
function identifySponsoredCctpSrcPeripheryInstruction(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([215, 60, 61, 46, 114, 55, 128, 176])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.DepositForBurn;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([19, 183, 42, 151, 118, 234, 57, 92])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.GetUsedNonceCloseInfo;
    }
    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 SponsoredCctpSrcPeripheryInstruction.Initialize;
    }
    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 SponsoredCctpSrcPeripheryInstruction.ReclaimEventAccount;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([153, 152, 111, 172, 156, 104, 116, 3])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.ReclaimUsedNonceAccount;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([111, 95, 222, 174, 241, 41, 61, 78])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.RepayRentFundDebt;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([69, 100, 169, 193, 125, 0, 150, 69])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.SetCurrentTime;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([176, 4, 74, 229, 206, 148, 151, 138])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.SetMinimumDepositAmount;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([127, 120, 252, 184, 97, 4, 88, 68])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.SetSigner;
    }
    if ((0, kit_1.containsBytes)(data, (0, kit_1.fixEncoderSize)((0, kit_1.getBytesEncoder)(), 8).encode(new Uint8Array([153, 28, 108, 116, 132, 70, 161, 125])), 0)) {
        return SponsoredCctpSrcPeripheryInstruction.WithdrawRentFund;
    }
    throw new Error('The provided instruction could not be identified as a sponsoredCctpSrcPeriphery instruction.');
}
