import { AztecAddress, type Fr, FunctionSelector } from '@aztec/circuits.js';
import { type OpcodeLocation } from '@aztec/foundation/abi';
import { z } from 'zod';
/**
 * Address and selector of a function that failed during simulation.
 */
export interface FailingFunction {
    /**
     * The address of the contract that failed.
     */
    contractAddress: AztecAddress;
    /**
     * The name of the contract that failed.
     */
    contractName?: string;
    /**
     * The selector of the function that failed.
     */
    functionSelector?: FunctionSelector;
    /**
     * The name of the function that failed.
     */
    functionName?: string;
}
/**
 * A pointer to a failing section of the noir source code.
 */
export interface SourceCodeLocation {
    /**
     * The path to the source file.
     */
    filePath: string;
    /**
     * The line number of the call.
     */
    line: number;
    /**
     * The column number of the call.
     */
    column: number;
    /**
     * The source code of the file.
     */
    fileSource: string;
    /**
     * The source code text of the failed constraint.
     */
    locationText: string;
}
/**
 * A stack of noir source code locations.
 */
export type NoirCallStack = SourceCodeLocation[] | OpcodeLocation[];
/**
 * Checks if a call stack is unresolved.
 */
export declare function isNoirCallStackUnresolved(callStack: NoirCallStack): callStack is OpcodeLocation[];
/**
 * An error during the simulation of a function call.
 */
export declare class SimulationError extends Error {
    private originalMessage;
    private functionErrorStack;
    revertData: Fr[];
    private noirErrorStack?;
    private aztecContext;
    constructor(originalMessage: string, functionErrorStack: FailingFunction[], revertData?: Fr[], noirErrorStack?: NoirCallStack | undefined, options?: ErrorOptions);
    getMessage(): string;
    getOriginalMessage(): string;
    setOriginalMessage(message: string): void;
    /**
     * Enriches the error with the name of a contract that failed.
     * @param contractAddress - The address of the contract
     * @param contractName - The corresponding name
     */
    enrichWithContractName(contractAddress: AztecAddress, contractName: string): void;
    /**
     * Enriches the error with the name of a function that failed.
     * @param contractAddress - The address of the contract
     * @param functionSelector - The selector of the function
     * @param functionName - The corresponding name
     */
    enrichWithFunctionName(contractAddress: AztecAddress, functionSelector: FunctionSelector, functionName: string): void;
    getStack(): string;
    /**
     * The aztec function stack that failed during simulation.
     */
    getCallStack(): FailingFunction[];
    /**
     * Returns the noir call stack inside the first function that failed during simulation.
     * @returns The noir call stack.
     */
    getNoirCallStack(): NoirCallStack;
    /**
     * Sets the noir call stack.
     * @param callStack - The noir call stack.
     */
    setNoirCallStack(callStack: NoirCallStack): void;
    setAztecContext(context: string): void;
    toJSON(): {
        originalMessage: string;
        functionErrorStack: FailingFunction[];
        noirErrorStack: NoirCallStack | undefined;
        revertData: `0x${string}`[];
    };
    static get schema(): z.ZodEffects<z.ZodObject<{
        originalMessage: z.ZodString;
        functionErrorStack: z.ZodArray<z.ZodObject<{
            contractAddress: z.ZodType<AztecAddress, any, string>;
            contractName: z.ZodOptional<z.ZodString>;
            functionSelector: z.ZodType<FunctionSelector, any, string>;
            functionName: z.ZodOptional<z.ZodString>;
        }, "strip", z.ZodTypeAny, {
            contractAddress: AztecAddress;
            functionSelector: FunctionSelector;
            contractName?: string | undefined;
            functionName?: string | undefined;
        }, {
            contractAddress: string;
            functionSelector: string;
            contractName?: string | undefined;
            functionName?: string | undefined;
        }>, "many">;
        noirErrorStack: z.ZodOptional<z.ZodType<NoirCallStack, z.ZodTypeDef, NoirCallStack>>;
        revertData: z.ZodArray<z.ZodType<Fr, any, string>, "many">;
    }, "strip", z.ZodTypeAny, {
        originalMessage: string;
        functionErrorStack: {
            contractAddress: AztecAddress;
            functionSelector: FunctionSelector;
            contractName?: string | undefined;
            functionName?: string | undefined;
        }[];
        revertData: Fr[];
        noirErrorStack?: NoirCallStack | undefined;
    }, {
        originalMessage: string;
        functionErrorStack: {
            contractAddress: string;
            functionSelector: string;
            contractName?: string | undefined;
            functionName?: string | undefined;
        }[];
        revertData: string[];
        noirErrorStack?: NoirCallStack | undefined;
    }>, SimulationError, {
        originalMessage: string;
        functionErrorStack: {
            contractAddress: string;
            functionSelector: string;
            contractName?: string | undefined;
            functionName?: string | undefined;
        }[];
        revertData: string[];
        noirErrorStack?: NoirCallStack | undefined;
    }>;
    static random(): SimulationError;
}
//# sourceMappingURL=simulation_error.d.ts.map