when window.ethereum is available web3 is likely not available as the
browser uses the new provider standard.
So we either user the window.ethereum as provider or the
web3.currentProvider as legacy option.
when window.ethereum is available web3 is likely not available as the
browser uses the new provider standard.
So we either user the window.ethereum as provider or the
web3.currentProvider as legacy option.
I'm not sure I understand. This is ported from the official upgrade instructions for Metamask and it comes with window.ethereum and window.Web3 (the constructor, not the instance). It is then set as web3 instance on window, so that the APIs are the same.
Am I missing something? Or is there a particular wallet that doesn't work this way perhaps?
I'm not sure I understand. This is ported from the official upgrade instructions for Metamask and it comes with `window.ethereum` and `window.Web3` (the constructor, not the instance). It is then set as `web3` instance on `window`, so that the APIs are the same.
Am I missing something? Or is there a particular wallet that doesn't work this way perhaps?
When I tried the app in opera I get the error that Web3 is undefined, but it injects an window.ethereum provider.
Looking at the metamask documentation here it seems that window.ethereum == window.web3.currentProvider. So there is no need to initialize another Web3 object.
It seems the new global API only injects window.ethereum and no Web3 is available. (which somehow makes sense as for example we use ethers and no full web3 is needed at all)
When I tried the app in opera I get the error that `Web3` is undefined, but it injects an `window.ethereum` provider.
Looking at the [metamask documentation here](https://metamask.github.io/metamask-docs/API_Reference/Ethereum_Provider) it seems that window.ethereum == window.web3.currentProvider. So there is no need to initialize another Web3 object.
It seems the new global API only injects `window.ethereum` and no Web3 is available. (which somehow makes sense as for example we use ethers and no full web3 is needed at all)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
when window.ethereum is available web3 is likely not available as the
browser uses the new provider standard.
So we either user the window.ethereum as provider or the
web3.currentProvider as legacy option.
I'm not sure I understand. This is ported from the official upgrade instructions for Metamask and it comes with
window.ethereumandwindow.Web3(the constructor, not the instance). It is then set asweb3instance onwindow, so that the APIs are the same.Am I missing something? Or is there a particular wallet that doesn't work this way perhaps?
When I tried the app in opera I get the error that
Web3is undefined, but it injects anwindow.ethereumprovider.Looking at the metamask documentation here it seems that window.ethereum == window.web3.currentProvider. So there is no need to initialize another Web3 object.
It seems the new global API only injects
window.ethereumand no Web3 is available. (which somehow makes sense as for example we use ethers and no full web3 is needed at all)Ah, I see. Thanks. 👍