# Delegator reward

The `DelegatorReward` entity offers a normalized representation of the Casper Network [Reward](https://docs.casper.network/concepts/glossary/R/#reward) related to the delegator account.

## Properties

The `DelegatorReward` entity contains the following properties:

| Property               | Type         | Description                                                                                             |
| ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
| `public_key`           | `string(64)` | The public key of the delegator account represented as a hexadecimal string. Primary account identifier |
| `validator_public_key` | `string(64)` | Public key of the validator represented as a hexadecimal string. Unique validator identifier            |
| `era_id`               | `uint32`     | Era identifier                                                                                          |
| `amount`               | `uint64`     | Amount of the reward received by the delegator.                                                         |
| `timestamp`            | `datetime`   | Timestamp indicating when the last block was proposed.                                                  |

**Example**

```json
{
  "public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca",
  "validator_public_key": "0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b94af64292419f7862936bca2ca",
  "era_id": 1,
  "amount": "1000000000000",
  "timestamp": "2021-03-24T10:00:00.000Z"
}
```

## Optional properties

Depending on the endpoint, the following optional properties may be included in the `DelegatorReward` 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) . |
| `account_info`             | [`AccountInfo`](https://docs.cspr.cloud/1.5.x/rest-api/account-info)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the account owner                                                                                              |
| `centralized_account_info` | [`CentralizedAccountInfo`](https://docs.cspr.cloud/1.5.x/rest-api/centralized-account-info) | Account information available for known accounts provided by CSPR.cloud team                                                                                                                             |
| `cspr_name`                | `string`                                                                                    | Primary CSPR.name of the account                                                                                                                                                                         |

## Relations

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

| Entity                                                          | Mapping property       | Description                                                                        |
| --------------------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------- |
| [`Account`](https://docs.cspr.cloud/1.5.x/rest-api/account)     | `public_key`           | Accounts receive rewards for delegating to validators.                             |
| [`Validator`](https://docs.cspr.cloud/1.5.x/rest-api/validator) | `validator_public_key` | Delegation rewards are associated with the validator, that distributed the rewards |

## Endpoints

The `DelegatorReward` entity has the following endpoints:

* [Get account delegator rewards](https://docs.cspr.cloud/1.5.x/rest-api/delegator-reward/get-account-delegation-rewards)
* [Get total account delegation rewards](https://docs.cspr.cloud/1.5.x/rest-api/delegator-reward/get-account-total-delegation-rewards)
* [Get total validator delegators' rewards](https://docs.cspr.cloud/1.5.x/rest-api/delegator-reward/get-total-validator-delegators-rewards)
