Skip to main content
deleted 14 characters in body
Source Link

How would I be able to get smart contract data to load on a site when someone has metamask installed but is not logged in? At the moment the data loads if you don't have metamask installed. I'm using ethers.js:

constlet provider = window.ethereum ? new ethers.providers.Web3Provider(window.ethereum) : new ethers.providers.JsonRpcProvider("URL");

export let signer = window.ethereum ? provider.getSigner() : undefined;

export let contract = new ethers.Contract(
   contractAddress,
   ABI,
   signer ?? provider
);

How would I be able to get smart contract data to load on a site when someone has metamask installed but is not logged in? At the moment the data loads if you don't have metamask installed. I'm using ethers.js:

const provider = window.ethereum ? new ethers.providers.Web3Provider(window.ethereum) : new ethers.providers.JsonRpcProvider("URL");

export let signer = window.ethereum ? provider.getSigner() : undefined;

export let contract = new ethers.Contract(
   contractAddress,
   ABI,
   signer ?? provider
);

How would I be able to get smart contract data to load on a site when someone has metamask installed but is not logged in? At the moment the data loads if you don't have metamask installed. I'm using ethers.js:

let provider = window.ethereum ? new ethers.providers.Web3Provider(window.ethereum) : new ethers.providers.JsonRpcProvider("URL");

let signer = window.ethereum ? provider.getSigner() : undefined;

let contract = new ethers.Contract(
   contractAddress,
   ABI,
   signer ?? provider
);
Source Link

How to show smart contract data when user has a wallet installed but is not logged in?

How would I be able to get smart contract data to load on a site when someone has metamask installed but is not logged in? At the moment the data loads if you don't have metamask installed. I'm using ethers.js:

const provider = window.ethereum ? new ethers.providers.Web3Provider(window.ethereum) : new ethers.providers.JsonRpcProvider("URL");

export let signer = window.ethereum ? provider.getSigner() : undefined;

export let contract = new ethers.Contract(
   contractAddress,
   ABI,
   signer ?? provider
);