nonce.watchActiveKeyCountChanged
Watches for active key count changed events. This event is emitted when an account starts using a new nonce key for the first time.
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
onActiveKeyCountChanged
- Type:
function
ts
declare function onActiveKeyCountChanged(args: Args, log: Log): void
type Args = {
/** Address of the account */
account: Address
/** New count of active nonce keys */
newCount: bigint
}Callback to invoke when the active key count changes.
args (optional)
- Type:
object
ts
type Args = {
/** Address of the account to filter by */
account?: Address | Address[] | null
}Optional filters for the event.
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.