58 if( !o_user && !o_password )
62 string user = *o_user;
67 if( acc->password_hash_b64 !=
"*" )
72 string password = *o_password;
74 if( hash_obj.
data_size() != acc_password_hash.length() )
76 if( memcmp( hash_obj.
data(), acc_password_hash.c_str(), hash_obj.
data_size() ) != 0 )
85 _allowed_apis = acc->allowed_apis;
94 _allowed_apis.clear();
105 bool is_allowed = !_allowed_apis.empty();
106 FC_ASSERT( is_allowed,
"Access denied, please login" );
112 return _allowed_apis;
117 bool is_allowed = ( _allowed_apis.find(
"database_api") != _allowed_apis.end() );
126 FC_ASSERT( block_num_to >= block_num_from );
127 vector<optional<signed_block>> res;
128 for(uint32_t block_num=block_num_from; block_num<=block_num_to; block_num++) {
136 _applied_block_connection = _app.
chain_database()->applied_block.connect(
142 if( _callbacks.size() )
145 auto capture_this = shared_from_this();
146 for( uint32_t trx_num = 0; trx_num < b.
transactions.size(); ++trx_num )
150 auto itr = _callbacks.find(
id);
151 if( itr != _callbacks.end() )
154 auto& callback = _callbacks.find(
id)->second;
167 FC_ASSERT( _app.
p2p_node() !=
nullptr,
"Not connected to P2P network, can't broadcast!" );
170 _app.
p2p_node()->broadcast_transaction(trx);
185 FC_ASSERT( _app.
p2p_node() !=
nullptr,
"Not connected to P2P network, can't broadcast!" );
193 FC_ASSERT( _app.
p2p_node() !=
nullptr,
"Not connected to P2P network, can't broadcast!" );
195 _callbacks[trx.id()] = cb;
197 _app.
p2p_node()->broadcast_transaction(trx);
209 result[
"connection_count"] = _app.
p2p_node()->get_connection_count();
222 return _app.
p2p_node()->get_connected_peers();
229 return _app.
p2p_node()->get_potential_peers();
236 return _app.
p2p_node()->get_advanced_node_parameters();
242 return _app.
p2p_node()->set_advanced_node_parameters(params);
247 bool is_allowed = ( _allowed_apis.find(
"network_broadcast_api") != _allowed_apis.end() );
248 FC_ASSERT( is_allowed,
"Access denied" );
249 if( !_network_broadcast_api )
251 _network_broadcast_api = std::make_shared< network_broadcast_api >( std::ref( _app ) );
253 return *_network_broadcast_api;
258 bool is_allowed = ( _allowed_apis.find(
"block_api") != _allowed_apis.end() );
259 FC_ASSERT( is_allowed,
"Access denied" );
262 _block_api = std::make_shared< block_api >( std::ref( *_app.
chain_database() ) );
269 bool is_allowed = ( _allowed_apis.find(
"network_node_api") != _allowed_apis.end() );
270 FC_ASSERT( is_allowed,
"Access denied" );
271 if( !_network_node_api )
273 _network_node_api = std::make_shared< network_node_api >( std::ref(_app) );
275 return *_network_node_api;
280 bool is_allowed = ( _allowed_apis.find(
"database_api") != _allowed_apis.end() );
281 FC_ASSERT( is_allowed,
"Access denied" );
284 _database_api = std::make_shared< database_api >( std::ref( *_app.
chain_database() ),
287 return *_database_api;
292 bool is_allowed = ( _allowed_apis.find(
"history_api") != _allowed_apis.end() );
293 FC_ASSERT( is_allowed,
"Access denied" );
296 _history_api = std::make_shared< history_api >( _app );
298 return *_history_api;
303 bool is_allowed = ( _allowed_apis.find(
"crypto_api") != _allowed_apis.end() );
304 FC_ASSERT( is_allowed,
"Access denied" );
307 _crypto_api = std::make_shared< crypto_api >();
314 bool is_allowed = ( _allowed_apis.find(
"asset_api") != _allowed_apis.end() );
315 FC_ASSERT( is_allowed,
"Access denied" );
318 _asset_api = std::make_shared< asset_api >( _app );
325 bool is_allowed = ( _allowed_apis.find(
"orders_api") != _allowed_apis.end() );
326 FC_ASSERT( is_allowed,
"Access denied" );
329 _orders_api = std::make_shared< orders_api >( std::ref( _app ) );
336 bool is_allowed = ( _allowed_apis.find(
"debug_api") != _allowed_apis.end() );
337 FC_ASSERT( is_allowed,
"Access denied" );
339 bool plugin_enabled = !!_app.
get_plugin(
"debug_witness" );
340 FC_ASSERT( plugin_enabled,
"The debug_witness plugin is not enabled" );
343 _debug_api = std::make_shared< graphene::debug_witness::debug_api >( std::ref(_app) );
350 bool is_allowed = ( _allowed_apis.find(
"custom_operations_api") != _allowed_apis.end() );
351 FC_ASSERT( is_allowed,
"Access denied" );
353 bool plugin_enabled = !!_app.
get_plugin(
"custom_operations" );
354 FC_ASSERT( plugin_enabled,
"The custom_operations plugin is not enabled" );
355 if( !_custom_operations_api )
357 _custom_operations_api = std::make_shared< custom_operations_api >( std::ref( _app ) );
359 return *_custom_operations_api;
366 _dummy_api = std::make_shared< dummy_api >();
377 const std::string& asset_b,
378 uint32_t limit )
const 381 FC_ASSERT( market_hist_plugin,
"Market history plugin is not enabled" );
387 if( a > b ) std::swap(a,b);
392 hkey.sequence = std::numeric_limits<int64_t>::min();
394 auto itr = history_idx.lower_bound( hkey );
395 vector<order_history_object> result;
396 while( itr != history_idx.end() && result.size() < limit )
398 if( itr->key.base != a || itr->key.quote != b )
break;
399 result.push_back( *itr );
407 operation_history_id_type stop,
409 operation_history_id_type start )
const 416 "limit can not be greater than ${configured_limit}",
417 (
"configured_limit", configured_limit) );
419 vector<operation_history_object> result;
420 if( start == operation_history_id_type() )
422 start = operation_history_id_type::max();
426 account_id_type account;
430 }
catch(...) {
return result; }
439 return es->get_account_history(account, stop, limit, start);
440 },
"thread invoke for method " BOOST_PP_STRINGIZE(method_name)).
wait();
445 auto itr = by_op_idx.lower_bound( boost::make_tuple( account, start ) );
446 auto itr_end = by_op_idx.lower_bound( boost::make_tuple( account, stop ) );
448 while( itr != itr_end && result.size() < limit )
450 result.emplace_back( itr->operation_id(db) );
454 if( 0 == stop.instance.value && result.size() < limit && itr != by_op_idx.end() )
456 const auto& obj = *itr;
457 if( obj.account == account )
458 result.emplace_back( obj.operation_id(db) );
465 const std::string& account_name_or_id,
466 const optional<uint32_t>& olimit,
467 const optional<fc::time_point_sec>& ostart )
const 473 uint32_t limit = olimit.valid() ? *olimit : configured_limit;
475 "limit can not be greater than ${configured_limit}",
476 (
"configured_limit", configured_limit) );
478 vector<operation_history_object> result;
479 account_id_type account;
488 auto op_hist_itr = op_hist_idx.lower_bound( start );
489 if( op_hist_itr == op_hist_idx.end() )
493 auto itr = acc_hist_idx.lower_bound( boost::make_tuple( account, op_hist_itr->get_id() ) );
494 auto itr_end = acc_hist_idx.upper_bound( account );
496 while( itr != itr_end && result.size() < limit )
498 result.emplace_back( itr->operation_id(db) );
506 const std::string& account_id_or_name,
507 int64_t operation_type,
508 operation_history_id_type start,
509 operation_history_id_type stop,
510 uint32_t limit )
const 517 "limit can not be greater than ${configured_limit}",
518 (
"configured_limit", configured_limit) );
520 vector<operation_history_object> result;
521 account_id_type account;
525 }
catch(...) {
return result; }
526 const auto& stats = account(db).statistics(db);
527 if( stats.most_recent_op == account_history_id_type() )
return result;
529 if( start == operation_history_id_type() )
532 while(node && node->
operation_id.instance.value > stop.instance.value && result.size() < limit)
534 if( node->
operation_id.instance.value <= start.instance.value ) {
539 if( node->
next == account_history_id_type() )
541 else node = &node->
next(db);
543 if( stop.instance.value == 0 && result.size() < limit ) {
544 const auto* head = db.find(account_history_id_type());
545 if (head !=
nullptr && head->account == account && head->operation_id(db).op.which() == operation_type)
546 result.push_back(head->operation_id(db));
555 uint64_t start )
const 562 "limit can not be greater than ${configured_limit}",
563 (
"configured_limit", configured_limit) );
565 vector<operation_history_object> result;
566 account_id_type account;
570 }
catch(...) {
return result; }
571 const auto& stats = account(db).statistics(db);
573 start = stats.total_ops;
575 start = std::min( stats.total_ops, start );
577 if( start >= stop && start > stats.removed_ops && limit > 0 )
580 const auto& by_seq_idx = hist_idx.
indices().get<by_seq>();
582 auto itr = by_seq_idx.upper_bound( boost::make_tuple( account, start ) );
583 auto itr_stop = by_seq_idx.lower_bound( boost::make_tuple( account, stop ) );
588 result.push_back( itr->operation_id(db) );
590 while ( itr != itr_stop && result.size() < limit );
597 const optional<uint16_t>& trx_in_block )
const 602 auto range = trx_in_block.valid() ? idx.equal_range( boost::make_tuple( block_num, *trx_in_block ) )
603 : idx.equal_range( block_num );
604 vector<operation_history_object> result;
605 std::copy( range.first, range.second, std::back_inserter( result ) );
610 const optional<fc::time_point_sec>& start )
const 615 auto itr = start.valid() ? idx.lower_bound( *start ) : idx.begin();
617 vector<operation_history_object> result;
618 if( itr == idx.end() )
621 auto itr_end = idx.upper_bound( itr->block_time );
623 std::copy( itr, itr_end, std::back_inserter( result ) );
631 FC_ASSERT( market_hist_plugin,
"Market history plugin is not enabled" );
632 return market_hist_plugin->tracked_buckets();
636 const std::string& account_id_or_name,
637 const flat_set<uint16_t>& operation_types,
638 uint32_t start, uint32_t limit )
const 642 "limit can not be greater than ${configured_limit}",
643 (
"configured_limit", configured_limit) );
650 if( operation_types.empty() )
656 if( operation_types.find(o.op.which()) != operation_types.end() ) {
666 uint32_t bucket_seconds,
672 FC_ASSERT( market_hist_plugin,
"Market history plugin is not enabled" );
679 vector<bucket_object> result;
681 result.reserve( configured_limit );
683 if( a > b ) std::swap(a,b);
686 const auto& by_key_idx = bidx.
indices().get<by_key>();
688 auto itr = by_key_idx.lower_bound(
bucket_key( a, b, bucket_seconds, start ) );
689 while( itr != by_key_idx.end() && itr->key.
open <= end && result.size() < configured_limit )
691 if( !(itr->key.base == a && itr->key.quote == b && itr->key.seconds == bucket_seconds) )
695 result.push_back(*itr);
701 static uint32_t validate_get_lp_history_params(
const application& _app,
const optional<uint32_t>& olimit )
706 uint32_t limit = olimit.valid() ? *olimit : configured_limit;
708 "limit can not be greater than ${configured_limit}",
709 (
"configured_limit", configured_limit) );
717 liquidity_pool_id_type pool_id,
718 const optional<fc::time_point_sec>& start,
719 const optional<fc::time_point_sec>& stop,
720 const optional<uint32_t>& olimit,
721 const optional<int64_t>& operation_type )
const 723 uint32_t limit = validate_get_lp_history_params( _app, olimit );
725 vector<liquidity_pool_history_object> result;
727 if( 0 == limit || ( start.valid() && stop.valid() && *start <= *stop ) )
734 if( operation_type.valid() )
736 const auto& idx = hist_idx.
indices().get<by_pool_op_type_time>();
737 auto itr = start.valid() ? idx.lower_bound( boost::make_tuple( pool_id, *operation_type, *start ) )
738 : idx.lower_bound( boost::make_tuple( pool_id, *operation_type ) );
739 auto itr_stop = stop.valid() ? idx.lower_bound( boost::make_tuple( pool_id, *operation_type, *stop ) )
740 : idx.upper_bound( boost::make_tuple( pool_id, *operation_type ) );
741 while( itr != itr_stop && result.size() < limit )
743 result.push_back( *itr );
749 const auto& idx = hist_idx.indices().get<by_pool_time>();
750 auto itr = start.valid() ? idx.lower_bound( boost::make_tuple( pool_id, *start ) )
751 : idx.lower_bound( pool_id );
752 auto itr_stop = stop.valid() ? idx.lower_bound( boost::make_tuple( pool_id, *stop ) )
753 : idx.upper_bound( pool_id );
754 while( itr != itr_stop && result.size() < limit )
756 result.push_back( *itr );
766 liquidity_pool_id_type pool_id,
767 const optional<uint64_t>& start,
768 const optional<fc::time_point_sec>& stop,
769 const optional<uint32_t>& olimit,
770 const optional<int64_t>& operation_type )
const 772 uint32_t limit = validate_get_lp_history_params( _app, olimit );
774 vector<liquidity_pool_history_object> result;
783 if( operation_type.valid() )
785 const auto& idx = hist_idx.
indices().get<by_pool_op_type_seq>();
786 const auto& idx_t = hist_idx.indices().get<by_pool_op_type_time>();
787 auto itr = start.valid() ? idx.lower_bound( boost::make_tuple( pool_id, *operation_type, *start ) )
788 : idx.lower_bound( boost::make_tuple( pool_id, *operation_type ) );
789 if( itr == idx.end() || itr->pool != pool_id || itr->op_type != *operation_type )
791 if( stop.valid() && itr->time <= *stop )
793 auto itr_temp = stop.valid() ? idx_t.lower_bound( boost::make_tuple( pool_id, *operation_type, *stop ) )
794 : idx_t.upper_bound( boost::make_tuple( pool_id, *operation_type ) );
795 auto itr_stop = ( itr_temp == idx_t.end() ? idx.end() : idx.iterator_to( *itr_temp ) );
796 while( itr != itr_stop && result.size() < limit )
798 result.push_back( *itr );
804 const auto& idx = hist_idx.indices().get<by_pool_seq>();
805 const auto& idx_t = hist_idx.indices().get<by_pool_time>();
806 auto itr = start.valid() ? idx.lower_bound( boost::make_tuple( pool_id, *start ) )
807 : idx.lower_bound( pool_id );
808 if( itr == idx.end() || itr->pool != pool_id )
810 if( stop.valid() && itr->time <= *stop )
812 auto itr_temp = stop.valid() ? idx_t.lower_bound( boost::make_tuple( pool_id, *stop ) )
813 : idx_t.upper_bound( pool_id );
814 auto itr_stop = ( itr_temp == idx_t.end() ? idx.end() : idx.iterator_to( *itr_temp ) );
815 while( itr != itr_stop && result.size() < limit )
817 result.push_back( *itr );
833 uint32_t non_neg )
const 839 const std::vector<commitment_type>& neg_commits_in,
840 int64_t excess )
const 846 const std::vector<char>& proof )
const 859 uint64_t actual_value )
const 867 const std::vector<char>& proof )
const 876 const_cast< commitment_type& >( commit ),
889 _db( *app.chain_database() )
894 uint32_t start, uint32_t limit )
const 898 "limit can not be greater than ${configured_limit}",
899 (
"configured_limit", configured_limit) );
904 auto range = bal_idx.equal_range( boost::make_tuple( asset_id ) );
906 vector<account_asset_balance> result;
911 if( result.size() >= limit )
914 if( bal.balance.value == 0 )
917 if( index++ < start )
920 const auto account = _db.
find(bal.owner);
923 aab.
name = account->name;
927 result.push_back(aab);
936 asset_id_type asset_id = db_api_helper.get_asset_from_string( asset_symbol_or_id )->get_id();
937 auto range = bal_idx.equal_range( boost::make_tuple( asset_id ) );
939 int64_t count = boost::distance(range) - 1;
945 vector<asset_holders> result;
946 vector<asset_id_type> total_assets;
949 const auto& dasset_obj = asset_obj.dynamic_asset_data_id(_db);
951 asset_id_type asset_id;
952 asset_id = dasset_obj.id;
955 auto range = bal_idx.equal_range( boost::make_tuple( asset_id ) );
957 int64_t count = boost::distance(range) - 1;
963 result.push_back(ah);
979 return plugin->tracked_groups();
983 const std::string& quote_asset,
985 const optional<price>& start,
986 uint32_t limit )
const 990 "limit can not be greater than ${configured_limit}",
991 (
"configured_limit", configured_limit) );
995 const auto& limit_groups =
plugin->limit_order_groups();
996 vector< limit_order_group > result;
1002 price max_price =
price::max( base_asset_id, quote_asset_id );
1003 price min_price =
price::min( base_asset_id, quote_asset_id );
1004 if( start.valid() && !start->is_null() )
1005 max_price = std::max( std::min( max_price, *start ), min_price );
1010 while( itr != end && result.size() < limit )
1012 result.emplace_back( *itr );
1025 const optional<std::string>& o_account_name_or_id,
1026 const optional<std::string>& catalog,
1027 const optional<std::string>& key,
1028 const optional<uint32_t>& limit,
1029 const optional<account_storage_id_type>& start_id )
const 1037 if( o_account_name_or_id.valid() )
1039 const string& account_name_or_id = *o_account_name_or_id;
1041 if( catalog.valid() )
1047 storage_index.get<by_account_catalog_key>(),
1048 limit, start_id, account_id, *catalog, *key );
1053 storage_index.get<by_account_catalog>(),
1054 limit, start_id, account_id, *catalog );
1058 FC_ASSERT( !key.valid(),
"Can not specify key if catalog is not specified" );
1062 storage_index.get<custom_operations::by_account>(),
1063 limit, start_id, account_id );
1066 else if( catalog.valid() )
1072 storage_index.get<by_catalog_key>(),
1073 limit, start_id, *catalog, *key );
1078 storage_index.get<by_catalog>(),
1079 limit, start_id, *catalog );
1083 FC_ASSERT( !key.valid(),
"Can not specify key if catalog is not specified" );
1087 storage_index.get<by_id>(),
fc::api< asset_api > asset()
Retrieve the asset API set.
const application_options & get_options() const
fc::optional< api_access_info > get_api_access_info(const string &username) const
uint32_t api_limit_get_market_history
uint32_t api_limit_get_account_history_by_operations
bool verify_sum(const std::vector< commitment_type > &commits_in, const std::vector< commitment_type > &neg_commits_in, int64_t excess) const
Verifies that commits + neg_commits + excess == 0.
Tracks the balance of a single account/asset pairThis object is indexed on owner and asset_type so th...
std::shared_ptr< fc::thread > elasticsearch_thread
fc::variant broadcast_transaction_synchronous(const precomputable_transaction &trx)
auto async(Functor &&f, const char *desc FC_TASK_NAME_DEFAULT_ARG, priority prio=priority()) -> fc::future< decltype(f())>
vector< operation_history_object > get_account_history(const std::string &account_name_or_id, operation_history_id_type stop=operation_history_id_type(), uint32_t limit=application_options::get_default().api_limit_get_account_history, operation_history_id_type start=operation_history_id_type()) const
Get the history of operations related to the specified account.
static ptr create(const char *desc FC_TASK_NAME_DEFAULT_ARG)
a placeholder for the result of an asynchronous operation.
fc::api< network_broadcast_api > network_broadcast()
Retrieve the network broadcast API set.
virtual void open(const fc::path &db)=0
void broadcast_transaction_with_callback(confirmation_callback cb, const precomputable_transaction &trx)
std::shared_ptr< chain::database > chain_database() const
bool verify_range(uint64_t &min_val, uint64_t &max_val, const commitment_type &commit, const range_proof_type &proof)
void on_applied_block(const signed_block &b)
Not reflected, thus not accessible to API clients.
static constexpr size_t data_size()
bool is_plugin_enabled(const string &name) const
T wait(boost::signals2::signal< void(T)> &sig, const microseconds &timeout_us=microseconds::maximum())
const index_type & indices() const
bool verify_sum(const std::vector< commitment_type > &commits, const std::vector< commitment_type > &neg_commits, int64_t excess)
#define GRAPHENE_MAX_NESTED_OBJECTS
bool has_market_history_plugin
tracks the history of all logical operations on blockchain stateAll operations and virtual operations...
fc::api< block_api > block()
Retrieve the network block API set.
tracks the blockchain state in an extensible manner
An order-perserving dictionary of variant's.
const IndexType & get_index_type() const
range_proof_info range_get_info(const range_proof_type &proof)
fc::sha256 blind_factor_type
void set_advanced_node_parameters(const fc::variant_object ¶ms)
Set advanced node parameters, such as desired and max number of connections.
uint32_t api_limit_get_asset_holders
std::vector< char > range_proof_sign(uint64_t min_value, const commitment_type &commit, const blind_factor_type &commit_blind, const blind_factor_type &nonce, int8_t base10_exp, uint8_t min_bits, uint64_t actual_value) const
Proves with respect to min_value the range for pedersen commitment which has the provided blinding fa...
vector< operation_history_object > get_account_history_by_time(const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< fc::time_point_sec > &start=optional< fc::time_point_sec >()) const
Get the history of operations related to the specified account no later than the specified time...
vector< order_history_object > get_fill_order_history(const std::string &a, const std::string &b, uint32_t limit) const
Get details of order executions occurred most recently in a trading pair.
Used to generate a useful error report when an exception is thrown.At each level in the stack where t...
fc::api< network_node_api > network_node()
Retrieve the network node API set.
flat_set< uint16_t > get_tracked_groups() const
Get tracked groups configured by the server.
history_operation_detail get_account_history_by_operations(const std::string &account_name_or_id, const flat_set< uint16_t > &operation_types, uint32_t start, uint32_t limit) const
Get the history of operations related to the specified account filtering by operation types...
account_history_id_type next
the operation position within the given account
fc::api< dummy_api > dummy()
Retrieve a dummy API set, not reflected.
network_node_api(application &a)
std::shared_ptr< abstract_plugin > get_plugin(const string &name) const
vector< liquidity_pool_history_object > get_liquidity_pool_history(liquidity_pool_id_type pool_id, const optional< fc::time_point_sec > &start=optional< fc::time_point_sec >(), const optional< fc::time_point_sec > &stop=optional< fc::time_point_sec >(), const optional< uint32_t > &limit=optional< uint32_t >(), const optional< int64_t > &operation_type=optional< int64_t >()) const
Get history of a liquidity pool.
static sha256 hash(const char *d, uint32_t dlen)
provides stack-based nullable value similar to boost::optional
void broadcast_transaction(const precomputable_transaction &trx)
Broadcast a transaction to the network.
operation_history_id_type operation_id
the account this operation applies to
const asset_object * get_asset_from_string(const std::string &symbol_or_id, bool throw_if_not_found=true) const
vector< account_storage_object > get_storage_info(const optional< std::string > &account_name_or_id=optional< std::string >(), const optional< std::string > &catalog=optional< std::string >(), const optional< std::string > &key=optional< std::string >(), const optional< uint32_t > &limit=optional< uint32_t >(), const optional< account_storage_id_type > &start_id=optional< account_storage_id_type >()) const
Get stored objects.
fc::ecc::commitment_type blind(const fc::ecc::blind_factor_type &blind, uint64_t value) const
Generates a pedersen commitment: *commit = blind * G + value * G2. The commitment is 33 bytes...
std::vector< net::potential_peer_record > get_potential_peers() const
Return list of potential peers.
commitment_type blind(const blind_factor_type &blind, uint64_t value)
string get_info() const
Retrive the node info string configured by the node operator.
uint32_t api_limit_get_account_history_operations
asset_api(graphene::app::application &app)
static time_point_sec maximum()
verify_range_proof_rewind_result verify_range_proof_rewind(const blind_factor_type &nonce, const fc::ecc::commitment_type &commit, const std::vector< char > &proof) const
Verifies range proof rewind for 33-byte pedersen commitment.
object_id< SpaceID, TypeID > get_id() const
uint32_t api_limit_get_relative_account_history
uint32_t api_limit_get_liquidity_pool_history
const T * find(const object_id_type &id) const
fc::variant_object get_advanced_node_parameters() const
Get advanced node parameters, such as desired and max number of connections.
void add_node(const fc::ip::endpoint &ep)
add_node Connect to a new peer
application_options get_config() const
Retrieve configured application options.
const object & get(object_id_type id) const
fc::api< database_api > database()
Retrieve the database API set.
a node in a linked list of operation_history_objectsAccount history is important for users and wallet...
vector< OBJ_TYPE > get_objects_by_x(T application_options::*app_opt_member_ptr, const INDEX_TYPE &idx, const optional< uint32_t > &olimit, const optional< OBJ_ID_TYPE > &ostart_id, X... x) const
void set_value(const T &v)
fc::ecc::blind_factor_type blind_out
zero_initialized_array< unsigned char, 33 > commitment_type
void broadcast_block(const signed_block &block)
Broadcast a signed block to the network.
std::function< void(variant)> confirmation_callback
history_api(application &app)
#define FC_CAPTURE_AND_RETHROW(...)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
int64_t get_asset_holders_count(const std::string &asset_symbol_or_id) const
Get asset holders count for a specific asset.
fc::api< graphene::debug_witness::debug_api > debug()
Retrieve the debug API set.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
vector< asset_holders > get_all_asset_holders() const
Get all asset holders.
fc::api< history_api > history()
Retrieve the history API set.
block_api(const graphene::chain::database &db)
const account_object * get_account_from_string(const std::string &name_or_id, bool throw_if_not_found=true) const
fc::variant_object get_info() const
Return general network information, such as p2p port.
variant login(const optional< string > &user, const optional< string > &password)
Authenticate to the RPC server, or retrieve the API set ID of the login API set.
custom_operations_api(application &app)
bool verify_range_proof_rewind(blind_factor_type &blind_out, uint64_t &value_out, string &message_out, const blind_factor_type &nonce, uint64_t &min_val, uint64_t &max_val, commitment_type commit, const range_proof_type &proof)
account_id_type account_id
vector< operation_history_object > get_account_history_operations(const std::string &account_name_or_id, int64_t operation_type, operation_history_id_type start=operation_history_id_type(), operation_history_id_type stop=operation_history_id_type(), uint32_t limit=application_options::get_default().api_limit_get_account_history_operations) const
Get the history of operations related to the specified account filtering by operation type...
fc::ecc::range_proof_info range_get_info(const std::vector< char > &proof) const
Gets "range proof" info. The cli_wallet includes functionality for sending blind transfers in which t...
flat_set< uint32_t > get_market_history_buckets() const
Get OHLCV time bucket lengths supported (configured) by this API server.
flat_set< string > get_available_api_sets() const
Retrieve a list of API sets that the user has access to.
tracks the parameters of an assetAll assets have a globally unique symbol name that controls how they...
range_proof_type range_proof_sign(uint64_t min_value, const commitment_type &commit, const blind_factor_type &commit_blind, const blind_factor_type &nonce, int8_t base10_exp, uint8_t min_bits, uint64_t actual_value)
vector< operation_history_object > get_block_operation_history(uint32_t block_num, const optional< uint16_t > &trx_in_block={}) const
Get all operations within a block or a transaction, including virtual operations. ...
blind_factor_type blind_sum(const std::vector< blind_factor_type > &blinds, uint32_t non_neg)
fc::api< crypto_api > crypto()
Retrieve the cryptography API set.
vector< bucket_object > get_market_history(const std::string &a, const std::string &b, uint32_t bucket_seconds, const fc::time_point_sec &start, const fc::time_point_sec &end) const
Get OHLCV data of a trading pair in a time range.
vector< account_asset_balance > get_asset_holders(const std::string &asset_symbol_or_id, uint32_t start, uint32_t limit) const
Get asset holders for a specific asset.
vector< operation_history_object > get_block_operations_by_time(const optional< fc::time_point_sec > &start=optional< fc::time_point_sec >()) const
Get all operations, including virtual operations, within the most recent block (no later than the spe...
std::vector< net::peer_status > get_connected_peers() const
Get status of all current connections to peers.
vector< operation_history_object > operation_history_objs
orders_api(application &app)
verify_range_result verify_range(const fc::ecc::commitment_type &commit, const std::vector< char > &proof) const
Verifies range proof for 33-byte pedersen commitment.
bool is_database_api_allowed() const
Check whether database_api is allowed, not reflected.
std::string base64_decode(const std::string &encoded_string)
vector< operation_history_object > get_relative_account_history(const std::string &account_name_or_id, uint64_t stop=0, uint32_t limit=application_options::get_default().api_limit_get_relative_account_history, uint64_t start=0) const
Get the history of operations related to the specified account referenced by an event numbering speci...
abstract base class for accessing objects indexed in various ways.
fc::ecc::blind_factor_type blind_sum(const std::vector< blind_factor_type > &blinds_in, uint32_t non_neg) const
Get sha-256 blind factor type.
void copy(const path &from, const path &to)
fc::api< orders_api > orders()
Retrieve the orders API set.
const string & get_node_info() const
fc::api< custom_operations_api > custom_operations()
Retrieve the custom operations API set.
vector< limit_order_group > get_grouped_limit_orders(const std::string &base_asset, const std::string "e_asset, uint16_t group, const optional< price > &start, uint32_t limit) const
Get grouped limit orders in given market.
vector< processed_transaction > transactions
object_id< account_storage_object::space_id, account_storage_object::type_id > account_storage_id_type
vector< liquidity_pool_history_object > get_liquidity_pool_history_by_sequence(liquidity_pool_id_type pool_id, const optional< uint64_t > &start=optional< uint64_t >(), const optional< fc::time_point_sec > &stop=optional< fc::time_point_sec >(), const optional< uint32_t > &limit=optional< uint32_t >(), const optional< int64_t > &operation_type=optional< int64_t >()) const
Get history of a liquidity pool.
std::shared_ptr< promise< T > > ptr
optional< signed_block > fetch_block_by_number(uint32_t num) const
vector< optional< signed_block > > get_blocks(uint32_t block_num_from, uint32_t block_num_to) const
Get signed blocks.
uint32_t api_limit_get_storage_info
uint32_t api_limit_get_account_history
An order-perserving dictionary of variant's.
uint32_t api_limit_get_grouped_limit_orders
network_broadcast_api(application &a)