# 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'
})
```

## 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#L952)

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

Signature to append to the Transaction Envelope.

## Return Type

Transaction Envelope.

`from.ReturnType<envelope>`
