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

pub trait AuthorApi<Hash, BlockHash>: 'static + Send + Sync {
    type Metadata: PubSubMetadata;
    pub fn submit_extrinsic(
        &self,
        extrinsic: Bytes
    ) -> Box<dyn Future<Error = Error, Item = Hash> + 'static + Send, Global>;
pub fn insert_key(
        &self,
        key_type: String,
        suri: String,
        public: Bytes
    ) -> Result<(), Error>;
pub fn rotate_keys(&self) -> Result<Bytes, Error>;
pub fn has_session_keys(&self, session_keys: Bytes) -> Result<bool, Error>;
pub fn has_key(
        &self,
        public_key: Bytes,
        key_type: String
    ) -> Result<bool, Error>;
pub fn pending_extrinsics(&self) -> Result<Vec<Bytes, Global>, Error>;
pub fn remove_extrinsic(
        &self,
        bytes_or_hash: Vec<ExtrinsicOrHash<Hash>, Global>
    ) -> Result<Vec<Hash, Global>, Error>;
pub fn watch_extrinsic(
        &self,
        metadata: Self::Metadata,
        subscriber: Subscriber<TransactionStatus<Hash, BlockHash>, Error>,
        bytes: Bytes
    );
pub fn unwatch_extrinsic(
        &self,
        metadata: Option<Self::Metadata>,
        id: SubscriptionId
    ) -> Result<bool, Error>; pub fn to_delegate(self) -> IoDelegate<Self, Self::Metadata>
    where
        Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
        BlockHash: Send + Sync + 'static + Serialize
, { ... } }

Substrate authoring RPC API

Associated Types

type Metadata: PubSubMetadata[src]

RPC metadata

Loading content...

Required methods

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

Submit hex-encoded extrinsic for inclusion in block.

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

Insert a key into the keystore.

pub fn rotate_keys(&self) -> Result<Bytes, Error>[src]

Generate new session keys and returns the corresponding public keys.

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

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.

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

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

Returns true if a private key could be found.

pub fn pending_extrinsics(&self) -> Result<Vec<Bytes, Global>, Error>[src]

Returns all pending extrinsics, potentially grouped by sender.

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

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

pub fn watch_extrinsic(
    &self,
    metadata: Self::Metadata,
    subscriber: Subscriber<TransactionStatus<Hash, BlockHash>, Error>,
    bytes: Bytes
)
[src]

Submit an extrinsic to watch.

See TransactionStatus for details on transaction life cycle.

pub fn unwatch_extrinsic(
    &self,
    metadata: Option<Self::Metadata>,
    id: SubscriptionId
) -> Result<bool, Error>
[src]

Unsubscribe from extrinsic watching.

Loading content...

Provided methods

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

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...