Estimate energy usage for contract call

Estimates the amount of energy that will be consumed by a smart contract call with given parameters.

Request

This endpoint expects an object.
owner_addressstringRequired
Base58 address calling the contract.
contract_addressstringRequired
Base58 address of the contract to call.
datastringRequired

Hex-encoded call data (function selector and arguments).

call_valueintegerOptional

Amount of TRX to transfer with the call (in SUN).

visiblebooleanOptional

Indicates if addresses are base58 (true) or hex (false).

Response

Energy estimation for contract call.
energy_requiredinteger or null
Estimated energy required for the call.
resultboolean or null
Whether the estimation was successful.
messagestring or null
Additional message or error.