pub trait Inspect<AccountId> {
type Balance: Balance;
fn total_issuance() -> Self::Balance;
fn minimum_balance() -> Self::Balance;
fn balance(who: &AccountId) -> Self::Balance;
fn reducible_balance(who: &AccountId, keep_alive: bool) -> Self::Balance;
fn can_deposit(
who: &AccountId,
amount: Self::Balance,
mint: bool
) -> DepositConsequence;
fn can_withdraw(
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>;
}
Expand description
Trait for providing balance-inspection access to a fungible asset.
Required Associated Types§
Required Methods§
sourcefn total_issuance() -> Self::Balance
fn total_issuance() -> Self::Balance
The total amount of issuance in the system.
sourcefn minimum_balance() -> Self::Balance
fn minimum_balance() -> Self::Balance
The minimum balance any single account may have.
sourcefn reducible_balance(who: &AccountId, keep_alive: bool) -> Self::Balance
fn reducible_balance(who: &AccountId, keep_alive: bool) -> Self::Balance
Get the maximum amount that who
can withdraw/transfer successfully.
sourcefn can_deposit(
who: &AccountId,
amount: Self::Balance,
mint: bool
) -> DepositConsequence
fn can_deposit(
who: &AccountId,
amount: Self::Balance,
mint: bool
) -> DepositConsequence
Returns true
if the balance of who
may be increased by amount
.
who
: The account of which the balance should be increased byamount
.amount
: How much should the balance be increased?mint
: Willamount
be minted to deposit it intoaccount
?
sourcefn can_withdraw(
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
fn can_withdraw(
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
Returns Failed
if the balance of who
may not be decreased by amount
, otherwise
the consequence.