"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DepositCap = exports.RewardPerSecond = exports.AllowInvestInWhitelistedReservesOnly = exports.AllowAllocationsInWhitelistedReservesOnly = exports.FirstLossCapitalFarm = exports.WithdrawalPenaltyBps = exports.WithdrawalPenaltyLamports = exports.UnallocatedTokensCap = exports.UnallocatedWeight = exports.AllocationAdmin = exports.Farm = exports.LookupTable = exports.Name = exports.PendingVaultAdmin = exports.CrankFundFeePerReserve = exports.MinInvestDelaySlots = exports.MinInvestAmount = exports.MinWithdrawAmount = exports.MinDepositAmount = exports.ManagementFeeBps = exports.PerformanceFeeBps = void 0;
exports.fromDecoded = fromDecoded;
exports.fromJSON = fromJSON;
exports.layout = layout;
const borsh = __importStar(require("@coral-xyz/borsh"));
class PerformanceFeeBps {
    static discriminator = 0;
    static kind = "PerformanceFeeBps";
    discriminator = 0;
    kind = "PerformanceFeeBps";
    toJSON() {
        return {
            kind: "PerformanceFeeBps",
        };
    }
    toEncodable() {
        return {
            PerformanceFeeBps: {},
        };
    }
}
exports.PerformanceFeeBps = PerformanceFeeBps;
class ManagementFeeBps {
    static discriminator = 1;
    static kind = "ManagementFeeBps";
    discriminator = 1;
    kind = "ManagementFeeBps";
    toJSON() {
        return {
            kind: "ManagementFeeBps",
        };
    }
    toEncodable() {
        return {
            ManagementFeeBps: {},
        };
    }
}
exports.ManagementFeeBps = ManagementFeeBps;
class MinDepositAmount {
    static discriminator = 2;
    static kind = "MinDepositAmount";
    discriminator = 2;
    kind = "MinDepositAmount";
    toJSON() {
        return {
            kind: "MinDepositAmount",
        };
    }
    toEncodable() {
        return {
            MinDepositAmount: {},
        };
    }
}
exports.MinDepositAmount = MinDepositAmount;
class MinWithdrawAmount {
    static discriminator = 3;
    static kind = "MinWithdrawAmount";
    discriminator = 3;
    kind = "MinWithdrawAmount";
    toJSON() {
        return {
            kind: "MinWithdrawAmount",
        };
    }
    toEncodable() {
        return {
            MinWithdrawAmount: {},
        };
    }
}
exports.MinWithdrawAmount = MinWithdrawAmount;
class MinInvestAmount {
    static discriminator = 4;
    static kind = "MinInvestAmount";
    discriminator = 4;
    kind = "MinInvestAmount";
    toJSON() {
        return {
            kind: "MinInvestAmount",
        };
    }
    toEncodable() {
        return {
            MinInvestAmount: {},
        };
    }
}
exports.MinInvestAmount = MinInvestAmount;
class MinInvestDelaySlots {
    static discriminator = 5;
    static kind = "MinInvestDelaySlots";
    discriminator = 5;
    kind = "MinInvestDelaySlots";
    toJSON() {
        return {
            kind: "MinInvestDelaySlots",
        };
    }
    toEncodable() {
        return {
            MinInvestDelaySlots: {},
        };
    }
}
exports.MinInvestDelaySlots = MinInvestDelaySlots;
class CrankFundFeePerReserve {
    static discriminator = 6;
    static kind = "CrankFundFeePerReserve";
    discriminator = 6;
    kind = "CrankFundFeePerReserve";
    toJSON() {
        return {
            kind: "CrankFundFeePerReserve",
        };
    }
    toEncodable() {
        return {
            CrankFundFeePerReserve: {},
        };
    }
}
exports.CrankFundFeePerReserve = CrankFundFeePerReserve;
class PendingVaultAdmin {
    static discriminator = 7;
    static kind = "PendingVaultAdmin";
    discriminator = 7;
    kind = "PendingVaultAdmin";
    toJSON() {
        return {
            kind: "PendingVaultAdmin",
        };
    }
    toEncodable() {
        return {
            PendingVaultAdmin: {},
        };
    }
}
exports.PendingVaultAdmin = PendingVaultAdmin;
class Name {
    static discriminator = 8;
    static kind = "Name";
    discriminator = 8;
    kind = "Name";
    toJSON() {
        return {
            kind: "Name",
        };
    }
    toEncodable() {
        return {
            Name: {},
        };
    }
}
exports.Name = Name;
class LookupTable {
    static discriminator = 9;
    static kind = "LookupTable";
    discriminator = 9;
    kind = "LookupTable";
    toJSON() {
        return {
            kind: "LookupTable",
        };
    }
    toEncodable() {
        return {
            LookupTable: {},
        };
    }
}
exports.LookupTable = LookupTable;
class Farm {
    static discriminator = 10;
    static kind = "Farm";
    discriminator = 10;
    kind = "Farm";
    toJSON() {
        return {
            kind: "Farm",
        };
    }
    toEncodable() {
        return {
            Farm: {},
        };
    }
}
exports.Farm = Farm;
class AllocationAdmin {
    static discriminator = 11;
    static kind = "AllocationAdmin";
    discriminator = 11;
    kind = "AllocationAdmin";
    toJSON() {
        return {
            kind: "AllocationAdmin",
        };
    }
    toEncodable() {
        return {
            AllocationAdmin: {},
        };
    }
}
exports.AllocationAdmin = AllocationAdmin;
class UnallocatedWeight {
    static discriminator = 12;
    static kind = "UnallocatedWeight";
    discriminator = 12;
    kind = "UnallocatedWeight";
    toJSON() {
        return {
            kind: "UnallocatedWeight",
        };
    }
    toEncodable() {
        return {
            UnallocatedWeight: {},
        };
    }
}
exports.UnallocatedWeight = UnallocatedWeight;
class UnallocatedTokensCap {
    static discriminator = 13;
    static kind = "UnallocatedTokensCap";
    discriminator = 13;
    kind = "UnallocatedTokensCap";
    toJSON() {
        return {
            kind: "UnallocatedTokensCap",
        };
    }
    toEncodable() {
        return {
            UnallocatedTokensCap: {},
        };
    }
}
exports.UnallocatedTokensCap = UnallocatedTokensCap;
class WithdrawalPenaltyLamports {
    static discriminator = 14;
    static kind = "WithdrawalPenaltyLamports";
    discriminator = 14;
    kind = "WithdrawalPenaltyLamports";
    toJSON() {
        return {
            kind: "WithdrawalPenaltyLamports",
        };
    }
    toEncodable() {
        return {
            WithdrawalPenaltyLamports: {},
        };
    }
}
exports.WithdrawalPenaltyLamports = WithdrawalPenaltyLamports;
class WithdrawalPenaltyBps {
    static discriminator = 15;
    static kind = "WithdrawalPenaltyBps";
    discriminator = 15;
    kind = "WithdrawalPenaltyBps";
    toJSON() {
        return {
            kind: "WithdrawalPenaltyBps",
        };
    }
    toEncodable() {
        return {
            WithdrawalPenaltyBps: {},
        };
    }
}
exports.WithdrawalPenaltyBps = WithdrawalPenaltyBps;
class FirstLossCapitalFarm {
    static discriminator = 16;
    static kind = "FirstLossCapitalFarm";
    discriminator = 16;
    kind = "FirstLossCapitalFarm";
    toJSON() {
        return {
            kind: "FirstLossCapitalFarm",
        };
    }
    toEncodable() {
        return {
            FirstLossCapitalFarm: {},
        };
    }
}
exports.FirstLossCapitalFarm = FirstLossCapitalFarm;
class AllowAllocationsInWhitelistedReservesOnly {
    static discriminator = 17;
    static kind = "AllowAllocationsInWhitelistedReservesOnly";
    discriminator = 17;
    kind = "AllowAllocationsInWhitelistedReservesOnly";
    toJSON() {
        return {
            kind: "AllowAllocationsInWhitelistedReservesOnly",
        };
    }
    toEncodable() {
        return {
            AllowAllocationsInWhitelistedReservesOnly: {},
        };
    }
}
exports.AllowAllocationsInWhitelistedReservesOnly = AllowAllocationsInWhitelistedReservesOnly;
class AllowInvestInWhitelistedReservesOnly {
    static discriminator = 18;
    static kind = "AllowInvestInWhitelistedReservesOnly";
    discriminator = 18;
    kind = "AllowInvestInWhitelistedReservesOnly";
    toJSON() {
        return {
            kind: "AllowInvestInWhitelistedReservesOnly",
        };
    }
    toEncodable() {
        return {
            AllowInvestInWhitelistedReservesOnly: {},
        };
    }
}
exports.AllowInvestInWhitelistedReservesOnly = AllowInvestInWhitelistedReservesOnly;
class RewardPerSecond {
    static discriminator = 19;
    static kind = "RewardPerSecond";
    discriminator = 19;
    kind = "RewardPerSecond";
    toJSON() {
        return {
            kind: "RewardPerSecond",
        };
    }
    toEncodable() {
        return {
            RewardPerSecond: {},
        };
    }
}
exports.RewardPerSecond = RewardPerSecond;
class DepositCap {
    static discriminator = 20;
    static kind = "DepositCap";
    discriminator = 20;
    kind = "DepositCap";
    toJSON() {
        return {
            kind: "DepositCap",
        };
    }
    toEncodable() {
        return {
            DepositCap: {},
        };
    }
}
exports.DepositCap = DepositCap;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function fromDecoded(obj) {
    if (typeof obj !== "object") {
        throw new Error("Invalid enum object");
    }
    if ("PerformanceFeeBps" in obj) {
        return new PerformanceFeeBps();
    }
    if ("ManagementFeeBps" in obj) {
        return new ManagementFeeBps();
    }
    if ("MinDepositAmount" in obj) {
        return new MinDepositAmount();
    }
    if ("MinWithdrawAmount" in obj) {
        return new MinWithdrawAmount();
    }
    if ("MinInvestAmount" in obj) {
        return new MinInvestAmount();
    }
    if ("MinInvestDelaySlots" in obj) {
        return new MinInvestDelaySlots();
    }
    if ("CrankFundFeePerReserve" in obj) {
        return new CrankFundFeePerReserve();
    }
    if ("PendingVaultAdmin" in obj) {
        return new PendingVaultAdmin();
    }
    if ("Name" in obj) {
        return new Name();
    }
    if ("LookupTable" in obj) {
        return new LookupTable();
    }
    if ("Farm" in obj) {
        return new Farm();
    }
    if ("AllocationAdmin" in obj) {
        return new AllocationAdmin();
    }
    if ("UnallocatedWeight" in obj) {
        return new UnallocatedWeight();
    }
    if ("UnallocatedTokensCap" in obj) {
        return new UnallocatedTokensCap();
    }
    if ("WithdrawalPenaltyLamports" in obj) {
        return new WithdrawalPenaltyLamports();
    }
    if ("WithdrawalPenaltyBps" in obj) {
        return new WithdrawalPenaltyBps();
    }
    if ("FirstLossCapitalFarm" in obj) {
        return new FirstLossCapitalFarm();
    }
    if ("AllowAllocationsInWhitelistedReservesOnly" in obj) {
        return new AllowAllocationsInWhitelistedReservesOnly();
    }
    if ("AllowInvestInWhitelistedReservesOnly" in obj) {
        return new AllowInvestInWhitelistedReservesOnly();
    }
    if ("RewardPerSecond" in obj) {
        return new RewardPerSecond();
    }
    if ("DepositCap" in obj) {
        return new DepositCap();
    }
    throw new Error("Invalid enum object");
}
function fromJSON(obj) {
    switch (obj.kind) {
        case "PerformanceFeeBps": {
            return new PerformanceFeeBps();
        }
        case "ManagementFeeBps": {
            return new ManagementFeeBps();
        }
        case "MinDepositAmount": {
            return new MinDepositAmount();
        }
        case "MinWithdrawAmount": {
            return new MinWithdrawAmount();
        }
        case "MinInvestAmount": {
            return new MinInvestAmount();
        }
        case "MinInvestDelaySlots": {
            return new MinInvestDelaySlots();
        }
        case "CrankFundFeePerReserve": {
            return new CrankFundFeePerReserve();
        }
        case "PendingVaultAdmin": {
            return new PendingVaultAdmin();
        }
        case "Name": {
            return new Name();
        }
        case "LookupTable": {
            return new LookupTable();
        }
        case "Farm": {
            return new Farm();
        }
        case "AllocationAdmin": {
            return new AllocationAdmin();
        }
        case "UnallocatedWeight": {
            return new UnallocatedWeight();
        }
        case "UnallocatedTokensCap": {
            return new UnallocatedTokensCap();
        }
        case "WithdrawalPenaltyLamports": {
            return new WithdrawalPenaltyLamports();
        }
        case "WithdrawalPenaltyBps": {
            return new WithdrawalPenaltyBps();
        }
        case "FirstLossCapitalFarm": {
            return new FirstLossCapitalFarm();
        }
        case "AllowAllocationsInWhitelistedReservesOnly": {
            return new AllowAllocationsInWhitelistedReservesOnly();
        }
        case "AllowInvestInWhitelistedReservesOnly": {
            return new AllowInvestInWhitelistedReservesOnly();
        }
        case "RewardPerSecond": {
            return new RewardPerSecond();
        }
        case "DepositCap": {
            return new DepositCap();
        }
    }
}
function layout(property) {
    const ret = borsh.rustEnum([
        borsh.struct([], "PerformanceFeeBps"),
        borsh.struct([], "ManagementFeeBps"),
        borsh.struct([], "MinDepositAmount"),
        borsh.struct([], "MinWithdrawAmount"),
        borsh.struct([], "MinInvestAmount"),
        borsh.struct([], "MinInvestDelaySlots"),
        borsh.struct([], "CrankFundFeePerReserve"),
        borsh.struct([], "PendingVaultAdmin"),
        borsh.struct([], "Name"),
        borsh.struct([], "LookupTable"),
        borsh.struct([], "Farm"),
        borsh.struct([], "AllocationAdmin"),
        borsh.struct([], "UnallocatedWeight"),
        borsh.struct([], "UnallocatedTokensCap"),
        borsh.struct([], "WithdrawalPenaltyLamports"),
        borsh.struct([], "WithdrawalPenaltyBps"),
        borsh.struct([], "FirstLossCapitalFarm"),
        borsh.struct([], "AllowAllocationsInWhitelistedReservesOnly"),
        borsh.struct([], "AllowInvestInWhitelistedReservesOnly"),
        borsh.struct([], "RewardPerSecond"),
        borsh.struct([], "DepositCap"),
    ]);
    if (property !== undefined) {
        return ret.replicate(property);
    }
    return ret;
}
//# sourceMappingURL=VaultConfigField.js.map