/** * 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, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; /** Currency mint definition */ export type CurrencyConfig = { /** The mint associated with this currency */ mint: Address; /** The vault associated with this currency */ vault: Address; /** The DAO vault associated with this currency */ daoVault: Address; /** The duration of a withdrawal epoch in seconds, if `0` withdrawals are disabled */ withdrawEpochDuration: number; /** The max withdrawable amount each epoch */ circuitBreaker: bigint; }; export type CurrencyConfigArgs = { /** The mint associated with this currency */ mint: Address; /** The vault associated with this currency */ vault: Address; /** The DAO vault associated with this currency */ daoVault: Address; /** The duration of a withdrawal epoch in seconds, if `0` withdrawals are disabled */ withdrawEpochDuration: number; /** The max withdrawable amount each epoch */ circuitBreaker: number | bigint; }; export function getCurrencyConfigEncoder(): FixedSizeEncoder { return getStructEncoder([ ['mint', getAddressEncoder()], ['vault', getAddressEncoder()], ['daoVault', getAddressEncoder()], ['withdrawEpochDuration', getU32Encoder()], ['circuitBreaker', getU64Encoder()], ]); } export function getCurrencyConfigDecoder(): FixedSizeDecoder { return getStructDecoder([ ['mint', getAddressDecoder()], ['vault', getAddressDecoder()], ['daoVault', getAddressDecoder()], ['withdrawEpochDuration', getU32Decoder()], ['circuitBreaker', getU64Decoder()], ]); } export function getCurrencyConfigCodec(): FixedSizeCodec< CurrencyConfigArgs, CurrencyConfig > { return combineCodec(getCurrencyConfigEncoder(), getCurrencyConfigDecoder()); }