/** * 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, getArrayDecoder, getArrayEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; import { getRelationshipDecoder, getRelationshipEncoder, type Relationship, type RelationshipArgs, } from '.'; /** * Per-pair relation record (the `Map` value). Account-field-only → `borsh_with_bytemuck!`. CANNOT be `Pod` * (it embeds the [`Relationship`] enum). `#[repr(C)]` with `PackedValue` for the i64 keeps it align-1 * without `packed` (mirrors [`ScanLootEntry`](crate::state::ScanLootEntry)). */ export type RelationEntry = { /** The relationship kind. */ rel: Relationship; /** Reserved per-pair growth (NOT alignment padding). */ reserved: Array; /** Unix ts the ceasefire lifts; attackable once `now >= this` (meaningful only when `rel == Ceasefire`). */ ceasefireUntil: bigint; }; export type RelationEntryArgs = { /** The relationship kind. */ rel: RelationshipArgs; /** Reserved per-pair growth (NOT alignment padding). */ reserved: Array; /** Unix ts the ceasefire lifts; attackable once `now >= this` (meaningful only when `rel == Ceasefire`). */ ceasefireUntil: number | bigint; }; export function getRelationEntryEncoder(): FixedSizeEncoder { return getStructEncoder([ ['rel', getRelationshipEncoder()], ['reserved', getArrayEncoder(getU8Encoder(), { size: 7 })], ['ceasefireUntil', getI64Encoder()], ]); } export function getRelationEntryDecoder(): FixedSizeDecoder { return getStructDecoder([ ['rel', getRelationshipDecoder()], ['reserved', getArrayDecoder(getU8Decoder(), { size: 7 })], ['ceasefireUntil', getI64Decoder()], ]); } export function getRelationEntryCodec(): FixedSizeCodec< RelationEntryArgs, RelationEntry > { return combineCodec(getRelationEntryEncoder(), getRelationEntryDecoder()); }