6 #ifndef KAGOME_API_CHAIN_API_HPP 7 #define KAGOME_API_CHAIN_API_HPP 9 #include <boost/variant.hpp> 28 using ValueType = boost::variant<BlockNumber, std::string>;
31 const std::shared_ptr<api::ApiService> &api_service) = 0;
36 virtual outcome::result<BlockHash>
getBlockHash()
const = 0;
50 std::string_view hex_number)
const = 0;
57 virtual outcome::result<std::vector<BlockHash>>
getBlockHash(
58 gsl::span<const ValueType> values)
const = 0;
63 virtual outcome::result<primitives::BlockHeader>
getHeader(
64 std::string_view hash) = 0;
69 virtual outcome::result<primitives::BlockHeader>
getHeader() = 0;
74 virtual outcome::result<primitives::BlockData>
getBlock(
75 std::string_view hash) = 0;
80 virtual outcome::result<primitives::BlockData>
getBlock() = 0;
98 uint32_t subscription_id) = 0;
110 uint32_t subscription_id) = 0;
115 #endif // KAGOME_API_CHAIN_API_HPP
virtual ~ChainApi()=default
virtual outcome::result< primitives::BlockData > getBlock()=0
virtual void setApiService(const std::shared_ptr< api::ApiService > &api_service)=0
virtual outcome::result< primitives::BlockHeader > getHeader()=0
primitives::BlockNumber BlockNumber
virtual outcome::result< uint32_t > subscribeFinalizedHeads()=0
virtual outcome::result< uint32_t > subscribeNewHeads()=0
virtual outcome::result< void > unsubscribeNewHeads(uint32_t subscription_id)=0
common::Hash256 BlockHash
virtual outcome::result< BlockHash > getBlockHash() const =0
virtual outcome::result< void > unsubscribeFinalizedHeads(uint32_t subscription_id)=0
virtual outcome::result< primitives::BlockHash > getFinalizedHead() const =0
boost::variant< BlockNumber, std::string > ValueType