Closed raucao closed 5 years ago
We have the available_networks
method in kredits-contracts (Kredits.available_networks()
) that can be used.
After the window.ethereum.enable()
call we should be able to check for window.ethereum.networkVersion
which returns a string of the network ID (should be confirmed if that is metamask specific or a general provider standard). https://github.com/67P/kredits-web/blob/master/app/services/kredits.js#L121
maybe @haythem96 you want to have a look at this?
@bumi sure will look at that...
Currently, with e.g. Metamask installed, and e.g. mainnet selected, the app will throw an exception about not being able to find the contract, but not tell the user anything about it. In that case, the loading indicator will just be visible indefinitely.
The app should catch that error and notify the user to make sure they have the right chain selected.