/** * 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, fixDecoderSize, fixEncoderSize, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array, } from "@solana/kit"; export type VaultConfiguration = { /** The maximum total amount allowed in the vault. */ maxCap: bigint; /** active from timestamp */ startAtTs: bigint; /** The locked profit degradation duration. */ lockedProfitDegradationDuration: bigint; /** The waiting period for a withdrawal. prec: seconds */ withdrawalWaitingPeriod: bigint; /** Reserved bytes for future use. */ disabledOperations: number; /** Reserved bytes for future use. */ reserved: ReadonlyUint8Array; }; export type VaultConfigurationArgs = { /** The maximum total amount allowed in the vault. */ maxCap: number | bigint; /** active from timestamp */ startAtTs: number | bigint; /** The locked profit degradation duration. */ lockedProfitDegradationDuration: number | bigint; /** The waiting period for a withdrawal. prec: seconds */ withdrawalWaitingPeriod: number | bigint; /** Reserved bytes for future use. */ disabledOperations: number; /** Reserved bytes for future use. */ reserved: ReadonlyUint8Array; }; export function getVaultConfigurationEncoder(): FixedSizeEncoder { return getStructEncoder([ ["maxCap", getU64Encoder()], ["startAtTs", getU64Encoder()], ["lockedProfitDegradationDuration", getU64Encoder()], ["withdrawalWaitingPeriod", getU64Encoder()], ["disabledOperations", getU16Encoder()], ["reserved", fixEncoderSize(getBytesEncoder(), 46)], ]); } export function getVaultConfigurationDecoder(): FixedSizeDecoder { return getStructDecoder([ ["maxCap", getU64Decoder()], ["startAtTs", getU64Decoder()], ["lockedProfitDegradationDuration", getU64Decoder()], ["withdrawalWaitingPeriod", getU64Decoder()], ["disabledOperations", getU16Decoder()], ["reserved", fixDecoderSize(getBytesDecoder(), 46)], ]); } export function getVaultConfigurationCodec(): FixedSizeCodec< VaultConfigurationArgs, VaultConfiguration > { return combineCodec( getVaultConfigurationEncoder(), getVaultConfigurationDecoder(), ); }