pub trait AuthorApiServer<Hash, BlockHash>: Sized + Send + Sync + 'static {
    // Required methods
    fn submit_extrinsic<'life0, 'async_trait>(
        &'life0 self,
        extrinsic: Bytes
    ) -> Pin<Box<dyn Future<Output = Result<Hash, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn insert_key(
        &self,
        key_type: String,
        suri: String,
        public: Bytes
    ) -> Result<(), Error>;
    fn rotate_keys(&self) -> Result<Bytes, Error>;
    fn has_session_keys(&self, session_keys: Bytes) -> Result<bool, Error>;
    fn has_key(&self, public_key: Bytes, key_type: String) -> Result<bool, Error>;
    fn pending_extrinsics(&self) -> Result<Vec<Bytes, Global>, Error>;
    fn remove_extrinsic(
        &self,
        bytes_or_hash: Vec<ExtrinsicOrHash<Hash>, Global>
    ) -> Result<Vec<Hash, Global>, Error>;
    fn watch_extrinsic(
        &self,
        subscription_sink: SubscriptionSink,
        bytes: Bytes
    ) -> Result<(), SubscriptionEmptyError>;

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

Server trait implementation for the AuthorApi RPC API.

Required Methods§

source

fn submit_extrinsic<'life0, 'async_trait>( &'life0 self, extrinsic: Bytes ) -> Pin<Box<dyn Future<Output = Result<Hash, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Submit hex-encoded extrinsic for inclusion in block.

source

fn insert_key( &self, key_type: String, suri: String, public: Bytes ) -> Result<(), Error>

Insert a key into the keystore.

source

fn rotate_keys(&self) -> Result<Bytes, Error>

Generate new session keys and returns the corresponding public keys.

source

fn has_session_keys(&self, session_keys: Bytes) -> Result<bool, Error>

Checks if the keystore has private keys for the given session public keys.

session_keys is the SCALE encoded session keys object from the runtime.

Returns true iff all private keys could be found.

source

fn has_key(&self, public_key: Bytes, key_type: String) -> Result<bool, Error>

Checks if the keystore has private keys for the given public key and key type.

Returns true if a private key could be found.

source

fn pending_extrinsics(&self) -> Result<Vec<Bytes, Global>, Error>

Returns all pending extrinsics, potentially grouped by sender.

source

fn remove_extrinsic( &self, bytes_or_hash: Vec<ExtrinsicOrHash<Hash>, Global> ) -> Result<Vec<Hash, Global>, Error>

Remove given extrinsic from the pool and temporarily ban it to prevent reimporting.

source

fn watch_extrinsic( &self, subscription_sink: SubscriptionSink, bytes: Bytes ) -> Result<(), SubscriptionEmptyError>

Submit an extrinsic to watch.

See TransactionStatus for details on transaction life cycle.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>where Hash: Send + Sync + 'static + DeserializeOwned + Serialize, BlockHash: Send + Sync + 'static + Serialize,

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

Implementors§

source§

impl<P, Client> AuthorApiServer<<P as TransactionPool>::Hash, <<P as TransactionPool>::Block as Block>::Hash> for Author<P, Client>where P: TransactionPool + Sync + Send + 'static, Client: HeaderBackend<P::Block> + ProvideRuntimeApi<P::Block> + Send + Sync + 'static, Client::Api: SessionKeys<P::Block>, P::Hash: Unpin, <P::Block as BlockT>::Hash: Unpin,