Skip to content

getUserOperationReceipt

Waits for the User Operation to be included on a Block (one confirmation), and then returns the User Operation receipt.

Usage

example.ts
import { bundlerClient } from './client'
 
const receipt = await bundlerClient.waitForUserOperationReceipt({ 
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d'
})
{
blockHash: '0xaf1dadb8a98f1282e8f7b42cc3da8847bfa2cf4e227b8220403ae642e1173088',
blockNumber: 15132008n,
sender: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
...
status: 'success',
}

Returns

UserOperationReceipt

The User Operation receipt.

Parameters

hash

  • Type: '0x${string}'

A User Operation hash.

const receipt = await bundlerClient.waitForUserOperationReceipt({
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d'
})

pollingInterval (optional)

  • Type: number

Polling frequency (in ms).

const receipt = await bundlerClient.waitForUserOperationReceipt({
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
  pollingInterval: 1_000
})

retryCount (optional)

  • Type: number
  • Default: 6

The number of times to retry.

const receipt = await bundlerClient.waitForUserOperationReceipt({
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
  retryCount: 3
})

timeout (optional)

  • Type: number

Optional timeout (in ms) to wait before stopping polling.

const receipt = await bundlerClient.waitForUserOperationReceipt({
  hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
  timeout: 30_000
})