pub fn convert_from_wrapped(wrapped_id: CurrencyId, wrapped_amount: Balance) -> BalanceResult {
		let underlying_asset = wrapped_id
			.underlying_asset()
			.ok_or(Error::<T>::NotValidWrappedTokenId)?;
		let exchange_rate = Self::get_exchange_rate(underlying_asset)?;

		let underlying_amount = Rate::from_inner(wrapped_amount)
			.checked_mul(&exchange_rate)
			.map(|x| x.into_inner())
			.ok_or(Error::<T>::ConversionError)?;

		Ok(underlying_amount)
	}
/// Converts a specified number of wrapped tokens into underlying assets.
/// The calculation is based on the exchange rate.
///
/// - `wrapped_id`: CurrencyId of the wrapped tokens to be converted to underlying assets.
/// - `wrapped_amount`: The amount of wrapped tokens to be converted to underlying assets.
///
/// Returns `underlying_amount = wrapped_amount * exchange_rate`
Converts a specified number of wrapped tokens into underlying assets.
The calculation is based on the exchange rate.

`wrapped_id`: CurrencyId of the wrapped tokens to be converted to underlying assets.
`wrapped_amount`: The amount of wrapped tokens to be converted to underlying assets.


Converts a specified number of wrapped tokens into underlying assets . The calculation is based on the exchange rate . ` wrapped_id ` : CurrencyId of the wrapped tokens to be converted to underlying assets . ` wrapped_amount ` : The amount of wrapped tokens to be converted to underlying assets .
pub fn convert_from_wrapped(wrapped_id: CurrencyId, wrapped_amount: Balance) -> BalanceResult {
		let underlying_asset = wrapped_id
			.underlying_asset()
			.ok_or(Error::<T>::NotValidWrappedTokenId)?;
		let exchange_rate = Self::get_exchange_rate(underlying_asset)?;
		let underlying_amount = Rate::from_inner(wrapped_amount)
			.checked_mul(&exchange_rate)
			.map(|x| x.into_inner())
			.ok_or(Error::<T>::ConversionError)?;
		Ok(underlying_amount)
	}
pub fn convert_from_wrapped ( wrapped_id : CurrencyId , wrapped_amount : Balance ) -> BalanceResult { let underlying_asset = wrapped_id . underlying_asset ( ) . ok_or ( Error :: < T > :: NotValidWrappedTokenId ) ? ; let exchange_rate = Self :: get_exchange_rate ( underlying_asset ) ? ; let underlying_amount = Rate :: from_inner ( wrapped_amount ) . checked_mul ( & exchange_rate ) . map ( | x | x . into_inner ( ) ) . ok_or ( Error :: < T > :: ConversionError ) ? ; Ok ( underlying_amount ) }
Converts a specified number of wrapped tokens into underlying assets.
Converts a specified number of wrapped tokens into underlying assets .
wrapped_id
CurrencyId
wrapped_amount
Balance
wrapped_id
CurrencyId
wrapped_amount
Balance