Skip to content
LogoLogo

receivePolicy.watchClaimed

Watches for receipt claimed events (ReceiptClaimed) emitted by the ReceivePolicyGuard when blocked funds are reclaimed.

Usage

import { client } from './viem.config'
 
const unwatch = client.receivePolicy.watchClaimed({
  onClaimed: (args, log) => {
    console.log('Receipt claimed:', args)
  },
})
 
// Later, stop watching
unwatch()

Return Type

type ReturnType = () => void

Returns a function to unsubscribe from the event.

Parameters

onClaimed

  • Type: function
declare function onClaimed(args: Args, log: Log): void

Callback to invoke when a receipt is claimed.

fromBlock (optional)

  • Type: bigint

Block to start listening from.

onError (optional)

  • Type: function
declare function onError(error: Error): void

The callback to call when an error occurred when trying to get for a new block.

poll (optional)

  • Type: true

Whether to use polling.

pollingInterval (optional)

  • Type: number

Polling frequency (in ms). Defaults to Client's pollingInterval config.