You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please suggest how to change this code according to new metamask security update.
Metamask Medium Post - New Changes
Now no accounts will be exposed by default and unable to show the account of testnet on UI.
import Web3 from "web3"; let web3; if (typeof window !== "undefined" && typeof window.web3 !== "undefined") { //We are in the browser and metamask is running. web3 = new Web3(window.web3.currentProvider); } else { //We are on ht browser OR the user is not running metamask const provider = new Web3.providers.HttpProvider( "https://rinkeby.infura.io/v3/<Infura_ID>" ); web3 = new Web3(provider); } export default web3;
The text was updated successfully, but these errors were encountered:
Please suggest how to change this code according to new metamask security update.
Metamask Medium Post - New Changes
Now no accounts will be exposed by default and unable to show the account of testnet on UI.
import Web3 from "web3"; let web3; if (typeof window !== "undefined" && typeof window.web3 !== "undefined") { //We are in the browser and metamask is running. web3 = new Web3(window.web3.currentProvider); } else { //We are on ht browser OR the user is not running metamask const provider = new Web3.providers.HttpProvider( "https://rinkeby.infura.io/v3/<Infura_ID>" ); web3 = new Web3(provider); } export default web3;
The text was updated successfully, but these errors were encountered: