- Category
- Developer Tools
- Rank
- No. 391Tools index
Previous survey · No. 386 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- wevm
- GitHub
- 547 stars
- Latest release
- abitype@1.3.0
- Date
About
Strict TypeScript types for Ethereum ABIs. Inference-friendly types used across the Wagmi/Viem ecosystem.
What it does
ABIType turns contract descriptions and EIP-712 typed data into useful TypeScript information. It can identify contract members, map Solidity parameters into JavaScript primitives, and drive autocomplete directly from an ABI, without a separate type-generation build step.
Why it's ranked here
The strongest case is its focused compile-time model. It covers functions, events, errors, constructors, tuples, arrays, mutability, and typed data, while allowing projects to customize address, integer, byte, and array behavior. Runtime validation exists through a separate Zod surface, but broader runtime ABI handling is explicitly left elsewhere.
What's good
The types preserve meaningful ABI detail instead of collapsing everything into broad strings and arrays. Fixed arrays become tuples, named tuple components become objects, and integer widths map to configurable number or bigint types. Dedicated compile-time and runtime tests cover valid inputs, rejected inputs, legacy fields, and real contract descriptions.
Tradeoffs
Its main value depends on TypeScript retaining a narrow, literal ABI shape. Broadly typed input cannot produce the same precise inference. Several safety and performance controls default to permissive settings, including strict ABI checking and named tuples. Human-readable ABI parsing and formatting are not its intended runtime scope.
How to use it well
Use it in TypeScript contract libraries or applications that already keep ABIs as data and want editor feedback without generated files. Configure its type register when your address, byte, integer, or array conventions differ. Pair it with another library when you need human-readable parsing, formatting, or broader runtime contract operations.
Technical notes+
packages/abitype/src/abi.ts models Solidity ABI items, arrays, tuples, and EIP-712 data through template literal and conditional types. packages/abitype/src/utils.ts maps ABI parameters to primitives, creates tuples for fixed arrays, and returns objects for fully named tuple components. packages/abitype/src/register.ts exposes declaration-merging configuration for primitive mappings, array limits, strict checking, and experimental named tuples. packages/abitype/src/zod.ts supplies Zod validators and normalizes deprecated mutability fields. packages/abitype/src/zod.test.ts, packages/abitype/src/abi.test-d.ts, and packages/abitype/src/zod.test-d.ts exercise runtime validation and compile-time assignability. The root package.json describes a private pnpm workspace with Vitest, coverage, build, benchmark, type-performance, and type-check scripts.
Observed
- License
- MIT
- Primary language
- TypeScript
- Packaging
- Published through npm as abitype; repository development uses a private pnpm workspace.
- Import surfaces
- Examples import types from abitype and bundled contract descriptions from abitype/abis.
- Interface
- TypeScript library with compile-time types and a Zod-based runtime validation surface.
- Specification coverage
- Models the Solidity contract ABI specification and EIP-712 typed data.
- Testing structure
- Repository text includes Vitest runtime tests and TypeScript declaration tests.
Read from README.md, package.json, packages/abitype/src/abi.ts, packages/abitype/src/zod.ts, packages/abitype/src/regex.ts, packages/abitype/src/types.ts, packages/abitype/src/utils.ts, packages/abitype/src/errors.ts, packages/abitype/src/narrow.ts, packages/abitype/src/version.ts, packages/abitype/src/register.ts, packages/abitype/src/zod.test.ts, packages/abitype/src/generated.ts, packages/abitype/src/abi.test-d.ts, packages/abitype/src/zod.test-d.ts.
What it can do
Generate TypeScript types from Ethereum ABI
Ethereum ABI (Application Binary Interface) → Strict TypeScript type definitions
Infer function parameter types
ABI function definitions → TypeScript parameter type annotations
Infer function return types
ABI function definitions → TypeScript return type annotations
Generate event type definitions
ABI event definitions → TypeScript event type interfaces
Provide type safety for contract interactions
Contract ABI and function calls → Type-safe contract method signatures
Enable TypeScript IntelliSense for smart contracts
Smart contract ABI → IDE autocompletion and type hints
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
