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>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_key(
&self,
ext: &Extensions,
key_type: String,
suri: String,
public: Bytes,
) -> Result<(), Error>;
fn rotate_keys(&self, ext: &Extensions) -> Result<Bytes, Error>;
fn rotate_keys_with_owner(
&self,
ext: &Extensions,
owner: Bytes,
) -> Result<GeneratedSessionKeys, Error>;
fn has_session_keys(
&self,
ext: &Extensions,
session_keys: Bytes,
) -> Result<bool, Error>;
fn has_key(
&self,
ext: &Extensions,
public_key: Bytes,
key_type: String,
) -> Result<bool, Error>;
fn pending_extrinsics(&self) -> Result<Vec<Bytes>, Error>;
fn remove_extrinsic<'life0, 'life1, 'async_trait>(
&'life0 self,
ext: &'life1 Extensions,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hash>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn watch_extrinsic(
&self,
subscription_sink: PendingSubscriptionSink,
bytes: Bytes,
);
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where Hash: Send + Sync + 'static + DeserializeOwned + Clone + 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 = Result<Hash, Error>> + 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 = Result<Hash, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit hex-encoded extrinsic for inclusion in block.
Sourcefn insert_key(
&self,
ext: &Extensions,
key_type: String,
suri: String,
public: Bytes,
) -> Result<(), Error>
fn insert_key( &self, ext: &Extensions, key_type: String, suri: String, public: Bytes, ) -> Result<(), Error>
Insert a key into the keystore.
Sourcefn rotate_keys(&self, ext: &Extensions) -> Result<Bytes, Error>
fn rotate_keys(&self, ext: &Extensions) -> Result<Bytes, Error>
Generate new session keys and returns the corresponding public keys.
Sourcefn rotate_keys_with_owner(
&self,
ext: &Extensions,
owner: Bytes,
) -> Result<GeneratedSessionKeys, Error>
fn rotate_keys_with_owner( &self, ext: &Extensions, owner: Bytes, ) -> Result<GeneratedSessionKeys, Error>
Generate new session keys and returns the corresponding public keys.
The owner should be something that can be used on chain for verifying the ownership of the
generated keys using the returned proof. For example, owner could be set to the account
id of the account registering the returned public session keys. The actual data to pass for
owner depends on the runtime logic verifying the proof.
Sourcefn has_session_keys(
&self,
ext: &Extensions,
session_keys: Bytes,
) -> Result<bool, Error>
fn has_session_keys( &self, ext: &Extensions, 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.
Sourcefn has_key(
&self,
ext: &Extensions,
public_key: Bytes,
key_type: String,
) -> Result<bool, Error>
fn has_key( &self, ext: &Extensions, 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.
Sourcefn pending_extrinsics(&self) -> Result<Vec<Bytes>, Error>
fn pending_extrinsics(&self) -> Result<Vec<Bytes>, Error>
Returns all pending extrinsics, potentially grouped by sender.
Sourcefn remove_extrinsic<'life0, 'life1, 'async_trait>(
&'life0 self,
ext: &'life1 Extensions,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hash>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_extrinsic<'life0, 'life1, 'async_trait>(
&'life0 self,
ext: &'life1 Extensions,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Hash>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove given extrinsic from the pool and temporarily ban it to prevent reimporting.
Sourcefn watch_extrinsic(
&self,
subscription_sink: PendingSubscriptionSink,
bytes: Bytes,
)
fn watch_extrinsic( &self, subscription_sink: PendingSubscriptionSink, bytes: Bytes, )
Submit an extrinsic to watch.
See TransactionStatus for details on
transaction life cycle.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.