pub trait AssetsAPIServer<BlockHash, AccountId, AssetId, Balance, OptionBalanceInfo, OptionAssetInfo, VecAssetInfo, VecAssetId>: Sized + Send + Sync + 'static {
    // Required methods
    fn free_balance(
        &self,
        account_id: AccountId,
        asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<OptionBalanceInfo>;
    fn usable_balance(
        &self,
        account_id: AccountId,
        asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<OptionBalanceInfo>;
    fn total_balance(
        &self,
        account_id: AccountId,
        asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<OptionBalanceInfo>;
    fn total_supply(
        &self,
        asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<OptionBalanceInfo>;
    fn list_asset_ids(&self, at: Option<BlockHash>) -> Result<VecAssetId>;
    fn list_asset_infos(&self, at: Option<BlockHash>) -> Result<VecAssetInfo>;
    fn get_asset_info(
        &self,
        asset_id: AssetId,
        at: Option<BlockHash>
    ) -> Result<OptionAssetInfo>;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where BlockHash: Send + Sync + 'static + DeserializeOwned,
             AccountId: Send + Sync + 'static + DeserializeOwned,
             AssetId: Send + Sync + 'static + DeserializeOwned,
             Balance: Send + Sync + 'static,
             OptionBalanceInfo: Send + Sync + 'static + Serialize,
             OptionAssetInfo: Send + Sync + 'static + Serialize,
             VecAssetInfo: Send + Sync + 'static + Serialize,
             VecAssetId: Send + Sync + 'static + Serialize { ... }
}
Expand description

Server trait implementation for the AssetsAPI RPC API.

Required Methods§

source

fn free_balance( &self, account_id: AccountId, asset_id: AssetId, at: Option<BlockHash> ) -> Result<OptionBalanceInfo>

source

fn usable_balance( &self, account_id: AccountId, asset_id: AssetId, at: Option<BlockHash> ) -> Result<OptionBalanceInfo>

source

fn total_balance( &self, account_id: AccountId, asset_id: AssetId, at: Option<BlockHash> ) -> Result<OptionBalanceInfo>

source

fn total_supply( &self, asset_id: AssetId, at: Option<BlockHash> ) -> Result<OptionBalanceInfo>

source

fn list_asset_ids(&self, at: Option<BlockHash>) -> Result<VecAssetId>

source

fn list_asset_infos(&self, at: Option<BlockHash>) -> Result<VecAssetInfo>

source

fn get_asset_info( &self, asset_id: AssetId, at: Option<BlockHash> ) -> Result<OptionAssetInfo>

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where BlockHash: Send + Sync + 'static + DeserializeOwned, AccountId: Send + Sync + 'static + DeserializeOwned, AssetId: Send + Sync + 'static + DeserializeOwned, Balance: Send + Sync + 'static, OptionBalanceInfo: Send + Sync + 'static + Serialize, OptionAssetInfo: Send + Sync + 'static + Serialize, VecAssetInfo: Send + Sync + 'static + Serialize, VecAssetId: Send + Sync + 'static + Serialize,

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Implementors§

source§

impl<C, Block, AccountId, AssetId, Balance, AssetSymbol, AssetName, Precision, ContentSource, Description> AssetsAPIServer<<Block as Block>::Hash, AccountId, AssetId, Balance, Option<BalanceInfo<Balance>>, Option<AssetInfo<AssetId, AssetSymbol, AssetName, Precision, ContentSource, Description>>, Vec<AssetInfo<AssetId, AssetSymbol, AssetName, Precision, ContentSource, Description>, Global>, Vec<AssetId, Global>> for AssetsClient<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: AssetsRuntimeAPI<Block, AccountId, AssetId, Balance, AssetSymbol, AssetName, Precision, ContentSource, Description>, AccountId: Codec, AssetId: Codec, Balance: Codec + MaybeFromStr + MaybeDisplay, AssetSymbol: Codec + MaybeFromStr + MaybeDisplay + IsValid, AssetName: Codec + MaybeFromStr + MaybeDisplay + IsValid, Precision: Codec + MaybeFromStr + MaybeDisplay, ContentSource: Codec + MaybeFromStr + MaybeDisplay + IsValid, Description: Codec + MaybeFromStr + MaybeDisplay + IsValid,