/** * 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, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; import { getMinorFactionIdDecoder, getMinorFactionIdEncoder, type MinorFactionId, type MinorFactionIdArgs, } from '.'; /** * Canonical unordered faction-pair key (`lo <= hi`, so `(a,b)` and `(b,a)` map to ONE entry). `Pod` packed, * align 1, 4 B. As a `Map` key it MUST derive `Ord`/`PartialOrd` (mirrors `define_id_struct!` + `BoundingBox`). */ export type FactionPair = { /** The numerically-smaller faction id. */ lo: MinorFactionId; /** The numerically-larger faction id. */ hi: MinorFactionId; }; export type FactionPairArgs = { /** The numerically-smaller faction id. */ lo: MinorFactionIdArgs; /** The numerically-larger faction id. */ hi: MinorFactionIdArgs; }; export function getFactionPairEncoder(): FixedSizeEncoder { return getStructEncoder([ ['lo', getMinorFactionIdEncoder()], ['hi', getMinorFactionIdEncoder()], ]); } export function getFactionPairDecoder(): FixedSizeDecoder { return getStructDecoder([ ['lo', getMinorFactionIdDecoder()], ['hi', getMinorFactionIdDecoder()], ]); } export function getFactionPairCodec(): FixedSizeCodec< FactionPairArgs, FactionPair > { return combineCodec(getFactionPairEncoder(), getFactionPairDecoder()); }