Skip to content
On this page

parseAbiParameter

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

Import

ts
import { parseAbiParameter } from 'viem'

Usage

ts
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.

ts
import { parseAbiParameter } from 'viem'

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

Released under the MIT License.