1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use frame_support::dispatch::DispatchError;
use sp_runtime::FixedPointNumber;

use crate::Config;

pub use sp_runtime::Rounding;

pub type CurrencyId<T> = <T as orml_tokens::Config>::CurrencyId;

pub(crate) type BalanceOf<T> = <T as Config>::Balance;

pub(crate) type SignedFixedPoint<T> = <T as Config>::SignedFixedPoint;

pub(crate) type UnsignedFixedPoint<T> = <T as Config>::UnsignedFixedPoint;

pub(crate) type SignedInner<T> = <T as Config>::SignedInner;

pub(crate) type UnsignedInner<T> = <<T as Config>::UnsignedFixedPoint as FixedPointNumber>::Inner;

pub trait CurrencyConversion<Amount, CurrencyId> {
    fn convert(amount: &Amount, to: CurrencyId) -> Result<Amount, DispatchError>;
}