/** * 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, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, type CargoId, type CargoIdArgs, } from '.'; /** * A medallion generation and the buyer liability attached to it. * * Changing `cargo_id` creates a new token generation. Keeping `cargo_id` while changing `buyer_price` * reprices every outstanding token and therefore requires an explicit update opt-in. */ export type MedallionRewardConfig = { cargoId: CargoId; generation: number; buyerPrice: bigint; }; export type MedallionRewardConfigArgs = { cargoId: CargoIdArgs; generation: number; buyerPrice: number | bigint; }; export function getMedallionRewardConfigEncoder(): FixedSizeEncoder { return getStructEncoder([ ['cargoId', getCargoIdEncoder()], ['generation', getU16Encoder()], ['buyerPrice', getU64Encoder()], ]); } export function getMedallionRewardConfigDecoder(): FixedSizeDecoder { return getStructDecoder([ ['cargoId', getCargoIdDecoder()], ['generation', getU16Decoder()], ['buyerPrice', getU64Decoder()], ]); } export function getMedallionRewardConfigCodec(): FixedSizeCodec< MedallionRewardConfigArgs, MedallionRewardConfig > { return combineCodec( getMedallionRewardConfigEncoder(), getMedallionRewardConfigDecoder(), ); }