npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

simulate-tx

v0.1.1

Published

EVM transaction simulator — simulate what a tx will do before sending it

Readme

simulate-tx

EVM transaction simulator — simulate what a tx will do before sending it.

Works on any EVM chain (Ethereum, Base, Arbitrum, Optimism, Polygon, BSC, etc.) and EraVM chains (ZkSync, Lens, Cronos zkEVM, Zircuit).

Powered by revm, compiled to WebAssembly.

Install

npm install simulate-tx

Usage

const { simulate, simulateFromObject } = require('simulate-tx');

// From a JSON string
const result = await simulate('https://eth.llamarpc.com', JSON.stringify({
  from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
  to: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  data: '0x095ea7b3...',
  value: '0x0',
  chain_id: 1,
}));

// Or pass a JS object directly
const result = await simulateFromObject('https://base-rpc.publicnode.com', {
  from: '0x...',
  to: '0x...',
  data: '0x...',
  value: '0x0',
  chain_id: 8453,
});

Output

{
  success: true,
  gas_used: 55582,
  return_data: '0x...0001',
  revert_reason: null,   // decoded string if tx reverts
  effects: [
    {
      type: 'Erc20Approval',
      token: '0xa0b8...',
      owner: '0xd8da...',
      spender: '0x6e4c...',
      value: '0x2386f26fc10000'
    }
  ],
  logs: [...],            // raw event logs (EVM chains only)
  calls: [...]            // internal call trace
}

Effect types

| Type | Description | |------|-------------| | NativeTransfer | ETH/native token transfer | | Erc20Transfer | ERC-20 transfer | | Erc20Approval | ERC-20 approve | | Erc721Transfer | NFT transfer | | Erc1155TransferSingle | ERC-1155 single transfer | | Erc1155TransferBatch | ERC-1155 batch transfer | | ApprovalForAll | Operator grant (ERC-721/1155) | | Permit | EIP-2612 permit | | Permit2Approval | Uniswap Permit2 | | ContractCreated | New contract deployed | | SelfDestruct | Contract self-destructed |

Input fields

| Field | Type | Required | Description | |-------|------|----------|-------------| | from | address | yes | Sender | | to | address | no | Recipient (omit for contract creation) | | data | hex string | yes | Calldata | | value | hex uint256 | yes | Wei to send | | chain_id | number | yes | Chain ID | | block_number | number | no | Block to fork from (default: latest) | | gas_limit | number | no | Gas limit (default: 30M) |

How it works

  • EVM chains: forks state via eth_createAccessList, prefetches in parallel, executes in revm with an inspector
  • EraVM chains: parallel eth_call + debug_traceCall, decodes effects from calldata

Engine is auto-selected by chain ID.

Links

License

MIT