/** * 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'; import { getMinorFactionIdEncoder, getRegionIdEncoder, type MinorFactionIdArgs, type RegionIdArgs, } from '../types'; export type EncounterPoolSeeds = { gameId: Address; regionId: RegionIdArgs; minorFaction: MinorFactionIdArgs; }; /** * The dev-registered ENVELOPE for one `(region, minor_faction)` encounter pool. * * Long-lived; created/edited only by `MANAGE_NPC_ENCOUNTERS`-gated admin instructions and read-only * at encounter time. Modeled on [`ScanPattern`](crate::state::ScanPattern): a sized header + an * `#[unsized_start]` `List` tail (additive growth lives in the tail). */ export async function findEncounterPoolPda( seeds: EncounterPoolSeeds, config: { programAddress?: Address | undefined } = {}, ): Promise { const { programAddress = 'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF' as Address<'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF'>, } = config; return await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([ 69, 110, 99, 111, 117, 110, 116, 101, 114, 80, 111, 111, 108, ]), ), getAddressEncoder().encode(seeds.gameId), getRegionIdEncoder().encode(seeds.regionId), getMinorFactionIdEncoder().encode(seeds.minorFaction), ], }); }