Returns all the available Mana rewards of an account or delegation output in the returned range of epochs.
GET/api/core/v3/rewards/:outputId
Returns all the available Mana rewards of an account or delegation output in the returned range of epochs. Note that rewards for an epoch only become available when the last slot of an epoch is committed. If the end epoch of a staking feature is equal or greater than the current epoch, the rewards response will thus not include the potential future rewards for those epochs. startEpoch and endEpoch indicate the actual epoch range in which rewards are available. Callers that use this API to build a transaction are highly advised to set the slot index parameter explicitly. The returned startEpoch can be used to check the first epoch for which rewards are available. Together with the retention period of rewards, applications can warn users to claim their rewards before their oldest rewards are beyond the retention period.
Request
Path Parameters
Output ID of an account or delegation output.
Query Parameters
A client can specify a slot index explicitly, which should be equal to the slot it uses as the commitment input for the claiming transaction to ensure the node calculates the rewards identically as during transaction execution. Rewards are decayed up to the epoch corresponding to the given slot + MinCommittableAge. For a Delegation Output in delegating state (i.e. when Delegation ID is zeroed), that epoch - 1 is also used as the last epoch for which rewards are fetched. Callers that do not build transactions with the returned values may omit this value in which case it defaults to the latest committed slot, which is good enough to, e.g. display estimated rewards to users.
Responses
- 200
- 400
- 403
- 500
- 503
Successful operation.
- application/json
- Schema
- Example (from schema)
- ManaRewardsResponse
Schema
The starting epoch index for which the mana rewards are returned.
The ending epoch index for which the mana rewards are returned, the decay is applied up to this point (inclusive).
The amount of totally available rewards the requested output may claim.
The rewards of the latest committed epoch of the staking pool to which this validator or delegator belongs. The ratio of this value and the maximally possible rewards for the latest committed epoch can be used to determine how well the validator of this staking pool performed in that epoch. Note that if the pool was not part of the committee in the latest committed epoch, this value is 0.
{
"startEpoch": 0,
"endEpoch": 0,
"rewards": "string",
"latestCommittedEpochPoolRewards": "string"
}
{
"startEpoch": 60,
"endEpoch": 80,
"rewards": "800000",
"latestCommittedEpochPoolRewards": "0"
}
Unsuccessful operation: indicates that the provided data is invalid.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 400,
"message": "invalid data provided"
}
}
Unsuccessful operation: indicates that the endpoint is not available for public use.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 403,
"message": "not available for public use"
}
}
Unsuccessful operation: indicates that an unexpected, internal server error happened which prevented the node from fulfilling the request.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 500,
"message": "internal server error"
}
}
Unsuccessful operation: indicates that the node is not synced.
- application/json
- Schema
- Example (from schema)
Schema
error objectrequired
The application error code.
The error reason.
{
"error": {
"code": 503,
"message": "service unavailable"
}
}