# TransactionRequest.fromRpc

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

## Imports

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

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

## Examples

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

const request = TransactionRequest.fromRpc({
  to: '0x0000000000000000000000000000000000000000',
  value: '0x2386f26fc10000'
})
```

## Definition

```ts
function fromRpc(
  request: Rpc,
): TransactionRequest
```

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

## Parameters

### request

* **Type:** `Rpc`

The RPC request to convert.

#### request.data

* **Type:** `0x${string}`

Frame calldata.

#### request.executionGas

* **Type:** `0x${string}`

Execution gas budget.

#### request.flags

* **Type:** `0x${string}`

Approval scope and batching bits.

#### request.mode

* **Type:** `0x${string}`

Execution mode.

#### request.msg

* **Type:** `0x${string}`
* **Optional**

Explicit digest, or empty bytes for the transaction signing hash.

#### request.scheme

* **Type:** `"0x0" | "0x1" | "0x2"`

Signature verification scheme.

#### request.signature

* **Type:** `0x${string}`
* **Optional**

Encoded signature bytes.

#### request.signer

* **Type:** `Address.Address | null | undefined`
* **Optional**

Signer address; absent for the transaction sender.

#### request.stateGas

* **Type:** `0x${string}`

State gas budget.

#### request.target

* **Type:** `Address.Address | null | undefined`
* **Optional**

Target address; absent for the transaction sender.

#### request.value

* **Type:** `0x${string}`

Value transferred in wei.

## Return Type

A transaction request.

`TransactionRequest`
