import winston from "winston";
import { AnyObject, BigNumber, DefaultLogLevels, DepositSearchResult, EventSearchConfig, MakeOptional, Address } from "../../utils";
import { BridgedToHubPoolWithBlock, ClaimedRelayerRefundWithBlock, Deposit, DepositWithBlock, Fill, FillStatus, FillWithBlock, RelayData, RelayerRefundExecutionWithBlock, RootBundleRelayWithBlock, SlowFillRequestWithBlock, SortableEvent, SpeedUpWithBlock, TokensBridged } from "../../interfaces";
import { BaseAbstractClient, UpdateFailureReason } from "../BaseAbstractClient";
import { AcrossConfigStoreClient } from "../AcrossConfigStoreClient";
import { HubPoolClient } from "../HubPoolClient";
export type SpokePoolUpdateSuccess = {
    success: true;
    currentTime: number;
    events: SortableEvent[][];
    searchEndBlock: number;
};
export type SpokePoolUpdateFailure = {
    success: false;
    reason: UpdateFailureReason;
};
export type SpokePoolUpdate = SpokePoolUpdateSuccess | SpokePoolUpdateFailure;
export declare const knownEventNames: string[];
export declare abstract class SpokePoolClient extends BaseAbstractClient {
    readonly logger: winston.Logger;
    readonly hubPoolClient: HubPoolClient | null;
    readonly chainId: number;
    deploymentBlock: number;
    abstract readonly type: string;
    protected currentTime: number;
    protected duplicateDepositHashes: {
        [depositHash: string]: DepositWithBlock[];
    };
    protected depositHashesToFills: {
        [depositHash: string]: FillWithBlock[];
    };
    protected speedUps: {
        [depositorAddress: string]: {
            [depositId: string]: SpeedUpWithBlock[];
        };
    };
    protected slowFillRequests: {
        [relayDataHash: string]: SlowFillRequestWithBlock;
    };
    protected depositRoutes: {
        [originToken: string]: {
            [DestinationChainId: number]: boolean;
        };
    };
    protected tokensBridged: TokensBridged[];
    protected rootBundleRelays: RootBundleRelayWithBlock[];
    protected relayerRefundExecutions: RelayerRefundExecutionWithBlock[];
    protected claimedRelayerRefunds: ClaimedRelayerRefundWithBlock[];
    protected bridgedToHubPool: BridgedToHubPoolWithBlock[];
    protected configStoreClient: AcrossConfigStoreClient | undefined;
    protected invalidFills: Set<string>;
    readonly depositHashes: {
        [depositHash: string]: DepositWithBlock;
    };
    spokePoolAddress: Address | undefined;
    fills: {
        [OriginChainId: number]: FillWithBlock[];
    };
    protected constructor(logger: winston.Logger, hubPoolClient: HubPoolClient | null, chainId: number, deploymentBlock: number, eventSearchConfig?: MakeOptional<EventSearchConfig, "to">);
    getDepositsForDestinationChain(destinationChainId: number): DepositWithBlock[];
    private _getDuplicateDeposits;
    getDepositsForDestinationChainWithDuplicates(destinationChainId: number): DepositWithBlock[];
    getDeposits(filter?: {
        fromBlock: number;
        toBlock: number;
    }): DepositWithBlock[];
    getTokensBridged(): TokensBridged[];
    getDepositRoutes(): {
        [originToken: string]: {
            [DestinationChainId: number]: boolean;
        };
    };
    getFills(): FillWithBlock[];
    getFillsForOriginChain(originChainId: number): FillWithBlock[];
    getFillsForRelayer(relayer: Address): FillWithBlock[];
    getFillsWithBlockInRange(startingBlock: number, endingBlock: number): FillWithBlock[];
    getRootBundleRelays(): RootBundleRelayWithBlock[];
    getLatestRootBundleId(): number;
    getRelayerRefundExecutions(): RelayerRefundExecutionWithBlock[];
    getClaimedRelayerRefunds(): ClaimedRelayerRefundWithBlock[];
    getBridgedToHubPoolEvents(): BridgedToHubPoolWithBlock[];
    appendMaxSpeedUpSignatureToDeposit(deposit: DepositWithBlock): DepositWithBlock;
    getDeposit(depositId: BigNumber): DepositWithBlock | undefined;
    getSlowFillRequests(): SlowFillRequestWithBlock[];
    getSlowFillRequest(relayData: Omit<RelayData, "message"> & {
        messageHash: string;
    }): SlowFillRequestWithBlock | undefined;
    getSlowFillRequestsForOriginChain(originChainId: number): SlowFillRequestWithBlock[];
    getSpeedUps(): {
        [depositorAddress: string]: {
            [depositId: string]: SpeedUpWithBlock[];
        };
    };
    getDepositForFill(fill: Fill): DepositWithBlock | undefined;
    getFillsForDeposit(deposit: Deposit): FillWithBlock[];
    isDepositFilled(deposit: Deposit): boolean;
    getValidUnfilledAmountForDeposit(deposit: Deposit): {
        unfilledAmount: BigNumber;
        fillCount: number;
        invalidFills: FillWithBlock[];
    };
    getDepositHash(event: {
        depositId: BigNumber;
        originChainId: number;
    }): string;
    protected canResolveZeroAddressOutputToken(deposit: Pick<DepositWithBlock, "originChainId" | "inputToken" | "quoteBlockNumber" | "destinationChainId">): boolean;
    update(eventsToQuery?: string[]): Promise<void>;
    protected getBlockNumber(timestamp: number): Promise<number>;
    protected getBlockNumbers(timestamps: number[]): Promise<{
        [quoteTimestamp: number]: number;
    }>;
    protected getDestinationTokenForDeposit(deposit: Pick<DepositWithBlock, "originChainId" | "inputToken" | "quoteBlockNumber" | "destinationChainId">): Address;
    protected log(level: DefaultLogLevels, message: string, data?: AnyObject): void;
    getCurrentTime(): number;
    protected isOriginLiteChain(deposit: Pick<DepositWithBlock, "originChainId" | "quoteTimestamp">): boolean;
    protected isDestinationLiteChain(deposit: Pick<DepositWithBlock, "destinationChainId" | "quoteTimestamp">): boolean;
    abstract _queryableEventNames(): string[];
    protected abstract _update(eventsToQuery: string[]): Promise<SpokePoolUpdate>;
    abstract getMaxFillDeadlineInRange(startBlock: number, endBlock: number): Promise<number>;
    abstract getTimestampForBlock(blockTag: number): Promise<number>;
    abstract getTimeAt(blockNumber: number): Promise<number>;
    abstract findDeposit(depositId: BigNumber): Promise<DepositSearchResult>;
    abstract relayFillStatus(relayData: RelayData, atHeight?: number): Promise<FillStatus>;
    abstract fillStatusArray(relayData: RelayData[], atHeight?: number): Promise<(FillStatus | undefined)[]>;
}
