Trait sc_rpc_api::author::AuthorApiServer
source · 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 = RpcResult<Hash>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_key(
&self,
key_type: String,
suri: String,
public: Bytes
) -> RpcResult<()>;
fn rotate_keys(&self) -> RpcResult<Bytes>;
fn has_session_keys(&self, session_keys: Bytes) -> RpcResult<bool>;
fn has_key(&self, public_key: Bytes, key_type: String) -> RpcResult<bool>;
fn pending_extrinsics(&self) -> RpcResult<Vec<Bytes>>;
fn remove_extrinsic(
&self,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>
) -> RpcResult<Vec<Hash>>;
fn watch_extrinsic(
&self,
subscription_sink: SubscriptionSink,
bytes: Bytes
) -> SubscriptionResult;
// 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§
sourcefn submit_extrinsic<'life0, 'async_trait>(
&'life0 self,
extrinsic: Bytes
) -> Pin<Box<dyn Future<Output = RpcResult<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_extrinsic<'life0, 'async_trait>( &'life0 self, extrinsic: Bytes ) -> Pin<Box<dyn Future<Output = RpcResult<Hash>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Submit hex-encoded extrinsic for inclusion in block.
sourcefn insert_key(
&self,
key_type: String,
suri: String,
public: Bytes
) -> RpcResult<()>
fn insert_key( &self, key_type: String, suri: String, public: Bytes ) -> RpcResult<()>
Insert a key into the keystore.
sourcefn rotate_keys(&self) -> RpcResult<Bytes>
fn rotate_keys(&self) -> RpcResult<Bytes>
Generate new session keys and returns the corresponding public keys.
sourcefn has_session_keys(&self, session_keys: Bytes) -> RpcResult<bool>
fn has_session_keys(&self, session_keys: Bytes) -> RpcResult<bool>
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.
sourcefn has_key(&self, public_key: Bytes, key_type: String) -> RpcResult<bool>
fn has_key(&self, public_key: Bytes, key_type: String) -> RpcResult<bool>
Checks if the keystore has private keys for the given public key and key type.
Returns true
if a private key could be found.
sourcefn pending_extrinsics(&self) -> RpcResult<Vec<Bytes>>
fn pending_extrinsics(&self) -> RpcResult<Vec<Bytes>>
Returns all pending extrinsics, potentially grouped by sender.
sourcefn remove_extrinsic(
&self,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>
) -> RpcResult<Vec<Hash>>
fn remove_extrinsic( &self, bytes_or_hash: Vec<ExtrinsicOrHash<Hash>> ) -> RpcResult<Vec<Hash>>
Remove given extrinsic from the pool and temporarily ban it to prevent reimporting.
sourcefn watch_extrinsic(
&self,
subscription_sink: SubscriptionSink,
bytes: Bytes
) -> SubscriptionResult
fn watch_extrinsic( &self, subscription_sink: SubscriptionSink, bytes: Bytes ) -> SubscriptionResult
Submit an extrinsic to watch.
See TransactionStatus
for details on
transaction life cycle.