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§
sourcefn 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 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.
sourcefn 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,
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§
sourcefn into_rpc(self) -> RpcModule<Self>where
BlockHash: Send + Sync + 'static + DeserializeOwned,
Balance: Send + Sync + 'static + DeserializeOwned + Serialize,
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
.