import { type InitialAccountData } from '@aztec/accounts/testing';
import { type AztecNodeConfig } from '@aztec/aztec-node';
import { type AccountWalletWithSecretKey, type AztecAddress, type AztecNode, type ContractMethod, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
import { type BlobSinkServer } from '@aztec/blob-sink/server';
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type Operator } from '@aztec/ethereum';
import { EthCheatCodes, startAnvil } from '@aztec/ethereum/test';
import { SecretValue } from '@aztec/foundation/config';
import { Fr } from '@aztec/foundation/fields';
import { TestDateProvider } from '@aztec/foundation/timer';
import type { DataStoreConfig } from '@aztec/kv-store/config';
import { MockGossipSubNetwork } from '@aztec/p2p/test-helpers';
import { type ProverNode, type ProverNodeConfig, type ProverNodeDeps } from '@aztec/prover-node';
import { type PXEService, type PXEServiceConfig } from '@aztec/pxe/server';
import type { SequencerClient } from '@aztec/sequencer-client';
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
import { type TelemetryClient, type TelemetryClientConfig } from '@aztec/telemetry-client';
import { type Chain, type HDAccount, type PrivateKeyAccount } from 'viem';
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
export { startAnvil };
export declare const getPrivateKeyFromIndex: (index: number) => Buffer | null;
export declare const setupL1Contracts: (l1RpcUrls: string[], account: HDAccount | PrivateKeyAccount, logger: Logger, args?: Partial<DeployL1ContractsArgs>, chain?: Chain) => Promise<DeployL1ContractsReturnType>;
/**
 * Sets up Private eXecution Environment (PXE).
 * @param aztecNode - An instance of Aztec Node.
 * @param opts - Partial configuration for the PXE service.
 * @param logger - The logger to be used.
 * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
 * @returns Private eXecution Environment (PXE), logger and teardown function.
 */
export declare function setupPXEService(aztecNode: AztecNode, opts?: Partial<PXEServiceConfig>, logger?: Logger, useLogSuffix?: boolean): Promise<{
    /**
     * The PXE instance.
     */
    pxe: PXEService;
    /**
     * Logger instance named as the current test.
     */
    logger: Logger;
    /**
     * Teardown function
     */
    teardown: () => Promise<void>;
}>;
/** Options for the e2e tests setup */
export type SetupOptions = {
    /** State load */
    stateLoad?: string;
    /** Whether to enable metrics collection, if undefined, metrics collection is disabled */
    metricsPort?: number | undefined;
    /** Previously deployed contracts on L1 */
    deployL1ContractsValues?: DeployL1ContractsReturnType;
    /** Whether to skip deployment of protocol contracts (auth registry, etc) */
    skipProtocolContracts?: boolean;
    /** Initial fee juice for default accounts */
    initialAccountFeeJuice?: Fr;
    /** Number of initial accounts funded with fee juice */
    numberOfInitialFundedAccounts?: number;
    /** Data of the initial funded accounts */
    initialFundedAccounts?: InitialAccountData[];
    /** Salt to use in L1 contract deployment */
    salt?: number;
    /** An initial set of validators */
    initialValidators?: (Operator & {
        privateKey: `0x${string}`;
    })[];
    /** Anvil Start time */
    l1StartTime?: number;
    /** The anvil time where we should at the earliest be seeing L2 blocks */
    l2StartTime?: number;
    /** Whether to start a prover node */
    startProverNode?: boolean;
    /** Whether to fund the rewardDistributor */
    fundRewardDistributor?: boolean;
    /** Manual config for the telemetry client */
    telemetryConfig?: Partial<TelemetryClientConfig> & {
        benchmark?: boolean;
    };
    /** Public data that will be inserted in the tree in genesis */
    genesisPublicData?: PublicDataTreeLeaf[];
    /** Specific config for the prover node, if set. */
    proverNodeConfig?: Partial<ProverNodeConfig>;
    /** Whether to use a mock gossip sub network for p2p clients. */
    mockGossipSubNetwork?: boolean;
    /** Whether to disable the anvil test watcher (can still be manually started) */
    disableAnvilTestWatcher?: boolean;
    /** Whether to enable anvil automine during deployment of L1 contracts (consider defaulting this to true). */
    automineL1Setup?: boolean;
    /** How many accounts to seed and unlock in anvil. */
    anvilAccounts?: number;
    /** Port to start anvil (defaults to 8545) */
    anvilPort?: number;
    /** Key to use for publishing L1 contracts */
    l1PublisherKey?: SecretValue<`0x${string}`>;
} & Partial<AztecNodeConfig>;
/** Context for an end-to-end test as returned by the `setup` function */
export type EndToEndContext = {
    /** The Aztec Node service or client a connected to it. */
    aztecNode: AztecNode;
    /** Client to the Aztec Node admin interface (undefined if connected to remote environment) */
    aztecNodeAdmin?: AztecNodeAdmin;
    /** The prover node service (only set if startProverNode is true) */
    proverNode: ProverNode | undefined;
    /** A client to the sequencer service (undefined if connected to remote environment) */
    sequencer: SequencerClient | undefined;
    /** The Private eXecution Environment (PXE). */
    pxe: PXE;
    /** Return values from deployL1Contracts function. */
    deployL1ContractsValues: DeployL1ContractsReturnType;
    /** The Aztec Node configuration. */
    config: AztecNodeConfig;
    /** The data for the initial funded accounts. */
    initialFundedAccounts: InitialAccountData[];
    wallets: AccountWalletWithSecretKey[];
    /** The first wallet to be used. */
    wallet: AccountWalletWithSecretKey;
    /** The accounts to be used. */
    accounts: AztecAddress[];
    /** Logger instance named as the current test. */
    logger: Logger;
    /** The cheat codes. */
    cheatCodes: CheatCodes;
    /** The cheat codes for L1 */
    ethCheatCodes: EthCheatCodes;
    /** The anvil test watcher (undefined if connected to remote environment) */
    watcher: AnvilTestWatcher | undefined;
    /** Allows tweaking current system time, used by the epoch cache only (undefined if connected to remote environment) */
    dateProvider: TestDateProvider | undefined;
    /** The blob sink (undefined if connected to remote environment) */
    blobSink: BlobSinkServer | undefined;
    /** Telemetry client */
    telemetryClient: TelemetryClient | undefined;
    /** Mock gossip sub network used for gossipping messages (only if mockGossipSubNetwork was set to true in opts) */
    mockGossipSubNetwork: MockGossipSubNetwork | undefined;
    /** Prefilled public data used for setting up nodes. */
    prefilledPublicData: PublicDataTreeLeaf[] | undefined;
    /** Function to stop the started services. */
    teardown: () => Promise<void>;
};
/**
 * Sets up the environment for the end-to-end tests.
 * @param numberOfAccounts - The number of new accounts to be created once the PXE is initiated.
 * @param opts - Options to pass to the node initialization and to the setup script.
 * @param pxeOpts - Options to pass to the PXE initialization.
 */
export declare function setup(numberOfAccounts?: number, opts?: SetupOptions, pxeOpts?: Partial<PXEServiceConfig>, chain?: Chain): Promise<EndToEndContext>;
/**
 * Registers the contract class used for test accounts and publicly deploys the instances requested.
 * Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
 * @param sender - Wallet to send the deployment tx.
 * @param accountsToDeploy - Which accounts to publicly deploy.
 */
export declare function ensureAccountContractsPublished(sender: Wallet, accountsToDeploy: Wallet[]): Promise<void>;
/**
 * Sets the timestamp of the next block.
 * @param rpcUrl - rpc url of the blockchain instance to connect to
 * @param timestamp - the timestamp for the next block
 */
export declare function setNextBlockTimestamp(rpcUrl: string, timestamp: number): Promise<void>;
/**
 * Returns a logger instance for the current test.
 * @returns a logger instance for the current test.
 */
export declare function getLogger(): Logger;
export type BalancesFn = ReturnType<typeof getBalancesFn>;
export declare function getBalancesFn(symbol: string, method: ContractMethod, from: AztecAddress, logger: any): (...addresses: (AztecAddress | {
    address: AztecAddress;
})[]) => Promise<bigint[]>;
export declare function expectMapping<K, V>(fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedOutputs: V[]): Promise<void>;
export declare function expectMappingDelta<K, V extends number | bigint>(initialValues: V[], fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedDiffs: V[]): Promise<void>;
/**
 * Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
 * but by conventions its address is computed with a salt of 0.
 * @returns The address of the sponsored FPC contract
 */
export declare function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress>;
/**
 * Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
 * but by conventions its address is computed with a salt of 0.
 * @returns The address of the sponsored FPC contract
 */
export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
/**
 * Deploy a sponsored FPC contract to a running instance.
 */
export declare function setupSponsoredFPC(pxe: PXE): Promise<ContractInstanceWithAddress>;
/**
 * Registers the SponsoredFPC in this PXE instance
 * @param pxe - The pxe client
 */
export declare function registerSponsoredFPC(pxe: PXE): Promise<void>;
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'> & {
    dontStart?: boolean;
}, aztecNode: AztecNode | undefined, prefilledPublicData?: PublicDataTreeLeaf[], proverNodeDeps?: ProverNodeDeps): Promise<ProverNode>;
//# sourceMappingURL=utils.d.ts.map