import { ENR } from "../enr"; export declare type SearchContext = { domain: string; publicKey: string; visits: { [key: string]: boolean; }; }; export interface DnsClient { resolveTXT: (domain: string) => Promise; } export interface NodeCapabilityCount { relay: number; store: number; filter: number; lightPush: number; } export declare class DnsNodeDiscovery { private readonly dns; private readonly _DNSTreeCache; private readonly _errorTolerance; static dnsOverHttp(dnsClient?: DnsClient): DnsNodeDiscovery; /** * Returns a list of verified peers listed in an EIP-1459 DNS tree. Method may * return fewer peers than requested if [[wantedNodeCapabilityCount]] requires * larger quantity of peers than available or the number of errors/duplicate * peers encountered by randomized search exceeds the sum of the fields of * [[wantedNodeCapabilityCount]] plus the [[_errorTolerance]] factor. */ getPeers(enrTreeUrls: string[], wantedNodeCapabilityCount: Partial): Promise; constructor(dns: DnsClient); /** * {@docInherit getPeers} */ getNextPeer(enrTreeUrls: string[], wantedNodeCapabilityCount: Partial): AsyncGenerator; /** * Runs a recursive, randomized descent of the DNS tree to retrieve a single * ENR record as an ENR. Returns null if parsing or DNS resolution fails. */ private _search; /** * Retrieves the TXT record stored at a location from either * this DNS tree cache or via DNS query. * * @throws if the TXT Record contains non-UTF-8 values. */ private _getTXTRecord; }