import type { BlockTracker, NetworkClientId } from '@metamask/network-controller'; import EventEmitter from 'events'; import type { TransactionControllerMessenger } from '../TransactionController.js'; import type { TransactionMeta } from '../types.js'; type Events = { 'transaction-confirmed': [txMeta: TransactionMeta]; 'transaction-dropped': [txMeta: TransactionMeta]; 'transaction-failed': [txMeta: TransactionMeta, error: Error]; 'transaction-updated': [txMeta: TransactionMeta, note: string]; }; export interface PendingTransactionTrackerEventEmitter extends EventEmitter { on(eventName: EventName, listener: (...args: Events[EventName]) => void): this; emit(eventName: EventName, ...args: Events[EventName]): boolean; } export declare class PendingTransactionTracker { #private; hub: PendingTransactionTrackerEventEmitter; constructor({ blockTracker, getGlobalLock, getTransactions, isTimeoutEnabled, hooks, messenger, networkClientId, }: { blockTracker: BlockTracker; getGlobalLock: () => Promise<() => void>; getTransactions: () => TransactionMeta[]; hooks?: { beforeCheckPendingTransaction?: (transactionMeta: TransactionMeta) => Promise; }; isTimeoutEnabled: (transactionMeta: TransactionMeta) => boolean; messenger: TransactionControllerMessenger; networkClientId: NetworkClientId; }); startIfPendingTransactions: () => void; /** * Adds a transaction to the polling mechanism for monitoring its status. * * This method forcefully adds a single transaction to the list of transactions * being polled, ensuring that its status is checked, event emitted but no update is performed. * It overrides the default behavior by prioritizing the given transaction for polling. * * @param transactionMeta - The transaction metadata to be added for polling. * * The transaction will now be monitored for updates, such as confirmation or failure. */ addTransactionToPoll(transactionMeta: TransactionMeta): void; /** * Force checks the network if the given transaction is confirmed and updates it's status. * * @param txMeta - The transaction to check */ forceCheckTransaction(txMeta: TransactionMeta): Promise; stop(): void; } export {}; //# sourceMappingURL=PendingTransactionTracker.d.ts.map