pub trait Inspect<AccountId> {
type AssetId: AssetId;
type Balance: Balance;
fn total_issuance(asset: Self::AssetId) -> Self::Balance;
fn minimum_balance(asset: Self::AssetId) -> Self::Balance;
fn balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance;
fn reducible_balance(
asset: Self::AssetId,
who: &AccountId,
keep_alive: bool
) -> Self::Balance;
fn can_deposit(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> DepositConsequence;
fn can_withdraw(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>;
}
Expand description
Trait for providing balance-inspection access to a set of named fungible assets.
Associated Types
Required methods
fn total_issuance(asset: Self::AssetId) -> Self::Balance
fn total_issuance(asset: Self::AssetId) -> Self::Balance
The total amount of issuance in the system.
fn minimum_balance(asset: Self::AssetId) -> Self::Balance
fn minimum_balance(asset: Self::AssetId) -> Self::Balance
The minimum balance any single account may have.
Get the asset
balance of who
.
Get the maximum amount of asset
that who
can withdraw/transfer successfully.
fn can_deposit(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> DepositConsequence
fn can_deposit(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> DepositConsequence
Returns true
if the asset
balance of who
may be increased by amount
.
fn can_withdraw(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
fn can_withdraw(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
Returns Failed
if the asset
balance of who
may not be decreased by amount
, otherwise
the consequence.