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

# TransactionRequest.toRpc

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

Converts a [`TransactionRequest.TransactionRequest`](/docs/utilities/transactionrequest/types#transactionrequest) to a [`TransactionRequest.Rpc`](/docs/utilities/transactionrequest/types#rpc).

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { TransactionRequest, Value } from 'viem/utils'

const request = TransactionRequest.toRpc({
  to: '0x0000000000000000000000000000000000000000',
  value: Value.fromEther('0.01')
})
```

### Using with a Provider

You can use [`Provider.from`](/docs/utilities/provider/from) to instantiate an EIP-1193 Provider and send a transaction to the Wallet using the `eth_sendTransaction` method.

```ts twoslash
// @noErrors
import 'ox/window'
import { Provider, TransactionRequest, Value } from 'viem/utils'

const provider = Provider.from(window.ethereum!)

const request = TransactionRequest.toRpc({
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: Value.fromEther('0.01')
})

const hash = await provider.request({
  // [!code focus]
  method: 'eth_sendTransaction', // [!code focus]
  params: [request] // [!code focus]
}) // [!code focus]
```

## Definition

```ts
function toRpc(
  request: toRpc.Input,
): Rpc
```

## Parameters

### request

* **Type:** `toRpc.Input`

The request to convert.

## Return Type

An RPC request.

`Rpc`
