Skip to content
LogoLogo

policy.watchAdminUpdated

Watches for policy admin update events on the TIP403 Registry.

Usage

import {  } from './viem.config'
 
const  = .policy.watchAdminUpdated({
  : (, ) => {
    .('Admin:', .admin)
    .('Policy ID:', .policyId)
    .('Updater:', .updater)
  },
})
 
// Later, stop watching
()

Return Type

type ReturnType = () => void

Returns a function to unsubscribe from the event.

Parameters

onAdminUpdated

  • Type: function
declare function onAdminUpdated(args: Args, log: Log): void
 
type Args = {
  /** ID of the policy */
  policyId: bigint
  /** Address that updated the admin */
  updater: Address
  /** Address of the admin */
  admin: Address
}

Callback to invoke when a policy admin is updated.

args (optional)

  • Type: object
type Args = {
  /** Filter by policy ID */
  policyId?: bigint | bigint[] | null
  /** Filter by updater address */
  updater?: Address | Address[] | null
  /** Filter by admin address */
  admin?: Address | Address[] | null
}

Optional filter arguments for the event.

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.