"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.SvmSpokeInstruction = exports.SvmSpokeAccount = exports.SVM_SPOKE_PROGRAM_ADDRESS = void 0;
exports.identifySvmSpokeAccount = identifySvmSpokeAccount;
exports.identifySvmSpokeInstruction = identifySvmSpokeInstruction;
const web3_v2_js_1 = require("@solana/web3-v2.js");
exports.SVM_SPOKE_PROGRAM_ADDRESS = 'D1WcTLKRyN4TuqnfMBGPvc16nACHfNhFPbgWNExb1aur';
var SvmSpokeAccount;
(function (SvmSpokeAccount) {
    SvmSpokeAccount[SvmSpokeAccount["ClaimAccount"] = 0] = "ClaimAccount";
    SvmSpokeAccount[SvmSpokeAccount["ExecuteRelayerRefundLeafParams"] = 1] = "ExecuteRelayerRefundLeafParams";
    SvmSpokeAccount[SvmSpokeAccount["ExecuteSlowRelayLeafParams"] = 2] = "ExecuteSlowRelayLeafParams";
    SvmSpokeAccount[SvmSpokeAccount["FillRelayParams"] = 3] = "FillRelayParams";
    SvmSpokeAccount[SvmSpokeAccount["FillStatusAccount"] = 4] = "FillStatusAccount";
    SvmSpokeAccount[SvmSpokeAccount["RequestSlowFillParams"] = 5] = "RequestSlowFillParams";
    SvmSpokeAccount[SvmSpokeAccount["RootBundle"] = 6] = "RootBundle";
    SvmSpokeAccount[SvmSpokeAccount["Route"] = 7] = "Route";
    SvmSpokeAccount[SvmSpokeAccount["State"] = 8] = "State";
    SvmSpokeAccount[SvmSpokeAccount["TransferLiability"] = 9] = "TransferLiability";
})(SvmSpokeAccount || (exports.SvmSpokeAccount = SvmSpokeAccount = {}));
function identifySvmSpokeAccount(account) {
    const data = 'data' in account ? account.data : account;
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([113, 109, 47, 96, 242, 219, 61, 165])), 0)) {
        return SvmSpokeAccount.ClaimAccount;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([192, 59, 93, 9, 171, 77, 28, 250])), 0)) {
        return SvmSpokeAccount.ExecuteRelayerRefundLeafParams;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([135, 208, 119, 251, 14, 222, 66, 155])), 0)) {
        return SvmSpokeAccount.ExecuteSlowRelayLeafParams;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([50, 243, 51, 185, 89, 60, 43, 202])), 0)) {
        return SvmSpokeAccount.FillRelayParams;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([105, 89, 88, 35, 24, 147, 178, 137])), 0)) {
        return SvmSpokeAccount.FillStatusAccount;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([5, 54, 214, 89, 197, 37, 118, 28])), 0)) {
        return SvmSpokeAccount.RequestSlowFillParams;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([66, 221, 214, 231, 25, 222, 184, 219])), 0)) {
        return SvmSpokeAccount.RootBundle;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([80, 179, 58, 115, 52, 19, 146, 134])), 0)) {
        return SvmSpokeAccount.Route;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([216, 146, 107, 94, 104, 75, 182, 177])), 0)) {
        return SvmSpokeAccount.State;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([157, 137, 86, 109, 206, 241, 183, 79])), 0)) {
        return SvmSpokeAccount.TransferLiability;
    }
    throw new Error('The provided account could not be identified as a svmSpoke account.');
}
var SvmSpokeInstruction;
(function (SvmSpokeInstruction) {
    SvmSpokeInstruction[SvmSpokeInstruction["BridgeTokensToHubPool"] = 0] = "BridgeTokensToHubPool";
    SvmSpokeInstruction[SvmSpokeInstruction["ClaimRelayerRefund"] = 1] = "ClaimRelayerRefund";
    SvmSpokeInstruction[SvmSpokeInstruction["CloseClaimAccount"] = 2] = "CloseClaimAccount";
    SvmSpokeInstruction[SvmSpokeInstruction["CloseFillPda"] = 3] = "CloseFillPda";
    SvmSpokeInstruction[SvmSpokeInstruction["CloseInstructionParams"] = 4] = "CloseInstructionParams";
    SvmSpokeInstruction[SvmSpokeInstruction["CreateTokenAccounts"] = 5] = "CreateTokenAccounts";
    SvmSpokeInstruction[SvmSpokeInstruction["Deposit"] = 6] = "Deposit";
    SvmSpokeInstruction[SvmSpokeInstruction["DepositNow"] = 7] = "DepositNow";
    SvmSpokeInstruction[SvmSpokeInstruction["EmergencyDeleteRootBundle"] = 8] = "EmergencyDeleteRootBundle";
    SvmSpokeInstruction[SvmSpokeInstruction["ExecuteRelayerRefundLeaf"] = 9] = "ExecuteRelayerRefundLeaf";
    SvmSpokeInstruction[SvmSpokeInstruction["ExecuteRelayerRefundLeafDeferred"] = 10] = "ExecuteRelayerRefundLeafDeferred";
    SvmSpokeInstruction[SvmSpokeInstruction["ExecuteSlowRelayLeaf"] = 11] = "ExecuteSlowRelayLeaf";
    SvmSpokeInstruction[SvmSpokeInstruction["FillRelay"] = 12] = "FillRelay";
    SvmSpokeInstruction[SvmSpokeInstruction["GetUnsafeDepositId"] = 13] = "GetUnsafeDepositId";
    SvmSpokeInstruction[SvmSpokeInstruction["HandleReceiveMessage"] = 14] = "HandleReceiveMessage";
    SvmSpokeInstruction[SvmSpokeInstruction["Initialize"] = 15] = "Initialize";
    SvmSpokeInstruction[SvmSpokeInstruction["InitializeClaimAccount"] = 16] = "InitializeClaimAccount";
    SvmSpokeInstruction[SvmSpokeInstruction["InitializeInstructionParams"] = 17] = "InitializeInstructionParams";
    SvmSpokeInstruction[SvmSpokeInstruction["PauseDeposits"] = 18] = "PauseDeposits";
    SvmSpokeInstruction[SvmSpokeInstruction["PauseFills"] = 19] = "PauseFills";
    SvmSpokeInstruction[SvmSpokeInstruction["RelayRootBundle"] = 20] = "RelayRootBundle";
    SvmSpokeInstruction[SvmSpokeInstruction["RequestSlowFill"] = 21] = "RequestSlowFill";
    SvmSpokeInstruction[SvmSpokeInstruction["SetCrossDomainAdmin"] = 22] = "SetCrossDomainAdmin";
    SvmSpokeInstruction[SvmSpokeInstruction["SetCurrentTime"] = 23] = "SetCurrentTime";
    SvmSpokeInstruction[SvmSpokeInstruction["SetEnableRoute"] = 24] = "SetEnableRoute";
    SvmSpokeInstruction[SvmSpokeInstruction["TransferOwnership"] = 25] = "TransferOwnership";
    SvmSpokeInstruction[SvmSpokeInstruction["UnsafeDeposit"] = 26] = "UnsafeDeposit";
    SvmSpokeInstruction[SvmSpokeInstruction["WriteInstructionParamsFragment"] = 27] = "WriteInstructionParamsFragment";
})(SvmSpokeInstruction || (exports.SvmSpokeInstruction = SvmSpokeInstruction = {}));
function identifySvmSpokeInstruction(instruction) {
    const data = 'data' in instruction ? instruction.data : instruction;
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([1, 83, 255, 59, 232, 55, 64, 216])), 0)) {
        return SvmSpokeInstruction.BridgeTokensToHubPool;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([205, 34, 34, 224, 204, 103, 81, 176])), 0)) {
        return SvmSpokeInstruction.ClaimRelayerRefund;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([241, 146, 203, 216, 58, 222, 91, 118])), 0)) {
        return SvmSpokeInstruction.CloseClaimAccount;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([224, 39, 208, 68, 8, 226, 23, 214])), 0)) {
        return SvmSpokeInstruction.CloseFillPda;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([224, 44, 254, 10, 216, 8, 172, 96])), 0)) {
        return SvmSpokeInstruction.CloseInstructionParams;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([163, 216, 49, 204, 97, 16, 80, 167])), 0)) {
        return SvmSpokeInstruction.CreateTokenAccounts;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([242, 35, 198, 137, 82, 225, 242, 182])), 0)) {
        return SvmSpokeInstruction.Deposit;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([75, 228, 135, 221, 200, 25, 148, 26])), 0)) {
        return SvmSpokeInstruction.DepositNow;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([226, 158, 1, 74, 84, 113, 24, 152])), 0)) {
        return SvmSpokeInstruction.EmergencyDeleteRootBundle;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([27, 136, 159, 240, 127, 68, 123, 164])), 0)) {
        return SvmSpokeInstruction.ExecuteRelayerRefundLeaf;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([110, 112, 89, 208, 38, 116, 93, 10])), 0)) {
        return SvmSpokeInstruction.ExecuteRelayerRefundLeafDeferred;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([26, 207, 3, 168, 193, 252, 59, 127])), 0)) {
        return SvmSpokeInstruction.ExecuteSlowRelayLeaf;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([100, 84, 222, 90, 106, 209, 58, 222])), 0)) {
        return SvmSpokeInstruction.FillRelay;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([118, 10, 135, 0, 168, 243, 223, 117])), 0)) {
        return SvmSpokeInstruction.GetUnsafeDepositId;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([133, 102, 1, 180, 145, 11, 138, 180])), 0)) {
        return SvmSpokeInstruction.HandleReceiveMessage;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([175, 175, 109, 31, 13, 152, 155, 237])), 0)) {
        return SvmSpokeInstruction.Initialize;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([22, 247, 214, 191, 90, 74, 87, 216])), 0)) {
        return SvmSpokeInstruction.InitializeClaimAccount;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([94, 206, 190, 192, 127, 8, 186, 28])), 0)) {
        return SvmSpokeInstruction.InitializeInstructionParams;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([206, 186, 203, 153, 253, 61, 206, 122])), 0)) {
        return SvmSpokeInstruction.PauseDeposits;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([92, 114, 214, 49, 13, 243, 73, 35])), 0)) {
        return SvmSpokeInstruction.PauseFills;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([69, 13, 223, 204, 251, 61, 105, 6])), 0)) {
        return SvmSpokeInstruction.RelayRootBundle;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([39, 157, 165, 187, 88, 217, 207, 98])), 0)) {
        return SvmSpokeInstruction.RequestSlowFill;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([102, 206, 237, 106, 63, 141, 42, 248])), 0)) {
        return SvmSpokeInstruction.SetCrossDomainAdmin;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([69, 100, 169, 193, 125, 0, 150, 69])), 0)) {
        return SvmSpokeInstruction.SetCurrentTime;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([166, 66, 33, 156, 122, 251, 223, 34])), 0)) {
        return SvmSpokeInstruction.SetEnableRoute;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([65, 177, 215, 73, 53, 45, 99, 47])), 0)) {
        return SvmSpokeInstruction.TransferOwnership;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([196, 187, 166, 179, 3, 146, 150, 246])), 0)) {
        return SvmSpokeInstruction.UnsafeDeposit;
    }
    if ((0, web3_v2_js_1.containsBytes)(data, (0, web3_v2_js_1.fixEncoderSize)((0, web3_v2_js_1.getBytesEncoder)(), 8).encode(new Uint8Array([238, 182, 109, 113, 124, 255, 72, 18])), 0)) {
        return SvmSpokeInstruction.WriteInstructionParamsFragment;
    }
    throw new Error('The provided instruction could not be identified as a svmSpoke instruction.');
}
