# Validator reward

The `ValidatorReward` entity offers a normalized representation of the Casper Network [Reward](https://docs.casper.network/concepts/glossary/R/#reward) received by a [Validator](https://docs.cspr.cloud/1.5.x/rest-api/validator) for a specific era.

## Properties

The `ValidatorReward` entity has the following properties:

| Property     | Type         | Description                                                                                                                                                                          |
| ------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `public_key` | `string(64)` | Public key of the validator represented as a hexadecimal string. Unique validator identifier                                                                                         |
| `era_id`     | `uint32`     | Era identifier                                                                                                                                                                       |
| `type`       | `uint8`      | [`RewardTypeID`](https://github.com/make-software/casper-middleware/blob/documentation-1.5.x/docs/public/rest-api/validator-reward/get-validator-reward-types.md) unique identifier. |
| `amount`     | `uint64`     | Amount of the reward received by the validator                                                                                                                                       |
| `timestamp`  | `datetime`   | Timestamp indicating when the last block in the era was proposed                                                                                                                     |

**Example**

```json
{
  "public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca",
  "era_id": 1,
  "type": 0,
  "amount": "1000000000000",
  "timestamp": "2023-01-01T12:00:00Z"
}
```

## Optional properties

Depending on the endpoint, the following optional properties may be included in the `ValidatorReward` entity:

| Property | Type      | Description                                                                                                                                                                                              |
| -------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rate`   | `float32` | The rate that was relevant at the moment when the last block was proposed. To get more details see [Including CSPR rates](https://docs.cspr.cloud/1.5.x/documentation/highlights/including-cspr-rates) . |

## Relations

The `ValidatorReward` entity has the following relations with other entities:

| Entity                                                          | Mapping property | Description                                                            |
| --------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------- |
| [`Validator`](https://docs.cspr.cloud/1.5.x/rest-api/validator) | `public_key`     | Validators receive rewards for participating in the consensus process. |

## Endpoints

The `ValidatorReward` entity has the following endpoints:

* [Get validator rewards](https://docs.cspr.cloud/1.5.x/rest-api/validator-reward/get-validator-rewards)
* [Get validator era rewards](https://docs.cspr.cloud/1.5.x/rest-api/validator-reward/get-validator-era-rewards)
* [Get validator total rewards](https://docs.cspr.cloud/1.5.x/rest-api/validator-reward/get-validator-total-rewards)

## Relation endpoints

The `ValidatorReward` entity has the following relation endpoints:

* [Get total validator delegators' rewards](https://docs.cspr.cloud/1.5.x/rest-api/delegator-reward/get-total-validator-delegators-rewards)
* [Get validator reward types](https://github.com/make-software/casper-middleware/blob/documentation-1.5.x/docs/public/rest-api/validator-reward/get-validator-reward-types.md)
