Trait centrifuge_chain::rpc::pools::PoolsApiServer
source · 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§
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 Methods§
sourcefn 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>,
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
.