UNPKG

@pavlovcik/permit2-rpc-manager

Version:

Intelligent RPC manager with Permit2 validation and advanced fallback strategy

25 lines 924 B
type LatencyTestStatus = "ok" | "syncing" | "wrong_bytecode" | "timeout" | "http_error" | "rpc_error" | "network_error"; export interface LatencyTestResult { url: string; latency: number; status: LatencyTestStatus; error?: string; } type LoggerFn = (level: "debug" | "info" | "warn" | "error", message: string, ...optionalParams: any[]) => void; export declare class LatencyTester { private timeoutMs; private log; constructor(timeoutMs?: number, logger?: LoggerFn); private _makeRpcCall; /** * Tests latency, sync status, and Permit2 bytecode for a single RPC URL. * Returns a detailed result object. */ private testSingleRpc; /** * Tests a list of RPC URLs concurrently and returns a map of URL to detailed results. */ testRpcUrls(urls: string[]): Promise<Record<string, LatencyTestResult>>; } export {}; //# sourceMappingURL=latency-tester.d.ts.map