Scorum
blockchain_history_api.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <fc/api.hpp>
8 
9 #ifndef API_BLOCKCHAIN_HISTORY
10 #define API_BLOCKCHAIN_HISTORY "blockchain_history_api"
11 #endif
12 
13 namespace scorum {
14 namespace app {
15 struct api_context;
16 }
17 } // namespace scorum
18 
19 namespace scorum {
20 namespace blockchain_history {
21 
22 using namespace scorum::protocol;
23 
24 namespace detail {
25 class blockchain_history_api_impl;
26 }
27 
38 {
39 public:
42 
43  void on_api_startup();
44 
48 
55  std::map<uint32_t, applied_operation>
56  get_ops_history(uint32_t from_op, uint32_t limit, applied_operation_type type_of_operation) const;
57 
65  std::map<uint32_t, applied_operation> get_ops_history_by_time(const fc::time_point_sec& from,
66  const fc::time_point_sec& to,
67  uint32_t from_op,
68  uint32_t limit) const;
69 
75  std::map<uint32_t, applied_operation> get_ops_in_block(uint32_t block_num,
76  applied_operation_type type_of_operation) const;
77 
83  annotated_signed_transaction get_transaction(transaction_id_type trx_id) const;
84 
90  optional<block_header> get_block_header(uint32_t block_num) const;
91 
98  std::map<uint32_t, block_header> get_block_headers_history(uint32_t block_num, uint32_t limit) const;
99 
105  optional<signed_block_api_obj> get_block(uint32_t block_num) const;
106 
113  std::map<uint32_t, signed_block_api_obj> get_blocks_history(uint32_t block_num, uint32_t limit) const;
114 
121  std::vector<block_api_object> get_blocks(uint32_t from, uint32_t limit) const;
123 
124 private:
125  std::unique_ptr<detail::blockchain_history_api_impl> _impl;
126 };
127 
128 } // namespace blockchain_history
129 } // namespace scorum
130 
132  (get_ops_history)(get_ops_history_by_time)(get_ops_in_block)
133  // Blocks and transactions
134  (get_transaction)(get_block_header)(get_block_headers_history)(get_block)(get_blocks_history)(get_blocks))
fc::ripemd160 transaction_id_type
Definition: types.hpp:65
Definition: asset.cpp:15