> **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.

# AbiParameters.from

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

Parses arbitrary **JSON ABI Parameters** or **Human Readable ABI Parameters** into typed [`AbiParameters.AbiParameters`](/docs/utilities/abiparameters/types#abiparameters).

## Imports

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

## Examples

### JSON Parameters

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

const parameters = AbiParameters.from([
  {
    name: 'spender',
    type: 'address'
  },
  {
    name: 'amount',
    type: 'uint256'
  }
])

parameters
//^?
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
```

### Human Readable Parameters

Human Readable ABI Parameters can be parsed into a typed [`AbiParameters.AbiParameters`](/docs/utilities/abiparameters/types#abiparameters):

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

const parameters = AbiParameters.from(
  'address spender, uint256 amount'
)

parameters
//^?
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
```

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

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

const parameters = AbiParameters.from([
  'struct Foo { address spender; uint256 amount; }', // [!code hl]
  'Foo foo, address bar'
])

parameters
//^?
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
```

## Definition

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

## Parameters

### parameters

* **Type:** `parameters | AbiParameters | string | readonly string[]`

The ABI Parameters to parse.

## Return Type

The typed ABI Parameters.

`from.ReturnType<parameters>`
