Metamask-extension: The event "chainChanged" does not work

Created on 23 Mar 2020  路  2Comments  路  Source: MetaMask/metamask-extension

Describe the bug
The event "chainChanged" does not work.
But the event "networkChanged" and "accountsChanged" works fine.

To Reproduce

  1. Open Chrome Console, paste this code and press Enter:
ethereum.on('chainChanged', chainId => console.log('chainChanged', chainId));
ethereum.on('networkChanged', network => console.log('networkChanged', network));
  1. Open metamask extension (logged in and enabled for the site), and change the Network.
  2. The event "chainChanged" does not fire, but the event "networkChanged" fires as expected.

Expected behavior
When I change the network, I expect to receive an "chainChanged" event.

Browser details

  • OS: MacOS Catalina 10.15.3 (19D76)
  • Browser: Chrome Version 80.0.3987.149
  • MetaMask Version: 7.7.8
T00-bug

All 2 comments

@OsoianMarcel due to a bug in the MetaMask inpage provider, it emits chainIdChanged instead of chainChanged. In our next release - step 1. in #8077 - it will emit chainChanged. Please follow #8077 for details.

Subscribed, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

beether picture beether  路  4Comments

kumavis picture kumavis  路  3Comments

danfinlay picture danfinlay  路  3Comments

glitch003 picture glitch003  路  3Comments

aecc picture aecc  路  3Comments