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§
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 Methods§
sourcefn 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,
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
.