Skip to content

ParseAbi

ParseAbi<TSignatures>: string[] extends TSignatures ? Abi : TSignatures extends readonly string[] ? TSignatures extends Signatures<TSignatures> ? ParseStructs<TSignatures> extends infer Structs ? { [K in keyof TSignatures]: TSignatures[K] extends string ? ParseSignature<TSignatures[K], Structs> : 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

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

Type parameters

TSignatures extends readonly string[]

Human-readable ABI

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:21