Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt MetaMask to change network #7

Open
marsrobertson opened this issue Jun 25, 2022 · 0 comments
Open

Prompt MetaMask to change network #7

marsrobertson opened this issue Jun 25, 2022 · 0 comments

Comments

@marsrobertson
Copy link
Member

https://ethereum.stackexchange.com/questions/117156/how-to-ask-the-metamask-user-to-switch-its-network

window.ethereum.request({
    method: "wallet_addEthereumChain",
    params: [{
        chainId: "0x89",
        rpcUrls: ["https://rpc-mainnet.matic.network/"],
        chainName: "Matic Mainnet",
        nativeCurrency: {
            name: "MATIC",
            symbol: "MATIC",
            decimals: 18
        },
        blockExplorerUrls: ["https://polygonscan.com/"]
    }]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant