Trait centrifuge_chain::rpc::rewards::RewardsApiServer
source · pub trait RewardsApiServer<AccountId, Balance, CurrencyId, BlockHash>: Sized + Send + Sync + 'static {
// Required methods
fn list_currencies(
&self,
domain: RewardDomain,
account_id: AccountId,
at: Option<BlockHash>
) -> RpcResult<Vec<CurrencyId>>;
fn compute_reward(
&self,
domain: RewardDomain,
currency_id: CurrencyId,
account_id: AccountId,
at: Option<BlockHash>
) -> RpcResult<Balance>;
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where AccountId: Send + Sync + 'static + DeserializeOwned,
Balance: Send + Sync + 'static + Serialize,
CurrencyId: Send + Sync + 'static + DeserializeOwned + Serialize,
BlockHash: Send + Sync + 'static + DeserializeOwned { ... }
}
Expand description
Server trait implementation for the RewardsApi
RPC API.
Required Methods§
fn list_currencies( &self, domain: RewardDomain, account_id: AccountId, at: Option<BlockHash> ) -> RpcResult<Vec<CurrencyId>>
fn compute_reward( &self, domain: RewardDomain, currency_id: CurrencyId, account_id: AccountId, at: Option<BlockHash> ) -> RpcResult<Balance>
Provided Methods§
sourcefn into_rpc(self) -> RpcModule<Self>where
AccountId: Send + Sync + 'static + DeserializeOwned,
Balance: Send + Sync + 'static + Serialize,
CurrencyId: Send + Sync + 'static + DeserializeOwned + Serialize,
BlockHash: Send + Sync + 'static + DeserializeOwned,
fn into_rpc(self) -> RpcModule<Self>where AccountId: Send + Sync + 'static + DeserializeOwned, Balance: Send + Sync + 'static + Serialize, CurrencyId: Send + Sync + 'static + DeserializeOwned + Serialize, BlockHash: Send + Sync + 'static + DeserializeOwned,
Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule
.