/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import { ClientIvcProof, Fr, PrivateKernelTailCircuitPublicInputs, type PrivateToPublicAccumulatedData, type ScopedLogHash } from '@aztec/circuits.js';
import { Buffer32 } from '@aztec/foundation/buffer';
import { BufferReader } from '@aztec/foundation/serialize';
import { type FieldsOf } from '@aztec/foundation/types';
import { z } from 'zod';
import { type GetUnencryptedLogsResponse } from '../logs/get_logs_response.js';
import { type L2LogsSource } from '../logs/l2_logs_source.js';
import { ContractClassTxL2Logs, UnencryptedTxL2Logs } from '../logs/tx_l2_logs.js';
import { Gossipable } from '../p2p/gossipable.js';
import { PublicExecutionRequest } from '../public_execution_request.js';
import { type TxStats } from '../stats/stats.js';
import { TxHash } from './tx_hash.js';
/**
 * The interface of an L2 transaction.
 */
export declare class Tx extends Gossipable {
    /**
     * Output of the private kernel circuit for this tx.
     */
    readonly data: PrivateKernelTailCircuitPublicInputs;
    /**
     * Proof from the private kernel circuit.
     * TODO(#7368): This client IVC object currently contains various VKs that will eventually be more like static data.
     *
     */
    readonly clientIvcProof: ClientIvcProof;
    /**
     * Unencrypted logs generated by the tx.
     * NOTE: These do not get filled, but remain here so enqueued_calls_processor.ts can accumulate public logs
     */
    unencryptedLogs: UnencryptedTxL2Logs;
    /**
     * Contract class logs generated by the tx.
     */
    contractClassLogs: ContractClassTxL2Logs;
    /**
     * Enqueued public functions from the private circuit to be run by the sequencer.
     */
    readonly enqueuedPublicFunctionCalls: PublicExecutionRequest[];
    /**
     * Public function call to be run by the sequencer as part of teardown.
     */
    readonly publicTeardownFunctionCall: PublicExecutionRequest;
    static p2pTopic: string;
    constructor(
    /**
     * Output of the private kernel circuit for this tx.
     */
    data: PrivateKernelTailCircuitPublicInputs, 
    /**
     * Proof from the private kernel circuit.
     * TODO(#7368): This client IVC object currently contains various VKs that will eventually be more like static data.
     *
     */
    clientIvcProof: ClientIvcProof, 
    /**
     * Unencrypted logs generated by the tx.
     * NOTE: These do not get filled, but remain here so enqueued_calls_processor.ts can accumulate public logs
     */
    unencryptedLogs: UnencryptedTxL2Logs, 
    /**
     * Contract class logs generated by the tx.
     */
    contractClassLogs: ContractClassTxL2Logs, 
    /**
     * Enqueued public functions from the private circuit to be run by the sequencer.
     */
    enqueuedPublicFunctionCalls: PublicExecutionRequest[], 
    /**
     * Public function call to be run by the sequencer as part of teardown.
     */
    publicTeardownFunctionCall: PublicExecutionRequest);
    p2pMessageIdentifier(): Buffer32;
    hasPublicCalls(): boolean;
    getNonRevertiblePublicExecutionRequests(): PublicExecutionRequest[];
    getRevertiblePublicExecutionRequests(): PublicExecutionRequest[];
    getPublicTeardownExecutionRequest(): PublicExecutionRequest | undefined;
    /**
     * Deserializes the Tx object from a Buffer.
     * @param buffer - Buffer or BufferReader object to deserialize.
     * @returns An instance of Tx.
     */
    static fromBuffer(buffer: Buffer | BufferReader): Tx;
    static newWithTxData(data: PrivateKernelTailCircuitPublicInputs, publicTeardownExecutionRequest?: PublicExecutionRequest): Tx;
    /**
     * Serializes the Tx object into a Buffer.
     * @returns Buffer representation of the Tx object.
     */
    toBuffer(): Buffer;
    static get schema(): z.ZodEffects<z.ZodObject<{
        data: z.ZodType<PrivateKernelTailCircuitPublicInputs, any, string>;
        clientIvcProof: z.ZodType<ClientIvcProof, any, string>;
        unencryptedLogs: z.ZodEffects<z.ZodObject<{
            functionLogs: z.ZodArray<z.ZodEffects<z.ZodObject<{
                logs: z.ZodArray<z.ZodEffects<z.ZodObject<{
                    contractAddress: z.ZodType<import("@aztec/circuits.js").AztecAddress, any, string>;
                    data: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer, string>, z.ZodEffects<z.ZodObject<{
                        type: z.ZodLiteral<"Buffer">;
                        data: z.ZodArray<z.ZodNumber, "many">;
                    }, "strip", z.ZodTypeAny, {
                        type: "Buffer";
                        data: number[];
                    }, {
                        type: "Buffer";
                        data: number[];
                    }>, Buffer, {
                        type: "Buffer";
                        data: number[];
                    }>]>;
                }, "strip", z.ZodTypeAny, {
                    contractAddress: import("@aztec/circuits.js").AztecAddress;
                    data: Buffer;
                }, {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }>, import("../index.js").UnencryptedL2Log, {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }>, "many">;
            }, "strip", z.ZodTypeAny, {
                logs: import("../index.js").UnencryptedL2Log[];
            }, {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }>, import("../index.js").UnencryptedFunctionL2Logs, {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }>, "many">;
        }, "strip", z.ZodTypeAny, {
            functionLogs: import("../index.js").UnencryptedFunctionL2Logs[];
        }, {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        }>, UnencryptedTxL2Logs, {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        }>;
        contractClassLogs: z.ZodEffects<z.ZodObject<{
            functionLogs: z.ZodArray<z.ZodEffects<z.ZodObject<{
                logs: z.ZodArray<z.ZodEffects<z.ZodObject<{
                    contractAddress: z.ZodType<import("@aztec/circuits.js").AztecAddress, any, string>;
                    data: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer, string>, z.ZodEffects<z.ZodObject<{
                        type: z.ZodLiteral<"Buffer">;
                        data: z.ZodArray<z.ZodNumber, "many">;
                    }, "strip", z.ZodTypeAny, {
                        type: "Buffer";
                        data: number[];
                    }, {
                        type: "Buffer";
                        data: number[];
                    }>, Buffer, {
                        type: "Buffer";
                        data: number[];
                    }>]>;
                }, "strip", z.ZodTypeAny, {
                    contractAddress: import("@aztec/circuits.js").AztecAddress;
                    data: Buffer;
                }, {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }>, import("../index.js").UnencryptedL2Log, {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }>, "many">;
            }, "strip", z.ZodTypeAny, {
                logs: import("../index.js").UnencryptedL2Log[];
            }, {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }>, import("../index.js").UnencryptedFunctionL2Logs, {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }>, "many">;
        }, "strip", z.ZodTypeAny, {
            functionLogs: import("../index.js").UnencryptedFunctionL2Logs[];
        }, {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        }>, ContractClassTxL2Logs, {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        }>;
        enqueuedPublicFunctionCalls: z.ZodArray<z.ZodEffects<z.ZodObject<{
            callContext: z.ZodEffects<z.ZodObject<{
                msgSender: z.ZodType<import("@aztec/circuits.js").AztecAddress, any, string>;
                contractAddress: z.ZodType<import("@aztec/circuits.js").AztecAddress, any, string>;
                functionSelector: z.ZodType<import("@aztec/circuits.js").FunctionSelector, any, string>;
                isStaticCall: z.ZodBoolean;
            }, "strip", z.ZodTypeAny, {
                msgSender: import("@aztec/circuits.js").AztecAddress;
                contractAddress: import("@aztec/circuits.js").AztecAddress;
                functionSelector: import("@aztec/circuits.js").FunctionSelector;
                isStaticCall: boolean;
            }, {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            }>, import("@aztec/circuits.js").CallContext, {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            }>;
            args: z.ZodArray<z.ZodType<Fr, any, string>, "many">;
        }, "strip", z.ZodTypeAny, {
            args: Fr[];
            callContext: import("@aztec/circuits.js").CallContext;
        }, {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        }>, PublicExecutionRequest, {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        }>, "many">;
        publicTeardownFunctionCall: z.ZodEffects<z.ZodObject<{
            callContext: z.ZodEffects<z.ZodObject<{
                msgSender: z.ZodType<import("@aztec/circuits.js").AztecAddress, any, string>;
                contractAddress: z.ZodType<import("@aztec/circuits.js").AztecAddress, any, string>;
                functionSelector: z.ZodType<import("@aztec/circuits.js").FunctionSelector, any, string>;
                isStaticCall: z.ZodBoolean;
            }, "strip", z.ZodTypeAny, {
                msgSender: import("@aztec/circuits.js").AztecAddress;
                contractAddress: import("@aztec/circuits.js").AztecAddress;
                functionSelector: import("@aztec/circuits.js").FunctionSelector;
                isStaticCall: boolean;
            }, {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            }>, import("@aztec/circuits.js").CallContext, {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            }>;
            args: z.ZodArray<z.ZodType<Fr, any, string>, "many">;
        }, "strip", z.ZodTypeAny, {
            args: Fr[];
            callContext: import("@aztec/circuits.js").CallContext;
        }, {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        }>, PublicExecutionRequest, {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        }>;
    }, "strip", z.ZodTypeAny, {
        data: PrivateKernelTailCircuitPublicInputs;
        unencryptedLogs: UnencryptedTxL2Logs;
        contractClassLogs: ContractClassTxL2Logs;
        enqueuedPublicFunctionCalls: PublicExecutionRequest[];
        publicTeardownFunctionCall: PublicExecutionRequest;
        clientIvcProof: ClientIvcProof;
    }, {
        data: string;
        unencryptedLogs: {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        };
        contractClassLogs: {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        };
        enqueuedPublicFunctionCalls: {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        }[];
        publicTeardownFunctionCall: {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        };
        clientIvcProof: string;
    }>, Tx, {
        data: string;
        unencryptedLogs: {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        };
        contractClassLogs: {
            functionLogs: {
                logs: {
                    contractAddress: string;
                    data: string | {
                        type: "Buffer";
                        data: number[];
                    };
                }[];
            }[];
        };
        enqueuedPublicFunctionCalls: {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        }[];
        publicTeardownFunctionCall: {
            args: string[];
            callContext: {
                msgSender: string;
                contractAddress: string;
                functionSelector: string;
                isStaticCall: boolean;
            };
        };
        clientIvcProof: string;
    }>;
    static from(fields: FieldsOf<Tx>): Tx;
    /**
     * Gets unencrypted logs emitted by this tx.
     * @param logsSource - An instance of `L2LogsSource` which can be used to obtain the logs.
     * @returns The requested logs.
     */
    getUnencryptedLogs(logsSource: L2LogsSource): Promise<GetUnencryptedLogsResponse>;
    /**
     * Construct & return transaction hash.
     * @returns The transaction's hash.
     */
    getTxHash(): TxHash;
    /** Returns the tx hash, or undefined if none is set. */
    tryGetTxHash(): TxHash | undefined;
    /** Returns stats about this tx. */
    getStats(): TxStats;
    getSize(): number;
    /**
     * Estimates the tx size based on its private effects. Note that the actual size of the tx
     * after processing will probably be larger, as public execution would generate more data.
     */
    getEstimatedPrivateTxEffectsSize(): number;
    /**
     * Convenience function to get a hash out of a tx or a tx-like.
     * @param tx - Tx-like object.
     * @returns - The hash.
     */
    static getHash(tx: Tx | HasHash): TxHash;
    /**
     * Convenience function to get array of hashes for an array of txs.
     * @param txs - The txs to get the hashes from.
     * @returns The corresponding array of hashes.
     */
    static getHashes(txs: (Tx | HasHash)[]): TxHash[];
    /**
     * Clones a tx, making a deep copy of all fields.
     * @param tx - The transaction to be cloned.
     * @returns The cloned transaction.
     */
    static clone(tx: Tx): Tx;
    static random(): Tx;
    /**
     * Filters out logs from functions that are not present in the provided kernel output.
     *
     * The purpose of this is to remove logs that got dropped due to a revert,
     * in which case, we only have the kernel's hashes to go on, as opposed to
     * this grouping by function maintained in this class.
     *
     * The logic therefore is to drop all FunctionLogs if any constituent hash
     * does not appear in the provided hashes: it is impossible for part of a
     * function to revert.
     *
     * @param logHashes the individual log hashes we want to keep
     * @param out the output to put passing logs in, to keep this function abstract
     */
    filterRevertedLogs(privateNonRevertible: PrivateToPublicAccumulatedData, unencryptedLogsHashes: ScopedLogHash[]): void;
}
/** Utility type for an entity that has a hash property for a txhash */
type HasHash = {
    hash: TxHash;
};
export {};
//# sourceMappingURL=tx.d.ts.map