# Frame.from

Coerces a frame object into a [`Frame.Frame`](/api/Frame/types#frame).

Validates the frame and returns a copy, preserving literal types and the supplied numeric or named mode and flags. Omitted fields stay omitted; [`Frame.toTuple`](/api/Frame/toTuple) supplies their defaults when encoding.

## Imports

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

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

## Examples

### Basic Usage

Construct a verification frame that approves execution and payment.

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

const frame = Frame.from({
  flags: 'approveExecutionAndPayment',
  gas: 50_000n,
  mode: 'verify'
})
```

## Definition

```ts
function from<frame>(
  frame: frame | Frame,
): frame
```

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

## Parameters

### frame

* **Type:** `frame | Frame`

The frame object to convert.

## Return Type

The validated frame.

`frame`
