0

Sometimes Energy Consumed in tron transactions became half!

In this moment, its345 Bandwidth and 29,631 Energy

But sometimes it became 345 Bandwidth and 14,815 Energy

How to estimate transfer Gas fee in moment?

(If getChainParameters api helping, tell me how? because I don't understand how to use it to estimate fee)

Reza Heydari
  • 126
  • 1
  • 9

1 Answers1

0

You can use the following tron API to estimate fee: https://developers.tron.network/reference/triggerconstantcontract

For estimating energy: use triggerconstantcontract to call the non-readonly method of the contract, and the energy_used field in the returned value is the energy consumption. Therefore, the fee_limit of the transaction can be set to energy_used x energy unit price

Nick
  • 144
  • 1
  • 4