ITX deposit gas problem

Hello!

I’ve been trying to transfer ETH on ropsten to fund my ITX gas tank. I used the code in the tutorial here:

How to use ITX: step-by-step guide | Infura Blog | Tutorials, Case Studies, News, Feature Announcements

I sent 1 ETH and the transaction went through and was mined:

https://ropsten.etherscan.io/tx/0x0f5a0997d948e1f719796e4306009af0957e21e5072494c4ec6703c18f66b01a

But when I try to relay a transaction using ITX, it says insufficient funds, because the gas tank is still empty. What happened? Any tips on how to get that 1ETH credited to my gas tank?

I see that many other transaction are of type Absolute Top Up and Relative Top Up. Do I need to be using one of those methods instead? Are there any docs?

(Using latest ethers.js on Linux with Docker)

Hi :wave: @Mayhem and welcome to the Infura community!

You can find documentation on ITX here Transactions - Infura Docs

Also, you can check your gas tank by following here: Transactions - Infura Docs

Thank for your reply, but I used the code in the examples to carry out the gas tank funding and then the gas tank says it has zero balance. In order words, the example code in the docs does not work. Are there any other docs or troubleshooting docs that could help me?

hey @Mayhem I can see the balance:

curl https://ropsten.infura.io/v3/projectID
-X POST
-H “Content-Type: application/json”
-d ‘{“id”: “1”, “jsonrpc”: “2.0”, “method”: “relay_getBalance”, “params”: [“0x9b3a020a9e9b2945b25ba933ef7f65b30b24db04”]}’

{“jsonrpc”:“2.0”,“id”:“1”,“result”:{“balance”:“1100000000000000000”}}

Are you still seeing the issue ?

Ahhh, very helpful, thank you. It appears that this code isn’t working as expected:

async function getGasTankBalance(itx, address) {
  response = await itx.send('relay_getBalance', [address])
  return response.balance
}

It always returns 0. But with your command line version, I get the right balance – thanks! And transactions appear to be going through now, which is great. I wonder if there is some delay between funding the gas tank and being able to send?

Thanks!

There is a bit of a delay sometimes, until seeing the gas tank balance, it shouldn’t be too high though. Btw in regards to that code snippet, it looks like the ethers send method acts weird, I’ve opened https://github.com/ethers-io/ethers.js/issues/2867

Thanks! Yes, transactions are being relayed and completed successfully, but somehow it never transfers anything – just 0 ether transactions. Any idea what might be wrong here?

const iface = new ethers.utils.Interface(["function transfer(address from, address to, uint256 amount)"]);
const data = iface.encodeFunctionData("transfer", [
        process.env.FAUCET_ID,
        '0xbA8E99e7e5C844f434086d70bdd2BBb9f43816a6',
        ethers.utils.parseEther(".00003").toNumber()
]);

Which then gives:

https://ropsten.etherscan.io/tx/0x280c74424a24b7ace2e708b5e2c429cd4af2e33868831dcb6fce793b438ac209

I’ve tried all sorts of incantations on passing a value, but it always transfers 0 eth. Any tips would be much appreciated!

Yeah, that’s one of the limitations, you cannot send value through ITX, see Transactions - Infura Docs.

" ITX supports any type of transaction that doesn’t directly carry Ether (i.e. whose value field is set to 0 ). You can use it for deploying your own contracts or calling arbitrary contract methods, and you can also use it for enabling your users to interact with your Dapp, even if they don’t hold any Ether. However, you cannot use ITX to send Ether without the intermediation of a wallet contract."

Oh, that explains quite a bit. Do you happen to know of an example contract that I can deploy so that it would allow me to actually complete sending ethers via ITX?

Thanks!

Hello! I also have a problem with “insufficient funds”. I’m trying to transfer USDT with a relay.


and then send a request with Postman

On my relay balance, I have 0.01 ETH