GET Rewards history
Returns the earned rewards history of one account given its stake address.
GET /api/core/accounts/{stake_address}/rewards
🎰 Parameters
Name | Description | In | Type | Required |
---|---|---|---|---|
stake_address | Bech32 Stake address | path | string | true |
👨💻 Code samples
- Node.js
- Python
- Rust
const CBI = await new CardanoBI({ apiKey: 'YOUR-KEY', apiSecret: 'YOUR-SECRET' });
const rewards = await CBI.core.accounts.rewards_({ stake_address: "stake1u8a9qstrmj4rvc3k5z8fems7f0j2vztz8det2klgakhfc8ce79fma" });
console.log(rewards);
CBI = CardanoBI(apiKey='YOUR-KEY', apiSecret='YOUR-SECRET' });
rewards = await CBI.core.accounts.rewards_(stake_address='stake1u8a9qstrmj4rvc3k5z8fems7f0j2vztz8det2klgakhfc8ce79fma');
print(rewards);
let CBI = CardanoBI::new(Some("YOUR-KEY"), Some("YOUR-SECRET")).await.expect("Failed to initialize CardanoBI");
let rewards_rewards = CBI.core.accounts.rewards_(Some("stake1u8a9qstrmj4rvc3k5z8fems7f0j2vztz8det2klgakhfc8ce79fma"), HashMap::new()).await.expect("Failed to call endpoint");
println!("rewards_rewards: {:?}", rewards_rewards);
💌 Response Codes
- 200
- 400
- 401
- 402
- 403
- 404
- 429
OK: Successful request.
[
{
"earned_epoch": 336,
"spendable_epoch": 338,
"type": "leader",
"pool_id_hex": "22ab39540db22349b1934f5dcb7788440c33709ea9fdac07fb343395",
"amount": 344553843
},
"...",
{
"earned_epoch": 490,
"spendable_epoch": 492,
"type": "leader",
"pool_id_hex": "22ab39540db22349b1934f5dcb7788440c33709ea9fdac07fb343395",
"amount": 373426967
}
]
Bad Request: The request was unacceptable, often due to missing a required parameter.
Response schema is undefined.
Unauthorized: No valid API key provided.
Response schema is undefined.
Quota Exceeded: This API key has reached its usage limit on request.
Response schema is undefined.
Access Denied: The request is missing a valid API key or token.
Response schema is undefined.
Not Found: The requested resource cannot be found.
Response schema is undefined.
Too Many Requests: This API key has reached its rate limit.
Response schema is undefined.
💌 Response Schemas
- 200
- 400
- 401
- 402
- 403
- 404
- 429
Status Code 200
Name | Type | Description |
---|---|---|
earned_epoch | integer(int64) | The epoch in which the reward was earned. For pool and leader rewards spendable in epoch N, this will be N - 2, for treasury and reserves N - 1 and for refund N. |
spendable_epoch | integer(int64) | The epoch in which the reward is actually distributed and can be spent. |
type | string | The source of the rewards; pool member, pool leader, treasury or reserves payment and pool deposits refunds |
pool_id_hex | string | The hexadecimal encoding of hash for the pool the stake address was delegated to when the reward is earned or for the pool that there is a deposit refund. Will be NULL for payments from the treasury or the reserves. |
amount | integer(int64) | The reward amount (in Lovelace). |
Status Code 400
Name | Type | Description |
---|
Response schema is undefined.
Status Code 401
Name | Type | Description |
---|
Response schema is undefined.
Status Code 402
Name | Type | Description |
---|
Response schema is undefined.
Status Code 403
Name | Type | Description |
---|
Response schema is undefined.
Status Code 404
Name | Type | Description |
---|
Response schema is undefined.
Status Code 429
Name | Type | Description |
---|
Response schema is undefined.