import type { Address } from "viem"; import { type BuildQueryFn } from "../../utils/buildQuery.js"; /** * Normalized response shape from the price backend. */ export type BackendPriceData = { address: string; price: number; source: string; symbol?: string; timestamp?: number; }; /** * Legacy response from /v1/prices endpoint. * Flat object keyed by lowercase address. */ export type BackendPriceResponse = Record; export type V3PriceRow = { address?: string; price?: number; priceUsd?: number; source?: string; symbol?: string; timestamp?: string; }; export type V3PriceResponse = { data?: V3PriceRow[]; meta?: { total?: number; offset?: number; limit?: number; timestamp?: string; chainId?: string; }; }; /** * Pricing service configuration for the V3 pricing endpoint. */ export type PricingServiceConfig = { /** Pricing API endpoint URL. */ endpoint: string; /** Optional API key sent as `X-API-Key` for V3-style backend requests. */ apiKey?: string; }; /** Normalize a pricing API price to a positive finite USD number. */ export declare const normalizeBackendPrice: (price: string | number) => number | undefined; /** Instance-based V3 pricing API client with batching. */ export declare class PricingBackendClient { private readonly endpoint; private readonly apiKey?; constructor(config: PricingServiceConfig, buildQuery?: BuildQueryFn); get isConfigured(): boolean; private getHeaders; private parseResponse; /** * Fetch a single asset price. Concurrent calls within the same microtask * are bundled into a single request per chainId, chunked into pages of * {@link V3_PRICES_PAGE_SIZE} addresses so we never exceed the server's * `limit` cap. */ queryV3Price: (key: { address: Address; chainId: number; }) => Promise; setQueryV3Price(fn: typeof this.queryV3Price): void; private buildPricesUrl; } //# sourceMappingURL=backendClient.d.ts.map