• Core
  • Actions
  • watchAccount

watchAccount

Action for subscribing to account changes.

import { watchAccount } from '@wagmi/core'

Usage

By default, the callback will be invoked when connected account changes.

import { watchAccount } from '@wagmi/core'
 
const unwatch = watchAccount((account) => console.log(account))

Return Value

unwatch is a function that can be called to unsubscribe from the account change event.