-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Incompatible types MetaMaskInpageProvider
and ethers.providers.Web3Provider()
#200
Comments
Any updates on this? |
This is still on our roadmap, but no updates so far, sorry. |
Hi @mcmire, any update on this? |
@dhapoer No, sorry, no updates. Now that I look at this again I'm actually wondering whether this might be an issue with Ethers. Our type is more strict and requires the request object to be a JSON-RPC request object. I can look into this further. |
Okay, I've just done a quick check on a codesandbox, and it appears that this may be fixed in Ethers v6 if you use BrowserProvider instead of Web3Provider: import { BrowserProvider } from 'ethers'
import type { MetaMaskInpageProvider } from '@metamask/providers'
const setWalletProvider = async (newWalletProvider: MetaMaskInpageProvider): Promise<void> => {
walletProvider.value = new BrowserProvider(newWalletProvider)
} Can you give that a shot and let me know? |
Hello, I installed the typings for Metamask provider from this
@metamask/providers
package. Since we allow multiple providers to be used, we wrap the provider into standardizedWeb3Provider
fromethers
package. However, I am unable to pass theMetaMaskInpageProvider
toWeb3Provider
constructor like this:Error is following:
I can easily surpress the error by
@ts-ignore
, but do you think it would be possible to make theMetaMaskInpageProvider
compatible with theethers.providers.Web3Provider
? Or should I rather post an issue to theethers
? Thanks!The text was updated successfully, but these errors were encountered: