BitShares-Core  6.0.1
BitShares blockchain implementation and command-line interface software
Public Member Functions | Public Attributes | List of all members
graphene::app::database_api_impl Class Reference

#include <database_api_impl.hxx>

Inheritance diagram for graphene::app::database_api_impl:

Public Member Functions

 database_api_impl (graphene::chain::database &db, const application_options *app_options)
 
virtual ~database_api_impl ()
 
fc::variants get_objects (const vector< object_id_type > &ids, optional< bool > subscribe) const
 
void set_subscribe_callback (std::function< void(const variant &)> cb, bool notify_remove_create)
 
void set_auto_subscription (bool enable)
 
void set_pending_transaction_callback (std::function< void(const variant &)> cb)
 
void set_block_applied_callback (std::function< void(const variant &block_id)> cb)
 
void cancel_all_subscriptions (bool reset_callback, bool reset_market_subscriptions)
 
optional< block_headerget_block_header (uint32_t block_num) const
 
map< uint32_t, optional< block_header > > get_block_header_batch (const vector< uint32_t > block_nums) const
 
optional< signed_blockget_block (uint32_t block_num) const
 
processed_transaction get_transaction (uint32_t block_num, uint32_t trx_in_block) const
 
chain_property_object get_chain_properties () const
 
global_property_object get_global_properties () const
 
fc::variant_object get_config () const
 
chain_id_type get_chain_id () const
 
dynamic_global_property_object get_dynamic_global_properties () const
 
vector< flat_set< account_id_type > > get_key_references (vector< public_key_type > key) const
 
bool is_public_key_registered (string public_key) const
 
account_id_type get_account_id_from_string (const std::string &name_or_id) const
 
vector< optional< account_object > > get_accounts (const vector< std::string > &account_names_or_ids, optional< bool > subscribe) const
 
std::map< string, full_accountget_full_accounts (const vector< string > &names_or_ids, optional< bool > subscribe)
 
vector< account_statistics_objectget_top_voters (uint32_t limit) const
 
optional< account_objectget_account_by_name (string name) const
 
vector< account_id_type > get_account_references (const std::string account_id_or_name) const
 
vector< optional< account_object > > lookup_account_names (const vector< string > &account_names) const
 
map< string, account_id_type > lookup_accounts (const string &lower_bound_name, uint32_t limit, optional< bool > subscribe) const
 
uint64_t get_account_count () const
 
vector< assetget_account_balances (const std::string &account_name_or_id, const flat_set< asset_id_type > &assets) const
 
vector< assetget_named_account_balances (const std::string &name, const flat_set< asset_id_type > &assets) const
 
vector< balance_objectget_balance_objects (const vector< address > &addrs) const
 
vector< assetget_vested_balances (const vector< balance_id_type > &objs) const
 
vector< vesting_balance_objectget_vesting_balances (const std::string account_id_or_name) const
 
uint64_t get_asset_count () const
 
asset_id_type get_asset_id_from_string (const std::string &symbol_or_id) const
 
vector< optional< extended_asset_object > > get_assets (const vector< std::string > &asset_symbols_or_ids, optional< bool > subscribe) const
 
vector< extended_asset_objectlist_assets (const string &lower_bound_symbol, uint32_t limit) const
 
vector< optional< extended_asset_object > > lookup_asset_symbols (const vector< string > &symbols_or_ids) const
 
vector< extended_asset_objectget_assets_by_issuer (const std::string &issuer_name_or_id, asset_id_type start, uint32_t limit) const
 
vector< limit_order_objectget_limit_orders (const std::string &a, const std::string &b, uint32_t limit) const
 
vector< limit_order_objectget_limit_orders_by_account (const string &account_name_or_id, optional< uint32_t > limit, optional< limit_order_id_type > start_id)
 
vector< limit_order_objectget_account_limit_orders (const string &account_name_or_id, const string &base, const string &quote, uint32_t limit, optional< limit_order_id_type > ostart_id, optional< price > ostart_price)
 
vector< call_order_objectget_call_orders (const std::string &a, uint32_t limit) const
 
vector< call_order_objectget_call_orders_by_account (const std::string &account_name_or_id, asset_id_type start, uint32_t limit) const
 
vector< force_settlement_objectget_settle_orders (const std::string &a, uint32_t limit) const
 
vector< force_settlement_objectget_settle_orders_by_account (const std::string &account_name_or_id, force_settlement_id_type start, uint32_t limit) const
 
vector< call_order_objectget_margin_positions (const std::string account_id_or_name) const
 
vector< collateral_bid_objectget_collateral_bids (const std::string &asset, uint32_t limit, uint32_t start) const
 
void subscribe_to_market (std::function< void(const variant &)> callback, const std::string &a, const std::string &b)
 
void unsubscribe_from_market (const std::string &a, const std::string &b)
 
market_ticker get_ticker (const string &base, const string &quote, bool skip_order_book=false) const
 
market_volume get_24_volume (const string &base, const string &quote) const
 
order_book get_order_book (const string &base, const string &quote, unsigned limit=50) const
 
vector< market_tickerget_top_markets (uint32_t limit) const
 
vector< market_tradeget_trade_history (const string &base, const string &quote, fc::time_point_sec start, fc::time_point_sec stop, unsigned limit=100) const
 
vector< market_tradeget_trade_history_by_sequence (const string &base, const string &quote, int64_t start, fc::time_point_sec stop, unsigned limit=100) const
 
vector< extended_liquidity_pool_objectlist_liquidity_pools (optional< uint32_t > limit=101, optional< liquidity_pool_id_type > start_id=optional< liquidity_pool_id_type >(), optional< bool > with_statistics=false) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_asset_a (std::string asset_symbol_or_id, optional< uint32_t > limit=101, optional< liquidity_pool_id_type > start_id=optional< liquidity_pool_id_type >(), optional< bool > with_statistics=false) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_asset_b (std::string asset_symbol_or_id, optional< uint32_t > limit=101, optional< liquidity_pool_id_type > start_id=optional< liquidity_pool_id_type >(), optional< bool > with_statistics=false) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_one_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=101, const optional< liquidity_pool_id_type > &start_id=optional< liquidity_pool_id_type >(), const optional< bool > &with_statistics=false) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_both_assets (std::string asset_symbol_or_id_a, std::string asset_symbol_or_id_b, optional< uint32_t > limit=101, optional< liquidity_pool_id_type > start_id=optional< liquidity_pool_id_type >(), optional< bool > with_statistics=false) const
 
vector< optional< extended_liquidity_pool_object > > get_liquidity_pools (const vector< liquidity_pool_id_type > &ids, optional< bool > subscribe=optional< bool >(), optional< bool > with_statistics=false) const
 
vector< optional< extended_liquidity_pool_object > > get_liquidity_pools_by_share_asset (const vector< std::string > &asset_symbols_or_ids, optional< bool > subscribe=optional< bool >(), optional< bool > with_statistics=false) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_owner (std::string account_name_or_id, optional< uint32_t > limit=101, optional< asset_id_type > start_id=optional< asset_id_type >(), optional< bool > with_statistics=false) const
 
vector< optional< witness_object > > get_witnesses (const vector< witness_id_type > &witness_ids) const
 
fc::optional< witness_objectget_witness_by_account (const std::string account_id_or_name) const
 
map< string, witness_id_type > lookup_witness_accounts (const string &lower_bound_name, uint32_t limit) const
 
uint64_t get_witness_count () const
 
vector< optional< committee_member_object > > get_committee_members (const vector< committee_member_id_type > &committee_member_ids) const
 
fc::optional< committee_member_objectget_committee_member_by_account (const std::string account_id_or_name) const
 
map< string, committee_member_id_type > lookup_committee_member_accounts (const string &lower_bound_name, uint32_t limit) const
 
uint64_t get_committee_count () const
 
vector< worker_objectget_all_workers (const optional< bool > is_expired=optional< bool >()) const
 
vector< worker_objectget_workers_by_account (const std::string account_id_or_name) const
 
uint64_t get_worker_count () const
 
vector< variant > lookup_vote_ids (const vector< vote_id_type > &votes) const
 
std::string get_transaction_hex (const signed_transaction &trx) const
 
std::string get_transaction_hex_without_sig (const transaction &trx) const
 
set< public_key_type > get_required_signatures (const signed_transaction &trx, const flat_set< public_key_type > &available_keys) const
 
set< public_key_type > get_potential_signatures (const signed_transaction &trx) const
 
set< address > get_potential_address_signatures (const signed_transaction &trx) const
 
bool verify_authority (const signed_transaction &trx) const
 
bool verify_account_authority (const string &account_name_or_id, const flat_set< public_key_type > &signers) const
 
processed_transaction validate_transaction (const signed_transaction &trx) const
 
vector< fc::variantget_required_fees (const vector< operation > &ops, const std::string &asset_id_or_symbol) const
 
vector< proposal_objectget_proposed_transactions (const std::string account_id_or_name) const
 
vector< blinded_balance_objectget_blinded_balances (const flat_set< commitment_type > &commitments) const
 
vector< withdraw_permission_objectget_withdraw_permissions_by_giver (const std::string account_id_or_name, withdraw_permission_id_type start, uint32_t limit) const
 
vector< withdraw_permission_objectget_withdraw_permissions_by_recipient (const std::string account_id_or_name, withdraw_permission_id_type start, uint32_t limit) const
 
optional< htlc_objectget_htlc (htlc_id_type id, optional< bool > subscribe) const
 
vector< htlc_objectget_htlc_by_from (const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const
 
vector< htlc_objectget_htlc_by_to (const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const
 
vector< htlc_objectlist_htlcs (const htlc_id_type lower_bound_id, uint32_t limit) const
 
vector< ticket_objectlist_tickets (optional< uint32_t > limit=101, optional< ticket_id_type > start_id=optional< ticket_id_type >()) const
 
vector< ticket_objectget_tickets_by_account (std::string account_name_or_id, optional< uint32_t > limit=101, optional< ticket_id_type > start_id=optional< ticket_id_type >()) const
 
const account_objectget_account_from_string (const std::string &name_or_id, bool throw_if_not_found=true) const
 
template<class ASSET >
extended_asset_object extend_asset (ASSET &&a) const
 
const asset_objectget_asset_from_string (const std::string &symbol_or_id, bool throw_if_not_found=true) const
 
vector< optional< extended_asset_object > > get_assets (const vector< asset_id_type > &asset_ids, optional< bool > subscribe=optional< bool >()) const
 
vector< limit_order_objectget_limit_orders (const asset_id_type a, const asset_id_type b, const uint32_t limit) const
 
template<class LP >
extended_liquidity_pool_object extend_liquidity_pool (LP &&a, bool with_stats) const
 
template<typename X >
vector< extended_liquidity_pool_objectget_liquidity_pools_by_asset_x (std::string asset_symbol_or_id, optional< uint32_t > olimit, optional< liquidity_pool_id_type > ostart_id, optional< bool > with_statistics) const
 
bool get_whether_to_subscribe (optional< bool > subscribe) const
 
vector< char > get_subscription_key (const object_id_type &item) const
 
template<typename T >
void subscribe_to_item (const T &item) const
 
template<typename T >
bool is_subscribed_to_item (const T &item) const
 
bool is_impacted_account (const flat_set< account_id_type > &accounts)
 
template<typename T >
const std::pair< asset_id_type, asset_id_type > get_order_market (const T &order)
 
const std::pair< asset_id_type, asset_id_type > get_order_market (const force_settlement_object &order)
 
template<typename T >
void enqueue_if_subscribed_to_market (const object *obj, market_queue_type &queue, bool full_object=true)
 
void broadcast_updates (const vector< variant > &updates)
 
void broadcast_market_updates (const market_queue_type &queue)
 
void handle_object_changed (bool force_notify, bool full_object, const vector< object_id_type > &ids, const flat_set< account_id_type > &impacted_accounts, std::function< const object *(object_id_type id)> find_object)
 
void on_objects_new (const vector< object_id_type > &ids, const flat_set< account_id_type > &impacted_accounts)
 
void on_objects_changed (const vector< object_id_type > &ids, const flat_set< account_id_type > &impacted_accounts)
 
void on_objects_removed (const vector< object_id_type > &ids, const vector< const object *> &objs, const flat_set< account_id_type > &impacted_accounts)
 
void on_applied_block ()
 
template<typename X >
auto make_tuple_if_multiple (X x) const
 
template<typename... X>
auto make_tuple_if_multiple (X... x) const
 
template<typename T >
auto call_end_or_upper_bound (const T &t) const
 
template<typename T , typename... X>
auto call_end_or_upper_bound (const T &t, X... x) const
 
template<typename OBJ_TYPE , typename OBJ_ID_TYPE , typename INDEX_TYPE , typename T , typename... X>
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
 

Public Attributes

bool _notify_remove_create = false
 
bool _enabled_auto_subscription = true
 
fc::bloom_filter _subscribe_filter
 
std::set< account_id_type > _subscribed_accounts
 
std::function< void(const fc::variant &)> _subscribe_callback
 
std::function< void(const fc::variant &)> _pending_trx_callback
 
std::function< void(const fc::variant &)> _block_applied_callback
 
boost::signals2::scoped_connection _new_connection
 
boost::signals2::scoped_connection _change_connection
 
boost::signals2::scoped_connection _removed_connection
 
boost::signals2::scoped_connection _applied_block_connection
 
boost::signals2::scoped_connection _pending_trx_connection
 
map< pair< asset_id_type, asset_id_type >, std::function< void(const variant &)> > _market_subscriptions
 
graphene::chain::database_db
 
const application_options_app_options = nullptr
 
const graphene::api_helper_indexes::amount_in_collateral_indexamount_in_collateral_index
 
const graphene::api_helper_indexes::asset_in_liquidity_pools_indexasset_in_liquidity_pools_index
 

Detailed Description

Definition at line 36 of file database_api_impl.hxx.

Constructor & Destructor Documentation

◆ database_api_impl()

graphene::app::database_api_impl::database_api_impl ( graphene::chain::database db,
const application_options app_options 
)
explicit

Definition at line 55 of file database_api.cpp.

◆ ~database_api_impl()

graphene::app::database_api_impl::~database_api_impl ( )
virtual

Definition at line 99 of file database_api.cpp.

Member Function Documentation

◆ broadcast_market_updates()

void graphene::app::database_api_impl::broadcast_market_updates ( const market_queue_type queue)

Definition at line 3293 of file database_api.cpp.

◆ broadcast_updates()

void graphene::app::database_api_impl::broadcast_updates ( const vector< variant > &  updates)

Definition at line 3282 of file database_api.cpp.

◆ call_end_or_upper_bound() [1/2]

template<typename T >
auto graphene::app::database_api_impl::call_end_or_upper_bound ( const T &  t) const
inline

Definition at line 358 of file database_api_impl.hxx.

◆ call_end_or_upper_bound() [2/2]

template<typename T , typename... X>
auto graphene::app::database_api_impl::call_end_or_upper_bound ( const T &  t,
X...  x 
) const
inline

Definition at line 362 of file database_api_impl.hxx.

◆ cancel_all_subscriptions()

void graphene::app::database_api_impl::cancel_all_subscriptions ( bool  reset_callback,
bool  reset_market_subscriptions 
)

Definition at line 196 of file database_api.cpp.

◆ enqueue_if_subscribed_to_market()

template<typename T >
void graphene::app::database_api_impl::enqueue_if_subscribed_to_market ( const object *  obj,
market_queue_type queue,
bool  full_object = true 
)
inline

Definition at line 470 of file database_api_impl.hxx.

◆ extend_asset()

template<class ASSET >
extended_asset_object graphene::app::database_api_impl::extend_asset ( ASSET &&  a) const
inline

Definition at line 264 of file database_api_impl.hxx.

◆ extend_liquidity_pool()

template<class LP >
extended_liquidity_pool_object graphene::app::database_api_impl::extend_liquidity_pool ( LP &&  a,
bool  with_stats 
) const
inline

Definition at line 296 of file database_api_impl.hxx.

◆ get_24_volume()

market_volume graphene::app::database_api_impl::get_24_volume ( const string &  base,
const string &  quote 
) const

Definition at line 1399 of file database_api.cpp.

◆ get_account_balances()

vector< asset > graphene::app::database_api_impl::get_account_balances ( const std::string &  account_name_or_id,
const flat_set< asset_id_type > &  assets 
) const

Definition at line 787 of file database_api.cpp.

◆ get_account_by_name()

optional< account_object > graphene::app::database_api_impl::get_account_by_name ( string  name) const

Definition at line 684 of file database_api.cpp.

◆ get_account_count()

uint64_t graphene::app::database_api_impl::get_account_count ( ) const

Definition at line 770 of file database_api.cpp.

◆ get_account_from_string()

const account_object * graphene::app::database_api_impl::get_account_from_string ( const std::string &  name_or_id,
bool  throw_if_not_found = true 
) const

Definition at line 3163 of file database_api.cpp.

◆ get_account_id_from_string()

account_id_type graphene::app::database_api_impl::get_account_id_from_string ( const std::string &  name_or_id) const

◆ get_account_limit_orders()

vector< limit_order_object > graphene::app::database_api_impl::get_account_limit_orders ( const string &  account_name_or_id,
const string &  base,
const string &  quote,
uint32_t  limit,
optional< limit_order_id_type >  ostart_id,
optional< price >  ostart_price 
)

Definition at line 1072 of file database_api.cpp.

◆ get_account_references()

vector< account_id_type > graphene::app::database_api_impl::get_account_references ( const std::string  account_id_or_name) const

Definition at line 698 of file database_api.cpp.

◆ get_accounts()

vector< optional< account_object > > graphene::app::database_api_impl::get_accounts ( const vector< std::string > &  account_names_or_ids,
optional< bool >  subscribe 
) const

Definition at line 450 of file database_api.cpp.

◆ get_all_workers()

vector< worker_object > graphene::app::database_api_impl::get_all_workers ( const optional< bool >  is_expired = optional<bool>()) const

Definition at line 2420 of file database_api.cpp.

◆ get_asset_count()

uint64_t graphene::app::database_api_impl::get_asset_count ( ) const

Definition at line 954 of file database_api.cpp.

◆ get_asset_from_string()

const asset_object * graphene::app::database_api_impl::get_asset_from_string ( const std::string &  symbol_or_id,
bool  throw_if_not_found = true 
) const

Definition at line 3189 of file database_api.cpp.

◆ get_asset_id_from_string()

asset_id_type graphene::app::database_api_impl::get_asset_id_from_string ( const std::string &  symbol_or_id) const

◆ get_assets() [1/2]

vector< optional< extended_asset_object > > graphene::app::database_api_impl::get_assets ( const vector< std::string > &  asset_symbols_or_ids,
optional< bool >  subscribe 
) const

Definition at line 905 of file database_api.cpp.

◆ get_assets() [2/2]

vector< optional< extended_asset_object > > graphene::app::database_api_impl::get_assets ( const vector< asset_id_type > &  asset_ids,
optional< bool >  subscribe = optional<bool>() 
) const

Definition at line 3216 of file database_api.cpp.

◆ get_assets_by_issuer()

vector< extended_asset_object > graphene::app::database_api_impl::get_assets_by_issuer ( const std::string &  issuer_name_or_id,
asset_id_type  start,
uint32_t  limit 
) const

Definition at line 965 of file database_api.cpp.

◆ get_balance_objects()

vector< balance_object > graphene::app::database_api_impl::get_balance_objects ( const vector< address > &  addrs) const

Definition at line 824 of file database_api.cpp.

◆ get_blinded_balances()

vector< blinded_balance_object > graphene::app::database_api_impl::get_blinded_balances ( const flat_set< commitment_type > &  commitments) const

Definition at line 2875 of file database_api.cpp.

◆ get_block()

optional< signed_block > graphene::app::database_api_impl::get_block ( uint32_t  block_num) const

Definition at line 249 of file database_api.cpp.

◆ get_block_header()

optional< block_header > graphene::app::database_api_impl::get_block_header ( uint32_t  block_num) const

Definition at line 221 of file database_api.cpp.

◆ get_block_header_batch()

map< uint32_t, optional< block_header > > graphene::app::database_api_impl::get_block_header_batch ( const vector< uint32_t >  block_nums) const

Definition at line 233 of file database_api.cpp.

◆ get_call_orders()

vector< call_order_object > graphene::app::database_api_impl::get_call_orders ( const std::string &  a,
uint32_t  limit 
) const

Definition at line 1162 of file database_api.cpp.

◆ get_call_orders_by_account()

vector< call_order_object > graphene::app::database_api_impl::get_call_orders_by_account ( const std::string &  account_name_or_id,
asset_id_type  start,
uint32_t  limit 
) const

Definition at line 1191 of file database_api.cpp.

◆ get_chain_id()

chain_id_type graphene::app::database_api_impl::get_chain_id ( ) const

Definition at line 317 of file database_api.cpp.

◆ get_chain_properties()

chain_property_object graphene::app::database_api_impl::get_chain_properties ( ) const

Definition at line 287 of file database_api.cpp.

◆ get_collateral_bids()

vector< collateral_bid_object > graphene::app::database_api_impl::get_collateral_bids ( const std::string &  asset,
uint32_t  limit,
uint32_t  start 
) const

Definition at line 1304 of file database_api.cpp.

◆ get_committee_count()

uint64_t graphene::app::database_api_impl::get_committee_count ( ) const

Definition at line 2403 of file database_api.cpp.

◆ get_committee_member_by_account()

fc::optional< committee_member_object > graphene::app::database_api_impl::get_committee_member_by_account ( const std::string  account_id_or_name) const

Definition at line 2348 of file database_api.cpp.

◆ get_committee_members()

vector< optional< committee_member_object > > graphene::app::database_api_impl::get_committee_members ( const vector< committee_member_id_type > &  committee_member_ids) const

Definition at line 2329 of file database_api.cpp.

◆ get_config()

fc::variant_object graphene::app::database_api_impl::get_config ( ) const

Definition at line 307 of file database_api.cpp.

◆ get_dynamic_global_properties()

dynamic_global_property_object graphene::app::database_api_impl::get_dynamic_global_properties ( ) const

Definition at line 327 of file database_api.cpp.

◆ get_full_accounts()

std::map< std::string, full_account > graphene::app::database_api_impl::get_full_accounts ( const vector< string > &  names_or_ids,
optional< bool >  subscribe 
)

Definition at line 479 of file database_api.cpp.

◆ get_global_properties()

global_property_object graphene::app::database_api_impl::get_global_properties ( ) const

Definition at line 297 of file database_api.cpp.

◆ get_htlc()

fc::optional< htlc_object > graphene::app::database_api_impl::get_htlc ( htlc_id_type  id,
optional< bool >  subscribe 
) const

Definition at line 2974 of file database_api.cpp.

◆ get_htlc_by_from()

vector< htlc_object > graphene::app::database_api_impl::get_htlc_by_from ( const std::string  account_id_or_name,
htlc_id_type  start,
uint32_t  limit 
) const

Definition at line 2990 of file database_api.cpp.

◆ get_htlc_by_to()

vector< htlc_object > graphene::app::database_api_impl::get_htlc_by_to ( const std::string  account_id_or_name,
htlc_id_type  start,
uint32_t  limit 
) const

Definition at line 3020 of file database_api.cpp.

◆ get_key_references()

vector< flat_set< account_id_type > > graphene::app::database_api_impl::get_key_references ( vector< public_key_type >  keys) const
Returns
all accounts that referr to the key or account id in their owner or active authorities.

Definition at line 346 of file database_api.cpp.

◆ get_limit_orders() [1/2]

vector< limit_order_object > graphene::app::database_api_impl::get_limit_orders ( const std::string &  a,
const std::string &  b,
uint32_t  limit 
) const

Definition at line 1010 of file database_api.cpp.

◆ get_limit_orders() [2/2]

vector< limit_order_object > graphene::app::database_api_impl::get_limit_orders ( const asset_id_type  a,
const asset_id_type  b,
const uint32_t  limit 
) const

Definition at line 3235 of file database_api.cpp.

◆ get_limit_orders_by_account()

vector< limit_order_object > graphene::app::database_api_impl::get_limit_orders_by_account ( const string &  account_name_or_id,
optional< uint32_t >  limit,
optional< limit_order_id_type >  start_id 
)

Definition at line 1031 of file database_api.cpp.

◆ get_liquidity_pools()

vector< optional< extended_liquidity_pool_object > > graphene::app::database_api_impl::get_liquidity_pools ( const vector< liquidity_pool_id_type > &  ids,
optional< bool >  subscribe = optional<bool>(),
optional< bool >  with_statistics = false 
) const

Definition at line 1935 of file database_api.cpp.

◆ get_liquidity_pools_by_asset_a()

vector< extended_liquidity_pool_object > graphene::app::database_api_impl::get_liquidity_pools_by_asset_a ( std::string  asset_symbol_or_id,
optional< uint32_t >  limit = 101,
optional< liquidity_pool_id_type >  start_id = optional<liquidity_pool_id_type>(),
optional< bool >  with_statistics = false 
) const

Definition at line 1779 of file database_api.cpp.

◆ get_liquidity_pools_by_asset_b()

vector< extended_liquidity_pool_object > graphene::app::database_api_impl::get_liquidity_pools_by_asset_b ( std::string  asset_symbol_or_id,
optional< uint32_t >  limit = 101,
optional< liquidity_pool_id_type >  start_id = optional<liquidity_pool_id_type>(),
optional< bool >  with_statistics = false 
) const

Definition at line 1805 of file database_api.cpp.

◆ get_liquidity_pools_by_asset_x()

template<typename X >
vector<extended_liquidity_pool_object> graphene::app::database_api_impl::get_liquidity_pools_by_asset_x ( std::string  asset_symbol_or_id,
optional< uint32_t >  olimit,
optional< liquidity_pool_id_type >  ostart_id,
optional< bool >  with_statistics 
) const
inline

Definition at line 312 of file database_api_impl.hxx.

◆ get_liquidity_pools_by_both_assets()

vector< extended_liquidity_pool_object > graphene::app::database_api_impl::get_liquidity_pools_by_both_assets ( std::string  asset_symbol_or_id_a,
std::string  asset_symbol_or_id_b,
optional< uint32_t >  limit = 101,
optional< liquidity_pool_id_type >  start_id = optional<liquidity_pool_id_type>(),
optional< bool >  with_statistics = false 
) const

Definition at line 1885 of file database_api.cpp.

◆ get_liquidity_pools_by_one_asset()

vector< extended_liquidity_pool_object > graphene::app::database_api_impl::get_liquidity_pools_by_one_asset ( const std::string &  asset_symbol_or_id,
const optional< uint32_t > &  limit = 101,
const optional< liquidity_pool_id_type > &  start_id = optional<liquidity_pool_id_type>(),
const optional< bool > &  with_statistics = false 
) const

Definition at line 1831 of file database_api.cpp.

◆ get_liquidity_pools_by_owner()

vector< extended_liquidity_pool_object > graphene::app::database_api_impl::get_liquidity_pools_by_owner ( std::string  account_name_or_id,
optional< uint32_t >  limit = 101,
optional< asset_id_type >  start_id = optional<asset_id_type>(),
optional< bool >  with_statistics = false 
) const

Definition at line 2028 of file database_api.cpp.

◆ get_liquidity_pools_by_share_asset()

vector< optional< extended_liquidity_pool_object > > graphene::app::database_api_impl::get_liquidity_pools_by_share_asset ( const vector< std::string > &  asset_symbols_or_ids,
optional< bool >  subscribe = optional<bool>(),
optional< bool >  with_statistics = false 
) const

Definition at line 1981 of file database_api.cpp.

◆ get_margin_positions()

vector< call_order_object > graphene::app::database_api_impl::get_margin_positions ( const std::string  account_id_or_name) const

Definition at line 1279 of file database_api.cpp.

◆ get_named_account_balances()

vector<asset> graphene::app::database_api_impl::get_named_account_balances ( const std::string &  name,
const flat_set< asset_id_type > &  assets 
) const

◆ get_objects()

fc::variants graphene::app::database_api_impl::get_objects ( const vector< object_id_type > &  ids,
optional< bool >  subscribe 
) const

Definition at line 115 of file database_api.cpp.

◆ get_objects_by_x()

template<typename OBJ_TYPE , typename OBJ_ID_TYPE , typename INDEX_TYPE , typename T , typename... X>
vector<OBJ_TYPE> graphene::app::database_api_impl::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
inline

Definition at line 366 of file database_api_impl.hxx.

◆ get_order_book()

order_book graphene::app::database_api_impl::get_order_book ( const string &  base,
const string &  quote,
unsigned  limit = 50 
) const

Definition at line 1418 of file database_api.cpp.

◆ get_order_market() [1/2]

template<typename T >
const std::pair<asset_id_type,asset_id_type> graphene::app::database_api_impl::get_order_market ( const T &  order)
inline

Definition at line 454 of file database_api_impl.hxx.

◆ get_order_market() [2/2]

const std::pair<asset_id_type,asset_id_type> graphene::app::database_api_impl::get_order_market ( const force_settlement_object order)
inline

Definition at line 460 of file database_api_impl.hxx.

◆ get_potential_address_signatures()

set< address > graphene::app::database_api_impl::get_potential_address_signatures ( const signed_transaction &  trx) const

Definition at line 2654 of file database_api.cpp.

◆ get_potential_signatures()

set< public_key_type > graphene::app::database_api_impl::get_potential_signatures ( const signed_transaction &  trx) const

Definition at line 2615 of file database_api.cpp.

◆ get_proposed_transactions()

vector< proposal_object > graphene::app::database_api_impl::get_proposed_transactions ( const std::string  account_id_or_name) const

Definition at line 2839 of file database_api.cpp.

◆ get_required_fees()

vector< fc::variant > graphene::app::database_api_impl::get_required_fees ( const vector< operation > &  ops,
const std::string &  asset_id_or_symbol 
) const

Definition at line 2805 of file database_api.cpp.

◆ get_required_signatures()

set< public_key_type > graphene::app::database_api_impl::get_required_signatures ( const signed_transaction &  trx,
const flat_set< public_key_type > &  available_keys 
) const

Definition at line 2590 of file database_api.cpp.

◆ get_settle_orders()

vector< force_settlement_object > graphene::app::database_api_impl::get_settle_orders ( const std::string &  a,
uint32_t  limit 
) const

Definition at line 1218 of file database_api.cpp.

◆ get_settle_orders_by_account()

vector< force_settlement_object > graphene::app::database_api_impl::get_settle_orders_by_account ( const std::string &  account_name_or_id,
force_settlement_id_type  start,
uint32_t  limit 
) const

Definition at line 1249 of file database_api.cpp.

◆ get_subscription_key()

vector<char> graphene::app::database_api_impl::get_subscription_key ( const object_id_type &  item) const
inline

Definition at line 421 of file database_api_impl.hxx.

◆ get_ticker()

market_ticker graphene::app::database_api_impl::get_ticker ( const string &  base,
const string &  quote,
bool  skip_order_book = false 
) const

Definition at line 1365 of file database_api.cpp.

◆ get_tickets_by_account()

vector< ticket_object > graphene::app::database_api_impl::get_tickets_by_account ( std::string  account_name_or_id,
optional< uint32_t >  limit = 101,
optional< ticket_id_type >  start_id = optional<ticket_id_type>() 
) const

Definition at line 3124 of file database_api.cpp.

◆ get_top_markets()

vector< market_ticker > graphene::app::database_api_impl::get_top_markets ( uint32_t  limit) const

Definition at line 1470 of file database_api.cpp.

◆ get_top_voters()

vector< account_statistics_object > graphene::app::database_api_impl::get_top_voters ( uint32_t  limit) const

Definition at line 658 of file database_api.cpp.

◆ get_trade_history()

vector< market_trade > graphene::app::database_api_impl::get_trade_history ( const string &  base,
const string &  quote,
fc::time_point_sec  start,
fc::time_point_sec  stop,
unsigned  limit = 100 
) const

Definition at line 1507 of file database_api.cpp.

◆ get_trade_history_by_sequence()

vector< market_trade > graphene::app::database_api_impl::get_trade_history_by_sequence ( const string &  base,
const string &  quote,
int64_t  start,
fc::time_point_sec  stop,
unsigned  limit = 100 
) const

Definition at line 1609 of file database_api.cpp.

◆ get_transaction()

processed_transaction graphene::app::database_api_impl::get_transaction ( uint32_t  block_num,
uint32_t  trx_in_block 
) const

Definition at line 268 of file database_api.cpp.

◆ get_transaction_hex()

std::string graphene::app::database_api_impl::get_transaction_hex ( const signed_transaction &  trx) const

Definition at line 2567 of file database_api.cpp.

◆ get_transaction_hex_without_sig()

std::string graphene::app::database_api_impl::get_transaction_hex_without_sig ( const transaction &  trx) const

Definition at line 2578 of file database_api.cpp.

◆ get_vested_balances()

vector< asset > graphene::app::database_api_impl::get_vested_balances ( const vector< balance_id_type > &  objs) const

Definition at line 852 of file database_api.cpp.

◆ get_vesting_balances()

vector< vesting_balance_object > graphene::app::database_api_impl::get_vesting_balances ( const std::string  account_id_or_name) const

Definition at line 870 of file database_api.cpp.

◆ get_whether_to_subscribe()

bool graphene::app::database_api_impl::get_whether_to_subscribe ( optional< bool >  subscribe) const
inline

Definition at line 403 of file database_api_impl.hxx.

◆ get_withdraw_permissions_by_giver()

vector< withdraw_permission_object > graphene::app::database_api_impl::get_withdraw_permissions_by_giver ( const std::string  account_id_or_name,
withdraw_permission_id_type  start,
uint32_t  limit 
) const

Definition at line 2904 of file database_api.cpp.

◆ get_withdraw_permissions_by_recipient()

vector< withdraw_permission_object > graphene::app::database_api_impl::get_withdraw_permissions_by_recipient ( const std::string  account_id_or_name,
withdraw_permission_id_type  start,
uint32_t  limit 
) const

Definition at line 2938 of file database_api.cpp.

◆ get_witness_by_account()

fc::optional< witness_object > graphene::app::database_api_impl::get_witness_by_account ( const std::string  account_id_or_name) const

Definition at line 2258 of file database_api.cpp.

◆ get_witness_count()

uint64_t graphene::app::database_api_impl::get_witness_count ( ) const

Definition at line 2312 of file database_api.cpp.

◆ get_witnesses()

vector< optional< witness_object > > graphene::app::database_api_impl::get_witnesses ( const vector< witness_id_type > &  witness_ids) const

Definition at line 2241 of file database_api.cpp.

◆ get_worker_count()

uint64_t graphene::app::database_api_impl::get_worker_count ( ) const

Definition at line 2472 of file database_api.cpp.

◆ get_workers_by_account()

vector< worker_object > graphene::app::database_api_impl::get_workers_by_account ( const std::string  account_id_or_name) const

Definition at line 2453 of file database_api.cpp.

◆ handle_object_changed()

void graphene::app::database_api_impl::handle_object_changed ( bool  force_notify,
bool  full_object,
const vector< object_id_type > &  ids,
const flat_set< account_id_type > &  impacted_accounts,
std::function< const object *(object_id_type id)>  find_object 
)

Definition at line 3343 of file database_api.cpp.

◆ is_impacted_account()

bool graphene::app::database_api_impl::is_impacted_account ( const flat_set< account_id_type > &  accounts)

Definition at line 3272 of file database_api.cpp.

◆ is_public_key_registered()

bool graphene::app::database_api_impl::is_public_key_registered ( string  public_key) const

Definition at line 404 of file database_api.cpp.

◆ is_subscribed_to_item()

template<typename T >
bool graphene::app::database_api_impl::is_subscribed_to_item ( const T &  item) const
inline

Definition at line 440 of file database_api_impl.hxx.

◆ list_assets()

vector< extended_asset_object > graphene::app::database_api_impl::list_assets ( const string &  lower_bound_symbol,
uint32_t  limit 
) const

Definition at line 929 of file database_api.cpp.

◆ list_htlcs()

vector< htlc_object > graphene::app::database_api_impl::list_htlcs ( const htlc_id_type  lower_bound_id,
uint32_t  limit 
) const

Definition at line 3049 of file database_api.cpp.

◆ list_liquidity_pools()

vector< extended_liquidity_pool_object > graphene::app::database_api_impl::list_liquidity_pools ( optional< uint32_t >  limit = 101,
optional< liquidity_pool_id_type >  start_id = optional<liquidity_pool_id_type>(),
optional< bool >  with_statistics = false 
) const

Definition at line 1734 of file database_api.cpp.

◆ list_tickets()

vector< ticket_object > graphene::app::database_api_impl::list_tickets ( optional< uint32_t >  limit = 101,
optional< ticket_id_type >  start_id = optional<ticket_id_type>() 
) const

Definition at line 3083 of file database_api.cpp.

◆ lookup_account_names()

vector< optional< account_object > > graphene::app::database_api_impl::lookup_account_names ( const vector< string > &  account_names) const

Definition at line 724 of file database_api.cpp.

◆ lookup_accounts()

map< string, account_id_type > graphene::app::database_api_impl::lookup_accounts ( const string &  lower_bound_name,
uint32_t  limit,
optional< bool >  subscribe 
) const

Definition at line 736 of file database_api.cpp.

◆ lookup_asset_symbols()

vector< optional< extended_asset_object > > graphene::app::database_api_impl::lookup_asset_symbols ( const vector< string > &  symbols_or_ids) const

Definition at line 993 of file database_api.cpp.

◆ lookup_committee_member_accounts()

map< string, committee_member_id_type > graphene::app::database_api_impl::lookup_committee_member_accounts ( const string &  lower_bound_name,
uint32_t  limit 
) const

Definition at line 2365 of file database_api.cpp.

◆ lookup_vote_ids()

vector< variant > graphene::app::database_api_impl::lookup_vote_ids ( const vector< vote_id_type > &  votes) const

Definition at line 2490 of file database_api.cpp.

◆ lookup_witness_accounts()

map< string, witness_id_type > graphene::app::database_api_impl::lookup_witness_accounts ( const string &  lower_bound_name,
uint32_t  limit 
) const

Definition at line 2274 of file database_api.cpp.

◆ make_tuple_if_multiple() [1/2]

template<typename X >
auto graphene::app::database_api_impl::make_tuple_if_multiple ( x) const
inline

Template functions for simple list_X and get_X_by_T APIs, to reduce duplicate code

Definition at line 350 of file database_api_impl.hxx.

◆ make_tuple_if_multiple() [2/2]

template<typename... X>
auto graphene::app::database_api_impl::make_tuple_if_multiple ( X...  x) const
inline

Definition at line 354 of file database_api_impl.hxx.

◆ on_applied_block()

void graphene::app::database_api_impl::on_applied_block ( )

note: this method cannot yield because it is called in the middle of apply a block.

we need to ensure the database_api is not deleted for the life of the async operation

Definition at line 3405 of file database_api.cpp.

◆ on_objects_changed()

void graphene::app::database_api_impl::on_objects_changed ( const vector< object_id_type > &  ids,
const flat_set< account_id_type > &  impacted_accounts 
)

Definition at line 3335 of file database_api.cpp.

◆ on_objects_new()

void graphene::app::database_api_impl::on_objects_new ( const vector< object_id_type > &  ids,
const flat_set< account_id_type > &  impacted_accounts 
)

called every time a block is applied to report the objects that were changed

Definition at line 3327 of file database_api.cpp.

◆ on_objects_removed()

void graphene::app::database_api_impl::on_objects_removed ( const vector< object_id_type > &  ids,
const vector< const object *> &  objs,
const flat_set< account_id_type > &  impacted_accounts 
)

Definition at line 3309 of file database_api.cpp.

◆ set_auto_subscription()

void graphene::app::database_api_impl::set_auto_subscription ( bool  enable)

Definition at line 166 of file database_api.cpp.

◆ set_block_applied_callback()

void graphene::app::database_api_impl::set_block_applied_callback ( std::function< void(const variant &block_id)>  cb)

Definition at line 186 of file database_api.cpp.

◆ set_pending_transaction_callback()

void graphene::app::database_api_impl::set_pending_transaction_callback ( std::function< void(const variant &)>  cb)

Definition at line 176 of file database_api.cpp.

◆ set_subscribe_callback()

void graphene::app::database_api_impl::set_subscribe_callback ( std::function< void(const variant &)>  cb,
bool  notify_remove_create 
)

Definition at line 147 of file database_api.cpp.

◆ subscribe_to_item()

template<typename T >
void graphene::app::database_api_impl::subscribe_to_item ( const T &  item) const
inline

Definition at line 427 of file database_api_impl.hxx.

◆ subscribe_to_market()

void graphene::app::database_api_impl::subscribe_to_market ( std::function< void(const variant &)>  callback,
const std::string &  a,
const std::string &  b 
)

Definition at line 1334 of file database_api.cpp.

◆ unsubscribe_from_market()

void graphene::app::database_api_impl::unsubscribe_from_market ( const std::string &  a,
const std::string &  b 
)

Definition at line 1350 of file database_api.cpp.

◆ validate_transaction()

processed_transaction graphene::app::database_api_impl::validate_transaction ( const signed_transaction &  trx) const

Definition at line 2738 of file database_api.cpp.

◆ verify_account_authority()

bool graphene::app::database_api_impl::verify_account_authority ( const string &  account_name_or_id,
const flat_set< public_key_type > &  signers 
) const

Definition at line 2707 of file database_api.cpp.

◆ verify_authority()

bool graphene::app::database_api_impl::verify_authority ( const signed_transaction &  trx) const

Definition at line 2688 of file database_api.cpp.

Member Data Documentation

◆ _app_options

const application_options* graphene::app::database_api_impl::_app_options = nullptr

Definition at line 521 of file database_api_impl.hxx.

◆ _applied_block_connection

boost::signals2::scoped_connection graphene::app::database_api_impl::_applied_block_connection

Definition at line 515 of file database_api_impl.hxx.

◆ _block_applied_callback

std::function<void(const fc::variant&)> graphene::app::database_api_impl::_block_applied_callback

Definition at line 510 of file database_api_impl.hxx.

◆ _change_connection

boost::signals2::scoped_connection graphene::app::database_api_impl::_change_connection

Definition at line 513 of file database_api_impl.hxx.

◆ _db

graphene::chain::database& graphene::app::database_api_impl::_db

Definition at line 520 of file database_api_impl.hxx.

◆ _enabled_auto_subscription

bool graphene::app::database_api_impl::_enabled_auto_subscription = true

Definition at line 503 of file database_api_impl.hxx.

◆ _market_subscriptions

map< pair<asset_id_type,asset_id_type>, std::function<void(const variant&)> > graphene::app::database_api_impl::_market_subscriptions

Definition at line 518 of file database_api_impl.hxx.

◆ _new_connection

boost::signals2::scoped_connection graphene::app::database_api_impl::_new_connection

Definition at line 512 of file database_api_impl.hxx.

◆ _notify_remove_create

bool graphene::app::database_api_impl::_notify_remove_create = false

Definition at line 502 of file database_api_impl.hxx.

◆ _pending_trx_callback

std::function<void(const fc::variant&)> graphene::app::database_api_impl::_pending_trx_callback

Definition at line 509 of file database_api_impl.hxx.

◆ _pending_trx_connection

boost::signals2::scoped_connection graphene::app::database_api_impl::_pending_trx_connection

Definition at line 516 of file database_api_impl.hxx.

◆ _removed_connection

boost::signals2::scoped_connection graphene::app::database_api_impl::_removed_connection

Definition at line 514 of file database_api_impl.hxx.

◆ _subscribe_callback

std::function<void(const fc::variant&)> graphene::app::database_api_impl::_subscribe_callback

Definition at line 508 of file database_api_impl.hxx.

◆ _subscribe_filter

fc::bloom_filter graphene::app::database_api_impl::_subscribe_filter
mutable

Definition at line 505 of file database_api_impl.hxx.

◆ _subscribed_accounts

std::set<account_id_type> graphene::app::database_api_impl::_subscribed_accounts

Definition at line 506 of file database_api_impl.hxx.

◆ amount_in_collateral_index

const graphene::api_helper_indexes::amount_in_collateral_index* graphene::app::database_api_impl::amount_in_collateral_index

Definition at line 523 of file database_api_impl.hxx.

◆ asset_in_liquidity_pools_index

const graphene::api_helper_indexes::asset_in_liquidity_pools_index* graphene::app::database_api_impl::asset_in_liquidity_pools_index

Definition at line 524 of file database_api_impl.hxx.


The documentation for this class was generated from the following files: