import type { Logger } from '@nestjs/common';
import { AggregateRoot } from '@easylayer/common/cqrs';
import type { BlockchainProviderService } from '../../../blockchain-provider/blockchain-provider.service';
import type { MempoolTxMetadata } from '../../../blockchain-provider/providers/interfaces';
import type { EvmLoadedMempoolTx } from '../../../native';
export type MempoolSnapshot = Record<string, EvmLoadedMempoolTx[]>;
/**
 * EVM mempool aggregate.
 *
 * Domain/CQRS behavior stays in TypeScript. The heavy mutable structures are
 * delegated to `EvmMempoolStateStore`, which is Rust-backed in Node when the
 * native addon is available and falls back to a JS implementation in browser/tests.
 *
 * EVM-specific behavior:
 * - replacement detection is `(from, nonce)` based;
 * - refresh mode can be `snapshot` (`txpool_content`) or `additive` (`newPendingTransactions` WS);
 * - loaded tx payloads do not store calldata/input in the state store;
 * - all gas/wei fields are decimal strings in public normalized models.
 */
export declare class Mempool extends AggregateRoot {
    private minGasPrice;
    private maxPendingCount;
    private pendingTxTtlMs;
    private batchSizer;
    private prevDuration;
    private store;
    private lastUpdatedMs;
    constructor({ aggregateId, blockHeight, minGasPrice, maxPendingCount, pendingTxTtlMs, options, }: {
        aggregateId: string;
        blockHeight: number;
        minGasPrice?: bigint;
        maxPendingCount?: number;
        pendingTxTtlMs?: number;
        options?: any;
    });
    private effectiveGasPrice;
    private meetsMinGasPrice;
    protected serializeUserState(): Record<string, any>;
    protected restoreUserState(state: any): void;
    init({ requestId, height, logger, }: {
        requestId: string;
        height: number;
        logger?: Logger;
    }): Promise<void>;
    refresh({ requestId, height, perProvider, mode, logger, }: {
        requestId: string;
        height: number;
        perProvider: MempoolSnapshot;
        mode: 'snapshot' | 'additive';
        logger?: Logger;
    }): Promise<void>;
    sync({ requestId, service, logger, }: {
        requestId: string;
        service: BlockchainProviderService;
        logger?: Logger;
    }): Promise<void>;
    removeConfirmed({ requestId, hashes, height, }: {
        requestId: string;
        hashes: string[];
        height: number;
    }): Promise<void>;
    private onEvmMempoolInitializedEvent;
    private onEvmMempoolTransactionReplacedEvent;
    private onEvmMempoolRefreshedEvent;
    private onEvmMempoolSyncProcessedEvent;
    private onEvmMempoolSynchronizedEvent;
    private onEvmMempoolTxsConfirmedEvent;
    hasTransaction(hash: string): boolean;
    getTransactionMetadata(hash: string): MempoolTxMetadata | undefined;
    isTransactionLoaded(hash: string): boolean;
    getStats(): {
        total: number;
        loaded: number;
        providers: number;
        nonceIndex: number;
    };
    getLastUpdatedMs(): number;
    /**
     * Iterates over loaded mempool entries — pairs of (hash, metadata) for every
     * transaction that has passed through `recordLoaded` after a sync phase.
     *
     * Delegates to the backing store (Rust native when available; JS fallback
     * otherwise). The native store returns an Array of `{ hash, metadata }`
     * objects in one NAPI call; arrays are iterable, so `yield*` works directly.
     */
    iterLoadedTx(): IterableIterator<EvmLoadedMempoolTx>;
    /**
     * Awaitable form of `iterLoadedTx`. The callback can be sync or async; awaited
     * sequentially so user code observing the mempool sees deterministic ordering.
     */
    forEachLoadedTx(cb: (tx: EvmLoadedMempoolTx) => void | Promise<void>): Promise<void>;
    dispose(): void;
}
