import type { MidnightBook, MidnightBookSource, MidnightBookTop } from './types';
/** Default hosted Midnight API (see @morpho-org/midnight-sdk MidnightApi). */
export declare const DEFAULT_MIDNIGHT_API = "https://api.morpho.org/v0/midnight";
type FetchLike = typeof fetch;
/** Resolve a chain's Midnight API base URL (runtime override → config → hosted default). */
export declare function midnightApiBaseUrl(chainId: string): string;
/**
 * Hosted-API book source. Reads `GET {base}/books/{marketId}` and reduces the
 * `asks`/`bids` price levels to a {@link MidnightBookTop}. This is the swappable
 * seam: a self-indexed mempool source can implement the same interface later.
 */
export declare class ApiBookSource implements MidnightBookSource {
    private readonly baseUrl;
    private readonly fetchImpl;
    constructor(baseUrl: string, fetchImpl?: FetchLike);
    getBookTop(marketId: string): Promise<MidnightBookTop | null>;
    /**
     * Full ladder for a market — every level per side, best-first (unlike
     * `getBookTop`, which collapses to the best level + aggregate depth). Same
     * `GET {base}/books/{marketId}` fetch; empty levels are dropped and each side
     * is sorted so the best executable offer is first (bids by tick ↓ = cheapest
     * borrow, asks by tick ↑ = highest lend yield). The caller derives per-level
     * APR (from tick + TTM) and applies count/size filters.
     */
    getBook(marketId: string): Promise<MidnightBook | null>;
    /**
     * ONE fetch → the full-depth aggregate top + a bounded best-first ladder slice
     * (top `maxLevels` per side). Same `/books/{marketId}` call as `getBookTop`, so
     * the public batch captures a chunk of the book for free (no extra request).
     */
    getTopAndBook(marketId: string, maxLevels?: number): Promise<{
        top: MidnightBookTop;
        book: MidnightBook;
    } | null>;
    /**
     * Maker addresses per price level, keyed by tick string. `getBook` levels are
     * aggregated by tick and carry NO maker (a level can be several makers), so
     * this reads the individual offers from the `{side}/quote` endpoint (which the
     * book endpoint lacks) and groups their makers by tick. `assets` should be the
     * book's total depth so the quote returns EVERY offer (it returns none when the
     * target exceeds depth). Best-effort: `{}` on any failure.
     */
    getOfferMakers(marketId: string, side: 'bids' | 'asks', assets: bigint): Promise<Record<string, string[]>>;
}
/** Build the default (hosted-API) book source for a chain. */
export declare function createMidnightBookSource(chainId: string, fetchImpl?: FetchLike): MidnightBookSource;
export {};
//# sourceMappingURL=apiClient.d.ts.map