import { serviceCapabilities, serviceDependencies } from '@libp2p/interface'; import type { AutoNATComponents, AutoNATServiceInit } from './index.js'; import type { Connection, Startable, AbortOptions, Stream } from '@libp2p/interface'; export declare class AutoNATService implements Startable { private readonly components; private readonly protocol; private readonly timeout; private readonly maxInboundStreams; private readonly maxOutboundStreams; private readonly maxMessageSize; private started; private readonly log; private topologyId?; private readonly dialResults; private readonly findPeers; private readonly addressFilter; private readonly connectionThreshold; constructor(components: AutoNATComponents, init: AutoNATServiceInit); readonly [Symbol.toStringTag] = "@libp2p/autonat"; readonly [serviceCapabilities]: string[]; get [serviceDependencies](): string[]; isStarted(): boolean; start(): Promise; stop(): Promise; private allAddressesAreVerified; findRandomPeers(options?: AbortOptions): Promise; /** * Handle an incoming AutoNAT request */ handleIncomingAutonatStream(stream: Stream, connection: Connection): Promise; private handleAutonatMessage; /** * The AutoNAT v1 server is not required to send us the address that it * dialed successfully. * * When addresses fail, it can be because they are NATed, or because the peer * did't support the transport, we have no way of knowing, so just send them * one address so we can treat the response as: * * - OK - the dial request worked and the address is not NATed * - E_DIAL_ERROR - the dial request failed and the address may be NATed * - E_DIAL_REFUSED/E_BAD_REQUEST/E_INTERNAL_ERROR - the remote didn't dial the address */ private getFirstUnverifiedMultiaddr; /** * Removes any multiaddr result objects created for old multiaddrs that we are * no longer waiting on */ private removeOutdatedMultiaddrResults; /** * Our multicodec topology noticed a new peer that supports autonat */ verifyExternalAddresses(connection: Connection): Promise; private askPeerToVerify; private hasConnectionCapacity; private confirmAddress; private unconfirmAddress; private getNetworkSegment; } //# sourceMappingURL=autonat.d.ts.map