alpha deployment

This commit is contained in:
Tim Olson
2023-11-16 17:36:44 -04:00
parent 0098d7f29f
commit 55591848be
10 changed files with 18 additions and 54 deletions

View File

@@ -44,11 +44,13 @@ function onAccountsChanged(accounts) {
changeAccounts(accounts);
}
export async function watchWallet() {
const chainId = (await new ethers.BrowserProvider(window.ethereum).getNetwork()).chainId
onChainChanged(chainId)
window.ethereum.on('chainChanged', onChainChanged);
window.ethereum.on('accountsChanged', onAccountsChanged);
export function detectChain() {
new ethers.BrowserProvider(window.ethereum).getNetwork().then((network)=>{
const chainId = network.chainId
onChainChanged(chainId)
window.ethereum.on('chainChanged', onChainChanged);
window.ethereum.on('accountsChanged', onAccountsChanged);
})
}