import { PublicKey } from "@solana/web3.js"; import { Buffer } from "buffer"; import { MarketState, PoolState } from "../types.js"; /** * Parse a MarketState account from raw buffer data * * This is useful when you've fetched account data directly via connection.getAccountInfo() * without using Anchor's account deserialization. * * @param data - Raw account data buffer (excluding 8-byte discriminator) * @returns Parsed MarketState object * @throws Error if buffer is too small * * @example * ```typescript * const marketPda = getMarketAddress(1); * const accountInfo = await connection.getAccountInfo(marketPda); * if (accountInfo) { * // Skip 8-byte discriminator * const market = parseMarketAccount(accountInfo.data.slice(8)); * } * ``` */ export declare function parseMarketAccount(data: Uint8Array | Buffer): MarketState; /** * Check if a market has ended based on timestamp * * Uses BN comparison to avoid toNumber() on timestamp. * * @param market - MarketState object * @returns true if current time is past end_timestamp */ export declare function isMarketEnded(market: MarketState): boolean; /** * Check if both pools are settled * * @param market - MarketState object * @returns true if both high and low pools are settled */ export declare function isFullySettled(market: MarketState): boolean; /** * Get the token mint for a specific position * * @param pool - PoolState object * @param strikeIndex - Strike index (0, 1, or 2) * @param isHit - Whether this is a HIT token * @returns Token mint public key */ export declare function getTokenMint(pool: PoolState, strikeIndex: number, isHit: boolean): PublicKey; //# sourceMappingURL=market.d.ts.map