import { Transport } from "viem";
import { GasPriceEstimateOptions } from "../gasPriceOracle";
import { RelayData, TokenInfo } from "../interfaces";
import { BigNumber, BigNumberish, TransactionCostEstimate, Address } from "../utils";
export interface QueryInterface {
    getGasCosts: (deposit: RelayData & {
        destinationChainId: number;
    }, relayer: Address, options?: Partial<GasPriceEstimateOptions & {
        gasPrice: BigNumberish;
        gasUnits: BigNumberish;
        opStackL1GasCostMultiplier: BigNumber;
    }>) => Promise<TransactionCostEstimate>;
    getTokenPrice: (tokenSymbol: string) => Promise<number>;
    getNativeGasCost: (deposit: RelayData & {
        destinationChainId: number;
    }, relayer: Address) => Promise<BigNumber>;
    getAuxiliaryNativeTokenCost(deposit: RelayData): BigNumber;
}
export declare const expectedCapitalCostsKeys: string[];
export interface CapitalCostConfig {
    lowerBound: string;
    upperBound: string;
    cutoff: string;
    decimals: number;
}
type ChainIdAsString = string;
export interface CapitalCostConfigOverride {
    default: CapitalCostConfig;
    routeOverrides?: Record<ChainIdAsString, Record<ChainIdAsString, CapitalCostConfig>>;
    destinationChainOverrides?: Record<ChainIdAsString, CapitalCostConfig>;
    originChainOverrides?: Record<ChainIdAsString, CapitalCostConfig>;
}
export type RelayCapitalCostConfig = CapitalCostConfigOverride | CapitalCostConfig;
export interface BaseRelayFeeCalculatorConfig {
    nativeTokenDecimals?: number;
    gasDiscountPercent?: number;
    capitalDiscountPercent?: number;
    feeLimitPercent?: number;
    capitalCostsConfig: {
        [token: string]: CapitalCostConfig | CapitalCostConfigOverride;
    };
}
export interface RelayFeeCalculatorConfigWithQueries extends BaseRelayFeeCalculatorConfig {
    queries: QueryInterface;
}
export interface RelayFeeCalculatorConfigWithMap extends BaseRelayFeeCalculatorConfig {
    queriesMap: Record<number, QueryInterface>;
}
export type RelayFeeCalculatorConfig = RelayFeeCalculatorConfigWithQueries | RelayFeeCalculatorConfigWithMap;
export interface RelayerFeeDetails {
    amountToRelay: string;
    tokenSymbol: string;
    gasFeePercent: string;
    gasFeeTotal: string;
    gasUnits: string;
    gasDiscountPercent: number;
    auxNativeFeePercent: string;
    auxNativeFeeTotal: string;
    auxNativeDiscountPercent: number;
    capitalFeePercent: string;
    capitalFeeTotal: string;
    capitalDiscountPercent: number;
    relayFeePercent: string;
    relayFeeTotal: string;
    feeLimitPercent: number;
    isAmountTooLow: boolean;
    maxGasFeePercent: string;
    minDeposit: string;
}
export interface LoggingFunction {
    (data: {
        at: string;
        message: string;
        [key: string]: unknown;
    }): void;
}
export interface Logger {
    debug: LoggingFunction;
    info: LoggingFunction;
    warn: LoggingFunction;
    error: LoggingFunction;
}
export declare const DEFAULT_LOGGER: Logger;
export declare function getDefaultRelayer(chainId?: number): Address;
export declare class RelayFeeCalculator {
    private queries;
    private gasDiscountPercent;
    private capitalDiscountPercent;
    private feeLimitPercent;
    private nativeTokenDecimals;
    private capitalCostsConfig;
    private logger;
    constructor(config: RelayFeeCalculatorConfigWithQueries, logger?: Logger);
    constructor(config: RelayFeeCalculatorConfigWithMap, logger?: Logger, destinationChainId?: number);
    /**
     * Type guard to check if a config is a CapitalCostConfigOverride or a CapitalCostConfig.
     * @param config CapitalCostConfig or CapitalCostConfigOverride
     * @returns true if the config is a CapitalCostConfigOverride, false otherwise.
     * @private
     * @dev This is a type guard that is used to check if a config is a CapitalCostConfigOverride or a CapitalCostConfig.
     * This is needed because the config can be either a CapitalCostConfig or a CapitalCostConfigOverride. If it's a
     * CapitalCostConfig, then we need to convert it to a CapitalCostConfigOverride with the default config set with no route
     * overrides.
     */
    private static capitalCostConfigIsOverride;
    /**
     * Validates a CapitalCostConfigOverride or a CapitalCostConfig.
     * @param capitalCosts CapitalCostConfig or CapitalCostConfigOverride
     * @returns CapitalCostConfigOverride
     */
    static validateAndTransformCapitalCostsConfigOverride(capitalCosts: CapitalCostConfigOverride | CapitalCostConfig): CapitalCostConfigOverride;
    /**
     * Validates a CapitalCostConfig.
     * @param capitalCosts CapitalCostConfig
     */
    static validateCapitalCostsConfig(capitalCosts: CapitalCostConfig): void;
    getTokenPrice(tokenSymbol: string): Promise<number>;
    /**
     * Calculate the gas fee as a % of the amount to relay.
     * @param deposit A valid deposit object to reason about
     * @param amountToRelay The amount that we should fill the deposit for
     * @param simulateZeroFill Whether to simulate a zero fill for the gas cost simulation
     *        A fill of 1 wei which would result in a slow/partial fill.
     *        You should do this if you're not worried about simulating a proper fill of a deposit
     *        with a message or if you are worried a fill amount that could exceed the balance of
     *        the relayer.
     * @param relayerAddress The relayer that will be used for the gas cost simulation
     * @param _tokenPrice The token price for normalizing fees
     * @returns The fee as a % of the amount to relay.
     * @note Setting simulateZeroFill to true will result on the gas costs being estimated
     *       on a zero fill. However, the percentage will be returned as a percentage of the
     *       amount to relay. This is useful for determining the maximum gas fee % that a
     *       relayer may need to make on a regular fill. You will get differing results if
     *       a message & recipient contract is provided as this function may not simulate with
     *       the correct parameters to see a full fill.
     */
    gasFeePercent(deposit: RelayData & {
        destinationChainId: number;
    }, outputAmount: BigNumberish, outputTokenInfo: TokenInfo, simulateZeroFill?: boolean, relayerAddress?: Address, _tokenPrice?: number, gasPrice?: BigNumberish, gasLimit?: BigNumberish, _tokenGasCost?: BigNumberish, transport?: Transport): Promise<BigNumber>;
    /**
     * Calculate the auxiliary native token fee as a % of the amount to relay.
     * Treats auxiliary native outlay as value forwarded to user, reported separately.
     */
    auxNativeFeePercent(deposit: RelayData & {
        destinationChainId: number;
    }, outputAmount: BigNumberish, outputTokenInfo: TokenInfo, _tokenPrice?: number): Promise<BigNumber>;
    capitalFeePercent(_outputAmount: BigNumberish, _tokenSymbol: string, _originRoute?: ChainIdAsString, _destinationRoute?: ChainIdAsString): BigNumber;
    /**
     * Checks for configuration conflicts across all token symbols and their associated chain configurations.
     * This method examines the capital costs configuration for each token and identifies any overlapping
     * or conflicting configurations between route overrides, destination chain overrides, and origin chain overrides.
     * If conflicts are found, warnings will be logged via the warnIfConfigConflicts method.
     */
    private checkAllConfigConflicts;
    /**
     * Log a warning if multiple configuration types apply to the same route
     * @private
     */
    private warnIfConfigConflicts;
    /**
     * Retrieves the relayer fee details for a deposit.
     * @param deposit A valid deposit object to reason about
     * @param amountToRelay The amount that the relayer would simulate a fill for
     * @param simulateZeroFill Whether to simulate a zero fill for the gas cost simulation
     *       For simulateZeroFill: A fill of 1 wei which would result in a slow/partial fill.
     *       You should do this if you're not worried about simulating a proper fill of a deposit
     *       with a message or if you are worried a fill amount that could exceed the balance of
     *       the relayer.
     * @param relayerAddress The relayer that will be used for the gas cost simulation
     * @param _tokenPrice The token price for normalizing fees
     * @param gasPrice Optional gas price to use for the simulation
     * @param gasUnits Optional gas units to use for the simulation
     * @returns A resulting `RelayerFeeDetails` object
     */
    relayerFeeDetails(deposit: RelayData & {
        destinationChainId: number;
    }, outputAmount?: BigNumberish, simulateZeroFill?: boolean, relayerAddress?: Address, _tokenPrice?: number, gasPrice?: BigNumberish, gasUnits?: BigNumberish, tokenGasCost?: BigNumberish): Promise<RelayerFeeDetails>;
    resolveInOutTokenInfos(deposit: RelayData & {
        destinationChainId: number;
    }, tokenMapping?: {
        ACX: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        ARB: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        AZERO: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        BADGER: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        BAL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        BNB: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        BOBA: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        CAKE: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        DAI: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        ETH: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        ezETH: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        GHO: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        GRASS: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        HYPE: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WHYPE: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        LSK: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        MATIC: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        MON: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        OP: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        POL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        POOL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        pathUSD: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        SNX: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        SOL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
                133268194659241: string;
            };
            coingeckoId: string;
        };
        UMA: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        USDB: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        USDC: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
                133268194659241: string;
            };
            coingeckoId: string;
        };
        "USDC.e": {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        USDbC: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        USDzC: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        "USDC-BNB": {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            l1TokenDecimals: number;
            coingeckoId: string;
        };
        USDH: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        "USDH-SPOT": {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        USDM: {
            name: string;
            symbol: string;
            decimals: number;
            coingeckoId: string;
            addresses: {
                [x: number]: string;
            };
        };
        USDT: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        "USDT-BNB": {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            l1TokenDecimals: number;
            coingeckoId: string;
        };
        "USDT-SPOT": {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            l1TokenDecimals: number;
            coingeckoId: string;
        };
        VLR: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        XPL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WAZERO: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WBNB: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WBTC: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WETH: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WGHO: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WGRASS: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WLD: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WMATIC: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WMON: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WPOL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        WSOL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
                133268194659241: string;
            };
            coingeckoId: string;
        };
        WXPL: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
        XYZ: {
            name: string;
            symbol: string;
            decimals: number;
            addresses: {
                [x: number]: string;
            };
            coingeckoId: string;
        };
    }): {
        inputTokenInfo: TokenInfo;
        outputTokenInfo: TokenInfo;
    };
    resolveTokenPrice(outputTokenInfo: TokenInfo, _tokenPrice: number | undefined, deposit: RelayData & {
        destinationChainId: number;
    }): Promise<number>;
}
export {};
//# sourceMappingURL=relayFeeCalculator.d.ts.map