# Abi.from

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

## Imports

:::code-group
```ts [Named]
import { Abi } from 'ox'
```

```ts [Entrypoint]
import * as Abi from 'ox/Abi'
```
:::

## Examples

### JSON ABIs

```ts twoslash
import { Abi } from 'ox'

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
import { Abi } from 'ox'

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

abi
//^?
```

## Definition

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

**Source:** [src/core/Abi.ts](https://github.com/wevm/ox/blob/main/src/core/Abi.ts#L136)

## Parameters

### abi

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

The ABI to parse.

## Return Type

The typed ABI.

`Abi.Abi`
