요금GitHub대시보드

TRON

walletsolidity/estimateenergy25 크레딧

Estimates the Energy needed by a smart contract call (solidified state).

네트워크: tron

매개변수

이름타입설명
owner_addressstringAddress of the caller (base58 or hex).
contract_addressstringContract address (base58 or hex). (선택)
function_selectorstringFunction signature, e.g. transfer(address,uint256). (선택)
parameterstringABI-encoded call arguments as a hex string, without the 4-byte selector. (선택)
datastringFull ABI-encoded call data (selector + arguments); ignored when function_selector is set. (선택)
call_valuenumberTRX sent with the call, in sun. (선택)
call_token_valuenumberAmount of a TRC-10 token sent with the call. (선택)
token_idnumberTRC-10 token id for call_token_value. (선택)
visiblebooleantrue = base58 addresses (in the request and the response); false (default) = hex addresses. (선택)

반환값

타입

Object

Object with result (result: true when the estimate succeeded; code, message on failure) and energy_required, the estimated Energy (not sun). Needs vm.estimateEnergy and vm.supportConstant enabled on the node.

코드 예제

curl 'https://holy-burned-sky-tron-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7/walletsolidity/estimateenergy' \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "owner_address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy",
  "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "function_selector": "symbol()",
  "visible": true
}'