diff --git a/docs b/docs index 94ec061b..71ed2984 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 94ec061b91edbe9d1ebae576e641f921998428c8 +Subproject commit 71ed2984b71d57cab13cdf12074cff150edc1d3d diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index 6a7a2d15..014b7385 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -445,7 +445,17 @@ namespace graphene { namespace app { } return result; } - vector history_api::get_market_history( asset_id_type a, asset_id_type b, uint32_t bucket_seconds, fc::time_point_sec start, fc::time_point_sec end )const + + + flat_set history_api::get_market_history_buckets()const + { + auto hist = _app.get_plugin( "market_history" ); + FC_ASSERT( hist ); + return hist->tracked_buckets(); + } + + vector history_api::get_market_history( asset_id_type a, asset_id_type b, + uint32_t bucket_seconds, fc::time_point_sec start, fc::time_point_sec end )const { try { FC_ASSERT(_app.chain_database()); const auto& db = *_app.chain_database(); diff --git a/libraries/app/include/graphene/app/api.hpp b/libraries/app/include/graphene/app/api.hpp index b6a7efbe..21fbc2e7 100644 --- a/libraries/app/include/graphene/app/api.hpp +++ b/libraries/app/include/graphene/app/api.hpp @@ -258,25 +258,27 @@ namespace graphene { namespace app { */ class history_api { - public: - history_api(application& app):_app(app){} + public: + history_api(application& app):_app(app){} - /** - * @brief Get operations relevant to the specificed account - * @param account The account whose history should be queried - * @param stop ID of the earliest operation to retrieve - * @param limit Maximum number of operations to retrieve (must not exceed 100) - * @param start ID of the most recent operation to retrieve - * @return A list of operations performed by account, ordered from most recent to oldest. - */ - vector get_account_history(account_id_type account, - operation_history_id_type stop = operation_history_id_type(), - int limit = 100, - operation_history_id_type start = operation_history_id_type())const; + /** + * @brief Get operations relevant to the specificed account + * @param account The account whose history should be queried + * @param stop ID of the earliest operation to retrieve + * @param limit Maximum number of operations to retrieve (must not exceed 100) + * @param start ID of the most recent operation to retrieve + * @return A list of operations performed by account, ordered from most recent to oldest. + */ + vector get_account_history(account_id_type account, + operation_history_id_type stop = operation_history_id_type(), + int limit = 100, + operation_history_id_type start = operation_history_id_type())const; - vector get_market_history( asset_id_type a, asset_id_type b, uint32_t bucket_seconds, fc::time_point_sec start, fc::time_point_sec end )const; - private: - application& _app; + vector get_market_history( asset_id_type a, asset_id_type b, uint32_t bucket_seconds, + fc::time_point_sec start, fc::time_point_sec end )const; + flat_set get_market_history_buckets()const; + private: + application& _app; }; /** @@ -377,7 +379,7 @@ FC_API(graphene::app::database_api, (get_transaction_hex) (get_proposed_transactions) ) -FC_API(graphene::app::history_api, (get_account_history)(get_market_history)) +FC_API(graphene::app::history_api, (get_account_history)(get_market_history)(get_market_history_buckets)) FC_API(graphene::app::network_api, (broadcast_transaction)(add_node)(get_connected_peers)) FC_API(graphene::app::login_api, (login) diff --git a/libraries/fc b/libraries/fc index 701b9ac0..c09035db 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 701b9ac00c46234ee7cc6385027f5942590debc9 +Subproject commit c09035dba0cdab7fcb2c11bf81aaeaffaa981f66 diff --git a/libraries/plugins/market_history/include/graphene/market_history/market_history_plugin.hpp b/libraries/plugins/market_history/include/graphene/market_history/market_history_plugin.hpp index 1453ca6c..79484194 100644 --- a/libraries/plugins/market_history/include/graphene/market_history/market_history_plugin.hpp +++ b/libraries/plugins/market_history/include/graphene/market_history/market_history_plugin.hpp @@ -117,8 +117,7 @@ class market_history_plugin : public graphene::app::plugin const boost::program_options::variables_map& options) override; virtual void plugin_startup() override; - vector get_history( const bucket_key& start, const bucket_key& end )const; - const flat_set& tracked_buckets()const; + const flat_set& tracked_buckets()const; private: friend class detail::market_history_plugin_impl;