pub trait TradingPairAPIServer<BlockHash, DEXId, TradingPair, AssetId, LiquiditySourceType>: Sized + Send + Sync + 'static {
    // Required methods
    fn list_enabled_pairs(
        &self,
        dex_id: DEXId,
        at: Option<BlockHash>
    ) -> Result<Vec<TradingPair>>;
    fn is_pair_enabled(
        &self,
        dex_id: DEXId,
        base_asset_id: AssetId,
        target_asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<bool>;
    fn list_enabled_sources_for_pair(
        &self,
        dex_id: DEXId,
        base_asset_id: AssetId,
        target_asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<Vec<LiquiditySourceType>>;
    fn is_source_enabled_for_pair(
        &self,
        dex_id: DEXId,
        base_asset_id: AssetId,
        target_asset_id: AssetId,
        source_type: LiquiditySourceType,
        at: Option<BlockHash>
    ) -> Result<bool>;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where BlockHash: Send + Sync + 'static + DeserializeOwned,
             DEXId: Send + Sync + 'static + DeserializeOwned,
             TradingPair: Send + Sync + 'static + Serialize,
             AssetId: Send + Sync + 'static + DeserializeOwned,
             LiquiditySourceType: Send + Sync + 'static + DeserializeOwned + Serialize { ... }
}
Expand description

Server trait implementation for the TradingPairAPI RPC API.

Required Methods§

source

fn list_enabled_pairs( &self, dex_id: DEXId, at: Option<BlockHash> ) -> Result<Vec<TradingPair>>

source

fn is_pair_enabled( &self, dex_id: DEXId, base_asset_id: AssetId, target_asset_id: AssetId, at: Option<BlockHash> ) -> Result<bool>

source

fn list_enabled_sources_for_pair( &self, dex_id: DEXId, base_asset_id: AssetId, target_asset_id: AssetId, at: Option<BlockHash> ) -> Result<Vec<LiquiditySourceType>>

source

fn is_source_enabled_for_pair( &self, dex_id: DEXId, base_asset_id: AssetId, target_asset_id: AssetId, source_type: LiquiditySourceType, at: Option<BlockHash> ) -> Result<bool>

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where BlockHash: Send + Sync + 'static + DeserializeOwned, DEXId: Send + Sync + 'static + DeserializeOwned, TradingPair: Send + Sync + 'static + Serialize, AssetId: Send + Sync + 'static + DeserializeOwned, LiquiditySourceType: Send + Sync + 'static + DeserializeOwned + Serialize,

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

Implementors§

source§

impl<C, Block, DEXId, TradingPair, AssetId, LiquiditySourceType> TradingPairAPIServer<<Block as Block>::Hash, DEXId, TradingPair, AssetId, LiquiditySourceType> for TradingPairClient<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: TradingPairRuntimeAPI<Block, DEXId, TradingPair, AssetId, LiquiditySourceType>, DEXId: Codec, TradingPair: Codec, AssetId: Codec, LiquiditySourceType: Codec,