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

iwooden picture iwooden  路  66Comments

prusnak picture prusnak  路  72Comments

danfinlay picture danfinlay  路  98Comments

ERC1975 picture ERC1975  路  75Comments

giver75 picture giver75  路  99Comments