Trait orml_traits::currency::MultiCurrencyExtended
source · pub trait MultiCurrencyExtended<AccountId>: MultiCurrency<AccountId> {
type Amount: Signed + TryInto<Self::Balance> + TryFrom<Self::Balance> + SimpleArithmetic + Codec + Copy + MaybeSerializeDeserialize + Debug + Default + TypeInfo + MaxEncodedLen;
fn update_balance(
currency_id: Self::CurrencyId,
who: &AccountId,
by_amount: Self::Amount
) -> DispatchResult;
}
Expand description
Extended MultiCurrency
with additional helper types and methods.
Required Associated Types§
sourcetype Amount: Signed + TryInto<Self::Balance> + TryFrom<Self::Balance> + SimpleArithmetic + Codec + Copy + MaybeSerializeDeserialize + Debug + Default + TypeInfo + MaxEncodedLen
type Amount: Signed + TryInto<Self::Balance> + TryFrom<Self::Balance> + SimpleArithmetic + Codec + Copy + MaybeSerializeDeserialize + Debug + Default + TypeInfo + MaxEncodedLen
The type for balance related operations, typically signed int.
Required Methods§
sourcefn update_balance(
currency_id: Self::CurrencyId,
who: &AccountId,
by_amount: Self::Amount
) -> DispatchResult
fn update_balance(
currency_id: Self::CurrencyId,
who: &AccountId,
by_amount: Self::Amount
) -> DispatchResult
Add or remove abs(by_amount
) from the balance of who
under
currency_id
. If positive by_amount
, do add, else do remove.