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