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

@@ -8,6 +8,9 @@ const uniswapV3Addresses = {
31337: {
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
},
53261: {
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
},
}
export function uniswapV3PoolAddress(chainId, tokenAddrA, tokenAddrB, fee) {

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);
})
}