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

web3x-evm

v4.0.3

Published

EVM implementation and provider for web3x.

Downloads

35

Readme

web3x-evm

Version Downloads Downloads GitHub Stars GitHub Issues License: MIT

A TypeScript implementation of the EVM which can be used for simplifying development workflows.

Assuming you are building a browser based app the EvmProvider will execute contract code directly in the browser without any dependency on third party processes such as ganache. This can speed up prototyping of apps and their associated contract code. This is an early-stage feature, not all opcodes have been implmented so YMMV.

Missing opcodes

To be implemented soon.

  • EXTCODECOPY
  • BLOCKHASH
  • CREATE
  • CALLCODE
  • SELFDESTRUCT

Usage

An example of how you might use this to deploy a contract and fund an account follows. The code below will persist all state in a browsers IndexedDB. If you want to use an in-memory implementation you can use levelup(memdown()) as per the test case here.

import { EvmProvider } from 'web3x-evm-es/provider';
import { Eth } from 'web3x-es/eth';
import { toWei } from 'web3x-es/utils';
import { Wallet } from 'web3x-es/wallet';
import { DaiContract } from './contracts/DaiContract';

async function getComponents(fresh: boolean = false) {
  const daiContractAddrStr = window.localStorage.getItem('DaiContractAddress');
  const daiContractAddr = !fresh && daiContractAddrStr ? Address.fromString(daiContractAddrStr) : await bootstrap();

  // Load the wallet this provider was initialised with.
  const wallet = await Wallet.fromLocalStorage('', 'provider-wallet');

  // Blocks will be mined with a 1000ms delay.
  const provider = await EvmProvider.fromLocalDb('testdb', { blockDelay: 1000, wallet });
  const eth = new Eth(provider);
  const daiContract = new DaiContract(eth, daiContractAddr, { gasPrice: 50000 });

  return { provider, eth, daiContract, wallet };
}

async function bootstrap() {
  console.log('Erasing existing database.');
  await EvmProvider.eraseLocalDb('testdb');

  const provider = await EvmProvider.fromLocalDb('testdb');
  const eth = new Eth(provider);

  const wallet = new Wallet(10);
  await wallet.saveToLocalStorage('', 'provider-wallet');

  // Create all wallet accounts on the simulated chain. Will preload ETH into each account.
  await provider.loadWallet(wallet);

  const bootstrapAccount = wallet.get(0)!.address;
  eth.defaultFromAddress = bootstrapAccount;

  const daiContract = new DaiContract(eth, undefined, { gasPrice: 50000 });

  // Deploy the contract.
  await daiContract
    .deploy(utf8ToHex('xf00f token'))
    .send()
    .getReceipt();
  console.log(`Deployed DAI contract at ${daiContract.address!}`);

  // Mint some DAI into the bootstrap account.
  await daiContract.methods
    .mint(bootstrapAccount, toWei('1000', 'ether'))
    .send()
    .getReceipt();

  console.log(`Minted 1000 DAI into ${bootstrapAccount}`);

  window.localStorage.setItem('DaiContractAddress', daiContract.address!.toString());
  return daiContract.address!;
}

async function main() {
  const { provider, eth, daiContract, wallet } = getComponents();

  const from = wallet.get(0)!.address;
  const to = wallet.get(1)!.address;

  // Transfer funds to recipient address.
  await daiContract.methods
    .transfer(to, toWei('1000', 'ether'))
    .send({ from })
    .getReceipt();

  console.log(`Transferred 1000 DAI to ${to}`);
}

main().catch(console.error);

Packages