OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Abitype

Abitype is a TypeScript library that provides strict static types and type inference for Ethereum ABIs.

Independent OpenViST project profile, based on linked sources.

Abitype — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Abitype when developing TypeScript software that works with Ethereum ABIs and you want strict static types or ABI-related type inference.

Who it is for

  • TypeScript developers working with Ethereum ABI definitions or ABI data.
  • Developers building applications that need typed representations of Ethereum ABIs.

Documented uses

  • Add strict TypeScript type checking for Ethereum ABI definitions.
  • Provide a type-inference layer for applications that consume Ethereum ABI data.
Before you choose

Requirements & limits

The public GitHub repository specifies an MIT license.

  • The project is a TypeScript library, so it is relevant to TypeScript development workflows.
  • Its stated scope is Ethereum ABI typing and inference, rather than a general Ethereum runtime or hosted service.
  • The repository identifies the project as MIT-licensed.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up ABIType in a TypeScript project

Prepare Ethereum ABI definitions for ABIType’s type utilities and inference.

Before you start

  • A TypeScript project
  • TypeScript version 5.0.4 or later

Steps

  1. Install ABIType in the TypeScript project.

  2. Keep ABI definitions as precise types by using a const assertion, such as as const or `, or use ABIType’s narrow` helper.

  3. Use exported ABIType types and utilities with the prepared ABI, or import a preconfigured ABI from abitype/abis.

Expected outcome

ABI definitions retain specific TypeScript types and can be used with ABIType’s exported type utilities.

Guide limitations

  • The guide does not specify an installation command.
  • Deeply nested ABI arrays and objects require a const assertion or the narrow helper to prevent type widening.
Source-based practical guide

Add ABI-based type inference to a readContract declaration

Type a read-only contract function declaration so its function names, arguments, and return values are derived from an ABI.

Before you start

  • A TypeScript project with ABIType available
  • An ABI represented with a const assertion

Steps

  1. Declare a readContract function whose config includes an ABI, function name, and arguments.

  2. Constrain generic ABI and function-name types using Abi and ExtractAbiFunctionNames for pure and view functions.

  3. Derive the argument type with ExtractAbiFunction and AbiParametersToPrimitiveTypes applied to the selected function’s inputs.

  4. Derive the return type using the selected function’s outputs and AbiParametersToPrimitiveTypes.

Expected outcome

TypeScript can infer permitted read function names, argument types, and return types from the ABI, including argument unions for overloaded functions.

Guide limitations

  • The walkthrough declares the function but does not implement contract calls or RPC behavior.
  • The example focuses on pure and view functions; write-function mutability is mentioned as a possible change, not implemented.
  • The documented example returns an array-shaped output type and notes that unwrapping or transforming outputs is left to the implementation.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
9 October 2026
Original website title
wevm/abitype · Official homepage title · retained in its source language