pub trait PriceToolsPallet<AssetId> {
    // Required methods
    fn get_average_price(
        input_asset_id: &AssetId,
        output_asset_id: &AssetId,
        price_variant: PriceVariant
    ) -> Result<Balance, DispatchError>;
    fn register_asset(asset_id: &AssetId) -> DispatchResult;
}

Required Methods§

source

fn get_average_price( input_asset_id: &AssetId, output_asset_id: &AssetId, price_variant: PriceVariant ) -> Result<Balance, DispatchError>

Get amount of output_asset_id corresponding to a unit (1) of input_asset_id. price_variant specifies the correction for price, either for buy or sell.

source

fn register_asset(asset_id: &AssetId) -> DispatchResult

Add asset to be tracked for average price.

Implementations on Foreign Types§

source§

impl<AssetId> PriceToolsPallet<AssetId> for ()

source§

fn get_average_price( _: &AssetId, _: &AssetId, _: PriceVariant ) -> Result<Balance, DispatchError>

source§

fn register_asset(_: &AssetId) -> DispatchResult

Implementors§