pub trait MultiAssetIdConverter<MultiAssetId, AssetId> {
    // Required methods
    fn get_native() -> MultiAssetId;
    fn is_native(asset: &MultiAssetId) -> bool;
    fn try_convert(
        asset: &MultiAssetId
    ) -> MultiAssetIdConversionResult<MultiAssetId, AssetId>;
}
Expand description

A trait that converts between a MultiAssetId and either the native currency or an AssetId.

Required Methods§

source

fn get_native() -> MultiAssetId

Returns the MultiAssetId representing the native currency of the chain.

source

fn is_native(asset: &MultiAssetId) -> bool

Returns true if the given MultiAssetId is the native currency.

source

fn try_convert( asset: &MultiAssetId ) -> MultiAssetIdConversionResult<MultiAssetId, AssetId>

If it’s not native, returns the AssetId for the given MultiAssetId.

Implementors§

source§

impl<AssetId: Ord + Clone> MultiAssetIdConverter<NativeOrAssetId<AssetId>, AssetId> for NativeOrAssetIdConverter<AssetId>