You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I'm trying to use EIP6963 provider provided by my browser along with ether's BrowserProvider but I'm facing an issue of missing either request() or getSigner() methods, depending on which provider I'm using.
If I use EIP6963 provider directly then I get an error when I try to use provider.getSigner() method, while provider.request() works fine:
// const provider = selectedEIP6963Provider.provider;
// const signer = await provider.getSigner();
Uncaught (in promise) TypeError: provider.getSigner is not a function
at connectToSelectedWallet (index.html:42:37)
If I wrap EIP6963 provider in BrowserProvider then I get an error when I try to use provider.request(), while provider.getSigner() works fine:
// const provider = new ethers.BrowserProvider(selectedEIP6963Provider.provider);
// const accounts = await provider.request({ method: 'eth_accounts' });
Failed to connect to MetaMask: TypeError: provider.request is not a function
at connectToSelectedWallet (index.html:37:24)
at HTMLSelectElement.<anonymous> (index.html:51:5)
Is there a way to create a provider with ethers to have both functions available all the time?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I'm trying to use EIP6963 provider provided by my browser along with ether's
BrowserProvider
but I'm facing an issue of missing eitherrequest()
orgetSigner()
methods, depending on which provider I'm using.If I use EIP6963 provider directly then I get an error when I try to use
provider.getSigner()
method, whileprovider.request()
works fine:If I wrap EIP6963 provider in
BrowserProvider
then I get an error when I try to useprovider.request()
, whileprovider.getSigner()
works fine:Is there a way to create a provider with ethers to have both functions available all the time?
Beta Was this translation helpful? Give feedback.
All reactions