import type { KoraNetwork } from "../env/index.js"; export type ApiHandleType = "handle" | "nft_subhandle" | "virtual_subhandle"; /** A handle as returned by the Ada Handle API (the subset we use). */ export interface ApiHandle { name: string; handle_type: ApiHandleType; policy?: string; hex?: string; holder?: string; resolved_addresses?: { ada?: string; [key: string]: string | undefined; }; image?: string; } export interface FetchWalletHandlesOptions { env?: KoraNetwork; hostname?: string; /** Override the API base URL (default: env-aware https://{env}api.handle.me). */ baseUrl?: string; /** Page size; the API caps JSON results at 250 (MAX_PAGINATED_RESULTS). */ pageSize?: number; /** Safety bound on pages fetched (default 40 → up to 10k handles). */ maxPages?: number; signal?: AbortSignal; } /** The API's MAX_PAGINATED_RESULTS — the most JSON handle objects it returns per request. */ export declare const HANDLE_API_MAX_PAGE = 250; /** * Fetch every handle held by the wallet, from the Ada Handle API, using the hex reward address * straight from CIP-30 (`walletStore.state.rewardAddressHex`). Returns [] for empty input. * * The API caps a JSON response at 250 handles, so this paginates: request 250/page until the full * set is gathered. Two stop signals, so it's correct under both the current API and the planned fix: * - the `x-handles-search-total` header — used as the authoritative grand total ONCE it's * trustworthy (a value exceeding a single page's size, which the current page-count quirk can * never produce; the team is fixing the header to always report the grand total); and * - a short page, as the fallback when no trustworthy total is seen. * Trusting the total also guards the edge where a full page of names yields fewer JSON objects (the * API drops handles without a UTxO), which a short-page-only rule would mistake for the last page. * A handful of users hold >250 handles; everyone else resolves in a single request. */ export declare function fetchWalletHandles(rewardAddressHex: string | null | undefined, opts?: FetchWalletHandlesOptions): Promise; export declare function isSubHandle(handle: ApiHandle): boolean; export declare function isVirtualSubHandle(handle: ApiHandle): boolean; export declare function isDeMiHandle(handle: ApiHandle): boolean; //# sourceMappingURL=handle-api.d.ts.map