Kagome
Polkadot Runtime Engine in C++17
chain.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_API_SYSTEM_REQUEST_CHAIN
7 #define KAGOME_API_SYSTEM_REQUEST_CHAIN
8 
9 #include <jsonrpc-lean/request.h>
10 
11 #include "outcome/outcome.hpp"
12 
13 namespace kagome::api {
14  class SystemApi;
15 }
16 
18 
24  class Chain final {
25  public:
26  Chain(const Chain &) = delete;
27  Chain &operator=(const Chain &) = delete;
28 
29  Chain(Chain &&) = default;
30  Chain &operator=(Chain &&) = default;
31 
32  explicit Chain(std::shared_ptr<SystemApi> api);
33  ~Chain() = default;
34 
35  outcome::result<void> init(const jsonrpc::Request::Parameters &params);
36 
37  outcome::result<std::string> execute();
38 
39  private:
40  std::shared_ptr<SystemApi> api_;
41  };
42 
43 } // namespace kagome::api::system::request
44 
45 #endif // KAGOME_API_SYSTEM_REQUEST_CHAIN
outcome::result< void > init(const jsonrpc::Request::Parameters &params)
Definition: chain.cpp:18
Chain & operator=(const Chain &)=delete
outcome::result< std::string > execute()
Definition: chain.cpp:26
Get the chain&#39;s type. Given as a string identifier.
Definition: chain.hpp:24
std::shared_ptr< SystemApi > api_
Definition: chain.hpp:40