Skip to content
On this page

parseAbiParameters

Parses human-readable ABI parameters into AbiParameters. Re-exported from ABIType.

Import

ts
import { parseAbiParameters } from 'viem'

Usage

ts
import { parseAbiParameters } from 'viem'

const abiParameters = parseAbiParameters(
  //  ^? const abiParameters: [{ type: "address"; name: "from"; }, { type: "address";...
  'address from, address to, uint256 amount',
)

Returns

Abi

Parsed ABI parameters.

Parameters

params

  • Type: string | string[]

Human-Readable ABI parameters.

ts
import { parseAbiParameters } from 'viem'

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

Released under the MIT License.