0

I am gonna send tether token from my wallet address to other wallet address using web3.

    const Web3 = require('web3');
    const web3 = new Web3('https://mainnet.infura.io/v3/projectId');
    web3.eth.accounts.wallet.add('<private key>');
    var count = web3.eth.getTransactionCount("my wallet");
    var contractAbi = [];
    var tokenAddress = '';
    tokenInst.methods.transfer('where I send', 1).send({from: 'my wallet', gas: 100000});
    tokenInst.methods.balanceOf('my wallet').call().then(console.log).catch(console.error);

I have 75 USDT in my wallet.

If I run above code, I can check 75000000.

But I faced this error

'errors.js:28 Uncaught (in promise) Error: Returned error: insufficient funds for gas * price + value at Object.ErrorResponse (errors.js:28) at index.js:303 at XMLHttpRequest.request.onreadystatechange (index.js:98)'

It would be appreciated if you could fix this. Thanks.

3
  • you probably need to have ether on that account to pay for the gas fee... etherscan.io/gastracker
    – Majd TL
    Sep 16 at 16:13
  • Thanks Majd TL. I appreciate your help.... Could you please let me know how to define gas fee and what is gas limit and gas Price? So, how much ethers I need for gas fee on my account and what is minium value. Sep 16 at 21:10
  • 1
    It depends on the time , version of web3, type of transaction (in good case it will cost u about 20$ in ether) :) can’t u just use metamask :/
    – Majd TL
    Sep 17 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.