import { providers } from "ethers"; import { CachingMechanismInterface } from "../interfaces"; import { EventSearchConfig, MakeOptional } from "../utils"; export declare enum UpdateFailureReason { NotReady = 0, AlreadyUpdated = 1, BadRequest = 2, RPCError = 3 } export declare function isUpdateFailureReason(x: EventSearchConfig | UpdateFailureReason): x is UpdateFailureReason; /** * Base class for all clients to extend. */ export declare abstract class BaseAbstractClient { readonly eventSearchConfig: MakeOptional; protected cachingMechanism?: CachingMechanismInterface | undefined; protected _isUpdated: boolean; firstBlockToSearch: number; latestBlockSearched: number; /** * Creates a new client. * @param cachingMechanism The caching mechanism to use for this client. If not provided, the client will not rely on an external cache. */ constructor(eventSearchConfig?: MakeOptional, cachingMechanism?: CachingMechanismInterface | undefined); /** * Indicates whether the client has been updated since it was created. * @returns Whether the client has been updated since it was created. */ get isUpdated(): boolean; /** * Sets whether the client has been updated since it was created. * @param value Whether the client has been updated since it was created. * @throws Error if the client has already been updated and the value is false. */ set isUpdated(value: boolean); /** * Validates and updates the stored EventSearchConfig in advance of an update() call. * Use isEventSearchConfig() to discriminate the result. * @provider Ethers RPC provider instance. * @returns An EventSearchConfig instance if valid, otherwise an UpdateFailureReason. */ updateSearchConfig(provider: providers.Provider): Promise; /** * Asserts that the client has been updated. */ protected assertUpdated(): void; /** * Determines if the client has an external cache. * @returns Whether the client has an external cache. */ protected hasCachingMechanism(): boolean; } //# sourceMappingURL=BaseAbstractClient.d.ts.map