import { Connection } from "@solana/web3.js"; import { Buffer } from "buffer"; import { RegistryState } from "../types.js"; /** * Parse a RegistryState account from raw buffer data * * @param data - Raw account data buffer (excluding 8-byte discriminator) * @returns Parsed RegistryState object * @throws Error if buffer is too small * * @example * ```typescript * const registryPda = getRegistryAddress(); * const accountInfo = await connection.getAccountInfo(registryPda); * if (accountInfo) { * // Skip 8-byte discriminator * const registry = parseRegistryAccount(accountInfo.data.slice(8)); * console.log('Active weeks:', registry.activeWeeks); * } * ``` */ export declare function parseRegistryAccount(data: Uint8Array | Buffer): RegistryState; /** * Fetch and parse the registry account * * @param connection - Solana connection * @returns RegistryState or null if account doesn't exist * * @example * ```typescript * const registry = await fetchRegistry(connection); * if (registry) { * console.log(`${registry.activeCount} active markets`); * for (const weekNumber of registry.activeWeeks) { * console.log(` Week ${weekNumber}`); * } * } * ``` */ export declare function fetchRegistry(connection: Connection): Promise; /** * Get all active market week numbers * * @param connection - Solana connection * @returns Array of active week numbers, or empty array if registry doesn't exist * * @example * ```typescript * const activeWeeks = await getActiveMarketWeeks(connection); * for (const weekNumber of activeWeeks) { * const marketPda = getMarketAddress(weekNumber); * // Fetch market data... * } * ``` */ export declare function getActiveMarketWeeks(connection: Connection): Promise; //# sourceMappingURL=registry.d.ts.map