pub trait DEXAPI<Block: BlockT, AssetId, DEXId, Balance, LiquiditySourceType, SwapVariant>: Core<Block>where
    AssetId: Codec,
    DEXId: Codec,
    LiquiditySourceType: Codec,
    Balance: Codec + MaybeFromStr + MaybeDisplay,
    SwapVariant: Codec,{
    // Provided methods
    fn quote(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        dex_id: DEXId,
        liquidity_source_type: LiquiditySourceType,
        input_asset_id: AssetId,
        output_asset_id: AssetId,
        amount: BalanceWrapper,
        swap_variant: SwapVariant
    ) -> Result<Option<SwapOutcomeInfo<Balance>>, ApiError> { ... }
    fn quote_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        dex_id: DEXId,
        liquidity_source_type: LiquiditySourceType,
        input_asset_id: AssetId,
        output_asset_id: AssetId,
        amount: BalanceWrapper,
        swap_variant: SwapVariant
    ) -> Result<Option<SwapOutcomeInfo<Balance>>, ApiError> { ... }
    fn can_exchange(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        dex_id: DEXId,
        liquidity_source_type: LiquiditySourceType,
        input_asset_id: AssetId,
        output_asset_id: AssetId
    ) -> Result<bool, ApiError> { ... }
    fn can_exchange_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext,
        dex_id: DEXId,
        liquidity_source_type: LiquiditySourceType,
        input_asset_id: AssetId,
        output_asset_id: AssetId
    ) -> Result<bool, ApiError> { ... }
    fn list_supported_sources(
        &self,
        __runtime_api_at_param__: &BlockId<Block>
    ) -> Result<Vec<LiquiditySourceType>, ApiError> { ... }
    fn list_supported_sources_with_context(
        &self,
        __runtime_api_at_param__: &BlockId<Block>,
        context: ExecutionContext
    ) -> Result<Vec<LiquiditySourceType>, ApiError> { ... }
}

Provided Methods§

source

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

source

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

source

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

source

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

source

fn list_supported_sources( &self, __runtime_api_at_param__: &BlockId<Block> ) -> Result<Vec<LiquiditySourceType>, ApiError>

source

fn list_supported_sources_with_context( &self, __runtime_api_at_param__: &BlockId<Block>, context: ExecutionContext ) -> Result<Vec<LiquiditySourceType>, ApiError>

Trait Implementations§

source§

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

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§