Open eelco2k opened 10 months ago
Hello @eelco2k, is this a report for WalletConnectModalFlutter or Web3Modal? Coz the info provided is related to Web3Modal but the issue is reported on WalletConnectModalFlutter.
Anyway, I tested it and it's fine for me, you sure you are adding the chain before service init?
W3MChainPresets.chains.putIfAbsent('11155111', () => sepoliaTestnet);
await _w3mService.init();
@quetool I'm sorry i posted in the wrong repo. If you suggest me to open a ticket there i will do that but here are some more small tests i conducted.
Yes i added this putIfAbsent before the service init.
I tried the same with the goerli testnet, same problem.
W3MChainInfo goerliTestnet = W3MChainInfo(
chainName: 'Goerli Test Network',
namespace: 'eip155:5',
chainId: '5',
tokenName: 'ETH',
requiredNamespaces: {
'eip155': const RequiredNamespace(
methods: EthUtil.ethRequiredMethods,
chains: ['eip155:5'],
events: EthUtil.ethEvents,
),
},
optionalNamespaces: {
'eip155': const RequiredNamespace(
methods: EthUtil.ethOptionalMethods,
chains: ['eip155:5'],
events: [],
),
},
rpcUrl: 'https://goerli.drpc.org/',
blockExplorer: W3MBlockExplorer(
name: 'Sepolia Etherscan',
url: 'https://goerli.etherscan.io',
),
);
W3MChainPresets.chains.putIfAbsent('5', () => goerliTestnet);
await _w3mService.init();
_w3mService.selectChain(goerliTestnet);
I run the sample Web3Modal Flutter app on Samsung M23 Android phone. Explicitly using ( Connect Wallet ) button, then "All Wallets" option, and then the {+} qr code camera icon right next to the search wallet input field.
Then i take another phone, iphone 12 Pro, iOS 17.0.3 and open MetaMask v7.8.0 (1174). In MetaMask i'm using also the scan QR-code icon in the top right corner, and i scan the showed QR-code (on android) with my iphone.
Iphone MetaMask prompts me if i want to connect to this site: (www.walletconnect.com, Goerli) and i click ( Connect ). I get a small dialog verifying connection is succesful. On my Android phone i get a Title: MetaMask Wallet with a session topic: 9ecxxxxx719. Ethereum with my Account ID 0x593xxxxA5 and 4 buttons with Methods. and two Events with outlined buttons.
When i click on one of the buttons for example: eht_sendTransaction. A dialog popups-up with this info:
eth_sendTransaction
WalletConnectError( code: 5100, message: Unsupported chains, The chain eip155:1 is not supported, data: null)
close
Perhaps it has to do with MetaMask and how it handles testNets?... Because when i use the normal Ethereum chain to connect i am able to do all the Methods succesfully....
Describe the bug
Because w3m_chains_presets.dart does not have the testnet network chains i was referred in a comment to implement it as a custom-chain:
But after after adding the W3MChainInfo() and run the flutter sample app. I can select the Sepolia Testnet, and i can scan the QR code, it also connects to my Metamask wallet, but when i want to execute one of the methods i receive an error
Is this still unsupported in web3modal_flutter @ 3.0.0-beta06 ? or am i implementing it wrong?