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

# Abi.from

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

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

## Imports

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

## Examples

### JSON ABIs

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

const abi = Abi.from([
  {
    type: 'function',
    name: 'approve',
    stateMutability: 'nonpayable',
    inputs: [
      {
        name: 'spender',
        type: 'address'
      },
      {
        name: 'amount',
        type: 'uint256'
      }
    ],
    outputs: [{ type: 'bool' }]
  }
])

abi
//^?
```

### Human Readable ABIs

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

const abi = Abi.from([
  'function approve(address spender, uint256 amount) returns (bool)'
])

abi
//^?
```

## Definition

```ts
function from(
  abi: Abi | readonly string[],
): Abi
```

## Parameters

### abi

* **Type:** `Abi | readonly string[]`

The ABI to parse.

## Return Type

The typed ABI.

`Abi.Abi`
