Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Strict TypeScript types for Ethereum ABIs

License

NotificationsYou must be signed in to change notification settings

simlecode/abitype

 
 

Repository files navigation


ABIType logo

Strict TypeScript types for Ethereum ABIs

VersionDownloads per monthMIT LicenseBest of JSCode coverage

Strict TypeScript types for Ethereum ABIs. ABIType provides utilities and type definitions for ABI properties and values, covering theContract ABI Specification, as well asEIP-712 Typed Data.

importtype{AbiParametersToPrimitiveTypes,ExtractAbiFunction,ExtractAbiFunctionNames}from'abitype'import{erc20Abi}from'abitype/abis'typeFunctionNames=ExtractAbiFunctionNames<typeoferc20Abi,'view'>//   ^? type FunctionNames = "symbol" | "name" | "allowance" | "balanceOf" | "decimals" | "totalSupply"typeTransferInputTypes=AbiParametersToPrimitiveTypes<// ^? type TransferInputTypes = readonly [`0x${string}`, bigint]ExtractAbiFunction<typeoferc20Abi,'transfer'>['inputs']>

Works great for adding blazing fastautocomplete 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 totypecheck 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, likeWagmi andViem.
  • You need toconvert ABI types (e.g.'string') to TypeScript types (e.g.string) or other type transformations.
  • You need to validate ABIs atruntime (e.g. after fetching from external resource).
  • You don’t want to set up a build process to generate types (e.g. TypeChain).

Documentation

For documentation and guides, visitabitype.dev.

Community

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

Discuss ABIType on GitHub

For casual chit-chat with others using the library:

Join the Wevm Discord

Sponsors

If you find ABIType useful or use it for work, please consider supporting development onGitHub Sponsors or sending crypto towevm.eth. Thank you 🙏

Contributing

Contributions to ABIType are greatly appreciated! If you're interested in contributing to ABIType, please read theContributing Guidebefore submitting a pull request.

About

Strict TypeScript types for Ethereum ABIs

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp