pub trait Inspect<AccountId>: Inspect<AccountId> {
type Id: Encode + TypeInfo + 'static;
// Required methods
fn balance_frozen(
asset: Self::AssetId,
id: &Self::Id,
who: &AccountId,
) -> Self::Balance;
fn can_freeze(asset: Self::AssetId, id: &Self::Id, who: &AccountId) -> bool;
// Provided method
fn balance_freezable(asset: Self::AssetId, who: &AccountId) -> Self::Balance { ... }
}
Expand description
Trait for inspecting a fungible asset which can be frozen. Freezing is essentially setting a minimum balance below 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§
fn balance_frozen(
asset: Self::AssetId,
id: &Self::Id,
who: &AccountId,
) -> Self::Balance
fn balance_frozen( asset: Self::AssetId, id: &Self::Id, who: &AccountId, ) -> Self::Balance
Amount of funds held in reserve by who
for the given id
.
fn can_freeze(asset: Self::AssetId, id: &Self::Id, who: &AccountId) -> bool
fn can_freeze(asset: Self::AssetId, 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 freeze locks as there are possible values of id
.
Provided Methods§
fn balance_freezable(asset: Self::AssetId, who: &AccountId) -> Self::Balance
fn balance_freezable(asset: Self::AssetId, 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.