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§
sourcefn get_native() -> MultiAssetId
fn get_native() -> MultiAssetId
Returns the MultiAssetId representing the native currency of the chain.
sourcefn is_native(asset: &MultiAssetId) -> bool
fn is_native(asset: &MultiAssetId) -> bool
Returns true if the given MultiAssetId is the native currency.
sourcefn try_convert(
asset: &MultiAssetId
) -> MultiAssetIdConversionResult<MultiAssetId, AssetId>
fn try_convert( asset: &MultiAssetId ) -> MultiAssetIdConversionResult<MultiAssetId, AssetId>
If it’s not native, returns the AssetId for the given MultiAssetId.