pub trait StakingRewardsApi<Block: BlockT, Balance>: Core<Block>where
Balance: Codec + MaybeDisplay + MaybeFromStr,{
// Provided methods
fn yearly_emission(
&self,
__runtime_api_at_param__: &BlockId<Block>,
total_staked: Balance,
total_issuance: Balance
) -> Result<Balance, ApiError> { ... }
fn yearly_emission_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
total_staked: Balance,
total_issuance: Balance
) -> Result<Balance, ApiError> { ... }
fn max_yearly_emission(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<Balance, ApiError> { ... }
fn max_yearly_emission_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Balance, ApiError> { ... }
}
Provided Methods§
sourcefn yearly_emission(
&self,
__runtime_api_at_param__: &BlockId<Block>,
total_staked: Balance,
total_issuance: Balance
) -> Result<Balance, ApiError>
fn yearly_emission( &self, __runtime_api_at_param__: &BlockId<Block>, total_staked: Balance, total_issuance: Balance ) -> Result<Balance, ApiError>
Get emission rewards for the whole year given total staked tokens and total issuance. Depends on the reward curve, decay percentage and remaining emission supply.
sourcefn yearly_emission_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
total_staked: Balance,
total_issuance: Balance
) -> Result<Balance, ApiError>
fn yearly_emission_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext, total_staked: Balance, total_issuance: Balance ) -> Result<Balance, ApiError>
Get emission rewards for the whole year given total staked tokens and total issuance. Depends on the reward curve, decay percentage and remaining emission supply.
sourcefn max_yearly_emission(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<Balance, ApiError>
fn max_yearly_emission( &self, __runtime_api_at_param__: &BlockId<Block> ) -> Result<Balance, ApiError>
Get max emission rewards for the whole year and depends on decay percentage and remaining emission supply.
sourcefn max_yearly_emission_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<Balance, ApiError>
fn max_yearly_emission_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext ) -> Result<Balance, ApiError>
Get max emission rewards for the whole year and depends on decay percentage and remaining emission supply.