pub trait Inspect<AccountId>: Inspect<AccountId> {
type Id: Encode + TypeInfo + 'static;
// Required methods
fn balance_frozen(id: &Self::Id, who: &AccountId) -> Self::Balance;
fn can_freeze(id: &Self::Id, who: &AccountId) -> bool;
// Provided method
fn balance_freezable(who: &AccountId) -> Self::Balance { ... }
}
Expand description
Trait for inspecting a fungible asset which can be frozen. Freezing is essentially setting a minimum balance bellow which the total balance (inclusive of any funds placed on hold) may not be normally allowed to drop. Generally, freezers will provide an “update” function such that if the total balance does drop below the limit, then the freezer can update their housekeeping accordingly.
Required Associated Types§
Required Methods§
sourcefn balance_frozen(id: &Self::Id, who: &AccountId) -> Self::Balance
fn balance_frozen(id: &Self::Id, who: &AccountId) -> Self::Balance
Amount of funds frozen in reserve by who
for the given id
.
sourcefn can_freeze(id: &Self::Id, who: &AccountId) -> bool
fn can_freeze(id: &Self::Id, who: &AccountId) -> bool
Returns true
if it’s possible to introduce a freeze for the given id
onto the
account of who
. This will be true as long as the implementor supports as many
concurrent freezes as there are possible values of id
.
Provided Methods§
sourcefn balance_freezable(who: &AccountId) -> Self::Balance
fn balance_freezable(who: &AccountId) -> Self::Balance
The amount of the balance which can become frozen. Defaults to total_balance()
.
Object Safety§
This trait is not object safe.