pub trait DexGeneralApi<Block: BlockT, AccountId, AssetId>: Core<Block>where
    AccountId: Codec,
    AssetBalance: Codec,
    AssetId: Codec,{
    // Provided methods
    fn get_pair_by_asset_id(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        asset_0: AssetId,
        asset_1: AssetId
    ) -> Result<Option<PairInfo<AccountId, AssetBalance, AssetId>>, ApiError> { ... }
    fn get_amount_in_price(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        supply: AssetBalance,
        path: Vec<AssetId>
    ) -> Result<AssetBalance, ApiError> { ... }
    fn get_amount_out_price(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        supply: AssetBalance,
        path: Vec<AssetId>
    ) -> Result<AssetBalance, ApiError> { ... }
    fn get_estimate_lptoken(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        asset_0: AssetId,
        asset_1: AssetId,
        amount_0_desired: AssetBalance,
        amount_1_desired: AssetBalance,
        amount_0_min: AssetBalance,
        amount_1_min: AssetBalance
    ) -> Result<AssetBalance, ApiError> { ... }
    fn calculate_remove_liquidity(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        asset_0: AssetId,
        asset_1: AssetId,
        amount: AssetBalance
    ) -> Result<Option<(AssetBalance, AssetBalance)>, ApiError> { ... }
}

Provided Methods§

source

fn get_pair_by_asset_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, asset_0: AssetId, asset_1: AssetId ) -> Result<Option<PairInfo<AccountId, AssetBalance, AssetId>>, ApiError>

source

fn get_amount_in_price( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, supply: AssetBalance, path: Vec<AssetId> ) -> Result<AssetBalance, ApiError>

source

fn get_amount_out_price( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, supply: AssetBalance, path: Vec<AssetId> ) -> Result<AssetBalance, ApiError>

source

fn get_estimate_lptoken( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, asset_0: AssetId, asset_1: AssetId, amount_0_desired: AssetBalance, amount_1_desired: AssetBalance, amount_0_min: AssetBalance, amount_1_min: AssetBalance ) -> Result<AssetBalance, ApiError>

source

fn calculate_remove_liquidity( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, asset_0: AssetId, asset_1: AssetId, amount: AssetBalance ) -> Result<Option<(AssetBalance, AssetBalance)>, ApiError>

Trait Implementations§

source§

impl<Block: BlockT, AccountId, AssetId> RuntimeApiInfo for dyn DexGeneralApi<Block, AccountId, AssetId>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§