POSTGetContractInfo

Tron Mainnethttps://tron-mainnet.nodit.io/wallet/getcontractinfo

Queries a contract's information from the blockchain. The difference from the wallet/getcontract interface is that this interface returns not only the bytecode but also the runtime bytecode of the contract. Compared with bytecode, runtime bytecode does not contain constructor and constructor parameter information.

Request Body
valuestring

Contract address (format: Base58 or Hex). Example: TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs

visibleboolean

Optional. Set to true to format addresses in Base58; set to false for hex format. (Default: false)

Responses
runtimecodestring

Runtime bytecode of the contract.

energy_usageinteger (int64)

Total basic energy usage of the contract in the current maintenance cycle.

energy_factorinteger (int64)

Energy factor of the contract.

update_cycleinteger (int64)

Current maintenance cycle number.

X-API-KEY
RequestCU40
cURL
curl -X POST "https://tron-mainnet.nodit.io/wallet/getcontractinfo" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "value": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "visible": true
}'
Response
Example · 200
{
  "runtimecode": "string",
  "smart_contract": {},
  "contract_state": {
    "energy_usage": 0,
    "energy_factor": 0,
    "update_cycle": 0
  }
}