Skip to content

parseAbi

parseAbi<TSignatures>(signatures): ParseAbi<TSignatures>

Parses human-readable ABI into JSON Abi

Type parameters

TSignatures extends readonly string[]

Parameters

signatures: TSignatures["length"] extends 0 ? ["Error: At least one signature required"] : Signatures<TSignatures> extends TSignatures ? TSignatures : Signatures<TSignatures>

Human-Readable ABI

Returns

ParseAbi<TSignatures>

Parsed Abi

Example

const abi = parseAbi([
// ^? const abi: readonly [{ name: "balanceOf"; type: "function"; stateMutability:...
'function balanceOf(address owner) view returns (uint256)',
'event Transfer(address indexed from, address indexed to, uint256 amount)',
])

Source

node_modules/.pnpm/abitype@1.0.2_typescript@5.4.5_zod@3.23.8/node_modules/abitype/dist/types/human-readable/parseAbi.d.ts:37