pub trait PoAApiServer<BlockHash, AccountId, Balance>: Sized + Send + Sync + 'static {
    // Required methods
    fn treasury_account<'life0, 'async_trait>(
        &'life0 self,
        at: Option<BlockHash>
    ) -> Pin<Box<dyn Future<Output = RpcResult<AccountId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn treasury_balance<'life0, 'async_trait>(
        &'life0 self,
        at: Option<BlockHash>
    ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

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

Server trait implementation for the PoAApi RPC API.

Required Methods§

source

fn treasury_account<'life0, 'async_trait>( &'life0 self, at: Option<BlockHash> ) -> Pin<Box<dyn Future<Output = RpcResult<AccountId>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return account address of treasury. The account address can then be used to query the chain for balance

source

fn treasury_balance<'life0, 'async_trait>( &'life0 self, at: Option<BlockHash> ) -> Pin<Box<dyn Future<Output = RpcResult<Balance>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return free balance of treasury account. In the context of PoA, only free balance makes sense for treasury. But just in case, to check all kinds of balance (locked, reserved, etc), get the account address with above call and query the chain.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where BlockHash: Send + Sync + 'static + DeserializeOwned, AccountId: Send + Sync + 'static + Serialize, Balance: 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, Balance> PoAApiServer<<Block as Block>::Hash, AccountId, Balance> for PoA<C, Block>where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: PoARuntimeApi<Block, AccountId, Balance>, AccountId: Codec + MaybeDisplay + MaybeFromStr, Balance: Codec + MaybeDisplay + MaybeFromStr,