parseAbiParameters
Parses human-readable ABI parameters into AbiParameter
s. Re-exported from ABIType.
Import
ts
import { parseAbiParameters } from 'viem'
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',
)
import { parseAbiParameters } from 'viem'
const abiParameters = parseAbiParameters(
// ^? const abiParameters: [{ type: "address"; name: "from"; }, { type: "address";...
'address from, address to, uint256 amount',
)
Returns
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; }',
])
import { parseAbiParameters } from 'viem'
const abiParameters = parseAbiParameters([
// ^? const abiParameters: [{ type: "tuple"; components: [{ type: "string"; name:...
'Baz bar',
'struct Baz { string name; }',
])