/** * 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 { getAddressEncoder, getBytesEncoder, getProgramDerivedAddress, type Address, type ProgramDerivedAddress, } from '@solana/kit'; export type FleetCrewBindingSeeds = { /** The owning `Fleet`. */ fleet: Address; }; /** * Each fleet's per-fleet crew aggregate. **Presence = at least one crew onboarded.** The * gameplay folds read `summary` (the sum of ONLY this fleet's onboarded crew), maintained by * `LoadFleetCrewRoster`/`UnloadFleetCrewRoster`. * * Body = 1 (version) + 1 (bump) + 6 (reserved) + 32 (fleet) + 32 (owner) + 315 (summary) * + 8 (last_action_epoch) = **395 B**, align 1. (The summary grew 274 → 314 with the * per-skill-XP accumulator block, → 315 with the `max_rarity` cache byte; `last_action_epoch` * is the binding-tail Cold Start marker. The header fields before the summary — * version/bump/_reserved/fleet/owner, 72 B — are unchanged, so the summary still begins at * account-offset `8 (disc) + 72 = 80`, exactly as before.) */ export async function findFleetCrewBindingPda( seeds: FleetCrewBindingSeeds, config: { programAddress?: Address | undefined } = {}, ): Promise { const { programAddress = 'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF' as Address<'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF'>, } = config; return await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([ 70, 108, 101, 101, 116, 67, 114, 101, 119, 66, 105, 110, 100, 105, 110, 103, ]), ), getAddressEncoder().encode(seeds.fleet), ], }); }