/** * 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 EncounterCommitSeeds = { gameId: Address; character: Address; }; /** * Per-character commit tracker for the two-phase encounter reveal (Option B — migration-safe; this * avoids touching the core `Fleet` account, which is a non-singleton `#[unsized_type]` with no spare * pad). Created once per character via `OpenEncounterTracking`; a scan that arms an encounter stamps * `commit_slot` + `region_id` + the triggering `fleet` here. The reveal reads it, draws the contents * from a *later* slot's hash, and clears it. One pending encounter per character at a time — a * subsequent scan overwrites the prior pending commit (reinforces the anti-multi-fleet design). */ export async function findEncounterCommitPda( seeds: EncounterCommitSeeds, 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, 67, 111, 109, 109, 105, 116, ]), ), getAddressEncoder().encode(seeds.gameId), getAddressEncoder().encode(seeds.character), ], }); }