import { Contract, PopulatedTransaction, providers } from "ethers"; import { Deposit, Fill, FillStatus, RelayData, SlowFillRequest } from "../interfaces"; import { SpokePoolClient } from "../clients"; type BlockTag = providers.BlockTag; /** * @param spokePool SpokePool Contract instance. * @param deposit V3Deopsit instance. * @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId). * @returns An Ethers UnsignedTransaction instance. */ export declare function populateV3Relay(spokePool: Contract, deposit: Deposit, relayer: string, repaymentChainId?: number): Promise; /** * Find the block range that contains the deposit ID. This is a binary search that searches for the block range * that contains the deposit ID. * @param targetDepositId The target deposit ID to search for. * @param initLow The initial lower bound of the block range to search. * @param initHigh The initial upper bound of the block range to search. * @param maxSearches The maximum number of searches to perform. This is used to prevent infinite loops. * @returns The block range that contains the deposit ID. * @note // We want to find the block range that satisfies these conditions: * // - the low block has deposit count <= targetDepositId * // - the high block has a deposit count > targetDepositId. * // This way the caller can search for a V3FundsDeposited event between [low, high] that will always * // contain the event emitted when deposit ID was incremented to targetDepositId + 1. This is the same transaction * // where the deposit with deposit ID = targetDepositId was created. */ export declare function getBlockRangeForDepositId(targetDepositId: number, initLow: number, initHigh: number, maxSearches: number, spokePool: SpokePoolClient): Promise<{ low: number; high: number; }>; /** * Finds the deposit id at a specific block number. * @param blockTag The block number to search for the deposit ID at. * @returns The deposit ID. */ export declare function getDepositIdAtBlock(contract: Contract, blockTag: number): Promise; /** * Compute the RelayData hash for a fill. This can be used to determine the fill status. * @param relayData RelayData information that is used to complete a fill. * @param destinationChainId Supplementary destination chain ID required by V3 hashes. * @returns The corresponding RelayData hash. */ export declare function getRelayDataHash(relayData: RelayData, destinationChainId: number): string; export declare function getRelayHashFromEvent(e: Deposit | Fill | SlowFillRequest): string; export declare function isUnsafeDepositId(depositId: number): boolean; /** * Find the amount filled for a deposit at a particular block. * @param spokePool SpokePool contract instance. * @param relayData Deposit information that is used to complete a fill. * @param blockTag Block tag (numeric or "latest") to query at. * @returns The amount filled for the specified deposit at the requested block (or latest). */ export declare function relayFillStatus(spokePool: Contract, relayData: RelayData, blockTag?: number | "latest", destinationChainId?: number): Promise; export declare function fillStatusArray(spokePool: Contract, relayData: RelayData[], blockTag?: BlockTag): Promise<(FillStatus | undefined)[]>; /** * Find the block at which a fill was completed. * @todo After SpokePool upgrade, this function can be simplified to use the FillStatus enum. * @param spokePool SpokePool contract instance. * @param relayData Deposit information that is used to complete a fill. * @param lowBlockNumber The lower bound of the search. Must be bounded by SpokePool deployment. * @param highBlocknumber Optional upper bound for the search. * @returns The block number at which the relay was completed, or undefined. */ export declare function findFillBlock(spokePool: Contract, relayData: RelayData, lowBlockNumber: number, highBlockNumber?: number): Promise; export {};