Skip to content
On this page

Type alias: ParseAbiItem<TSignature>

ParseAbiItem: <TSignature> TSignature extends string ? string extends TSignature ? Abi[number] : TSignature extends Signature< TSignature > ? ParseSignature< TSignature > : never : never | TSignature extends readonly string[] ? string[] extends TSignature ? Abi[number] : TSignature extends Signatures< 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 extends undefined ? never : Result : never : never : never : never : never

Parses human-readable ABI item (e.g. error, event, function) into Abi item

Example

ts
type Result = ParseAbiItem<'function balanceOf(address owner) view returns (uint256)'>
//   ^? type Result = { name: "balanceOf"; type: "function"; stateMutability: "view";...

Example

ts
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

ParameterDescription
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