> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://viem-7qkv6fceu-wevm.vercel.app/api/mcp` to find what you need.

# TxEnvelope.from

:::info
`TxEnvelope.from` is a re-export of ox's [`TransactionEnvelope.from`](https://oxlib.sh/api/TransactionEnvelope/from). Refer to the ox documentation for the full reference.
:::

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

## Imports

```ts
import { TxEnvelope } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { TxEnvelope } from 'viem/utils'

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

### Frame Transaction

```ts twoslash
// @noErrors
import { Frame, TxEnvelope } from 'viem/utils'

const envelope = TxEnvelope.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>
```

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