post
https://api.shasta.trongrid.io/wallet/getaccountresource
查询账户的带宽、能量和 TRON Power 聚合配额及已使用量。
计算可用资源
响应以 limit 和 used 字段返回账户的聚合资源情况,不直接返回可用量,也不拆分资源的自质押和代理来源。可用量需由客户端计算:
| 资源 | 计算公式 |
|---|---|
| 剩余免费带宽 | max(0, freeNetLimit - freeNetUsed) |
| 剩余质押 / 代理带宽 | max(0, NetLimit - NetUsed) |
| 剩余能量 | max(0, EnergyLimit - EnergyUsed) |
| 剩余可分配 TRON Power(TP) | max(0, tronPowerLimit - tronPowerUsed) |
数值为 0 的 Protocol Buffers 字段可能不出现在 JSON 响应中,计算前应将缺省字段按 0 处理。如需区分质押和代理来源,请结合 wallet/getaccount 查询账户质押字段;Stake 2.0 代理使用 wallet/getdelegatedresourcev2 和 wallet/getdelegatedresourceaccountindexv2,历史 Stake 1.0 代理使用 wallet/getdelegatedresource 和 wallet/getdelegatedresourceaccountindex 查询。
相关资源
- GetAccountNet —— 仅查带宽信息(轻量替代)
- GetCanDelegatedMaxSize —— 查询可代理给他人的资源上限
- 带宽与能量 —— 资源类型、消耗顺序与 24h 滚动恢复模型
- TRON 质押 —— 质押 TRX 获取资源的机制
