pub fn convert_to_wrapped(underlying_asset: CurrencyId, underlying_amount: Balance) -> BalanceResult {
		let exchange_rate = Self::get_exchange_rate(underlying_asset)?;

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

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

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