Trait assets_rpc::AssetsAPIServer
source · 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§
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 Methods§
sourcefn 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,
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
.