/** * 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 EphemeralMarketSeeds = { gameId: Address; ownerCharacter: Address; }; /** * The revealed, player-scoped, time-boxed NPC market (Phase 3). Created (player-funded) at reveal when * the rare candidacy hits; holds the concrete `LiveOffer`s + an `expires_at`. Trades settle DIRECTLY * against the `EncounterTreasury`, so this account itself holds NO funds (close is trivial — nothing to * sweep). One open market per character at a time (seeds = game + owner character); the prior one must * be reaped before a new reveal. */ export async function findEphemeralMarketPda( seeds: EphemeralMarketSeeds, config: { programAddress?: Address | undefined } = {}, ): Promise { const { programAddress = 'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF' as Address<'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF'>, } = config; return await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([ 69, 112, 104, 101, 109, 101, 114, 97, 108, 77, 97, 114, 107, 101, 116, ]), ), getAddressEncoder().encode(seeds.gameId), getAddressEncoder().encode(seeds.ownerCharacter), ], }); }