import { RequestContext } from '@chimera-monorepo/utils'; import { Gas, ITransactionReceipt, ITransactionRequest, ITransactionResponse, WriteTransaction } from './types'; type TransactionConfig = { confirmationTimeout: number; confirmationsRequired: number; }; type LoggableTransactionData = { txsId: string; nonce: number; type: number; hashes?: string[]; attempt?: number; bumps?: number; minedBlockNumber?: number; confirmedBlockNumber?: number; gasPrice?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; gasLimit: string; error?: string; confirmations?: number; state?: string; }; /** * @classdesc A data structure for storing invariant params and managing state related to a single transaction. */ export declare class OnchainTransaction { readonly context: RequestContext; readonly minTx: WriteTransaction; readonly nonce: number; readonly gas: Gas; private readonly config; readonly uuid: string; responses: ITransactionResponse[]; private _receipt; get receipt(): ITransactionReceipt | undefined; set receipt(value: ITransactionReceipt | undefined); minedBlockNumber: number; readonly timestamp: number; error: Error | undefined; attempt: number; bumps: number; type: number; get hash(): string | undefined; get hashes(): string[]; /** * Specifies whether the transaction has been submitted. * @returns boolean indicating whether the transaction is submitted. */ get didSubmit(): boolean; /** * Specifies whether the transaction has been mined. * @returns boolean indicating whether the transaction is mined. */ get didMine(): boolean; /** * Specifies whether the transaction has been completed - meaning that it's been * mined and has received the target number of confirmations. * @returns boolean indicating whether the transaction is completed. */ get didFinish(): boolean; /** * Formats gas fee info according to tx type (safely ensures we do not send redundant fee info, * and that params are properly named). */ get gasFee(): { gasPrice?: string; maxPriorityFeePerGas?: string; maxFeePerGas?: string; }; /** * Retrieves all params needed to format a full transaction, including current gas price set, nonce, etc. */ get params(): ITransactionRequest; /** * Formats gas fees into gwei units. */ get loggableGasFee(): { gasPrice?: string; maxPriorityFeePerGas?: string; maxFeePerGas?: string; }; /** * Packages transaction data into a format best for logging. */ get loggable(): LoggableTransactionData; /** * A data structure used for management of the lifecycle of one on-chain transaction. * * @param context - Logging context. * @param minTx - The minimum transaction data required to send a transaction. * @param nonce - Assigned nonce number for this transaction. * @param gas - The Gas tracker instance, which will include price, limit, and maximum. * @param config - Transaction configuration. * @param uuid - A unique ID for this transaction. */ constructor(context: RequestContext, minTx: WriteTransaction, nonce: number, gas: Gas, config: TransactionConfig, uuid: string); } export {}; //# sourceMappingURL=transaction.d.ts.map