/** * 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, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; import { getMinorFactionIdDecoder, getMinorFactionIdEncoder, type MinorFactionId, type MinorFactionIdArgs, } from '.'; export type InitFactionOwnershipArgs = { /** Dynamic controller to seed (0 = legacy-owned but now in the dynamic regime / contestable). */ controllingFaction: MinorFactionId; /** No re-flip until this ts (0 = immediately capturable); must be 0 or strictly-future + capped. */ contestedUntil: bigint; /** Generation witness (== `StarSystem.seq_id` for a starbase); 0 for Fleet/Region. */ capturedSeqId: bigint; }; export type InitFactionOwnershipArgsArgs = { /** Dynamic controller to seed (0 = legacy-owned but now in the dynamic regime / contestable). */ controllingFaction: MinorFactionIdArgs; /** No re-flip until this ts (0 = immediately capturable); must be 0 or strictly-future + capped. */ contestedUntil: number | bigint; /** Generation witness (== `StarSystem.seq_id` for a starbase); 0 for Fleet/Region. */ capturedSeqId: number | bigint; }; export function getInitFactionOwnershipArgsEncoder(): FixedSizeEncoder { return getStructEncoder([ ['controllingFaction', getMinorFactionIdEncoder()], ['contestedUntil', getI64Encoder()], ['capturedSeqId', getU64Encoder()], ]); } export function getInitFactionOwnershipArgsDecoder(): FixedSizeDecoder { return getStructDecoder([ ['controllingFaction', getMinorFactionIdDecoder()], ['contestedUntil', getI64Decoder()], ['capturedSeqId', getU64Decoder()], ]); } export function getInitFactionOwnershipArgsCodec(): FixedSizeCodec< InitFactionOwnershipArgsArgs, InitFactionOwnershipArgs > { return combineCodec( getInitFactionOwnershipArgsEncoder(), getInitFactionOwnershipArgsDecoder(), ); }