Trait sc_rpc_api::author::AuthorApi
source · [−]pub trait AuthorApi<Hash, BlockHash>: Sized + Send + Sync + 'static {
type Metadata: PubSubMetadata;
fn submit_extrinsic(&self, extrinsic: Bytes) -> FutureResult<Hash>;
fn insert_key(
&self,
key_type: String,
suri: String,
public: Bytes
) -> Result<()>;
fn rotate_keys(&self) -> Result<Bytes>;
fn has_session_keys(&self, session_keys: Bytes) -> Result<bool>;
fn has_key(&self, public_key: Bytes, key_type: String) -> Result<bool>;
fn pending_extrinsics(&self) -> Result<Vec<Bytes>>;
fn remove_extrinsic(
&self,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>
) -> Result<Vec<Hash>>;
fn watch_extrinsic(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<TransactionStatus<Hash, BlockHash>>,
bytes: Bytes
);
fn unwatch_extrinsic(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool>;
fn to_delegate(self) -> IoDelegate<Self, Self::Metadata>
where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
BlockHash: Send + Sync + 'static + Serialize,
{ ... }
}
Expand description
Substrate authoring RPC API
Associated Types
type Metadata: PubSubMetadata
type Metadata: PubSubMetadata
RPC metadata
Required methods
fn submit_extrinsic(&self, extrinsic: Bytes) -> FutureResult<Hash>
fn submit_extrinsic(&self, extrinsic: Bytes) -> FutureResult<Hash>
Submit hex-encoded extrinsic for inclusion in block.
Insert a key into the keystore.
fn rotate_keys(&self) -> Result<Bytes>
fn rotate_keys(&self) -> Result<Bytes>
Generate new session keys and returns the corresponding public keys.
fn has_session_keys(&self, session_keys: Bytes) -> Result<bool>
fn has_session_keys(&self, session_keys: Bytes) -> Result<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.
Checks if the keystore has private keys for the given public key and key type.
Returns true
if a private key could be found.
fn pending_extrinsics(&self) -> Result<Vec<Bytes>>
fn pending_extrinsics(&self) -> Result<Vec<Bytes>>
Returns all pending extrinsics, potentially grouped by sender.
fn remove_extrinsic(
&self,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>
) -> Result<Vec<Hash>>
fn remove_extrinsic(
&self,
bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>
) -> Result<Vec<Hash>>
Remove given extrinsic from the pool and temporarily ban it to prevent reimporting.
fn watch_extrinsic(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<TransactionStatus<Hash, BlockHash>>,
bytes: Bytes
)
fn watch_extrinsic(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<TransactionStatus<Hash, BlockHash>>,
bytes: Bytes
)
Submit an extrinsic to watch.
See TransactionStatus
for details on transaction
life cycle.
fn unwatch_extrinsic(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool>
fn unwatch_extrinsic(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool>
Unsubscribe from extrinsic watching.
Provided methods
fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
BlockHash: Send + Sync + 'static + Serialize,
fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
BlockHash: Send + Sync + 'static + Serialize,
Create an IoDelegate
, wiring rpc calls to the trait methods.