import { AbiRepositoryConfig } from '../config';
import { Address } from './contract';
import { AbiItemDefinition, AbiItem } from './item';
import { RuntimeError } from '../utils/error';
export declare class AbiError extends RuntimeError {
}
interface TruffleBuild {
    contractName: string;
    abi: AbiItem[];
    networks?: {
        [id: string]: {
            address: string;
        };
    };
}
export interface SignatureFileContents {
    type: 'function' | 'event';
    entries: Array<[string, AbiItemDefinition[]]>;
}
export declare function isAbiItem(obj: any): obj is AbiItem;
export declare function isAbiItemArray(obj: any): obj is AbiItem[];
export declare function isTruffleBuildFile(obj: any): obj is TruffleBuild;
export declare function extractDeployedContractAddresses(truffleBuild: TruffleBuild): Address[] | undefined;
export declare function searchAbiFiles(dir: string, config: AbiRepositoryConfig): AsyncIterable<string>;
export interface AbiFileContents {
    contractName: string;
    contractAddress?: string;
    contractFingerprint?: string;
    entries: Array<{
        abi: AbiItemDefinition;
        sig: string;
    }>;
    fileName?: string;
}
export declare function computeRelativePath(fileName: string, basePath?: string): string | null;
export declare function parseAbiFileContents(abiData: any, { computeFingerprint, fileName, basePath }: {
    computeFingerprint: boolean;
    fileName: string;
    basePath?: string;
}): AbiFileContents;
export declare function loadAbiFile(path: string, config: AbiRepositoryConfig): Promise<AbiFileContents>;
export declare function readGzipFile(path: string, { encoding }?: {
    encoding?: string;
}): Promise<string>;
export declare function loadSignatureFile(path: string): Promise<SignatureFileContents>;
export {};
