# UserOperationReceipt.fromRpc

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

## Imports

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

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

## Examples

```ts twoslash
// @noErrors
import { UserOperationReceipt } from 'ox/erc4337'

const userOperationReceipt = UserOperationReceipt.fromRpc({
  actualGasCost: '0x1',
  actualGasUsed: '0x2',
  entryPoint: '0x0000000071727de22e5e9d8baf0edac6f37da032',
  logs: [],
  nonce: '0x1',
  receipt: { ... },
  sender: '0xE911628bF8428C23f179a07b081325cAe376DE1f',
  success: true,
  userOpHash: '0x5ab163e9b2f30549274c7c567ca0696edf9ef1aa476d9784d22974468fdb24d8',
})
```

## Definition

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

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

## Parameters

### rpc

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

The RPC user operation receipt to convert.

#### rpc.blobGasPrice

* **Type:** `bigintType`
* **Optional**

The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844.

#### rpc.blobGasUsed

* **Type:** `bigintType`
* **Optional**

The amount of blob gas used. Only specified for blob transactions as defined by EIP-4844.

#### rpc.blockHash

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

Hash of block containing this transaction

#### rpc.blockNumber

* **Type:** `bigintType`

Number of block containing this transaction

#### rpc.contractAddress

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

Address of new contract or `null` if no contract was created

#### rpc.cumulativeGasUsed

* **Type:** `bigintType`

Gas used by this and all preceding transactions in this block

#### rpc.effectiveGasPrice

* **Type:** `bigintType`

Pre-London, it is equal to the transaction's gasPrice. Post-London, it is equal to the actual gas price paid for inclusion.

#### rpc.from

* **Type:** `abitype_Address`

Transaction sender

#### rpc.gasUsed

* **Type:** `bigintType`

Gas used by this transaction

#### rpc.logs

* **Type:** `{ address: abitype_Address; blockHash: 0x${string}; blockNumber: bigintType; blockTimestamp?: bigintType; data: 0x${string}; logIndex: numberType; topics: 0x${string}[]; transactionHash: 0x${string}; transactionIndex: numberType; removed: boolean; }[]`

List of log objects generated by this transaction

#### rpc.logsBloom

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

Logs bloom filter

#### rpc.root

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

The post-transaction state root. Only specified for transactions included before the Byzantium upgrade.

#### rpc.status

* **Type:** `status`

`success` if this transaction was successful or `reverted` if it failed

#### rpc.to

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

Transaction recipient or `null` if deploying a contract

#### rpc.transactionHash

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

Hash of this transaction

#### rpc.transactionIndex

* **Type:** `numberType`

Index of this transaction in the block

#### rpc.type

* **Type:** `type`

Transaction type

## Return Type

An instantiated [`UserOperationReceipt.UserOperationReceipt`](/ercs/erc4337/UserOperationReceipt/types#useroperationreceipt).

`UserOperationReceipt<entryPointVersion>`
