/wallet/getReward¶
Query the unclaimed voting rewards for an account.
- Source:
framework/src/main/java/org/tron/core/services/http/GetRewardServlet.java - Method:
GET/POST - Solidity endpoint:
/walletsolidity/getReward
Request parameters¶
GET reads address from the URL query; POST reads it from a JSON request body. visible is ignored.
| Field | Method | Type | Required | Description |
|---|---|---|---|---|
address |
GET / POST | string | No | Voter account address; omitted or empty returns reward: 0 |
visible |
GET / POST | bool | No | No effect (the servlet auto-detects address format via the 41 prefix; the response has no bytes fields) |
int64_as_string |
GET | bool | No | GET only; when true, returns reward as a JSON string |
Example:
curl --request POST \
--url https://nile.trongrid.io/wallet/getReward \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"address": "419c7c7049d26108be0dcb5f78479c6ff27ba101d1"
}
'
Response¶
| Field | Type | Description |
|---|---|---|
reward |
int64 | Unit: sun (1 TRX = 1e6 sun) |
Response example (Nile, sr-15 currently accumulated reward, ~29994831 TRX):
{ "reward": 29994831460307 }
Note: when
addressis missing or empty, no error is reported;rewardis0(or"0"whenint64_as_string=trueon GET).
With ?int64_as_string=true on a GET request:
{ "reward": "29994831460307" }
Withdraw via /wallet/withdrawbalance.
Error responses¶
| Method | Trigger | Response |
|---|---|---|
| GET / POST | Request body exceeds node.http.maxMessageSize |
Usually HTTP 413 Payload Too Large when rejected by SizeLimitHandler |
| GET / POST | address parse failure (invalid hex / base58) |
{"Error": "INVALID address, <details>"} |
| POST | Request body is not valid JSON (POST) | {"Error": "class org.tron.json.JSONException : <parser info>"} |
| GET / POST | Other exceptions | {"Error": "<exceptionClass> : <message>"} |