> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# AbiParameter.from

:::info
`AbiParameter.from` is a re-export of ox's [`AbiParameter.from`](https://oxlib.sh/api/AbiParameter/from). Refer to the ox documentation for the full reference.
:::

Parses an arbitrary **JSON ABI Parameter** or **Human Readable ABI Parameter** into a typed [`AbiParameter.AbiParameter`](/docs/utilities/abiparameter/types#abiparameter).

## Imports

```ts
import { AbiParameter } from 'viem/utils'
```

## Examples

### JSON Parameters

```ts twoslash
// @noErrors
import { AbiParameter } from 'viem/utils'

const parameter = AbiParameter.from({
  name: 'spender',
  type: 'address'
})

parameter
//^?
```

### Human Readable Parameters

```ts twoslash
// @noErrors
import { AbiParameter } from 'viem/utils'

const parameter = AbiParameter.from('address spender')

parameter
//^?
```

It is possible to specify `struct`s along with your definition:

```ts twoslash
// @noErrors
import { AbiParameter } from 'viem/utils'

const parameter = AbiParameter.from([
  'struct Foo { address spender; uint256 amount; }',
  'Foo foo'
])

parameter
//^?
```

## Definition

```ts
function from<parameter>(
  parameter: parameter | AbiParameter | string | readonly string[],
): from.ReturnType<parameter>
```

## Parameters

### parameter

* **Type:** `parameter | AbiParameter | string | readonly string[]`

The ABI Parameter to parse.

## Return Type

The typed ABI Parameter.

`from.ReturnType<parameter>`
