Deprecating Legacy Provider Properties, networkChanged
event, and send()
net_version
support
#23
Replies: 9 comments 4 replies
-
Before getting rid of these properties it should be make sure that |
Beta Was this translation helpful? Give feedback.
-
Adding some recommended alternatives for each property we intend to remove:
|
Beta Was this translation helpful? Give feedback.
-
After one page updated and added new wallets top their page , now my hot wallet refuses to launch on it or when it does - it shows the issue, so i check the dev tools to find the exact issue |
Beta Was this translation helpful? Give feedback.
-
With the recommended “window.ethereum.request({ method: ‘net_version’ })”, “await ethereum.request({ method: ‘eth_chainId’ });”, “await web3.eth.getChainId();”, and “await web3.eth.net.getId();”, if I change the network after connecting MetaMask to a DApp, only the network ID at the time of connection is returned, not the changed network ID. As far as I know, if you change the network after connecting MetaMask to DApps, only “window.ethereum.networkVersion” can get the changed network ID, so I really hope it won’t be deleted. With “window.ethereum.on(‘chainChanged’, async (chainId) =>”, I can obtain the changed network ID even if I change the network after connecting MetaMask to a DApp, but this is inconvenient, so “window.ethereum.networkVersion”, which allows me to actively obtain the changed network ID, is more convenient. If I change the network after connecting MetaMask to a DApp, is there any other way to obtain the new network ID? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Still MetaMask: 'ethereum.selectedAddress' is deprecated and may be removed in the future. Please use the 'eth_accounts' RPC method instead. |
Beta Was this translation helpful? Give feedback.
-
How do I get rid of this metamask errors from the console ?? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Please see the updated announcement. Sorry for any inconvenience the original announcement may have caused. |
Beta Was this translation helpful? Give feedback.
-
Currently the following properties are accessible on the MetaMask provider object:*window.ethereum.chainId
*window.ethereum.networkVersion
*window.ethereum.selectedAddress
They allow for synchronous access to the last known value of these chain/network attributes. They are not part of the EIP-1193 spec and are not officially listed in our provider API documentation . Despite not being intended for public usage, these properties have been publicly available for some time and we can assume that there are some Dapps out there that now rely on these values being available on the MetaMask provider object. Given this, we should make a best effort to inform developers that usage of these properties is not supported, that these properties will be removed in the future, and what equivalents can be used instead.Related to the above fields, we also plan on removing the following which have already been properly deprecated:*networkChanged
event*net_version
support inwindow.ethereum.send()
The above announcement can be ignored. As of September 6th 2024, we plan on continuing to support:
window.ethereum.chainId
window.ethereum.networkVersion
window.ethereum.selectedAddress
networkChanged
eventnet_version
support inwindow.ethereum.send()
In a few releases, you should stop seeing console warnings when accessing
window.ethereum.chainId
,window.ethereum.networkVersion
, andwindow.ethereum.selectedAddress
.We still recommend the migrations specified in the comment below.
Beta Was this translation helpful? Give feedback.
All reactions