# Frame.toTuple

Converts a [`Frame.Frame`](/api/Frame/types#frame) to its RLP-ready [`Frame.Tuple`](/api/Frame/types#tuple).

Named mode and flags are encoded as integers. An omitted target and zero integer fields are encoded as empty bytes. Omitted mode and flags default to zero; omitted gas limits and value default to `0n`, and data defaults to `'0x'`.

## Imports

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

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

## Examples

### Basic Usage

Encode a verification frame in the field order required by EIP-8141.

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

const tuple = Frame.toTuple({
  flags: 'approveExecutionAndPayment',
  gas: 50_000n,
  mode: 'verify'
})
// @log: ['0x01', '0x03', '0x', ['0xc350', '0x'], '0x', '0x']
```

## Definition

```ts
function toTuple(
  frame: Frame,
): Tuple
```

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

## Parameters

### frame

* **Type:** `Frame`

The frame to convert.

#### frame.data

* **Type:** `0x${string}`
* **Optional**

Frame calldata.

#### frame.flags

* **Type:** `Flags`
* **Optional**

Approval scope and atomic batching bits.

#### frame.gas

* **Type:** `bigintType`
* **Optional**

Execution gas budget.

#### frame.mode

* **Type:** `Mode`
* **Optional**

Execution context: default, verify, or sender.

#### frame.stateGas

* **Type:** `bigintType`
* **Optional**

State gas budget.

#### frame.target

* **Type:** `Address.Address | undefined`
* **Optional**

Target address. Omit to target the transaction sender.

#### frame.value

* **Type:** `bigintType`
* **Optional**

Value transferred by a sender frame, in wei.

## Return Type

The encoded frame tuple.

`Tuple`
