Ethers.js MetaMask Mobile error: eth_sendTransaction
See original GitHub issueNot 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…
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Understanding and resolving MetaMask error codes
This guide outlines the most common and confusing MetaMask error codes to help you resolve errors for a smoother Web3 development ...
Read more >Ether.js works fine on desktop but not with metamask app ...
1 Answer 1 · 1- Try to connect to Metamask on mobile via wallet connect. · 2- if you're using React, use @react-web3/core...
Read more >Sending Transactions - MetaMask Docs
Transactions are a formal action on a blockchain. They are always initiated in MetaMask with a call to the eth_sendTransaction method. They can ......
Read more >ethers: processing response error code -32000 ...
I am trying to get MetaMask to popup to approve a dapp to use my erc20 tokens like: const provider = new ethers.providers....
Read more >Documentation - Ethers.js
A Web3Provider wraps a standard Web3 provider, which is // what MetaMask injects as ... error.hash - the hash of the original transaction...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
IT WORKS!!!
Could you try the following which we are currently testing?
next
tag (v1.2.0-alpha.0)Example: