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.