API ReferenceReact provider and hooksFunction
bindOnAccountChanged()
function bindOnAccountChanged(listener): OnAccountChangedHandle;Binds an event listener to the accountsChanged event of the injected browser wallet
(window.ethereum), if it exists.
This is a browser-only utility — it accesses window.ethereum directly. For non-browser
environments, use wagmi’s watchAccount or your framework’s account change detection.
Parameters
| Parameter | Type | Description |
|---|---|---|
listener | OnAccountChangedListener | The listener to bind to the event. |
Returns
A handle that, when called, unbinds the listener.