[−][src]Trait eq_balances::BalanceGetter
Balances reading interface
Associated Types
type PriceGetter: PriceGetter
Required methods
fn get_balance(who: &AccountId, currency: &Currency) -> SignedBalance<Balance>
fn get_total_collateral_value() -> FixedI64
Gets total USD value of positive currency balances
fn get_total_debt_value() -> FixedI64
Gets total USD value of of negative currency balances
fn iterate_balances(
) -> BTreeMap<AccountId, Vec<(Currency, SignedBalance<Balance>)>>
) -> BTreeMap<AccountId, Vec<(Currency, SignedBalance<Balance>)>>
Used for iteration over whole balances storage. DO NOT USE IN RUNTIME, only for offchain workers
fn iterate_account_balances(
account: &AccountId
) -> Vec<(Currency, SignedBalance<Balance>)>
account: &AccountId
) -> Vec<(Currency, SignedBalance<Balance>)>
Used to iterate over each currency balance of account
Provided methods
fn get_debt_and_colaterall(who: &AccountId) -> (FixedI128, FixedI128)
Gets total value of account's debt and collateral in USD
Implementors
impl<T: Trait> BalanceGetter<<T as Trait>::AccountId, <T as Trait>::Balance> for Module<T>
[src]
type PriceGetter = T::PriceGetter
fn get_balance(
who: &T::AccountId,
currency: &Currency
) -> SignedBalance<T::Balance>
[src]
who: &T::AccountId,
currency: &Currency
) -> SignedBalance<T::Balance>
fn get_total_collateral_value() -> FixedI64
[src]
fn iterate_balances(
) -> BTreeMap<T::AccountId, Vec<(Currency, SignedBalance<T::Balance>)>>
[src]
) -> BTreeMap<T::AccountId, Vec<(Currency, SignedBalance<T::Balance>)>>
fn iterate_account_balances(
account: &T::AccountId
) -> Vec<(Currency, SignedBalance<T::Balance>)>
[src]
account: &T::AccountId
) -> Vec<(Currency, SignedBalance<T::Balance>)>