Skip to content

parseAbi

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

Parses human-readable ABI into JSON Abi

Type Parameters

signatures extends readonly string[]

Human-Readable ABI

Parameters

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

Returns

ParseAbi<signatures>

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)',
])

Defined in

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