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§

source

type Id: Encode + TypeInfo + 'static

An identifier for a freeze.

Required Methods§

source

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.

source

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§

source

fn balance_freezable(asset: Self::AssetId, who: &AccountId) -> Self::Balance

The amount of the balance which can become frozen. Defaults to total_balance().

Implementors§