import { type Address } from 'viem'; import type * as Tidx from './Tidx.js'; import type * as Viem from './Viem.js'; /** Only interval supported by historical Earn share prices. */ export declare const interval: 'day'; /** Maximum observations returned by one historical share-price request. */ export declare const maxPoints = 31; /** Reads daily historical share prices for one Earn vault. */ export declare function resolve(options: resolve.Options): Promise; export declare namespace resolve { /** Inputs selecting one Earn vault share-price series. */ type Options = { /** Chain containing the Earn vault. */ chainId: number; /** First inclusive daily observation, as an ISO 8601 timestamp. */ from: string; /** Resolves the chain RPC client used for historical quotes. */ getClient: Viem.GetClient; /** Resolves the chain indexer client used for block boundaries. */ getTidx: Tidx.GetClient; /** Decimal places used by the vault share token. */ shareDecimals: number; /** Inclusive upper bound for daily observations, as an ISO 8601 timestamp. */ to: string; /** Earn vault contract address. */ vault: Address; }; } /** Returns one whole share in base units when it fits in a `uint256`. */ export declare function quoteShareAmount(options: quoteShareAmount.Options): bigint; export declare namespace quoteShareAmount { /** Share-token metadata used to derive one whole share. */ type Options = { /** Decimal places used by the vault share token. */ shareDecimals: number; }; } /** One historical share-price observation. */ export type Point = { /** Assets returned for one whole vault share, in the asset token's base unit. */ amount: bigint; /** Requested daily observation timestamp in ISO 8601 format. */ timestamp: string; }; /** Returns daily observation timestamps anchored to the requested start. */ export declare function timestamps(options: timestamps.Options): readonly string[]; export declare namespace timestamps { /** Range covered by daily observations. */ type Options = { /** First inclusive daily observation, as an ISO 8601 timestamp. */ from: string; /** Inclusive upper bound for daily observations, as an ISO 8601 timestamp. */ to: string; }; } /** Returns whether a historical quote is unavailable from contract execution. */ export declare function isUnavailable(error: unknown): boolean; /** Validates that indexed block timestamps cover a requested observation. */ export declare function parseCoverage(options: parseCoverage.Options): void; export declare namespace parseCoverage { /** Indexed timestamp and requested observation to compare. */ type Options = { /** Latest indexed block by timestamp. */ row: Row | undefined; /** Requested observation timestamp. */ timestamp: string; }; } type Block = { /** Indexed block number used for the historical quote. */ number: number; /** Requested observation timestamp represented by this block. */ requestedAt: string; /** Actual timestamp of the indexed block. */ timestamp: string; }; /** Decodes daily historical boundaries from TIDX rows. */ export declare function parseBlocks(options: parseBlocks.Options): Block[]; export declare namespace parseBlocks { /** Indexed rows and requested daily observations. */ type Options = { /** Rows containing the requested boundaries. */ rows: readonly Row[]; /** Observation timestamps represented by the supplied boundary rows. */ timestamps: readonly string[]; }; } type Row = { kind?: unknown; num?: unknown; requested_at?: unknown; timestamp?: unknown; }; /** Thrown when no indexed block exists for a requested observation. */ export declare class IndexedBlockNotFoundError extends Error { name: string; constructor(timestamp: string); } /** Thrown when the indexer has not reached a requested observation. */ export declare class IndexedCoverageError extends Error { name: string; constructor(timestamp: string); } /** Thrown when TIDX returns malformed historical share-price data. */ export declare class MalformedResponseError extends Error { name: string; constructor(message: string); } /** Thrown when a TIDX request fails before historical rows can be decoded. */ export declare class TidxRequestError extends Error { name: string; constructor(cause: unknown); } /** Thrown when one whole share cannot be represented as a `uint256`. */ export declare class UnsupportedShareDecimalsError extends Error { name: string; constructor(decimals: number); } export {}; //# sourceMappingURL=EarnSharePrices.d.ts.map