import { SpokePoolClient } from "../clients"; import { CachingMechanismInterface, Deposit, DepositWithBlock, Fill, SlowFillRequest } from "../interfaces"; export declare enum InvalidFill { DepositIdInvalid = 0, DepositIdNotFound = 1, FillMismatch = 2 } 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; /** * 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): 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; /** * 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; //# sourceMappingURL=DepositUtils.d.ts.map