import type { PollingBlockTrackerOptions } from "@metamask/eth-block-tracker"; import type { Logger } from "loglevel"; import type { NetworkClientId, NetworkControllerMessenger } from "./NetworkController.cjs"; import type { RpcServiceOptionsWithDefaults } from "./rpc-service/rpc-service.cjs"; import type { RpcFailoverMode } from "./selectors.cjs"; import type { BlockTracker, NetworkClientConfiguration, Provider } from "./types.cjs"; /** * Why the degraded event was emitted. */ export type DegradedEventType = 'slow_success' | 'retries_exhausted'; /** * The category of error that was retried until retries were exhausted. */ export type RetryReason = 'connection_failed' | 'response_not_json' | 'non_successful_http_status' | 'timed_out' | 'connection_reset' | 'unknown'; /** * Classifies the error that was being retried when retries were exhausted. * * @param error - The error from the last retry attempt. * @returns A classification string. */ export declare function classifyRetryReason(error: unknown): RetryReason; /** * The pair of provider / block tracker that can be used to interface with the * network and respond to new activity. */ export type NetworkClient = { configuration: NetworkClientConfiguration; provider: Provider; blockTracker: BlockTracker; destroy: () => void; }; /** * Create a JSON RPC network client for a specific network. * * @param args - The arguments. * @param args.id - The ID that will be assigned to the new network client in * the registry. * @param args.configuration - The network configuration. * @param args.getRpcServiceOptions - Factory for constructing RPC service * options. See {@link NetworkControllerOptions.getRpcServiceOptions}. * @param args.getBlockTrackerOptions - Factory for constructing block tracker * options. See {@link NetworkControllerOptions.getBlockTrackerOptions}. * @param args.messenger - The network controller messenger. * @param args.rpcFailoverMode - The RPC failover mode to apply: `disabled` * (failover off), `enabled` (divert to the configured failover URLs when the * primary endpoint is unavailable), or `forced` (Infura endpoints that have * failover URLs route all traffic to those URLs, bypassing Infura entirely). * @param args.logger - A `loglevel` logger. * @returns The network client. */ export declare function createNetworkClient({ id, configuration, getRpcServiceOptions, getBlockTrackerOptions, messenger, rpcFailoverMode, logger, }: { id: NetworkClientId; configuration: NetworkClientConfiguration; getRpcServiceOptions?: (rpcEndpointUrl: string) => RpcServiceOptionsWithDefaults; getBlockTrackerOptions: (rpcEndpointUrl: string) => Omit; messenger: NetworkControllerMessenger; rpcFailoverMode: RpcFailoverMode; logger?: Logger; }): NetworkClient; //# sourceMappingURL=create-network-client.d.cts.map