> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# TxEnvelope.toRpc

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

Converts a [`TxEnvelope.TxEnvelope`](/docs/utilities/txenvelope/types#txenvelope) to an [`TxEnvelope.Rpc`](/docs/utilities/txenvelope/types#rpc).

## Imports

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

## Examples

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

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

## Definition

```ts
function toRpc<envelope>(
  envelope: envelope | toRpc.Input,
): toRpc.ReturnType<envelope>
```

## Parameters

### envelope

* **Type:** `envelope | toRpc.Input`

The transaction envelope.

## Return Type

RPC representation.

`toRpc.ReturnType<envelope>`
