import { Contract, BigNumber, Event, EventFilter } from "ethers";
import { Block } from "@ethersproject/abstract-provider";
import { BlockFinder } from "@uma/sdk";
import winston from "winston";
import { EventSearchConfig, MakeOptional, BigNumberish } from "../utils";
import { Deposit, L1Token, CancelledRootBundle, DisputedRootBundle, LpToken, TokenRunningBalance, DepositWithBlock, ProposedRootBundleStringified, ExecutedRootBundleStringified } from "../interfaces";
import { ExecutedRootBundle, PendingRootBundle, ProposedRootBundle } from "../interfaces";
import { CrossChainContractsSet, DestinationTokenWithBlock } from "../interfaces";
import { AcrossConfigStoreClient as ConfigStoreClient } from "./AcrossConfigStoreClient/AcrossConfigStoreClient";
import { BaseAbstractClient } from "./BaseAbstractClient";
declare type _HubPoolUpdate = {
    success: true;
    currentTime: number;
    latestBlockNumber: number;
    pendingRootBundleProposal: PendingRootBundle;
    events: Record<string, Event[]>;
    searchEndBlock: number;
};
export declare type HubPoolUpdate = {
    success: false;
} | _HubPoolUpdate;
declare type HubPoolEvent = "SetPoolRebalanceRoute" | "L1TokenEnabledForLiquidityProvision" | "ProposeRootBundle" | "RootBundleCanceled" | "RootBundleDisputed" | "RootBundleExecuted" | "CrossChainContractsSet";
declare type L1TokensToDestinationTokens = {
    [l1Token: string]: {
        [destinationChainId: number]: string;
    };
};
export declare class HubPoolClient extends BaseAbstractClient {
    readonly logger: winston.Logger;
    readonly hubPool: Contract;
    configStoreClient: ConfigStoreClient;
    deploymentBlock: number;
    readonly chainId: number;
    readonly eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock">;
    protected readonly configOverride: {
        ignoredHubExecutedBundles: number[];
        ignoredHubProposedBundles: number[];
    };
    protected l1TokensToDestinationTokens: L1TokensToDestinationTokens;
    protected l1Tokens: L1Token[];
    protected lpTokens: {
        [token: string]: LpToken;
    };
    protected proposedRootBundles: ProposedRootBundle[];
    protected canceledRootBundles: CancelledRootBundle[];
    protected disputedRootBundles: DisputedRootBundle[];
    protected executedRootBundles: ExecutedRootBundle[];
    protected crossChainContracts: {
        [l2ChainId: number]: CrossChainContractsSet[];
    };
    protected l1TokensToDestinationTokensWithBlock: {
        [l1Token: string]: {
            [destinationChainId: number]: DestinationTokenWithBlock[];
        };
    };
    protected pendingRootBundle: PendingRootBundle | undefined;
    firstBlockToSearch: number;
    latestBlockNumber: number | undefined;
    currentTime: number | undefined;
    readonly blockFinder: BlockFinder<Block>;
    constructor(logger: winston.Logger, hubPool: Contract, configStoreClient: ConfigStoreClient, deploymentBlock?: number, chainId?: number, eventSearchConfig?: MakeOptional<EventSearchConfig, "toBlock">, configOverride?: {
        ignoredHubExecutedBundles: number[];
        ignoredHubProposedBundles: number[];
    });
    protected hubPoolEventFilters(): Record<HubPoolEvent, EventFilter>;
    hasPendingProposal(): boolean;
    getPendingRootBundle(): PendingRootBundle | undefined;
    getProposedRootBundles(): ProposedRootBundle[];
    getCancelledRootBundles(): CancelledRootBundle[];
    getDisputedRootBundles(): DisputedRootBundle[];
    getSpokePoolForBlock(chain: number, block?: number): string;
    getSpokePoolActivationBlock(chain: number, spokePool: string): number | undefined;
    getDestinationTokenForDeposit(deposit: {
        originChainId: number;
        originToken: string;
        destinationChainId: number;
    }): string;
    getL1TokensToDestinationTokens(): L1TokensToDestinationTokens;
    getL1TokenForDeposit(deposit: {
        originChainId: number;
        originToken: string;
    }): string;
    getL1TokenCounterpartAtBlock(l2ChainId: number, l2Token: string, hubPoolBlock: number): string;
    getDestinationTokenForL1Token(l1Token: string, destinationChainId: number): string;
    l2TokenEnabledForL1Token(l1Token: string, destinationChainId: number): boolean;
    getDestinationTokensToL1TokensForChainId(chainId: number): {
        [destinationToken: string]: L1Token;
    };
    protected getBlockNumber(timestamp: number): Promise<number | undefined>;
    getCurrentPoolUtilization(l1Token: string): Promise<BigNumberish>;
    getPostRelayPoolUtilization(l1Token: string, quoteBlockNumber: number, relaySize: BigNumber): Promise<{
        current: BigNumber;
        post: BigNumber;
    }>;
    protected getUtilization(l1Token: string, blockNumber: number, amount: BigNumber, _timestamp: number): Promise<{
        current: BigNumber;
        post: BigNumber;
    }>;
    computeRealizedLpFeePct(deposit: Pick<DepositWithBlock, "quoteTimestamp" | "amount" | "destinationChainId" | "originChainId" | "blockNumber">, l1Token: string): Promise<{
        realizedLpFeePct: BigNumber | undefined;
        quoteBlock: number;
    }>;
    getL1Tokens(): L1Token[];
    getTokenInfoForL1Token(l1Token: string): L1Token | undefined;
    getLpTokenInfoForL1Token(l1Token: string): LpToken | undefined;
    getL1TokenInfoForL2Token(l2Token: string, chainId: number): L1Token | undefined;
    getTokenInfoForDeposit(deposit: Deposit): L1Token | undefined;
    getTokenInfo(chainId: number | string, tokenAddress: string): L1Token | undefined;
    getSpokeActivationBlockForChain(chainId: number): number;
    isRootBundleValid(rootBundle: ProposedRootBundle, latestMainnetBlock: number): boolean;
    getRootBundleEvalBlockNumberContainingBlock(latestMainnetBlock: number, block: number, chain: number, chainIdListOverride?: number[]): number | undefined;
    getProposedRootBundlesInBlockRange(startingBlock: number, endingBlock: number): ProposedRootBundle[];
    getCancelledRootBundlesInBlockRange(startingBlock: number, endingBlock: number): CancelledRootBundle[];
    getDisputedRootBundlesInBlockRange(startingBlock: number, endingBlock: number): DisputedRootBundle[];
    getLatestProposedRootBundle(): ProposedRootBundle;
    getFollowingRootBundle(currentRootBundle: ProposedRootBundle): ProposedRootBundle | undefined;
    getExecutedLeavesForRootBundle(rootBundle: ProposedRootBundle, latestMainnetBlockToSearch: number): ExecutedRootBundle[];
    getValidatedRootBundles(latestMainnetBlock?: number): ProposedRootBundle[];
    getLatestFullyExecutedRootBundle(latestMainnetBlock: number): ProposedRootBundle | undefined;
    getEarliestFullyExecutedRootBundle(latestMainnetBlock: number, startBlock?: number): ProposedRootBundle | undefined;
    getNthFullyExecutedRootBundle(n: number, startBlock?: number): ProposedRootBundle | undefined;
    getLatestBundleEndBlockForChain(chainIdList: number[], latestMainnetBlock: number, chainId: number): number;
    getNextBundleStartBlockNumber(chainIdList: number[], latestMainnetBlock: number, chainId: number): number;
    getRunningBalanceBeforeBlockForChain(block: number, chain: number, l1Token: string): TokenRunningBalance;
    getRunningBalanceForToken(l1Token: string, executedRootBundle: ExecutedRootBundle): TokenRunningBalance;
    _update(eventNames: HubPoolEvent[]): Promise<HubPoolUpdate>;
    update(eventsToQuery?: HubPoolEvent[]): Promise<void>;
    protected getBundleEndBlockForChain(proposeRootBundleEvent: ProposedRootBundle, chainId: number, chainIdList: number[]): number;
    updateFromJSON(hubPoolClientState: Partial<ReturnType<HubPoolClient["toJSON"]>>): void;
    toJSON(): {
        deploymentBlock: number;
        chainId: number;
        eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock">;
        configOverride: {
            ignoredHubExecutedBundles: number[];
            ignoredHubProposedBundles: number[];
        };
        firstBlockToSearch: number;
        latestBlockNumber: number | undefined;
        currentTime: number | undefined;
        l1TokensToDestinationTokens: L1TokensToDestinationTokens;
        l1Tokens: L1Token[];
        lpTokens: {
            [token: string]: LpToken;
        };
        proposedRootBundles: ProposedRootBundleStringified[];
        canceledRootBundles: CancelledRootBundle[];
        disputedRootBundles: DisputedRootBundle[];
        executedRootBundles: ExecutedRootBundleStringified[];
        pendingRootBundle: PendingRootBundle | undefined;
        crossChainContracts: {
            [l2ChainId: number]: CrossChainContractsSet[];
        };
        l1TokensToDestinationTokensWithBlock: {
            [l1Token: string]: {
                [destinationChainId: number]: DestinationTokenWithBlock[];
            };
        };
    };
}
export {};
