-
Notifications
You must be signed in to change notification settings - Fork 2
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
Can you add a custom chain on mobile ? #23
Comments
Hello, The chains you set in Could you please share the code for |
@skibitsky do you have any possible release date for that switching chain fix? |
@LukaszwBeamable I'm aiming for tomorrow! |
@LukaszwBeamable @talha-trili the latest version v1.1.2 has a potential fix for this issue |
Hi @skibitsky It still behaves as it used to be. Meaning it doesnt prompt for adding/changing to custom network on mm mobile. I've also tested couple of other wallets like trust mobile wallet. And on the trust you have to manually add custom networks before connection. Without doing it, it just throws unsupported chain error. It would've make sense if i had the same behaviour on mm mobile but on mm it just connects without caring for the network. so maybe its related to mm mobile. |
I've reproduced the issue: some chains (including Etherlink) aren't getting added to MetaMask. If the chain is already in your wallet, switching between networks works fine. |
Hi @skibitsky, any updates ? |
Hello @talha-trili, Sorry for the delayed answer. The good news is that I've found the issue! In your network configuration set native token decimal value to 6, but it has to be 18. Chain ETHERLINK_TESTNET = new(
ChainConstants.Namespaces.Evm,
"128123",
"Etherlink Testnet",
new Currency("Tez", "XTZ", 18), // 👈 use 18 here
new BlockExplorer("Explorer", "https://testnet.explorer.etherlink.com/"),
"https://node.ghostnet.etherlink.com",
true,
"https://etherlink.com/opengraph-image.png?4dd162b94a289c06",
"etherlinkTestnet"
); I'll work on improving the error messages so you could get more useful information from MetaMask app! |
Hi @skibitsky, i do not see any changes after setting decimals to 18 🤔 Metamask android still doesn't add etherlink and just connects whatever network/s it has. |
@talha-trili, yes, MetaMask always connects the chain that is active in the MetaMask app, regardless of your app configuration. However, when you switch to the Etherlink in the dapp, AppKit will try to add that chain to the MetaMask. Basically, the AppKit chain will take priority over whatever is active in MetaMask when you make requests, but not during connection. The problem is that there's a bug in latest version of MetaMask that essentially breaks chain switching 😔 We're in touch with the MetaMask team, I'll keep you posted. |
This is for mobile platforms.
Is it possible to add custom chains ?
Below is an example implementation and it doesnt add custom chains.
On webgl however, it adds custom chains and overall handles network switches better.
The text was updated successfully, but these errors were encountered: