Skip to content

Cannot connect to metamask default chain #208

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

Closed
quurkyhongyu opened this issue Jul 25, 2024 · 1 comment · Fixed by #207
Closed

Cannot connect to metamask default chain #208

quurkyhongyu opened this issue Jul 25, 2024 · 1 comment · Fixed by #207

Comments

@quurkyhongyu
Copy link

quurkyhongyu commented Jul 25, 2024

When on sepolia test net, metamask can't connect due to it has to connected through "wallet_switchEthereumChain" and not "wallet_addEthereumChain". But inside the Blockchains.MetaMaskDefaults does not contains sepolia test net, so after comment the condition sanitisation then can work alr.

(we tested so far only arbitrum-sepolia can work)

        protected async Task ConnectWithDefaultChain()
        {
            var chainData =  #DefaultChainInfo;

            // after comment out this then can connect to metamask wallet, sepolia test net
            //if (Blockchains.MetaMaskDefaults.Contains((long)defaultChain))
            {
                await _wallet.ConnectWith<object>(RpcMethods.WalletSwitchEthereumChain,
                    new object[] { chainData.AsSwitchChainRequest() });
                return;
            }
            
            await _wallet.ConnectWith<object>(RpcMethods.WalletAddEthereumChain,
                new object[] { chainData });
        }

here is the error log in unity
unitysdk-metamask-error.txt

Hope this will get fixed soon

@0xFirekeeper
Copy link
Member

Hi, this is being looked at as part of #207 and will likely be merged next week after some additional testing, apologies for the inconvenience.

@0xFirekeeper 0xFirekeeper linked a pull request Jul 25, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants