[][src]Trait sc_rpc::author::AuthorApi

pub trait AuthorApi<Hash, BlockHash>: 'static + Send + Sync {
    type Metadata: PubSubMetadata;
    fn submit_extrinsic(
        &self,
        extrinsic: Bytes
    ) -> Box<dyn Future<Error = Error, Item = Hash> + 'static + Send>;
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>, Error>;
fn remove_extrinsic(
        &self,
        bytes_or_hash: Vec<ExtrinsicOrHash<Hash>>
    ) -> Result<Vec<Hash>, Error>;
fn watch_extrinsic(
        &self,
        metadata: Self::Metadata,
        subscriber: Subscriber<TransactionStatus<Hash, BlockHash>, Error>,
        bytes: Bytes
    );
fn unwatch_extrinsic(
        &self,
        metadata: Option<Self::Metadata>,
        id: SubscriptionId
    ) -> Result<bool, Error>; fn to_delegate(self) -> IoDelegate<Self, Self::Metadata>
    where
        BlockHash: Send + Sync + 'static + Serialize,
        Hash: Send + Sync + 'static + Serialize + DeserializeOwned
, { ... } }

Substrate authoring RPC API

Associated Types

type Metadata: PubSubMetadata

RPC metadata

Loading content...

Required methods

fn submit_extrinsic(
    &self,
    extrinsic: Bytes
) -> Box<dyn Future<Error = Error, Item = Hash> + 'static + Send>

Submit hex-encoded extrinsic for inclusion in block.

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

Insert a key into the keystore.

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

Generate new session keys and returns the corresponding public keys.

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.

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.

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

Returns all pending extrinsics, potentially grouped by sender.

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

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>, Error>,
    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, Error>

Unsubscribe from extrinsic watching.

Loading content...

Provided methods

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

Create an IoDelegate, wiring rpc calls to the trait methods.

Loading content...

Implementors

impl<P, Client> AuthorApi<<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, Error = ClientError>, 
[src]

type Metadata = Metadata

Loading content...