# UserOperationGas.fromRpc

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

## Imports

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

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

## Examples

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

const userOperationGas = UserOperationGas.fromRpc({
  callGasLimit: '0x69420',
  preVerificationGas: '0x69420',
  verificationGasLimit: '0x69420'
})
```

## Definition

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

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

## Parameters

### rpc

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

The RPC user operation gas to convert.

## Return Type

An instantiated [`UserOperationGas.UserOperationGas`](/ercs/erc4337/UserOperationGas/types#useroperationgas).

`UserOperationGas<entryPointVersion>`
