pub trait PoolsApiServer<PoolId, TrancheId, Balance, Currency, BalanceRatio, BlockHash, MaxTranches>: Sized + Send + Sync + 'staticwhere
    MaxTranches: Get<u32>,{
    // Required methods
    fn currency(
        &self,
        poold_id: PoolId,
        at: Option<BlockHash>
    ) -> RpcResult<Currency>;
    fn inspect_epoch_solution(
        &self,
        pool_id: PoolId,
        solution: Vec<TrancheSolution>,
        at: Option<BlockHash>
    ) -> RpcResult<EpochSolution<Balance, MaxTranches>>;
    fn tranche_token_price(
        &self,
        pool_id: PoolId,
        tranche: TrancheId,
        at: Option<BlockHash>
    ) -> RpcResult<BalanceRatio>;
    fn tranche_token_prices(
        &self,
        pool_id: PoolId,
        at: Option<BlockHash>
    ) -> RpcResult<Vec<BalanceRatio>>;
    fn tranche_ids(
        &self,
        pool_id: PoolId,
        at: Option<BlockHash>
    ) -> RpcResult<Vec<TrancheId>>;
    fn tranche_id(
        &self,
        pool_id: PoolId,
        tranche_index: TrancheIndex,
        at: Option<BlockHash>
    ) -> RpcResult<TrancheId>;
    fn tranche_currency(
        &self,
        pool_id: PoolId,
        tranche_id: TrancheId,
        at: Option<BlockHash>
    ) -> RpcResult<Currency>;

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

Server trait implementation for the PoolsApi RPC API.

Required Methods§

source

fn currency( &self, poold_id: PoolId, at: Option<BlockHash> ) -> RpcResult<Currency>

source

fn inspect_epoch_solution( &self, pool_id: PoolId, solution: Vec<TrancheSolution>, at: Option<BlockHash> ) -> RpcResult<EpochSolution<Balance, MaxTranches>>

source

fn tranche_token_price( &self, pool_id: PoolId, tranche: TrancheId, at: Option<BlockHash> ) -> RpcResult<BalanceRatio>

source

fn tranche_token_prices( &self, pool_id: PoolId, at: Option<BlockHash> ) -> RpcResult<Vec<BalanceRatio>>

source

fn tranche_ids( &self, pool_id: PoolId, at: Option<BlockHash> ) -> RpcResult<Vec<TrancheId>>

source

fn tranche_id( &self, pool_id: PoolId, tranche_index: TrancheIndex, at: Option<BlockHash> ) -> RpcResult<TrancheId>

source

fn tranche_currency( &self, pool_id: PoolId, tranche_id: TrancheId, at: Option<BlockHash> ) -> RpcResult<Currency>

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where PoolId: Send + Sync + 'static + DeserializeOwned, TrancheId: Send + Sync + 'static + DeserializeOwned + Serialize, Balance: Send + Sync + 'static + Serialize, Currency: Send + Sync + 'static + Serialize, BalanceRatio: Send + Sync + 'static + Serialize, BlockHash: Send + Sync + 'static + DeserializeOwned, MaxTranches: Send + Sync + 'static + Serialize + Get<u32>,

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

Implementors§

source§

impl<C, Block, PoolId, TrancheId, Balance, Currency, BalanceRatio, MaxTranches> PoolsApiServer<PoolId, TrancheId, Balance, Currency, BalanceRatio, <Block as Block>::Hash, MaxTranches> for Pools<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: PoolsRuntimeApi<Block, PoolId, TrancheId, Balance, Currency, BalanceRatio, MaxTranches>, Balance: Codec + Copy, PoolId: Codec + Copy + Debug, TrancheId: Codec + Clone + Debug, Currency: Codec, BalanceRatio: Codec, MaxTranches: Codec + Get<u32>,