@tevm/txpool
Transaction pool facade backed by @evmts/zevm/txpool. Adds Tevm-specific fee classification for fee-market-shaped transactions, including EIP-7702 and impersonated transactions.
Normally managed by TevmNode, MemoryClient, and the JSON-RPC layer. Use directly when building custom VM tooling or low-level pending-tx control.
Installation
npm install @tevm/txpoolAPI
TxPool
TxPool extends the ZEVM txpool.
import { TxPool, type TxPoolOptions } from '@tevm/txpool'
const txPool = new TxPool({
vm,
maxSize: 5000,
maxPerSender: 100,
} satisfies TxPoolOptions)Options
type TxPoolOptions = {
vm: TxPoolVm
maxSize?: number
maxPerSender?: number
}vm- VM facade withblockchain,stateManager, anddeepCopy().maxSize- max transactions in the pool.maxPerSender- max transactions per sender.
Methods
open()/close()- open or clear the pool.start()/stop()- background cleanup.add(tx, requireSignature?, skipBalance?)- validate and add.addUnverified(tx)- add without validation.getByHash(hashOrHashes)- look up by hex hash, or many by byte hashes.removeByHash(hash)- remove from all indexes.txsByPriceAndNonce({ baseFee, allowedBlobs })- ordered for block building.cleanup()- drop stale txs and sync indexes.deepCopy(options)- copy with another VM/options.
JSON-RPC
Exposed via:
txpool_contenttxpool_contentFromtxpool_inspecttxpool_status
Dev methods (anvil_impersonateAccount, tevm_impersonateAccount, evm_mine) interact with the same pending state.
Transaction Support
Legacy, EIP-2930, EIP-1559, EIP-4844, EIP-7702, and Tevm impersonated EIP-1559-shaped transactions.
Related Packages
- @tevm/vm - VM execution facade
- @tevm/tx - transaction constructors and helpers
- @tevm/common - chain and hardfork configuration
- JSON-RPC

