/** * 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, getAddressDecoder, getAddressEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array, } from "@solana/kit"; export type VaultAsset = { /** The mint for the vault’s main asset. */ mint: Address; /** The “idle” token account holding un-invested assets. */ idleAta: Address; /** The total amount of this asset currently in the vault. */ totalValue: bigint; /** The bump for the vault asset mint. */ idleAtaAuthBump: number; /** Reserved bytes for future use. */ reserved: ReadonlyUint8Array; }; export type VaultAssetArgs = { /** The mint for the vault’s main asset. */ mint: Address; /** The “idle” token account holding un-invested assets. */ idleAta: Address; /** The total amount of this asset currently in the vault. */ totalValue: number | bigint; /** The bump for the vault asset mint. */ idleAtaAuthBump: number; /** Reserved bytes for future use. */ reserved: ReadonlyUint8Array; }; export function getVaultAssetEncoder(): FixedSizeEncoder { return getStructEncoder([ ["mint", getAddressEncoder()], ["idleAta", getAddressEncoder()], ["totalValue", getU64Encoder()], ["idleAtaAuthBump", getU8Encoder()], ["reserved", fixEncoderSize(getBytesEncoder(), 95)], ]); } export function getVaultAssetDecoder(): FixedSizeDecoder { return getStructDecoder([ ["mint", getAddressDecoder()], ["idleAta", getAddressDecoder()], ["totalValue", getU64Decoder()], ["idleAtaAuthBump", getU8Decoder()], ["reserved", fixDecoderSize(getBytesDecoder(), 95)], ]); } export function getVaultAssetCodec(): FixedSizeCodec< VaultAssetArgs, VaultAsset > { return combineCodec(getVaultAssetEncoder(), getVaultAssetDecoder()); }