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) -> Result<(), DispatchError>;
    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<u128, DispatchError>;
    fn total_balance(
        asset_id: &AssetId,
        who: &AccountId
    ) -> Result<u128, DispatchError>;
    fn free_balance(
        asset_id: &AssetId,
        who: &AccountId
    ) -> Result<u128, DispatchError>;
    fn ensure_can_withdraw(
        asset_id: &AssetId,
        who: &AccountId,
        amount: u128
    ) -> Result<(), DispatchError>;
}
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) -> Result<(), DispatchError>

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<u128, DispatchError>

source

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

source

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

source

fn ensure_can_withdraw( asset_id: &AssetId, who: &AccountId, amount: u128 ) -> Result<(), DispatchError>

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) -> Result<(), DispatchError>

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<u128, DispatchError>

source§

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

source§

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

source§

fn ensure_can_withdraw( _asset_id: &AssetId, _who: &AccountId, _amount: u128 ) -> Result<(), DispatchError>

source§

impl<T> AssetInfoProvider<<T as Config>::AssetId, <T as Config>::AccountId, AssetSymbol, AssetName, u8, ContentSource, Description> for Pallet<T>where T: Config,

source§

fn asset_exists(asset_id: &<T as Config>::AssetId) -> bool

source§

fn ensure_asset_exists( asset_id: &<T as Config>::AssetId ) -> Result<(), DispatchError>

source§

fn is_asset_owner( asset_id: &<T as Config>::AssetId, account_id: &<T as Config>::AccountId ) -> bool

source§

fn get_asset_info( asset_id: &<T as Config>::AssetId ) -> (AssetSymbol, AssetName, u8, bool, Option<ContentSource>, Option<Description>)

source§

fn is_non_divisible(asset_id: &<T as Config>::AssetId) -> bool

source§

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

source§

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

source§

fn total_issuance( asset_id: &<T as Config>::AssetId ) -> Result<u128, DispatchError>

source§

fn total_balance( asset_id: &<T as Config>::AssetId, who: &<T as Config>::AccountId ) -> Result<u128, DispatchError>

source§

fn free_balance( asset_id: &<T as Config>::AssetId, who: &<T as Config>::AccountId ) -> Result<u128, DispatchError>

source§

fn ensure_can_withdraw( asset_id: &<T as Config>::AssetId, who: &<T as Config>::AccountId, amount: u128 ) -> Result<(), DispatchError>

Implementors§