# 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                                                                                                                                                                                                |
| ------------------------------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `delegator_identifier`         | `string(64)` | A representation of the delegator identifier, which can be either: a hex-encoded public key, or a purse URef, depending on `delegator_identifier_type_id`. Primary identifier                              |
| `delegator_identifier_type_id` | `uint8`      | Identifier representing the type of the delegator identifier: `0` for PublicKey, `1` for purse URef                                                                                                        |
| `public_key`                   | `string(64)` | The public key of the delegator account represented as a hexadecimal string. Primary account identifier (deprecated: use `delegator_identifier` instead, this property will be removed in future versions) |
| `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
{
  "amount": "44272516539",
  "delegator_identifier": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
  "delegator_identifier_type_id": 0,
  "era_id": 17997,
  "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
  "timestamp": "2025-05-22T07:03:50Z",
  "validator_public_key": "01fe8594026624b992c840281cb528515bd8574d281c38222deaa6eb22546c7656"
}
```

## 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/documentation/highlights/including-cspr-rates) . |
| `account_info`             | [`AccountInfo`](https://docs.cspr.cloud/rest-api/account-info)                        | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the account owner                                                                                        |
| `validator_account_info`   | [AccountInfo](https://docs.cspr.cloud/rest-api/account-info)                          | [Account info](https://github.com/make-software/casper-account-info-contract) provided by the validator                                                                                            |
| `centralized_account_info` | [`CentralizedAccountInfo`](https://docs.cspr.cloud/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                                                                                                                                                                   |
| `validator_cspr_name`      | `string`                                                                              | Primary CSPR.name of the validator account                                                                                                                                                         |

## Relations

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

| Entity                                                    | Mapping property                                       | Description                                                                        |
| --------------------------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| [`Account`](https://docs.cspr.cloud/rest-api/account)     | `delegator_identifier`, `delegator_identifier_type_id` | Accounts receive rewards for delegating to validators.                             |
| [`Purse`](https://docs.cspr.cloud/rest-api/purse-uref)    | `delegator_identifier`, `delegator_identifier_type_id` | Purses receive rewards for delegating to validators.                               |
| [`Validator`](https://docs.cspr.cloud/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 delegation rewards](https://docs.cspr.cloud/rest-api/delegator-reward/get-account-delegation-rewards)
* [Get total account delegation rewards](https://docs.cspr.cloud/rest-api/delegator-reward/get-account-total-delegation-rewards)
* [Get purse delegation rewards](https://github.com/make-software/casper-middleware/blob/documentation/docs/public/rest-api/delegator-reward/get-purse-uref-delegation-rewards.md)
* [Get total purse delegation rewards](https://github.com/make-software/casper-middleware/blob/documentation/docs/public/rest-api/delegator-reward/get-purse-uref-total-delegation-rewards.md)
* [Get total validator delegators' rewards](https://docs.cspr.cloud/rest-api/delegator-reward/get-total-validator-delegators-rewards)
