# abitype

> Strict TypeScript types for Ethereum ABIs

Latest version **1.3.0** (published 2026-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install abitype
pnpm add abitype
yarn add abitype
bun add abitype
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2026-07-16 |
| First published | 2022-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 548 |
| Maintainers | awkweb, jmoxey |
| Keywords | abi, eth, ethereum, types, typescript, viem, wagmi, web3, wevm |

## Links

- npm: https://www.npmjs.com/package/abitype
- Repository: https://github.com/wevm/abitype
- Homepage: https://github.com/wevm/abitype#readme
- Issues: https://github.com/wevm/abitype/issues
- Funding: https://github.com/sponsors/wevm
- npm.io page: https://npm.io/package/abitype

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2026-07-16
- 1.2.4 — 2026-04-20
- 1.2.3 — 2025-12-15
- 1.2.2 — 2025-12-09
- 1.2.1 — 2025-12-03
- 1.2.0 — 2025-11-21
- 1.1.2 — 2025-11-18
- 1.1.1 — 2025-09-18
- 1.1.0 — 2025-09-02
- 1.0.9 — 2025-08-19
- 1.0.8 — 2024-12-21
- 1.0.7 — 2024-12-03
- 1.0.6 — 2024-08-06
- 0.0.0-canary-20240806154016 — 2024-08-06
- 1.0.5 — 2024-06-28
- … 177 more at https://npm.io/package/abitype/versions

## README

<br/>

<p align="center">
  <a href="https://abitype.dev">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/abitype/main/.github/logo-dark.svg">
      <img alt="ABIType logo" src="https://raw.githubusercontent.com/wevm/abitype/main/.github/logo-light.svg" width="auto" height="45">
    </picture>
  </a>
</p>

<p align="center">
  Strict TypeScript types for Ethereum ABIs
<p>

<div align="center">
  <a href="https://www.npmjs.com/package/abitype">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/abitype?colorA=21262d&colorB=21262d&style=flat">
      <img src="https://img.shields.io/npm/v/abitype?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Version">
    </picture>
  </a>
  <a href="https://www.npmjs.com/package/abitype">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/abitype?colorA=21262d&colorB=21262d&style=flat">
      <img src="https://img.shields.io/npm/dm/abitype?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="Downloads per month">
    </picture>
  </a>
  <a href="https://github.com/wevm/abitype/blob/main/LICENSE">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/abitype?colorA=21262d&colorB=21262d&style=flat">
      <img src="https://img.shields.io/npm/l/abitype?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="MIT License">
    </picture>
  </a>
  <a href="https://bestofjs.org/projects/abitype">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/endpoint?colorA=21262d&colorB=21262d&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wevm%2Fabitype%26since=daily">
      <img src="https://img.shields.io/endpoint?colorA=f6f8fa&colorB=f6f8fa&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wevm%2Fabitype%26since=daily" alt="Best of JS">
    </picture>
  </a>
  <a href="https://app.codecov.io/gh/wevm/abitype">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/codecov/c/github/wevm/abitype?colorA=21262d&colorB=21262d">
      <img src="https://img.shields.io/codecov/c/github/wevm/abitype?colorA=f6f8fa&colorB=f6f8fa" alt="Code coverage">
    </picture>
  </a>
</div>

---

Strict TypeScript types for Ethereum ABIs. ABIType provides utilities and type definitions for ABI properties and values, covering the [Contract ABI Specification](https://docs.soliditylang.org/en/latest/abi-spec.html), as well as [EIP-712](https://eips.ethereum.org/EIPS/eip-712) Typed Data.

```ts
import type {
  AbiParametersToPrimitiveTypes,
  ExtractAbiFunction,
  ExtractAbiFunctionNames,
} from 'abitype'
import { erc20Abi } from 'abitype/abis'

type FunctionNames = ExtractAbiFunctionNames<typeof erc20Abi, 'view'>
//   ^? type FunctionNames = "symbol" | "name" | "allowance" | "balanceOf" | "decimals" | "totalSupply"

type TransferInputTypes = AbiParametersToPrimitiveTypes<
  // ^? type TransferInputTypes = readonly [`0x${string}`, bigint]
  ExtractAbiFunction<typeof erc20Abi, 'transfer'>['inputs']
>
```

Works great for adding blazing fast [autocomplete](https://twitter.com/awkweb/status/1555678944770367493) and type checking to functions, variables, or your own types. No need to generate types with third-party tools – just use your ABI and let TypeScript do the rest!

## TL;DR

ABIType might be a good option for your project if:

- You want to [typecheck](https://abitype.dev/api/types) your ABIs or EIP-712 Typed Data.
- You want to add type inference and autocomplete to your library based on user-provided ABIs or EIP-712 Typed Data, like [Wagmi](https://wagmi.sh) and [Viem](https://viem.sh).
- You need to [convert ABI types](https://abitype.dev/api/utilities#abiparameterstoprimitivetypes) (e.g. `'string'`) to TypeScript types (e.g. `string`) or other type transformations.
- You don’t want to set up a build process to generate types (e.g. TypeChain).

> [!NOTE]
> If you need runtime capabilities like Zod schemas or human-readable ABI parsing and formatting, check out [Ox](https://oxlib.sh).

## Documentation

For documentation and guides, visit [abitype.dev](https://abitype.dev).

## Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Discuss ABIType on GitHub](https://github.com/wevm/abitype/discussions)

For casual chit-chat with others using the library:

[Join the Wevm Discord](https://discord.gg/SghfWBKexF)

## Sponsors

If you find ABIType useful or use it for work, please consider supporting development on [GitHub Sponsors](https://github.com/sponsors/wevm?metadata_campaign=abitype_readme) or sending crypto to `wevm.eth`. Thank you 🙏

## Contributing

Contributions to ABIType are greatly appreciated! If you're interested in contributing to ABIType, please read the [Contributing Guide](https://github.com/wevm/abitype/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**.

<br />
<br />

<a href="https://vercel.com/?utm_source=wevm&utm_campaign=oss">
  <img src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg" alt="Powered by Vercel" height="35">
</a>

---
_Source: https://npm.io/package/abitype · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
