Type alias: ParseAbiItem<TSignature>
ParseAbiItem: <
TSignature
>TSignature
extendsstring
?string
extendsTSignature
?Abi
[number
] :TSignature
extendsSignature
<TSignature
> ?ParseSignature
<TSignature
> :never
:never
|TSignature
extends readonlystring
[] ?string
[] extendsTSignature
?Abi
[number
] :TSignature
extendsSignatures
<TSignature
> ?ParseStructs
<TSignature
> extends infer Structs ?{ [K in keyof TSignature]: ParseSignature<TSignature[K] extends string ? TSignature[K] : never, Structs> }
extends infer Mapped ?Filter
<Mapped
,never
>[0
] extends infer Result ?Result
extendsundefined
?never
:Result
:never
:never
:never
:never
:never
Parses human-readable ABI item (e.g. error, event, function) into Abi item
Example
type Result = ParseAbiItem<'function balanceOf(address owner) view returns (uint256)'>
// ^? type Result = { name: "balanceOf"; type: "function"; stateMutability: "view";...
Example
type Result = ParseAbiItem<
// ^? type Result = { name: "foo"; type: "function"; stateMutability: "view"; inputs:...
['function foo(Baz bar) view returns (string)', 'struct Baz { string name; }']
>
Type parameters
Parameter | Description |
---|---|
TSignature extends string | readonly string [] | readonly unknown [] | Human-readable ABI item |
Defined In
node_modules/.pnpm/abitype@0.7.1_typescript@4.9.5/node_modules/abitype/dist/index.d.ts:544
Generated using TypeDoc and typedoc-plugin-markdown