import { AbstractJsonRpc } from "./JsonRpc"; import { JsonRpc } from "./JsonRpc"; import { Batch, RawBatchResponse } from "./Batch"; export declare type StatusListener = (status: boolean) => void; /** * JsonRpc that delegates call to an underlying provider and tracks it's state. If underlying JsonRpc failed to * return response it gets market as invalid and is not going to be called until it will be fixed. */ export declare class RevalidatingJsonRpc extends AbstractJsonRpc { private _delegate; private _listener; private _active; private _interval; private _timeoutId?; /** * * @param interval interval (in ms) to revalidate RPC * @param delegate */ constructor(interval: number, delegate: JsonRpc); start(): void; stop(): void; /** * Setup a listener for RPC status. * * Function `function(stat: boolean)` will be called each time status changed * * @param value */ set listener(value: StatusListener); get status(): boolean; private update; /** * Calls revalidation of the underlying RPC provider */ revalidate(): Promise; execute(batch: Batch, force?: boolean): Promise; }