Skip to content

ParseAbi

ParseAbi<signatures>: string[] extends signatures ? Abi : signatures extends readonly string[] ? signatures extends Signatures<signatures> ? ParseStructs<signatures> extends infer sructs ? { [key in keyof signatures]: signatures[key] extends string ? ParseSignature<signatures[key], sructs> : never } extends infer mapped ? Filter<mapped, never> extends infer result ? result extends readonly [] ? never : result : never : never : never : never : never

Parses human-readable ABI into JSON Abi

Type Parameters

signatures extends readonly string[]

Human-readable ABI

Example

type Result = ParseAbi<
// ^? type Result = 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.6.2_zod@3.23.8/node_modules/abitype/dist/types/human-readable/parseAbi.d.ts:21