# TransactionEnvelope.from

Converts an arbitrary transaction object or serialized transaction into a Transaction Envelope.

## Imports

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

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

## Examples

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

const envelope = TransactionEnvelope.from({
  chainId: 1,
  maxFeePerGas: 1n,
  type: 'eip1559'
})
```

### Frame Transaction

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

const envelope = TransactionEnvelope.from({
  chainId: 1,
  frames: [
    Frame.from({ executionGas: 50_000n, mode: 'sender' })
  ],
  sender: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
})
```

## Definition

```ts
function from<envelope, signature>(
  envelope: envelope | Typeable | Hex.Hex,
  options?: from.Options<signature>,
): from.ReturnType<envelope>
```

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

## Parameters

### envelope

* **Type:** `envelope | Typeable | Hex.Hex`

The transaction envelope.

### options

* **Type:** `from.Options<signature>`
* **Optional**

Options.

#### options.signature

* **Type:** `{ r: 0x${string}; s: 0x${string}; yParity: number; } | signature`
* **Optional**

Outer signature to append. EIP-8141 uses the envelope’s `signatures` list.

## Return Type

Transaction Envelope.

`from.ReturnType<envelope>`
