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

# AbiConstructor.from

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

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

## Imports

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

## Examples

### JSON ABIs

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

const constructor = AbiConstructor.from({
  inputs: [{ name: 'owner', type: 'address' }],
  payable: false,
  stateMutability: 'nonpayable',
  type: 'constructor'
})

constructor
//^?
```

### Human Readable ABIs

A Human Readable ABI can be parsed into a typed ABI object:

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

const constructor = AbiConstructor.from(
  'constructor(address owner)' // [!code hl]
)

constructor
//^?
```

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

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

const constructor = AbiConstructor.from([
  'struct Foo { address owner; uint256 amount; }', // [!code hl]
  'constructor(Foo foo)'
])

constructor
//^?
```

## Definition

```ts
function from(
  abiConstructor: AbiConstructor | string | readonly string[],
): AbiConstructor
```

## Parameters

### abiConstructor

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

The ABI Constructor to parse.

## Return Type

Typed ABI Constructor.

`AbiConstructor`
