6 #ifndef KAGOME_API_SERVICE_STATE_API 7 #define KAGOME_API_SERVICE_STATE_API 26 const std::shared_ptr<api::ApiService> &api_service) = 0;
28 virtual outcome::result<common::Buffer>
call(
29 std::string_view method,
31 const std::optional<primitives::BlockHash> &opt_at)
const = 0;
33 virtual outcome::result<std::vector<common::Buffer>>
getKeysPaged(
34 const std::optional<common::BufferView> &prefix,
36 const std::optional<common::BufferView> &prev_key,
37 const std::optional<primitives::BlockHash> &block_hash_opt)
const = 0;
39 virtual outcome::result<std::optional<common::Buffer>>
getStorage(
41 virtual outcome::result<std::optional<common::Buffer>>
getStorageAt(
49 std::optional<common::Buffer>
data;
54 virtual outcome::result<std::vector<StorageChangeSet>>
queryStorage(
55 gsl::span<const common::Buffer> keys,
57 std::optional<primitives::BlockHash> to)
const = 0;
59 virtual outcome::result<std::vector<StorageChangeSet>>
queryStorageAt(
60 gsl::span<const common::Buffer> keys,
61 std::optional<primitives::BlockHash> at)
const = 0;
64 const std::vector<common::Buffer> &keys) = 0;
66 const std::vector<uint32_t> &subscription_id) = 0;
69 const std::optional<primitives::BlockHash> &at)
const = 0;
73 uint32_t subscription_id) = 0;
74 virtual outcome::result<std::string>
getMetadata() = 0;
77 std::string_view hex_block_hash) = 0;
82 #endif // KAGOME_API_SERVICE_STATE_API
virtual outcome::result< std::optional< common::Buffer > > getStorageAt(const common::BufferView &key, const primitives::BlockHash &at) const =0
Class represents arbitrary (including empty) byte buffer.
virtual outcome::result< common::Buffer > call(std::string_view method, common::Buffer data, const std::optional< primitives::BlockHash > &opt_at) const =0
virtual outcome::result< std::vector< StorageChangeSet > > queryStorage(gsl::span< const common::Buffer > keys, const primitives::BlockHash &from, std::optional< primitives::BlockHash > to) const =0
virtual outcome::result< std::optional< common::Buffer > > getStorage(const common::BufferView &key) const =0
primitives::BlockHash block
virtual outcome::result< std::vector< StorageChangeSet > > queryStorageAt(gsl::span< const common::Buffer > keys, std::optional< primitives::BlockHash > at) const =0
virtual ~StateApi()=default
std::vector< Change > changes
virtual outcome::result< std::vector< common::Buffer > > getKeysPaged(const std::optional< common::BufferView > &prefix, uint32_t keys_amount, const std::optional< common::BufferView > &prev_key, const std::optional< primitives::BlockHash > &block_hash_opt) const =0
virtual outcome::result< bool > unsubscribeStorage(const std::vector< uint32_t > &subscription_id)=0
std::optional< common::Buffer > data
virtual outcome::result< void > unsubscribeRuntimeVersion(uint32_t subscription_id)=0
virtual outcome::result< primitives::Version > getRuntimeVersion(const std::optional< primitives::BlockHash > &at) const =0
virtual void setApiService(const std::shared_ptr< api::ApiService > &api_service)=0
virtual outcome::result< uint32_t > subscribeStorage(const std::vector< common::Buffer > &keys)=0
virtual outcome::result< uint32_t > subscribeRuntimeVersion()=0
virtual outcome::result< std::string > getMetadata()=0