Extension Wallet
Integration
Cosmos Chains
Deprecated
Event

Event

Account change event

onAccountChanged

Code using @cosmostation/extension-client

provider.onAccountChanged(() => console.log("changed"));

Vanilla Code

window.addEventListener("cosmostation_keystorechange", () => {
    console.log("Key store in Cosmostation is changed. You may need to refetch the account info.")
})

offAccountChanged

Code using @cosmostation/extension-client

const event = provider.onAccountChanged(() => console.log("changed"));
provider.offAccountChanged(event);

Vanilla Code

window.removeEventListener("cosmostation_keystorechange", handler)