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§

source

fn list_currencies( &self, domain: RewardDomain, account_id: AccountId, at: Option<BlockHash> ) -> RpcResult<Vec<CurrencyId>>

source

fn compute_reward( &self, domain: RewardDomain, currency_id: CurrencyId, account_id: AccountId, at: Option<BlockHash> ) -> RpcResult<Balance>

Provided Methods§

source

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.

Implementors§

source§

impl<C, Block, AccountId, Balance, CurrencyId> RewardsApiServer<AccountId, Balance, CurrencyId, <Block as Block>::Hash> for Rewards<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: RewardsRuntimeApi<Block, AccountId, Balance, CurrencyId>, AccountId: Codec, Balance: Codec + Copy, CurrencyId: Codec + Copy + Debug,