/wallet/getaccountresource¶
Query an account's bandwidth (Net) + energy + TronPower usage.
- Source:
framework/src/main/java/org/tron/core/services/http/GetAccountResourceServlet.java - Method:
GET/POST
Request parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
address |
string | Yes | Account address |
visible |
bool | No | Address format |
Example:
curl --request POST \
--url https://nile.trongrid.io/wallet/getaccountresource \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"address": "41dd791d6b49e190062d650e6a23c575510d35f2f9"
}
'
Response¶
Returns api.AccountResourceMessage (api.proto):
| Field | Type | Description |
|---|---|---|
freeNetUsed / freeNetLimit |
int64 | Free bandwidth (resets every 24h) |
NetUsed / NetLimit |
int64 | Staked bandwidth |
assetNetUsed / assetNetLimit |
map | Per-TRC10 bandwidth |
TotalNetLimit / TotalNetWeight |
int64 | Network-wide bandwidth quota / total staked TRX |
EnergyUsed / EnergyLimit |
int64 | Energy |
TotalEnergyLimit / TotalEnergyWeight |
int64 | Network-wide energy quota / total staked TRX |
tronPowerUsed / tronPowerLimit |
int64 | Voting power |
TotalTronPowerWeight |
int64 | Network-wide total voting power |
storageUsed / storageLimit |
int64 | Storage (no longer used) |
Response example:
{
"freeNetUsed": 441,
"freeNetLimit": 600,
"assetNetUsed": [
{ "key": "1005416", "value": 0 }
],
"assetNetLimit": [
{ "key": "1005416", "value": 10000 }
],
"TotalNetLimit": 43200000000,
"TotalNetWeight": 68305209098,
"TotalEnergyLimit": 180000000000,
"TotalEnergyWeight": 2411528185
}
Returns {} if address is missing or the account does not exist.
Error responses¶
| Trigger | Response |
|---|---|
Request body exceeds node.maxMessageSize (POST) |
{"Error": "class java.lang.Exception : body size is too big, the limit is <N>"} |
address is not valid hex (visible=false) |
{"Error": "class org.bouncycastle.util.encoders.DecoderException : exception decoding Hex string: <details>"} |
address is not valid base58check (visible=true) |
{"Error": "class java.lang.IllegalArgumentException : <details>"} |
| Request body is not valid JSON / field type mismatch (POST) | {"Error": "class com.alibaba.fastjson.JSONException : <parser info>"} |
| Other exceptions | {"Error": "<exceptionClass> : <message>"} |