pub trait LiquidityProxyAPI<Block: BlockT, DEXId, AssetId, Balance, SwapVariant, LiquiditySourceType, FilterMode>: Core<Block>where
    DEXId: Codec,
    AssetId: Codec + MaybeFromStr + MaybeDisplay,
    Balance: Codec + MaybeFromStr + MaybeDisplay,
    SwapVariant: Codec,
    LiquiditySourceType: Codec,
    FilterMode: Codec,{
    // Provided methods
    fn quote(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId,
        amount: BalanceWrapper,
        swap_variant: SwapVariant,
        selected_source_types: Vec<LiquiditySourceType>,
        filter_mode: FilterMode
    ) -> Result<Option<SwapOutcomeInfo<Balance, AssetId>>, ApiError> { ... }
    fn quote_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId,
        amount: BalanceWrapper,
        swap_variant: SwapVariant,
        selected_source_types: Vec<LiquiditySourceType>,
        filter_mode: FilterMode
    ) -> Result<Option<SwapOutcomeInfo<Balance, AssetId>>, ApiError> { ... }
    fn quote_before_version_2(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId,
        amount: BalanceWrapper,
        swap_variant: SwapVariant,
        selected_source_types: Vec<LiquiditySourceType>,
        filter_mode: FilterMode
    ) -> Result<Option<SwapOutcomeInfoV1<Balance, AssetId>>, ApiError> { ... }
    fn quote_before_version_2_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId,
        amount: BalanceWrapper,
        swap_variant: SwapVariant,
        selected_source_types: Vec<LiquiditySourceType>,
        filter_mode: FilterMode
    ) -> Result<Option<SwapOutcomeInfoV1<Balance, AssetId>>, ApiError> { ... }
    fn is_path_available(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId
    ) -> Result<bool, ApiError> { ... }
    fn is_path_available_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId
    ) -> Result<bool, ApiError> { ... }
    fn list_enabled_sources_for_path(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId
    ) -> Result<Vec<LiquiditySourceType>, ApiError> { ... }
    fn list_enabled_sources_for_path_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        dex_id: DEXId,
        input_asset_id: AssetId,
        output_asset_id: AssetId
    ) -> Result<Vec<LiquiditySourceType>, ApiError> { ... }
}

Provided Methods§

source

fn quote( &self, __runtime_api_at_param__: &BlockId<Block>, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId, amount: BalanceWrapper, swap_variant: SwapVariant, selected_source_types: Vec<LiquiditySourceType>, filter_mode: FilterMode ) -> Result<Option<SwapOutcomeInfo<Balance, AssetId>>, ApiError>

source

fn quote_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId, amount: BalanceWrapper, swap_variant: SwapVariant, selected_source_types: Vec<LiquiditySourceType>, filter_mode: FilterMode ) -> Result<Option<SwapOutcomeInfo<Balance, AssetId>>, ApiError>

source

fn quote_before_version_2( &self, __runtime_api_at_param__: &BlockId<Block>, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId, amount: BalanceWrapper, swap_variant: SwapVariant, selected_source_types: Vec<LiquiditySourceType>, filter_mode: FilterMode ) -> Result<Option<SwapOutcomeInfoV1<Balance, AssetId>>, ApiError>

👎Deprecated
source

fn quote_before_version_2_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId, amount: BalanceWrapper, swap_variant: SwapVariant, selected_source_types: Vec<LiquiditySourceType>, filter_mode: FilterMode ) -> Result<Option<SwapOutcomeInfoV1<Balance, AssetId>>, ApiError>

👎Deprecated
source

fn is_path_available( &self, __runtime_api_at_param__: &BlockId<Block>, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId ) -> Result<bool, ApiError>

source

fn is_path_available_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId ) -> Result<bool, ApiError>

source

fn list_enabled_sources_for_path( &self, __runtime_api_at_param__: &BlockId<Block>, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId ) -> Result<Vec<LiquiditySourceType>, ApiError>

source

fn list_enabled_sources_for_path_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext, dex_id: DEXId, input_asset_id: AssetId, output_asset_id: AssetId ) -> Result<Vec<LiquiditySourceType>, ApiError>

Trait Implementations§

source§

impl<Block: BlockT, DEXId, AssetId, Balance, SwapVariant, LiquiditySourceType, FilterMode> RuntimeApiInfo for dyn LiquidityProxyAPI<Block, DEXId, AssetId, Balance, SwapVariant, LiquiditySourceType, FilterMode>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 2u32

The version of the runtime api.

Implementors§