pub trait AssetInfoProvider<AssetId, AccountId, AssetSymbol, AssetName, BalancePrecision, ContentSource, Description> {
    // Required methods
    fn asset_exists(asset_id: &AssetId) -> bool;
    fn ensure_asset_exists(asset_id: &AssetId) -> DispatchResult;
    fn is_asset_owner(asset_id: &AssetId, account_id: &AccountId) -> bool;
    fn get_asset_info(
        asset_id: &AssetId
    ) -> (AssetSymbol, AssetName, BalancePrecision, bool, Option<ContentSource>, Option<Description>);
    fn is_non_divisible(asset_id: &AssetId) -> bool;
    fn get_asset_content_src(asset_id: &AssetId) -> Option<ContentSource>;
    fn get_asset_description(asset_id: &AssetId) -> Option<Description>;
    fn total_issuance(asset_id: &AssetId) -> Result<Balance, DispatchError>;
    fn total_balance(
        asset_id: &AssetId,
        who: &AccountId
    ) -> Result<Balance, DispatchError>;
    fn free_balance(
        asset_id: &AssetId,
        who: &AccountId
    ) -> Result<Balance, DispatchError>;
    fn ensure_can_withdraw(
        asset_id: &AssetId,
        who: &AccountId,
        amount: Balance
    ) -> DispatchResult;
}
Expand description

Trait to provide info about assets

Required Methods§

source

fn asset_exists(asset_id: &AssetId) -> bool

source

fn ensure_asset_exists(asset_id: &AssetId) -> DispatchResult

source

fn is_asset_owner(asset_id: &AssetId, account_id: &AccountId) -> bool

source

fn get_asset_info( asset_id: &AssetId ) -> (AssetSymbol, AssetName, BalancePrecision, bool, Option<ContentSource>, Option<Description>)

source

fn is_non_divisible(asset_id: &AssetId) -> bool

source

fn get_asset_content_src(asset_id: &AssetId) -> Option<ContentSource>

source

fn get_asset_description(asset_id: &AssetId) -> Option<Description>

source

fn total_issuance(asset_id: &AssetId) -> Result<Balance, DispatchError>

source

fn total_balance( asset_id: &AssetId, who: &AccountId ) -> Result<Balance, DispatchError>

source

fn free_balance( asset_id: &AssetId, who: &AccountId ) -> Result<Balance, DispatchError>

source

fn ensure_can_withdraw( asset_id: &AssetId, who: &AccountId, amount: Balance ) -> DispatchResult

Implementations on Foreign Types§

source§

impl<AssetId, AccountId, AssetSymbol, AssetName, BalancePrecision, ContentSource, Description> AssetInfoProvider<AssetId, AccountId, AssetSymbol, AssetName, BalancePrecision, ContentSource, Description> for ()

source§

fn asset_exists(_asset_id: &AssetId) -> bool

source§

fn ensure_asset_exists(_asset_id: &AssetId) -> DispatchResult

source§

fn is_asset_owner(_asset_id: &AssetId, _account_id: &AccountId) -> bool

source§

fn get_asset_info( _asset_id: &AssetId ) -> (AssetSymbol, AssetName, BalancePrecision, bool, Option<ContentSource>, Option<Description>)

source§

fn is_non_divisible(_asset_id: &AssetId) -> bool

source§

fn get_asset_content_src(_asset_id: &AssetId) -> Option<ContentSource>

source§

fn get_asset_description(_asset_id: &AssetId) -> Option<Description>

source§

fn total_balance( _asset_id: &AssetId, _who: &AccountId ) -> Result<Balance, DispatchError>

source§

fn total_issuance(_asset_id: &AssetId) -> Result<Balance, DispatchError>

source§

fn free_balance( _asset_id: &AssetId, _who: &AccountId ) -> Result<Balance, DispatchError>

source§

fn ensure_can_withdraw( _asset_id: &AssetId, _who: &AccountId, _amount: Balance ) -> DispatchResult

Implementors§