/** * 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, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from '@solana/kit'; export type UpdateCurrencyArgs = { /** The duration of a withdrawal epoch in seconds, if `0` withdrawals are disabled */ withdrawEpochDuration: Option; /** The max withdrawable amount each epoch */ circuitBreaker: Option; }; export type UpdateCurrencyArgsArgs = { /** The duration of a withdrawal epoch in seconds, if `0` withdrawals are disabled */ withdrawEpochDuration: OptionOrNullable; /** The max withdrawable amount each epoch */ circuitBreaker: OptionOrNullable; }; export function getUpdateCurrencyArgsEncoder(): Encoder { return getStructEncoder([ ['withdrawEpochDuration', getOptionEncoder(getU32Encoder())], ['circuitBreaker', getOptionEncoder(getU64Encoder())], ]); } export function getUpdateCurrencyArgsDecoder(): Decoder { return getStructDecoder([ ['withdrawEpochDuration', getOptionDecoder(getU32Decoder())], ['circuitBreaker', getOptionDecoder(getU64Decoder())], ]); } export function getUpdateCurrencyArgsCodec(): Codec< UpdateCurrencyArgsArgs, UpdateCurrencyArgs > { return combineCodec( getUpdateCurrencyArgsEncoder(), getUpdateCurrencyArgsDecoder(), ); }