import { Contract as MulticallContract, ContractCall } from "ethers-multicall"; import { Provider as EthersProvider } from "@ethersproject/providers"; export declare const MULTICALL2_ABI: string[]; type AllResult = [success: true, returns: T] | [success: false, returns: never[]]; type TryAllResult = number extends T["length"] ? { [K in keyof T]: K extends number ? { success: true; returnData: T[K]; } | { success: false; returnData: never[]; } : T[K]; } : { [K in keyof T]: { success: true; returnData: T[K]; } | { success: false; returnData: never[]; }; }; type GroupAllResult = [ success: true, returns: { [K in keyof T]: T[K]; } ] | [success: false, returns: never[][]]; type GroupTryAllResult = { [K in keyof T]: TryAllResult; }; declare class _Provider { protected _provider: EthersProvider; protected _multicallAddress: string; constructor(provider: EthersProvider, chainId?: number); init(): Promise; getEthBalance(address: string): any; } declare const MulticallProvider_base: new (provider: EthersProvider, chainId?: number) => _Provider; /** * Provider class heavily based on ethers-multicall, but supporting specifying a blockTag for the multicall contract * call and `tryAggregate`. */ declare class MulticallProvider extends MulticallProvider_base { constructor(provider: EthersProvider, chainId?: number); static setMulticall2Addresses(addresses: Record): void; init(): Promise; /** * Requires success of all calls. * @returns Tuple of format [success, results]. `success` indicates whether all the calls were successful or at least * one of them failed. */ all(calls: ContractCall[], blockTag?: number | string, batchSize?: number): Promise>; /** * Does not require success of calls, returns the success status and result of each call. */ tryAll(calls: ContractCall[], blockTag?: number | string, batchSize?: number): Promise>; /** * Similar to `all` but supports a group of calls as an input. Preserves the inputs calls structure. */ groupAll(callGroups: ContractCall[][], blockTag?: number | string, batchSize?: number): Promise>; /** * Similar to `tryAll` but supports a group of calls as an input. Preserves the inputs calls structure. */ groupTryAll(callGroups: ContractCall[][], blockTag?: number | string, batchSize?: number): Promise>; private _tryAll; private _all; /** * Helper function to split the calls array into sub-arrays of size n. */ private batchArray; /** * Sets the Multicall2 contract address to a specific chain ID deployed contract. * Throws an error if there's no known contract address for that chain ID. */ private setMulticallAddress; } export { MulticallContract, MulticallProvider };