policy.watchBlacklistUpdated
Watches for blacklist update events on the TIP403 Registry.
Usage
import { } from './viem.config'
const = .policy.watchBlacklistUpdated({
: (, ) => {
.('Account:', .account)
.('Policy ID:', .policyId)
.('Restricted:', .restricted)
.('Updater:', .updater)
},
})
// Later, stop watching
()Return Type
type ReturnType = () => voidReturns a function to unsubscribe from the event.
Parameters
onBlacklistUpdated
- Type:
function
declare function onBlacklistUpdated(args: Args, log: Log): void
type Args = {
/** Address of the account */
account: Address
/** ID of the policy */
policyId: bigint
/** Whether the account is restricted */
restricted: boolean
/** Address that updated the blacklist */
updater: Address
}Callback to invoke when a blacklist 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 account address */
account?: Address | Address[] | null
}Optional filter arguments to narrow the events being watched.
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.