policy.watchWhitelistUpdated
Watches for whitelist update events on the TIP403 Registry.
Usage
ts
import { } from 'wagmi/tempo'
import { } from './config'
const = ..(, {
(, ) {
.('args:', )
},
})
// Later, stop watching
()ts
import { createConfig, http } from 'wagmi'
import { tempoTestnet } from 'wagmi/chains'
import { KeyManager, webAuthn } from 'wagmi/tempo'
export const config = createConfig({
connectors: [
webAuthn({
keyManager: KeyManager.localStorage(),
}),
],
chains: [tempoTestnet],
multiInjectedProviderDiscovery: false,
transports: {
[tempoTestnet.id]: http(),
},
})Return Type
() => void
Returns a function to unsubscribe from the event.
Parameters
onWhitelistUpdated
- Type:
function
ts
declare function onWhitelistUpdated(args: Args, log: Log): void
type Args = {
/** Address of the account */
account: Address
/** Whether the account is allowed */
allowed: boolean
/** ID of the policy */
policyId: bigint
/** Address that updated the whitelist */
updater: Address
}Callback to invoke when a whitelist is updated.
args (optional)
- Type:
object
ts
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 for the watch.
fromBlock (optional)
- Type:
bigint
Block to start listening from.
onError (optional)
- Type:
function
ts
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
Enable polling mode.
pollingInterval (optional)
- Type:
number
Polling frequency (in ms). Defaults to Client's pollingInterval config.