alpha deployment
This commit is contained in:
@@ -8,6 +8,9 @@ const uniswapV3Addresses = {
|
||||
31337: {
|
||||
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
||||
},
|
||||
53261: {
|
||||
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
||||
},
|
||||
}
|
||||
|
||||
export function uniswapV3PoolAddress(chainId, tokenAddrA, tokenAddrB, fee) {
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user