Kagome
Polkadot Runtime Engine in C++17
kagome::api::AuthorApi Class Referenceabstract

#include <author_api.hpp>

Inheritance diagram for kagome::api::AuthorApi:
Collaboration diagram for kagome::api::AuthorApi:

Public Member Functions

virtual ~AuthorApi ()=default
 
virtual void setApiService (std::shared_ptr< api::ApiService > const &api_service)=0
 
virtual outcome::result< common::Hash256submitExtrinsic (TransactionSource source, const Extrinsic &extrinsic)=0
 validates and sends extrinsic to transaction pool More...
 
virtual outcome::result< void > insertKey (crypto::KeyTypeId key_type, const gsl::span< const uint8_t > &seed, const gsl::span< const uint8_t > &public_key)=0
 insert an anonimous key pair into the keystore More...
 
virtual outcome::result< common::BufferrotateKeys ()=0
 Generate new session keys and returns the corresponding public keys. More...
 
virtual outcome::result< bool > hasSessionKeys (const gsl::span< const uint8_t > &keys)=0
 checks if the keystore has private keys for the given session public keys More...
 
virtual outcome::result< bool > hasKey (const gsl::span< const uint8_t > &public_key, crypto::KeyTypeId key_type)=0
 checks if the keystore has private keys for the given public key and key type More...
 
virtual outcome::result< std::vector< Extrinsic > > pendingExtrinsics ()=0
 
virtual outcome::result< std::vector< Extrinsic > > removeExtrinsic (const std::vector< ExtrinsicKey > &keys)=0
 
virtual outcome::result< SubscriptionIdsubmitAndWatchExtrinsic (Extrinsic extrinsic)=0
 
virtual outcome::result< bool > unwatchExtrinsic (SubscriptionId sub_id)=0
 

Protected Types

using Hash256 = common::Hash256
 
using Buffer = common::Buffer
 
using Extrinsic = primitives::Extrinsic
 
using Metadata = primitives::Metadata
 
using SubscriptionId = primitives::SubscriptionId
 
using ExtrinsicKey = primitives::ExtrinsicKey
 
using TransactionSource = primitives::TransactionSource
 

Detailed Description

Definition at line 24 of file author_api.hpp.

Member Typedef Documentation

Definition at line 27 of file author_api.hpp.

Definition at line 28 of file author_api.hpp.

Definition at line 31 of file author_api.hpp.

Definition at line 26 of file author_api.hpp.

Definition at line 29 of file author_api.hpp.

Constructor & Destructor Documentation

virtual kagome::api::AuthorApi::~AuthorApi ( )
virtualdefault

Member Function Documentation

virtual outcome::result<bool> kagome::api::AuthorApi::hasKey ( const gsl::span< const uint8_t > &  public_key,
crypto::KeyTypeId  key_type 
)
pure virtual

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

Parameters
public_keyThe public key in binary
key_typeThe key type

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<bool> kagome::api::AuthorApi::hasSessionKeys ( const gsl::span< const uint8_t > &  keys)
pure virtual

checks if the keystore has private keys for the given session public keys

Parameters
keysSCALE encoded concatenated keys
Returns
returns true if all private keys could be found, false if otherwise

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<void> kagome::api::AuthorApi::insertKey ( crypto::KeyTypeId  key_type,
const gsl::span< const uint8_t > &  seed,
const gsl::span< const uint8_t > &  public_key 
)
pure virtual

insert an anonimous key pair into the keystore

Parameters
key_typeKey type
seedThe seed (suri) in binary
public_keyThe public key in binary

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<std::vector<Extrinsic> > kagome::api::AuthorApi::pendingExtrinsics ( )
pure virtual
Returns
collection of pending extrinsics

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<std::vector<Extrinsic> > kagome::api::AuthorApi::removeExtrinsic ( const std::vector< ExtrinsicKey > &  keys)
pure virtual

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

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<common::Buffer> kagome::api::AuthorApi::rotateKeys ( )
pure virtual

Generate new session keys and returns the corresponding public keys.

Returns
The SCALE encoded, concatenated keys

Implemented in kagome::api::AuthorApiImpl.

virtual void kagome::api::AuthorApi::setApiService ( std::shared_ptr< api::ApiService > const &  api_service)
pure virtual
virtual outcome::result<SubscriptionId> kagome::api::AuthorApi::submitAndWatchExtrinsic ( Extrinsic  extrinsic)
pure virtual

Submit an extrinsic and watch.

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<common::Hash256> kagome::api::AuthorApi::submitExtrinsic ( TransactionSource  source,
const Extrinsic extrinsic 
)
pure virtual

validates and sends extrinsic to transaction pool

Parameters
sourcehow extrinsic was received (for example external or submitted through offchain worker)
extrinsicset of bytes representing either transaction or inherent
Returns
hash of successfully validated extrinsic or error if state is invalid or unknown

Implemented in kagome::api::AuthorApiImpl.

virtual outcome::result<bool> kagome::api::AuthorApi::unwatchExtrinsic ( SubscriptionId  sub_id)
pure virtual

Unsubscribe from extrinsic watching.

See also
AuthorApi::submitAndWatchExtrinsic
Returns
true if the subscriber was unsubscribed, false if there was no subscriber.

Implemented in kagome::api::AuthorApiImpl.


The documentation for this class was generated from the following file: