import type { PublicClient, Transport, Chain } from 'viem'; import { type RegistryEntry, type DiscoveryParams, type SupportedChainName } from '@azeth/common'; /** Discover services from the Azeth server's trust registry index. * * MEDIUM-8 (Audit): Results are fetched from the server's in-memory index, NOT verified * on-chain. The server could return stale, incomplete, or manipulated entries. For security- * critical decisions (e.g., routing payments or trusting a service endpoint), callers SHOULD * verify the returned entries against the on-chain ERC-8004 Identity Registry before trusting * them. Use the contract's `ownerOf(tokenId)` and metadata to confirm authenticity. */ export declare function discoverServices(serverUrl: string, params: DiscoveryParams): Promise; /** Get a specific registry entry by token ID */ export declare function getRegistryEntry(serverUrl: string, tokenId: bigint): Promise; /** Result from discovery with fallback — includes source indicator */ export interface DiscoveryWithFallbackResult { entries: RegistryEntry[]; /** 'server' if results came from the API, 'on-chain' if from direct contract reads */ source: 'server' | 'on-chain'; /** True when minReputation was requested but ignored in on-chain mode */ minReputationIgnored?: boolean; } /** Options for discoverServicesWithFallback */ export interface DiscoveryFallbackOptions { /** Cache query results in-memory for 60s (default: false) */ cacheResults?: boolean; } /** Discover services with automatic on-chain fallback when the server is unavailable. * * First tries the Azeth server API (fast, indexed, supports reputation sorting). * If the server is unreachable (`SERVER_UNAVAILABLE`), retries once after 2s delay, * then falls back to reading the ERC-8004 Identity Registry via the AzethOracle's * `discoverRegistry()` view function. * * On-chain fallback limitations: * - Does NOT support minReputation or sortByReputation (requires the server's index) * - Filters by capability and entityType are applied client-side * - Reads up to 1000 entries per RPC call via the AzethOracle batch view function * - Oracle uses early termination after 5 consecutive non-existent token IDs * * @param options.cacheResults - Cache results in-memory for 60s (default: false) */ export declare function discoverServicesWithFallback(serverUrl: string, params: DiscoveryParams, publicClient: PublicClient, chainName: SupportedChainName, options?: DiscoveryFallbackOptions): Promise; //# sourceMappingURL=discover.d.ts.map