[][src]Trait eq_balances::BalanceGetter

pub trait BalanceGetter<AccountId, Balance> where
    Balance: Debug + Member + Into<u64>, 
{ type PriceGetter: PriceGetter; fn get_balance(
        who: &AccountId,
        currency: &Currency
    ) -> SignedBalance<Balance>;
fn get_total_collateral_value() -> FixedI64;
fn get_total_debt_value() -> FixedI64;
fn iterate_balances(
    ) -> BTreeMap<AccountId, Vec<(Currency, SignedBalance<Balance>)>>;
fn iterate_account_balances(
        account: &AccountId
    ) -> Vec<(Currency, SignedBalance<Balance>)>; fn get_debt_and_colaterall(who: &AccountId) -> (FixedI128, FixedI128) { ... } }

Balances reading interface

Associated Types

type PriceGetter: PriceGetter

Loading content...

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>)>>

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>)>

Used to iterate over each currency balance of account

Loading content...

Provided methods

fn get_debt_and_colaterall(who: &AccountId) -> (FixedI128, FixedI128)

Gets total value of account's debt and collateral in USD

Loading content...

Implementors

impl<T: Trait> BalanceGetter<<T as Trait>::AccountId, <T as Trait>::Balance> for Module<T>[src]

type PriceGetter = T::PriceGetter

Loading content...