Skip to content
LogoLogo

accessKey.watchWitnessBurned

Watches for key-authorization witness burned events (KeyAuthorizationWitnessBurned), emitted when a witness is burned (see accessKey.burnWitness).

TIP-1053

Usage

import { client } from './viem.config'
 
const unwatch = client.accessKey.watchWitnessBurned({
  onBurned: (args, log) => {
    console.log('Witness burned:', args)
  },
})
 
// Later, stop watching
unwatch()

Return Type

type ReturnType = () => void

Returns a function to unsubscribe from the event.

Parameters

onBurned

  • Type: function
declare function onBurned(args: Args, log: Log): void
 
type Args = {
  /** The account that burned the witness. */
  account: Address
  /** The witness that was burned. */
  witness: Hex
}

Callback to invoke when a witness is burned.

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.