0

Is there a way or api endpoint to calculate the gas fee before sending the ETH? My client requirements is to calculate the gas fee before sending an ETH to other user.

I can only get the gas price using blockcypher api.

Thank you

0

If you are only sending Ethers directly to a user's wallet the gas usage is always 21000. But if you are sending Ethers to a contract it may be arbitrary.

Most clients offer functionality to estimate the gas usage in advance. Note that this is only an estimation and sometimes it's not possible to make even an estimate.

If you mean only the gas price, you can get that for example here: https://docs.ethgasstation.info/gas-price

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.