/** * 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 */ import { combineCodec, getAddressDecoder, getAddressEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; import { getFeeDecoder, getFeeEncoder, getLiqPoolDecoder, getLiqPoolEncoder, getStakeSystemDecoder, getStakeSystemEncoder, getValidatorSystemDecoder, getValidatorSystemEncoder, type Fee, type FeeArgs, type LiqPool, type LiqPoolArgs, type StakeSystem, type StakeSystemArgs, type ValidatorSystem, type ValidatorSystemArgs, } from "."; export type State = { msolMint: Address; adminAuthority: Address; operationalSolAccount: Address; treasuryMsolAccount: Address; reserveBumpSeed: number; msolMintAuthorityBumpSeed: number; rentExemptForTokenAcc: bigint; rewardFee: Fee; stakeSystem: StakeSystem; validatorSystem: ValidatorSystem; liqPool: LiqPool; availableReserveBalance: bigint; msolSupply: bigint; msolPrice: bigint; /** count tickets for delayed-unstake */ circulatingTicketCount: bigint; /** total lamports amount of generated and not claimed yet tickets */ circulatingTicketBalance: bigint; lentFromReserve: bigint; minDeposit: bigint; minWithdraw: bigint; stakingSolCap: bigint; emergencyCoolingDown: bigint; }; export type StateArgs = { msolMint: Address; adminAuthority: Address; operationalSolAccount: Address; treasuryMsolAccount: Address; reserveBumpSeed: number; msolMintAuthorityBumpSeed: number; rentExemptForTokenAcc: number | bigint; rewardFee: FeeArgs; stakeSystem: StakeSystemArgs; validatorSystem: ValidatorSystemArgs; liqPool: LiqPoolArgs; availableReserveBalance: number | bigint; msolSupply: number | bigint; msolPrice: number | bigint; /** count tickets for delayed-unstake */ circulatingTicketCount: number | bigint; /** total lamports amount of generated and not claimed yet tickets */ circulatingTicketBalance: number | bigint; lentFromReserve: number | bigint; minDeposit: number | bigint; minWithdraw: number | bigint; stakingSolCap: number | bigint; emergencyCoolingDown: number | bigint; }; export function getStateEncoder(): FixedSizeEncoder { return getStructEncoder([ ["msolMint", getAddressEncoder()], ["adminAuthority", getAddressEncoder()], ["operationalSolAccount", getAddressEncoder()], ["treasuryMsolAccount", getAddressEncoder()], ["reserveBumpSeed", getU8Encoder()], ["msolMintAuthorityBumpSeed", getU8Encoder()], ["rentExemptForTokenAcc", getU64Encoder()], ["rewardFee", getFeeEncoder()], ["stakeSystem", getStakeSystemEncoder()], ["validatorSystem", getValidatorSystemEncoder()], ["liqPool", getLiqPoolEncoder()], ["availableReserveBalance", getU64Encoder()], ["msolSupply", getU64Encoder()], ["msolPrice", getU64Encoder()], ["circulatingTicketCount", getU64Encoder()], ["circulatingTicketBalance", getU64Encoder()], ["lentFromReserve", getU64Encoder()], ["minDeposit", getU64Encoder()], ["minWithdraw", getU64Encoder()], ["stakingSolCap", getU64Encoder()], ["emergencyCoolingDown", getU64Encoder()], ]); } export function getStateDecoder(): FixedSizeDecoder { return getStructDecoder([ ["msolMint", getAddressDecoder()], ["adminAuthority", getAddressDecoder()], ["operationalSolAccount", getAddressDecoder()], ["treasuryMsolAccount", getAddressDecoder()], ["reserveBumpSeed", getU8Decoder()], ["msolMintAuthorityBumpSeed", getU8Decoder()], ["rentExemptForTokenAcc", getU64Decoder()], ["rewardFee", getFeeDecoder()], ["stakeSystem", getStakeSystemDecoder()], ["validatorSystem", getValidatorSystemDecoder()], ["liqPool", getLiqPoolDecoder()], ["availableReserveBalance", getU64Decoder()], ["msolSupply", getU64Decoder()], ["msolPrice", getU64Decoder()], ["circulatingTicketCount", getU64Decoder()], ["circulatingTicketBalance", getU64Decoder()], ["lentFromReserve", getU64Decoder()], ["minDeposit", getU64Decoder()], ["minWithdraw", getU64Decoder()], ["stakingSolCap", getU64Decoder()], ["emergencyCoolingDown", getU64Decoder()], ]); } export function getStateCodec(): FixedSizeCodec { return combineCodec(getStateEncoder(), getStateDecoder()); }