import { AbiRepositoryConfig, LogConfigSchema } from '../config';
import { ManagedResource } from '@splunkdlt/managed-resource';
import { DecodedFunctionCall } from './decode';
import { AbiFileContents } from './files';
import { AbiItemDefinition } from './item';
interface AbiMatch {
    anonymous: boolean;
    candidates: AbiItemDefinition[];
}
interface AbiMatchParams {
    contractFingerprint?: string;
    contractAddress?: string;
}
export interface ContractAbi {
    contractName: string;
    fileName?: string;
}
export interface TransactionLog {
    address: string;
    topics: Array<string>;
    data: string;
}
/** Sort abi defintions in consistent priority order */
export declare function sortAbis(abis: AbiItemDefinition[]): AbiItemDefinition[];
export declare class AbiRepository implements ManagedResource {
    private config;
    private logging;
    private signatures;
    private contractsByFingerprint;
    private contractsByAddress;
    constructor(config: AbiRepositoryConfig, logging: LogConfigSchema);
    private addToSignatures;
    initialize(): Promise<void>;
    loadAnonymousSignatures(file: string): Promise<number>;
    loadAbisFromDir(dir: string, config: AbiRepositoryConfig): Promise<number>;
    loadAbiFile(path: string, config: AbiRepositoryConfig): Promise<void>;
    addAbi(abiFileContents: AbiFileContents): void;
    get signatureCount(): number;
    getMatchingAbi(signatureHash: string): AbiMatch | undefined;
    getMatchingSignature(signatureHash: string): string | undefined;
    getContractByFingerprint(fingerprint: string): ContractAbi | undefined;
    getContractByAddress(address: string): ContractAbi | undefined;
    findMatchingAbis(sigHash: string, { contractFingerprint, contractAddress }: AbiMatchParams): AbiMatch | undefined;
    private abiDecode;
    decodeFunctionCall(data: string, matchParams: AbiMatchParams): DecodedFunctionCall | undefined;
    decodeLogEvent(logEvent: TransactionLog, matchParams: AbiMatchParams): DecodedFunctionCall | undefined;
    shutdown(): Promise<void>;
}
export {};
