/** * 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, getArrayDecoder, getArrayEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; export type DemocracyCurveValues = { algorithmVersion: number; pad0: Array; pvpThreshold: bigint; basePvpPerCrew: bigint; premiumCoefficientNumerator: bigint; premiumCoefficientDenominator: bigint; maxPvp: bigint; /** Exact v1 output at `max_pvp`; consumers can preflight representability without recomputing. */ maxRequiredCrew: bigint; }; export type DemocracyCurveValuesArgs = { algorithmVersion: number; pad0: Array; pvpThreshold: number | bigint; basePvpPerCrew: number | bigint; premiumCoefficientNumerator: number | bigint; premiumCoefficientDenominator: number | bigint; maxPvp: number | bigint; /** Exact v1 output at `max_pvp`; consumers can preflight representability without recomputing. */ maxRequiredCrew: number | bigint; }; export function getDemocracyCurveValuesEncoder(): FixedSizeEncoder { return getStructEncoder([ ['algorithmVersion', getU8Encoder()], ['pad0', getArrayEncoder(getU8Encoder(), { size: 7 })], ['pvpThreshold', getU64Encoder()], ['basePvpPerCrew', getU64Encoder()], ['premiumCoefficientNumerator', getU64Encoder()], ['premiumCoefficientDenominator', getU64Encoder()], ['maxPvp', getU64Encoder()], ['maxRequiredCrew', getU64Encoder()], ]); } export function getDemocracyCurveValuesDecoder(): FixedSizeDecoder { return getStructDecoder([ ['algorithmVersion', getU8Decoder()], ['pad0', getArrayDecoder(getU8Decoder(), { size: 7 })], ['pvpThreshold', getU64Decoder()], ['basePvpPerCrew', getU64Decoder()], ['premiumCoefficientNumerator', getU64Decoder()], ['premiumCoefficientDenominator', getU64Decoder()], ['maxPvp', getU64Decoder()], ['maxRequiredCrew', getU64Decoder()], ]); } export function getDemocracyCurveValuesCodec(): FixedSizeCodec< DemocracyCurveValuesArgs, DemocracyCurveValues > { return combineCodec( getDemocracyCurveValuesEncoder(), getDemocracyCurveValuesDecoder(), ); }