Catalog npm
PACKAGE EXPLORERView in registry

@0xdoublesharp/abi-typegen

npm

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

abicodegenethereumethersfoundryhardhatsmart-contractssoliditytypegentypescriptviemwagmiweb3zod
Versions collected12
Direct dependencies0From release 0.8.0
Last observed20 Oct, 23:05 UTC

README

Current package documentation

abi-typegen

Fast typed bindings from Solidity ABI artifacts.

22 targets · 16 languages · Foundry & Hardhat

@0xdoublesharp/abi-typegen

Pre-built binary for abi-typegen. Reads compiled Solidity artifacts and generates typed bindings. Generating files requires no native toolchain; compiling the generated output requires the target language and its SDK.

Install

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

The installer downloads the platform archive over HTTPS and checks its SHA-256 against checksums.json bundled in the npm package before extracting it. Missing hashes, mismatches, and incomplete archives fail installation. Downloads retry transient HTTP errors, including 504, up to three times with exponential backoff. Connection, transfer, and overall download deadlines prevent indefinite waits.

Hashes are pinned during npm publication after checking every GitHub release archive. This detects corruption and later archive replacement; it trusts the release and npm publishing process and is not independent build attestation.

Re-running postinstall verifies a fresh archive before replacing the binary. Installations need curl and tar. Linux archives currently target glibc.

See the installation guide for supported platforms and download troubleshooting.

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

There are 28 CLI targets across 21 languages. Unity uses the csharp target with an adapter package.

JavaScript and TypeScript

TargetFramework or SDKWhat you get
viemviemTyped contract helpers and ABI
wagmiwagmiReact hooks for reads, writes, and events
ethersethers v6Typed contract interfaces and connection helpers
ethers5ethers v5Typed contract interfaces and connection helpers
web3jsweb3.js v4Typed contract methods
zodZod 4Validation schemas and ABI

Native languages

LanguageTargetRuntime or SDKWhat you get
CcShared Rust runtimeC11 codecs and client helpers with explicit ownership
C++cppShared Rust runtimeC++17 codecs and client helpers with automatic cleanup
C#csharpNethereumTyped DTOs, contract methods, and deployment
Dartdartweb3dartTyped values, codecs, calls, and transactions
ElixirelixirEthersTransaction data, reads, sends, events, and errors
F#fsharpNethereumRecords, ABI codecs, and contract helpers
Gogogo-ethereumTyped calls, transactions, deployment, and events
Javajavaweb3jTyped values, codecs, calls, and transactions
Kotlinkotlinweb3jTyped values, codecs, calls, and transactions
OCamlocamlZarith and shared Rust runtimeRecords, ABI codecs, and caller-supplied transport
PHPphpBrick Math, ethereum-tx, cURLCodecs, RPC reads, signed legacy transactions, receipts, and logs
Pythonpythonweb3.pyReads, transaction builders, codecs, events, and errors
qqkdb+ and shared Rust runtimeEvent table schemas, decoders, and log rows
RubyrubyethCalls, transaction builders, codecs, events, and errors
RustrustAlloysol! types, codecs, and contract instances
Swiftswiftweb3swiftTyped values, codecs, and contract operations

Game engines

EngineTargetWhat you get
Unitycsharp + Unity adapterC# bindings with Unity HTTP transport and object lifecycle support
GodotgodotGDScript bindings and a native extension for codecs and asynchronous RPC
Unreal EngineunrealC++ codecs and Blueprint nodes for asynchronous scalar reads

See engine packages for setup and native bindings for supported features and platforms.

Shell and ABI formats

TargetWorks withWhat you get
shellBash and Foundry castSourceable helpers for encoding, reads, sends, deployment, and logs
soliditySolidityInterfaces, tuple structs, events, and errors
yamlYAMLReadable ABI descriptions

Zod, Solidity, and YAML describe or validate contracts; they do not submit transactions. See native bindings for SDK versions and configuration for target aliases.

COBOL

TargetWorks withWhat you get
cobolGnuCOBOL and the shared Rust runtimeReads taking one address and returning one uint256 🤷

Target aliases: ethers6 → ethers, web3 → web3js, cs → csharp, kt → kotlin, sol → solidity, yml → yaml, c++ → cpp, fs/f# → fsharp, ml → ocaml, kdb/kdb+ → q

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 init                     # add Foundry configuration
npx abi-typegen forge-install --shell zsh # print Forge shell integration
npx abi-typegen help generate            # show command help
npx abi-typegen --version                # print the installed version
npx abi-typegen fetch --name WETH \
  --network mainnet 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2          # fetch ABI from block explorer
npx abi-typegen fetch --name WETH \
  --file ./WETH.abi.json                 # import a local ABI file

Generation options

OptionDescription
--config <path>Configuration file
--package <name>Package, namespace, or Unreal module name
--target <name>Target name or comma-separated names (see table above)
--artifacts <path>Path to compiled artifacts directory
--out <path>Output directory
--hardhatUse Hardhat artifact layout (artifacts/contracts/)
--contracts <names>Comma-separated contract allowlist
--exclude <patterns>Comma-separated glob patterns (e.g. *Test,*Mock)
--no-wrappersDisable wrapper function generation
--checkExit non-zero if output is stale
--cleanRemove stale generated files

Fetch Networks

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

GroupNetworks
Ethereummainnet (default), sepolia, holesky, hoodi
OP Stackoptimism, base, blast, fraxtal, worldchain, unichain
Arbitrumarbitrum, arbitrum-nova, arbitrum-sepolia
Polygonpolygon, polygon-amoy, polygon-zkevm
BNB Chainbsc, opbnb
Avalancheavalanche, fuji
L2slinea, scroll, zksync, mantle, sonic, taiko, swellchain
Alt L1sgnosis, celo, moonbeam, moonriver, fantom, cronos, berachain, sei
Newer chainshyperevm, abstract, monad, megaeth, apechain, katana
Othermanta, 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.

Native contract bindings

Go, Swift, Kotlin, C#, F#, Java, and Dart wrappers use their runtime SDKs for contract calls and transactions. PHP includes ABI codecs, JSON-RPC reads, legacy transaction signing, receipt and log queries, and event/error decoding. It requires PHP 8.2+ with cURL, GMP, mbstring, and iconv. It does not generate EIP-1559 or deployment helpers. C/C++ bindings link abi-typegen-runtime and accept a caller-supplied transport/signing adapter. OCaml uses Zarith integers and the shared runtime with application-supplied transport. q/kdb+ generates event schemas, decoders, and log rows; it does not include an RPC client. OCaml and q also require compiled bridges linked to the shared runtime. --no-wrappers preserves primary ABI metadata, value types, and q table schemas. See the native binding guide for dependencies, ownership rules, supported features, and SDK limits.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 12

Collected releases
VersionPublishedDirect dependenciesOpen version
0.8.0Registry latest1 Oct 20260
0.7.028 Sept 20260
0.6.025 Sept 20260
0.5.124 Sept 20260
0.5.024 Sept 20260
0.4.323 Sept 20260
0.4.223 Sept 20260
0.4.114 Sept 20260
0.3.210 Sept 20260
0.3.110 Sept 20260
0.2.04 Apr 20260
0.1.02 Apr 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
doublesharp/abi-typegen

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:01402f110941054168b1d2b30e521d67415f1805150ce5f5988d5f4a9943d057