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> { ... }
}
The identifier of the runtime api.
The version of the runtime api.