# UserOperation.fromRpc

Converts an [`UserOperation.Rpc`](/ercs/erc4337/UserOperation/types#rpc) to an [`UserOperation.UserOperation`](/ercs/erc4337/UserOperation/types#useroperation).

## Imports

:::code-group
```ts [Named]
import { UserOperation } from 'ox/erc4337'
```

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

## Examples

```ts twoslash
import { UserOperation } from 'ox/erc4337'

const userOperation = UserOperation.fromRpc({
  callData: '0xdeadbeef',
  callGasLimit: '0x69420',
  maxFeePerGas: '0x2ca6ae494',
  maxPriorityFeePerGas: '0x41cc3c0',
  nonce: '0x357',
  preVerificationGas: '0x69420',
  signature: '0x',
  sender: '0x1234567890123456789012345678901234567890',
  verificationGasLimit: '0x69420'
})
```

## Definition

```ts
function fromRpc<entryPointVersion>(
  rpc: Rpc<entryPointVersion>,
): UserOperation<entryPointVersion, true>
```

**Source:** [src/erc4337/UserOperation.ts](https://github.com/wevm/ox/blob/main/src/erc4337/UserOperation.ts#L1098)

## Parameters

### rpc

* **Type:** `Rpc<entryPointVersion>`

The RPC user operation to convert.

## Return Type

An instantiated [`UserOperation.UserOperation`](/ercs/erc4337/UserOperation/types#useroperation).

`UserOperation<entryPointVersion, true>`
