Skip to content

UserOperationReceipt.toRpc

Converts a UserOperationReceipt.UserOperationReceipt to a UserOperationReceipt.Rpc.

Imports

Named
import { UserOperationReceipt } from 'ox/erc4337'

Examples

import { UserOperationReceipt } from 'ox/erc4337'
 
const userOperationReceipt = UserOperationReceipt.toRpc({
  actualGasCost: 1n,
  actualGasUsed: 2n,
  entryPoint: '0x0000000071727de22e5e9d8baf0edac6f37da032',
  logs: [],
  nonce: 1n,
  receipt: { ... },
  sender: '0xE911628bF8428C23f179a07b081325cAe376DE1f',
  success: true,
  userOpHash: '0x5ab163e9b2f30549274c7c567ca0696edf9ef1aa476d9784d22974468fdb24d8',
})

Definition

function toRpc(
  userOperationReceipt: UserOperationReceipt.UserOperationReceipt,
): Rpc

Source: src/erc4337/UserOperationReceipt.ts

Parameters

userOperationReceipt

The user operation receipt to convert.

userOperationReceipt.actualGasCost

  • Type: bigIntType

Actual gas cost.

userOperationReceipt.actualGasUsed

  • Type: bigIntType

Actual gas used.

userOperationReceipt.entryPoint

  • Type: abitype_Address

Entrypoint address.

userOperationReceipt.logs

  • Type: { address: abitype_Address; blockHash: 0x${string}; blockNumber: bigIntType; data: 0x${string}; logIndex: intType; topics: [0x${string}, ...0x${string}[]]; transactionHash: 0x${string}; transactionIndex: intType; removed: boolean; }[]

Logs emitted during execution.

userOperationReceipt.nonce

  • Type: bigIntType

Anti-replay parameter.

userOperationReceipt.paymaster

  • Type: Address.Address | undefined
  • Optional

Paymaster for the user operation.

userOperationReceipt.reason

  • Type: string
  • Optional

Revert reason, if unsuccessful.

userOperationReceipt.receipt

  • Type: receipt

Transaction receipt of the user operation execution.

userOperationReceipt.sender

  • Type: abitype_Address

The account sending the user operation.

userOperationReceipt.success

  • Type: boolean

If the user operation execution was successful.

userOperationReceipt.userOpHash

  • Type: 0x${string}

Hash of the user operation.

Return Type

An RPC-formatted user operation receipt.

Rpc