receivePolicy.watchBurned
Watches for receipt burned events (ReceiptBurned) emitted by the ReceivePolicyGuard when blocked funds are burned.
Usage
import { client } from './viem.config'
const unwatch = client.receivePolicy.watchBurned({
onBurned: (args, log) => {
console.log('Receipt burned:', args)
},
})
// Later, stop watching
unwatch()import { Account, createClient } from 'viem/tempo'
export const client = createClient({
account: Account.fromSecp256k1('0x...'),
})Return Type
type ReturnType = () => voidReturns a function to unsubscribe from the event.
Parameters
onBurned
- Type:
function
declare function onBurned(args: Args, log: Log): voidCallback to invoke when a receipt is burned.
fromBlock (optional)
- Type:
bigint
Block to start listening from.
onError (optional)
- Type:
function
declare function onError(error: Error): voidThe 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.