# Web3 error: The method eth\_sendTransaction does not exist/is not available (Ropsten)

**URL:** <https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376>\
**Category:** Support\
**Created:** [May 14, 2021, 10:52am UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376 "2021-05-14T10:52:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![EththeNoob](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EththeNoob](https://forum.openzeppelin.com/u/EththeNoob)\
**Post date:** [May 14, 2021, 10:52am UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/1 "2021-05-14T10:52:49Z")

</div>

Hello,

I created a simple erc20 token on remix. When a call the approve function in web3 js i’m getting error “The method eth\_sendTransaction does not exist/is not available”.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/7/7be44beb7332ef8b15849faf4f3d1fec98820506.png)

The approve function works well on remix. Compiler version 0.8.0,

pragma solidity \>=0.7.0 \<0.9.0;

import “@openzeppelin/contracts/token/ERC20/ERC20.sol”;  
import “@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol”;

contract SimpleToken is ERC20, ERC20Burnable {

```
constructor () ERC20("SimpleToken", "Sim") {
    _mint(msg.sender, 1000000000 * (10 ** uint256(decimals())));
}

```

}

My js code looks like below

```
Web3Connect: async () => {
        try {
            const provider = await App.Provider()
            if (provider) {
                App.web3 = new Web3(provider)
            } else {
                App.web3 = new Web3(new Web3.providers.HttpProvider(App.infuraNetwork + App.infuraToken))
            }
        } catch (error) {
            alert("Enable to access to Metamask")
            console.log(error)
        }
    }
  Provider: async () => {
        const {
            ethereum
        } = window
        if (ethereum) {
            try {
                await ethereum.enable()
                return ethereum
            } catch (error) {
               //throw
            }
        }
        //legacy provider
        const {
            web3
        } = window
        if (web3 && web3.currentProvider) {
            return web3.currentProvider
        }

        return null
    }

```

----approve code  
await token.methods.approve(  
contractaddress,  
amount  
).send({ from: account })

I tried using the latest version of web3 js still got the same error. I’m using ropsten infura

Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![Yoshiko](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/yoshiko/32/6858_2.png) [@Yoshiko](https://forum.openzeppelin.com/u/Yoshiko)\
**Post date:** [May 14, 2021, 12:34pm UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/2 "2021-05-14T12:34:23Z")

</div>

You will need to connect first to a wallet that can Send Transaction.

You may have skipped the provider step?

You’ll need to first get some accounts like so

`var accountsFromMetaMask = await window.ethereum.send('eth_requestAccounts');`

Read some web3js tutorials

[https://cypherpunks-core.github.io/ethereumbook/appdx-web3js-tutorial.html](https://cypherpunks-core.github.io/ethereumbook/appdx-web3js-tutorial.html)

---

<div class="post-metadata">

**Author:** ![EththeNoob](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EththeNoob](https://forum.openzeppelin.com/u/EththeNoob)\
**Post date:** [May 14, 2021, 12:45pm UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/3 "2021-05-14T12:45:48Z")

</div>

Sorry didn’t mentioned that I have already done the provider step. I will edit post now

---

<div class="post-metadata">

**Author:** ![Yoshiko](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/yoshiko/32/6858_2.png) [@Yoshiko](https://forum.openzeppelin.com/u/Yoshiko)\
**Post date:** [May 14, 2021, 1:09pm UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/4 "2021-05-14T13:09:38Z")

</div>

Please post the full code. I don’t see the step where you get the ABI. You will need to get the contract’s ABI first before you can use its function. Otherwise the code will not know what to do.

Please use proper post formatting. Use ``` for code blocks.

---

<div class="post-metadata">

**Author:** ![EththeNoob](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EththeNoob](https://forum.openzeppelin.com/u/EththeNoob)\
**Post date:** [May 15, 2021, 8:09pm UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/5 "2021-05-15T20:09:56Z")

</div>

I got it working now. I found out the issue was due to Metamask deprecated function.

---

<div class="post-metadata">

**Author:** ![Yukigeshiki](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/yukigeshiki/32/8327_2.png) [@Yukigeshiki](https://forum.openzeppelin.com/u/Yukigeshiki)\
**Post date:** [August 19, 2021, 4:43pm UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/6 "2021-08-19T16:43:09Z")

</div>

@EththeNoob can you explain how you solved this issue? I'm having the same problem while using MetaMask.

---

<div class="post-metadata">

**Author:** ![EththeNoob](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EththeNoob](https://forum.openzeppelin.com/u/EththeNoob)\
**Post date:** [December 2, 2021, 10:42am UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/7 "2021-12-02T10:42:38Z")

</div>

@Yukigeshiki sorry for the late reply, I changed the ethereum.enable() part of code to  
await window.ethereum.request({  
method: "eth\_requestAccounts"  
});  
return ethereum

I hope that helps

---

<div class="post-metadata">

**Author:** ![allen\_guo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allen_guo/32/12522_2.png) [@allen\_guo](https://forum.openzeppelin.com/u/allen_guo)\
**Post date:** [August 11, 2022, 4:27am UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/8 "2022-08-11T04:27:58Z")

</div>

@EththeNoob@Yukigeshiki Hi, I have a simple script that also encountered the same problem. How to solve it please 🙇‍♀️

import Web3 from 'web3'  
let contractAddress = ''contractAddress"  
let privateKey = 'myKey'  
let account1 = 'account1'  
let account2 = 'account2'  
const web3 = new Web3(new Web3.providers.HttpProvider('[https://rinkeby.infura.io/v3/xxxxxxxxx](https://rinkeby.infura.io/v3/xxxxxxxxx)'))  
let myContract = new web3.eth.Contract(abi, contractAddress);  
let func = await myContract.methods.transferFrom(account2,account1,1).send({ from: account2 }, function (err, res) {  
if (err) {  
console.log("An error occured", err)  
return  
}  
console.log("Hash of the transaction: " + res)  
})  
console.log(await func)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/9/92ca57626101c79e10f9054dede84510e954ad1f.png)

env:  
"web3": "^1.7.4"  
"node": v18.6.0

---

<div class="post-metadata">

**Author:** ![EththeNoob](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@EththeNoob](https://forum.openzeppelin.com/u/EththeNoob)\
**Post date:** [August 11, 2022, 7:56am UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/9 "2022-08-11T07:56:29Z")

</div>

Hi @allen_guo,

In my case, the issue was with the provider instance i.e ethereum.enable() is deprecated. So had to change like the snippet below

From

```auto
if (ethereum) { 
try 
{ 
   await ethereum.enable() return ethereum
 } 
catch (error) { //throw } }

```

To

```auto
if (window.ethereum) {
            const ethereum = window.ethereum;
            try {
                await window.ethereum.request({
                    method: "eth_requestAccounts"
                });
                return ethereum
            } catch (error) {
                //throw
            }
        }

```

---

<div class="post-metadata">

**Author:** ![Priyanka\_Jadhav](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/priyanka_jadhav/32/14675_2.png) [@Priyanka\_Jadhav](https://forum.openzeppelin.com/u/Priyanka_Jadhav)\
**Post date:** [November 8, 2022, 8:03am UTC](https://forum.openzeppelin.com/t/web3-error-the-method-eth-sendtransaction-does-not-exist-is-not-available-ropsten/8376/10 "2022-11-08T08:03:11Z")

</div>

I have similar code

```auto
async function trySwap(){
 // Grant the allowance target (the 0x Exchange Proxy) an allowance to spend our tokens. Note that this is a txn that incurs fees. 
  const tx = await ERC20TokenContract.methods.approve(
    swapQuoteJSON.allowanceTarget,
    maxApproval,
  )
  .send({ from: takerAddress })
  .then(tx => {
    console.log("tx: ", tx)
  });

}

```

for wallet connect using this

```auto
  if (typeof window.ethereum !== "undefined") {
            try {
                console.log("connecting");
                await ethereum.request({ method: "eth_requestAccounts" });
            } catch (error) {
                console.log(error);
            }
            const myacc = await ethereum.request({ method: "eth_accounts" });
            document.getElementById("login_button").innerHTML = "Connected to " + myacc[0];
            // const accounts = await ethereum.request({ method: "eth_accounts" });
            document.getElementById("swap_button").disabled = false;
        } else {
            document.getElementById("login_button").innerHTML = "Please install MetaMask";
        }

```

On approve method getting this Error: Returned error: The method eth\_sendTransaction does not exist/is not available. @EththeNoob @Yukigeshiki can any one help?
