import { SpokePoolClient } from "../clients";
import { CachingMechanismInterface, Deposit, DepositWithBlock, Fill, RelayData, SlowFillRequest, ConvertedRelayData, ConvertedFill } from "../interfaces";
export declare enum InvalidFill {
    DepositIdInvalid = 0,
    DepositIdNotFound = 1,
    FillMismatch = 2,
    DepositIdOutOfRange = 3
}
export type DepositSearchResult = {
    found: true;
    deposit: DepositWithBlock;
} | {
    found: false;
    code: InvalidFill;
    reason: string;
};
/**
 * Attempts to resolve a deposit for a fill. If the fill's deposit Id is within the spoke pool client's search range,
 * the deposit is returned immediately. Otherwise, the deposit is queried first from the provided cache, and if it is
 * not found in the cache, it is queried from the spoke pool client. If the deposit is found, it is cached before
 * being returned.
 * @param spokePoolClient The spoke pool client to use to query the deposit.
 * @param fill The fill to resolve a deposit for.
 * @param cache An optional cache to use to store the deposit. Optional.
 * @returns The deposit for the fill, or undefined if the deposit could not be found.
 * @throws If the fill's origin chain ID does not match the spoke pool client's chain ID.
 * @throws If the spoke pool client has not been updated.
 */
export declare function queryHistoricalDepositForFill(spokePoolClient: SpokePoolClient, fill: Fill | SlowFillRequest, cache?: CachingMechanismInterface): Promise<DepositSearchResult>;
/**
 * Concatenate all fields from a Deposit, Fill or SlowFillRequest into a single string.
 * This can be used to identify a bridge event in a mapping. This is used instead of the actual keccak256 hash
 * (getRelayDataHash()) for two reasons: performance and the fact that only Deposit includes the `message` field, which
 * is required to compute a complete RelayData hash.
 * note: This function should _not_ be used to query the SpokePool.fillStatuses mapping.
 */
export declare function getRelayEventKey(data: Omit<RelayData, "message"> & {
    messageHash: string;
    destinationChainId: number;
}): string;
export declare function validateFillForDeposit(relayData: Omit<RelayData, "message"> & {
    messageHash: string;
    destinationChainId: number;
}, deposit?: Omit<Deposit, "quoteTimestamp" | "fromLiteChain" | "toLiteChain">): {
    valid: true;
} | {
    valid: false;
    reason: string;
};
/**
 * Returns true if filling this deposit (as a slow or fast fill) or refunding it would not change any state
 * on-chain. The dataworker functions can use this to conveniently filter out useless deposits.
 * @dev The reason we allow a 0-input deposit to have a non-empty message is that the message might be used
 * to pay the filler in an indirect way so it might have economic value as a fast or slow fill.
 * @param deposit Deposit to check.
 * @returns True if deposit's input amount is 0 and message is empty.
 */
export declare function isZeroValueDeposit(deposit: Pick<RelayData, "inputAmount" | "message">): boolean;
export declare function invalidOutputToken(deposit: Pick<RelayData, "outputToken">): boolean;
export declare function isZeroValueFillOrSlowFillRequest(e: Pick<Fill | SlowFillRequest, "inputAmount" | "messageHash">): boolean;
/**
 * Determines if a message is empty or not.
 * @param message The message to check.
 * @returns True if the message is empty, false otherwise.
 */
export declare function isMessageEmpty(message?: string): boolean;
export declare function isFillOrSlowFillRequestMessageEmpty(message: string): boolean;
/**
 * Determines if a deposit was updated via a speed-up transaction.
 * @param deposit Deposit to evaluate.
 * @returns True if the deposit was updated, otherwise false.
 */
export declare function isDepositSpedUp(deposit: Deposit): boolean;
/**
 * Resolves the applicable message for a deposit.
 * @param deposit Deposit to evaluate.
 * @returns Original or updated message string, depending on whether the depositor updated the deposit.
 */
export declare function resolveDepositMessage(deposit: Deposit): string;
/**
 * Converts a RelayData object with `Address` types as address fields to a `RelayData`-like object with
 * strings as address fields.
 * @param relayData RelayData type.
 * @returns a RelayData-like type which has strings as fields.
 */
export declare function convertRelayDataParamsToBytes32(relayData: RelayData): ConvertedRelayData;
/**
 * Converts a Fill object with `Address` types as address fields to a `RelayData`-like object with
 * strings as address fields.
 * @param relayData RelayData type.
 * @returns a RelayData-like type which has strings as fields.
 */
export declare function convertFillParamsToBytes32(fill: Fill): ConvertedFill;
