walletconnect-monorepo: Ethers.js MetaMask Mobile error: eth_sendTransaction
Not sure where this issue originates - MetaMask, Ethers.js, or here. Apologies if this is the wrong place.
Issue
Attempting to fire a transaction fails with error The method eth_sendTransaction does not exist/is not available.
This flow works for WalletConnect with the test wallet (test.walletconnect.org). It also works well with MetaMask browser extension (ie. not using WalletConnect)
@walletconnect/web3-provider v1.0.13
@ethersproject/providers ^5.0.4
const provider = new WalletConnectProvider({
infuraId: infuraKey // Required
});
await provider.enable();
const walletProvider = new Web3Provider(provider);
contracts[name] = new Contract(
CONTRACTS[name][networkName],
CONTRACTS[name].abi,
walletProvider
);
const approvalAmount = amountBn || parseUnits("500000", 18);
const tx = await contracts[token].approve(
spender,
approvalAmount
);
Discussion
- It looks like ethers.js supports eth_sendTransaction https://github.com/ethers-io/ethers.js/issues/298
- It looks like MetaMask Mobile supports eth_sendTransaction https://github.com/MetaMask/metamask-mobile/blob/aa2895d5c08469c8a23522b455bed55acc8d11a1/app/core/WalletConnect.js#L90
- It looks like WalletConnect should support ethers providers and MetaMask Mobile https://github.com/ethers-io/ethers.js/issues/775
Going to continue researching…
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 18 (4 by maintainers)
IT WORKS!!!
Could you try the following which we are currently testing?
nexttag (v1.2.0-alpha.0)Example:
No. The ethers issue I linked is fixed in the latest version.
However, this WalletConnect issue on which we are commenting is broken with the latest ethers version. So we cannot upgrade to the latest ethers version in the Uniswap Interface without breaking WalletConnect. And we need to upgrade ethers to fix the ethers issue.
I’m asking if you have any insight into how to fix this WalletConnect/ethers compatibility issue in the latest version of ethers.
Hey, just wanted to see what the latest is on this issue and if there’s any known workarounds? Thought I must have been making a simple mistake but apparently this is quite the tricky issue. In this instance I’m seeing the error when trying to send a transaction with ethers + Argent via WalletConnect