import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types'; import { RevertCode } from '../avm/revert_code.js'; import { BlockHash } from '../block/block_hash.js'; import { DebugLog } from '../logs/debug_log.js'; import { type ZodFor } from '../schemas/schemas.js'; import { TxHash } from './tx_hash.js'; /** Block inclusion/finalization status. */ export declare enum TxStatus { DROPPED = "dropped", PENDING = "pending", PROPOSED = "proposed", CHECKPOINTED = "checkpointed", PROVEN = "proven", FINALIZED = "finalized" } /** Tx status sorted by finalization progress. */ export declare const SortedTxStatuses: TxStatus[]; /** Execution result - only set when tx is in a block. */ export declare enum TxExecutionResult { SUCCESS = "success", REVERTED = "reverted", /** @deprecated Use REVERTED instead. */ APP_LOGIC_REVERTED = "reverted", /** @deprecated Use REVERTED instead. */ TEARDOWN_REVERTED = "reverted", /** @deprecated Use REVERTED instead. */ BOTH_REVERTED = "reverted" } /** * Represents a transaction receipt in the Aztec network. * Contains essential information about the transaction including its status, origin, and associated addresses. * REFACTOR: TxReceipt should be returned only once the tx is mined, and all its fields should be required. * We should not be using a TxReceipt to answer a query for a pending or dropped tx. */ export declare class TxReceipt { /** A unique identifier for a transaction. */ txHash: TxHash; /** The transaction's block finalization status. */ status: TxStatus; /** The execution result of the transaction, only set when tx is in a block. */ executionResult: TxExecutionResult | undefined; /** Description of transaction error, if any. */ error: string | undefined; /** The transaction fee paid for the transaction. */ transactionFee?: bigint | undefined; /** The hash of the block containing the transaction. */ blockHash?: BlockHash | undefined; /** The block number in which the transaction was included. */ blockNumber?: BlockNumber | undefined; /** The epoch number in which the transaction was included. */ epochNumber?: EpochNumber | undefined; /** * Debug logs collected during public function execution. Served only when the node is in test mode and placed on * the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined * tx receipt is obtained). */ debugLogs?: DebugLog[] | undefined; constructor( /** A unique identifier for a transaction. */ txHash: TxHash, /** The transaction's block finalization status. */ status: TxStatus, /** The execution result of the transaction, only set when tx is in a block. */ executionResult: TxExecutionResult | undefined, /** Description of transaction error, if any. */ error: string | undefined, /** The transaction fee paid for the transaction. */ transactionFee?: bigint | undefined, /** The hash of the block containing the transaction. */ blockHash?: BlockHash | undefined, /** The block number in which the transaction was included. */ blockNumber?: BlockNumber | undefined, /** The epoch number in which the transaction was included. */ epochNumber?: EpochNumber | undefined, /** * Debug logs collected during public function execution. Served only when the node is in test mode and placed on * the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined * tx receipt is obtained). */ debugLogs?: DebugLog[] | undefined); /** Returns true if the transaction was executed successfully. */ hasExecutionSucceeded(): boolean; /** Returns true if the transaction execution reverted. */ hasExecutionReverted(): boolean; /** Returns true if the transaction has been included in a block (proposed, checkpointed, proven, or finalized). */ isMined(): boolean; /** Returns true if the transaction is pending. */ isPending(): boolean; /** Returns true if the transaction was dropped. */ isDropped(): boolean; static empty(): TxReceipt; static get schema(): ZodFor; static from(fields: { txHash: TxHash; status: TxStatus; executionResult?: TxExecutionResult; error?: string; transactionFee?: bigint; blockHash?: BlockHash; blockNumber?: BlockNumber; epochNumber?: EpochNumber; debugLogs?: DebugLog[]; }): TxReceipt; static executionResultFromRevertCode(revertCode: RevertCode): TxExecutionResult; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfcmVjZWlwdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3R4L3R4X3JlY2VpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBcUIsV0FBVyxFQUFxQixNQUFNLGlDQUFpQyxDQUFDO0FBSWpILE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNuRCxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxLQU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