/** * 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, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, type CargoId, type CargoIdArgs, } from '.'; /** One entry in the synthetic-salvage table. */ export type SalvageRewardEntry = { cargoId: CargoId; weight: number; referenceValue: bigint; }; export type SalvageRewardEntryArgs = { cargoId: CargoIdArgs; weight: number; referenceValue: number | bigint; }; export function getSalvageRewardEntryEncoder(): FixedSizeEncoder { return getStructEncoder([ ['cargoId', getCargoIdEncoder()], ['weight', getU32Encoder()], ['referenceValue', getU64Encoder()], ]); } export function getSalvageRewardEntryDecoder(): FixedSizeDecoder { return getStructDecoder([ ['cargoId', getCargoIdDecoder()], ['weight', getU32Decoder()], ['referenceValue', getU64Decoder()], ]); } export function getSalvageRewardEntryCodec(): FixedSizeCodec< SalvageRewardEntryArgs, SalvageRewardEntry > { return combineCodec( getSalvageRewardEntryEncoder(), getSalvageRewardEntryDecoder(), ); }