hello, I'm doing an old tutorial, I saw that window.web3 is deprecated, does anyone know how can I update it to current pattern?

Dec 20, 2021, 1:59 PM
the old code:

const web3 = window.web3;
const networkId = await web3.eth.net.getId();
I solved that using this:

const web3 = window.ethereum;
const networkId = await web3.networkVersion;
Dec 20, 2021, 2:34 PM

© 2024 Draquery.com All rights reserved.