pub trait StakingRewardsApiServer<BlockHash, Balance>: Sized + Send + Sync + 'static {
    // Required methods
    fn yearly_emission<'life0, 'async_trait>(
        &'life0 self,
        total_staked: Balance,
        total_issuance: Balance,
        at: Option<BlockHash>
    ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn max_yearly_emission<'life0, 'async_trait>(
        &'life0 self,
        at: Option<BlockHash>
    ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where BlockHash: Send + Sync + 'static + DeserializeOwned,
             Balance: Send + Sync + 'static + DeserializeOwned + Serialize { ... }
}
Expand description

Server trait implementation for the StakingRewardsApi RPC API.

Required Methods§

source

fn yearly_emission<'life0, 'async_trait>( &'life0 self, total_staked: Balance, total_issuance: Balance, at: Option<BlockHash> ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Emission reward 1 year from now given the currently staked funds and issuance. Depends on the reward curve, decay percentage and remaining emission supply.

source

fn max_yearly_emission<'life0, 'async_trait>( &'life0 self, at: Option<BlockHash> ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Maximum emission reward for 1 year from now. Depends on decay percentage and remaining emission supply.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where BlockHash: Send + Sync + 'static + DeserializeOwned, Balance: Send + Sync + 'static + DeserializeOwned + Serialize,

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Implementors§

source§

impl<C, Block, Balance> StakingRewardsApiServer<<Block as Block>::Hash, Balance> for StakingRewards<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: StakingRewardsRuntimeApi<Block, Balance>, Balance: Codec + MaybeDisplay + MaybeFromStr + Send + 'static,