/** * 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, getArrayEncoder, getBytesEncoder, getProgramDerivedAddress, getU8Encoder, type Address, type ProgramDerivedAddress, } from '@solana/kit'; export type FactionOwnershipSeeds = { gameId: Address; /** 1-byte mandatory discriminator — the cross-kind collision boundary; never drop, never derive from data. */ assetKind: number; /** 32-byte canonical identity. */ assetKey: Array; }; /** * Dynamic-ownership sidecar for ONE asset. Sized `Pod` (the `CurrencyConfigCache` idiom), `#[repr(C,packed)]`, * `Align1`. `directive_block` is RESERVED for P5 (zero-written, read nowhere in P4). */ export async function findFactionOwnershipPda( seeds: FactionOwnershipSeeds, config: { programAddress?: Address | undefined } = {}, ): Promise { const { programAddress = 'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF' as Address<'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF'>, } = config; return await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([ 70, 97, 99, 116, 105, 111, 110, 79, 119, 110, 101, 114, 115, 104, 105, 112, ]), ), getAddressEncoder().encode(seeds.gameId), getU8Encoder().encode(seeds.assetKind), getArrayEncoder(getU8Encoder(), { size: 32 }).encode(seeds.assetKey), ], }); }