import { PythPrice } from "./types.js"; import type { OutcomeResult } from "../outcome/types.js"; import BN from "bn.js"; /** * Pyth Price Service * * Fetches SOL/USD prices from Pyth Hermes API for: * - Displaying current prices * - Checking if price crosses strikes * - Getting price update data for on-chain verification * * @example * ```typescript * const priceService = new PythPriceService(); * * // Get current price * const price = await priceService.getLatestPrice(); * console.log(`SOL/USD: $${price.price}`); * * // Get price update data for on-chain posting * const updateData = await priceService.getPriceUpdateData(); * ``` */ export declare class PythPriceService { private hermesUrl; private feedId; /** * Create a new PythPriceService * * @param hermesUrl - Hermes API URL (default: https://hermes.pyth.network) * @param feedId - Pyth feed ID (default: SOL/USD) */ constructor(hermesUrl?: string, feedId?: string); /** * Get the latest SOL/USD price * * @returns Parsed price data * @throws Error if fetch fails or price is not available */ getLatestPrice(): Promise; /** * Get price update data for posting to Pyth Solana Receiver * * This returns the VAA (Verified Action Approval) data that needs to be * posted on-chain before calling mark_extreme. * * @returns Base64-encoded price update data * @throws Error if fetch fails */ getPriceUpdateData(): Promise; /** * Calculate the expected outcome based on current price and strikes * * @deprecated Use calculateOutcome from @pit-protocol/sdk/outcome instead * * @param priceInCents - Current price in cents * @param strikes - Strike prices in cents [strike0, strike1, strike2] * @returns Outcome for both High and Low pools */ calculateOutcome(priceInCents: number, strikes: [BN, BN, BN] | [number, number, number]): OutcomeResult; /** * Check if a new outcome should be marked * * @deprecated Use shouldMarkExtreme from @pit-protocol/sdk/outcome instead * * @param currentOutcome - Current winning_outcome from pool * @param newOutcome - Calculated outcome from price * @returns true if newOutcome > currentOutcome (should call mark_extreme) */ shouldMarkExtreme(currentOutcome: number, newOutcome: number): boolean; } //# sourceMappingURL=hermes.d.ts.map