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

@0xdoublesharp/abi-typegen

v0.2.0

Published

Generate typed bindings from Solidity ABI artifacts — pre-built binary

Downloads

431

Readme

@0xdoublesharp/abi-typegen

Pre-built binary for abi-typegen. Reads compiled Solidity artifacts and generates production-ready typed bindings — no native toolchain required.

Install

npm install -D @0xdoublesharp/abi-typegen
yarn add -D @0xdoublesharp/abi-typegen
pnpm add -D @0xdoublesharp/abi-typegen

Usage

# Single target
npx abi-typegen generate --target viem

# Hardhat artifact layout
npx abi-typegen generate --hardhat --target ethers

# Multi-target (each gets its own output subdirectory)
npx abi-typegen generate --target viem,python,rust

Targets

| Target | Flag | Language | Ecosystem | |---|---|---|---| | viem | --target viem | TypeScript | viem | | zod | --target zod | TypeScript | Zod 4 | | wagmi | --target wagmi | TypeScript | wagmi v2 | | ethers v6 | --target ethers | TypeScript | ethers v6 | | ethers v5 | --target ethers5 | TypeScript | ethers v5 | | web3.js | --target web3js | TypeScript | web3.js v4 | | Python | --target python | Python | web3.py | | Go | --target go | Go | go-ethereum | | Rust | --target rust | Rust | alloy | | Swift | --target swift | Swift | web3swift | | C# | --target csharp | C# | Nethereum | | Kotlin | --target kotlin | Kotlin | web3j | | Solidity | --target solidity | Solidity | External interfaces | | YAML | --target yaml | YAML | Human-readable ABI descriptions |

Target aliases: ethers6 → ethers, web3 → web3js, cs → csharp, kt → kotlin, sol → solidity, yml → yaml

Commands

npx abi-typegen generate                 # write generated bindings
npx abi-typegen generate --check         # fail if output is stale (CI)
npx abi-typegen generate --clean         # remove stale generated files
npx abi-typegen diff                     # show what would change (dry run)
npx abi-typegen json --pretty            # dump parsed ABI as JSON
npx abi-typegen watch                    # watch artifacts and regenerate
npx abi-typegen fetch --name WETH \
  --network mainnet 0xc02aaa...          # fetch ABI from block explorer
npx abi-typegen fetch --name WETH \
  --file ./WETH.abi.json                 # import a local ABI file

CLI Options

| Option | Description | |---|---| | --target <name> | Target name or comma-separated names (see table above) | | --artifacts <path> | Path to compiled artifacts directory | | --out <path> | Output directory | | --hardhat | Use Hardhat artifact layout (artifacts/contracts/) | | --contracts <names> | Comma-separated contract allowlist | | --exclude <patterns> | Comma-separated glob patterns (e.g. *Test,*Mock) | | --no-wrappers | Disable wrapper function generation | | --check | Exit non-zero if output is stale | | --clean | Remove stale generated files |

Fetch Networks

The fetch command supports 80+ networks via --network. Some examples:

| Group | Networks | |---|---| | Ethereum | mainnet (default), sepolia, holesky, hoodi | | OP Stack | optimism, base, blast, fraxtal, worldchain, unichain | | Arbitrum | arbitrum, arbitrum-nova, arbitrum-sepolia | | Polygon | polygon, polygon-amoy, polygon-zkevm | | BNB Chain | bsc, opbnb | | Avalanche | avalanche, fuji | | L2s | linea, scroll, zksync, mantle, sonic, taiko, swellchain | | Alt L1s | gnosis, celo, moonbeam, moonriver, fantom, cronos, berachain, sei | | Newer chains | hyperevm, abstract, monad, megaeth, apechain, katana | | Other | manta, metis, xdc, bittorrent |

Pass --url <URL> for any Etherscan-compatible explorer not in the list.

Hardhat Plugin

For automatic generation on compile, use @0xdoublesharp/hardhat-abi-typegen.

Configuration

Multi-target generation can also be configured in foundry.toml:

[abi-typegen]
target = ["viem", "python", "rust"]   # also accepts "viem,python,rust"

Notes

  • When using --target zod, install the latest zod package in the consuming project
  • Multi-target runs write each target to its own subdirectory under the output path

See github.com/doublesharp/abi-typegen for full documentation.