import { type Address, type Hex, type PublicClient } from "viem"; import { type BuildQueryFn } from "../../utils/buildQuery.js"; import { type EulerPlugin } from "../types.js"; export type PythUpdateBundle = { feedIds: Hex[]; publishTimes: number[]; updates: Hex[]; }; /** * Adapter for the Pyth plugin. Follows the SDK's injectable query pattern: * all external calls are `query*` arrow-function properties, wrapped by `applyBuildQuery`. */ export declare class PythPluginAdapter { private hermesUrl; private fetchFn; private inFlightUpdateBundles; constructor(hermesUrl: string, buildQuery?: BuildQueryFn, fetchFn?: typeof fetch); /** * Fetch latest price update data from Pyth Hermes API. * Concurrent calls coalesce only when their normalized feed sets are * identical. */ queryPythUpdateBundle: (feedIds: Hex[]) => Promise; queryPythUpdateData: (feedIds: Hex[]) => Promise; getQueryKeyPythUpdateBundle(feedIds: Hex[]): string | null; getQueryKeyPythUpdateData(feedIds: Hex[]): string | null; private fetchPythUpdateBundle; /** * Query the on-chain Pyth contract for the fee required to update given price data. */ queryPythUpdateFee: (provider: PublicClient, pythAddress: Address, updateData: Hex[]) => Promise; getQueryKeyPythUpdateFee(provider: PublicClient, pythAddress: Address, updateData: Hex[]): string | null; setQueryPythUpdateData(fn: typeof this.queryPythUpdateData): void; setQueryPythUpdateBundle(fn: typeof this.queryPythUpdateBundle): void; setQueryPythUpdateFee(fn: typeof this.queryPythUpdateFee): void; } export interface PythPluginConfig { hermesUrl?: string; buildQuery?: BuildQueryFn; /** Additional trusted Pyth contract addresses by chain ID. Official addresses are allowed by default. */ pythAddresses?: Record; /** Maximum native-token fee accepted for one Pyth update batch. Defaults to 0.01 native token. */ maxUpdateFee?: bigint; /** Override fetch used to call the Hermes endpoint. Apps that proxy Hermes through their own backend (e.g. to satisfy CSP) pass a fetcher that rewrites the request URL. */ fetchFn?: typeof fetch; } export declare function createPythPlugin(config?: PythPluginConfig): EulerPlugin; //# sourceMappingURL=pythPlugin.d.ts.map