Skip to main content

Stake forecast

Obtain an approximate forecast of the rewards expected from the stake by date.

Parameter

AttributeDescription
stakeIdThe stake identifier for forecasting

Usage example

import { anvil } from "@ada-anvil/sdk-server";

try {
await anvil.staking.getStakeForecast({
stakeId: YOUR_STAKE_ID,
});
} catch {
console.log("YOUR ERROR HANDLING");
}

Return informations

AttributeDescription
[]An array containing forecasted reward information
[0].dateThe date associated with the forecasted values
[0].totalAn array that groups rewards by unit
[0].total.unitBreakdown of rewards generated for each unit
[0].total.quantityAn array containing minted assets resulting from the stake