Trait common::prelude::PriceToolsPallet
source · 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§
sourcefn get_average_price(
input_asset_id: &AssetId,
output_asset_id: &AssetId,
price_variant: PriceVariant
) -> Result<Balance, DispatchError>
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.
sourcefn register_asset(asset_id: &AssetId) -> DispatchResult
fn register_asset(asset_id: &AssetId) -> DispatchResult
Add asset to be tracked for average price.