/** * 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, getU16Encoder, type Address, type ProgramDerivedAddress, } from '@solana/kit'; export type CrewRosterSeeds = { /** The owning SAGE `Character`. */ character: Address; /** `0`-based page index within this character's roster. */ pageIndex: number; }; /** * The bulk crew container for one `(Character, page_index)`: a `RosterSummary` cache * header + an append-only `List`. * * `#[unsized_type(program_account, seeds = CrewRosterSeeds)]` — same form as the * marketplace `Market` (marketplace/src/state_rs:384-398) and SAGE `Character` * (character_rs:17-29). `summary` is the sized packed header (315 B); `crew` is the * unsized tail. */ export async function findCrewRosterPda( seeds: CrewRosterSeeds, config: { programAddress?: Address | undefined } = {}, ): Promise { const { programAddress = 'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF' as Address<'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF'>, } = config; return await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([67, 114, 101, 119, 82, 111, 115, 116, 101, 114]), ), getAddressEncoder().encode(seeds.character), getU16Encoder().encode(seeds.pageIndex), ], }); }