@nosana/kit
Version:
Nosana KIT
24 lines (23 loc) • 930 B
TypeScript
import { Address } from '@solana/kit';
import type { SolanaService } from '../services/solana/index.js';
import type { ProgramConfig } from '../config/types.js';
export type StaticAccounts = {
rewardsReflection: Address;
rewardsVault: Address;
rewardsProgram: Address;
jobsProgram: Address;
};
export type StaticAccountsCache = {
value?: StaticAccounts;
promise?: Promise<StaticAccounts>;
};
/**
* Gets the static accounts, initializing them if needed.
* This function caches the result to avoid redundant PDA lookups.
*
* @param programsConfig - Programs configuration
* @param solana - Solana service for PDA lookups
* @param cache - Optional cache object to store the result (for memoization)
* @returns Promise resolving to static accounts
*/
export declare function getStaticAccounts(programsConfig: ProgramConfig, solana: SolanaService, cache?: StaticAccountsCache): Promise<StaticAccounts>;