/** * 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, getU64Encoder, type Address, type ProgramDerivedAddress, } from '@solana/kit'; import { getMinorFactionIdEncoder, type MinorFactionIdArgs } from '../types'; export type LoyaltyContributionSeeds = { gameId: Address; profile: Address; factionId: MinorFactionIdArgs; epochIndex: number | bigint; }; /** One profile's LP in one faction epoch. LP never rolls forward. */ export async function findLoyaltyContributionPda( seeds: LoyaltyContributionSeeds, config: { programAddress?: Address | undefined } = {}, ): Promise { const { programAddress = 'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF' as Address<'C4SAgeKLgb3pTLWhVr6NRwWyYFuTR7ZeSXFrzoLwfMzF'>, } = config; return await getProgramDerivedAddress({ programAddress, seeds: [ getBytesEncoder().encode( new Uint8Array([ 76, 111, 121, 97, 108, 116, 121, 67, 111, 110, 116, 114, 105, 98, 117, 116, 105, 111, 110, ]), ), getAddressEncoder().encode(seeds.gameId), getAddressEncoder().encode(seeds.profile), getMinorFactionIdEncoder().encode(seeds.factionId), getU64Encoder().encode(seeds.epochIndex), ], }); }