# AbiConstructor.from

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

## Imports

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

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

## Examples

### JSON ABIs

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

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

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

constructor
//^?
```

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

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

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
```

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

## Parameters

### abiConstructor

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

The ABI Constructor to parse.

## Return Type

Typed ABI Constructor.

`AbiConstructor`
