Skip to content

parseAbiParameter

Parses human-readable ABI parameter into AbiParameter. Re-exported from ABIType.

Import

import { parseAbiParameter } from 'viem'

Usage

import { parseAbiParameter } from 'viem'
 
const abiParameter = parseAbiParameter('address from')
//    ^? const abiParameter: { type: "address"; name: "from"; }

Returns

Abi

Parsed ABI parameter.

Parameters

signature

  • Type: string | string[]

Human-Readable ABI parameter.

import { parseAbiParameter } from 'viem'
 
const abiParameter = parseAbiParameter([
  //  ^? const abiParameter: { type: "tuple"; components: [{ type: "string"; name:...
  'Baz bar',
  'struct Baz { string name; }',
])