APIs for deploying, calling, triggering, and querying smart contracts.
Common tasks
| Goal | Recommended path |
|---|---|
| Query a TRC-20 balance | TriggerConstantContract(balanceOf); see Interacting with smart contracts |
| Simulate a write and estimate Energy | TriggerConstantContract for general use, or EstimateEnergy for specific high-accuracy cases when supported by the node; see Setting an appropriate FeeLimit for fee rules |
| Submit a state-changing contract call | TriggerSmartContract → local signing → BroadcastTransaction → receipt; see Interacting with smart contracts |
| Determine execution success | Check the receipt result, Energy usage, and expected event; see Confirmation semantics |
APIs in this group
| API | Purpose |
|---|---|
| DeployContract | Deploy a smart contract. |
| TriggerSmartContract | Trigger a state-changing smart contract method. |
| TriggerConstantContract | Simulate a read-only or constant contract call. |
| EstimateEnergy | Estimate the Energy required by a contract call. |
| GetContract | Query deployed contract information. |
| GetContractInfo | Query contract metadata and runtime information. |
| ClearABI | Clear a contract ABI. |
| UpdateSetting | Update a contract's consume_user_resource_percent setting. |
| UpdateEnergyLimit | Update a contract's origin Energy limit. |
Related resources
- Smart contracts — smart contract concepts and development flow
- TVM — TRON Virtual Machine behavior
- Resource model — Energy consumption and fee rules