BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet 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:
graphene::app::database_api_helper

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< maybe_signed_block_headerget_block_header (uint32_t block_num, bool with_witness_signature) const
 
map< uint32_t, optional< maybe_signed_block_header > > get_block_header_batch (const vector< uint32_t > &block_nums, bool with_witness_signatures) 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
 
object_id_type get_next_object_id (uint8_t space_id, uint8_t type_id, bool with_pending_transactions) 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
 
vector< optional< account_object > > get_accounts (const vector< std::string > &account_names_or_ids, optional< bool > subscribe) const
 
map< string, full_account, std::less<> > get_full_accounts (const vector< string > &names_or_ids, const 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, std::less<> > lookup_accounts (const string &lower_bound_name, uint32_t limit, const 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
 
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, const optional< uint32_t > &limit, const 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< 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, uint32_t limit) 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, uint32_t limit) const
 
vector< market_tradeget_trade_history_by_sequence (const string &base, const string &quote, int64_t start, fc::time_point_sec stop, uint32_t limit) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_one_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit, const optional< liquidity_pool_id_type > &start_id, const optional< bool > &with_statistics) const
 
vector< optional< extended_liquidity_pool_object > > get_liquidity_pools (const vector< liquidity_pool_id_type > &ids, const optional< bool > &subscribe, const optional< bool > &with_statistics) const
 
vector< optional< extended_liquidity_pool_object > > get_liquidity_pools_by_share_asset (const vector< std::string > &asset_symbols_or_ids, const optional< bool > &subscribe, const optional< bool > &with_statistics) const
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_owner (const std::string &account_name_or_id, const optional< uint32_t > &limit, const optional< asset_id_type > &start_id, const optional< bool > &with_statistics) 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, std::less<> > 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, std::less<> > 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) 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
 
template<class ASSET >
extended_asset_object extend_asset (ASSET &&a) 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 INDEX_TAG , typename... X>
vector< extended_liquidity_pool_objectget_liquidity_pools_by_asset_x (const optional< uint32_t > &olimit, const optional< liquidity_pool_id_type > &ostart_id, const optional< bool > &with_statistics, X... x) 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 ()
 
- Public Member Functions inherited from graphene::app::database_api_helper
 database_api_helper (graphene::chain::database &db, const application_options *app_options)
 
 database_api_helper (const graphene::app::application &app)
 
const account_objectget_account_from_string (const std::string &name_or_id, bool throw_if_not_found=true) const
 
const asset_objectget_asset_from_string (const std::string &symbol_or_id, bool throw_if_not_found=true) const
 
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
 
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
 
const graphene::api_helper_indexes::next_object_ids_indexnext_object_ids_index
 
- Public Attributes inherited from graphene::app::database_api_helper
graphene::chain::database_db
 
const application_options_app_options = nullptr
 

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 
)

Definition at line 69 of file database_api.cpp.

◆ ~database_api_impl()

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

Definition at line 124 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 3172 of file database_api.cpp.

◆ broadcast_updates()

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

Definition at line 3161 of file database_api.cpp.

◆ cancel_all_subscriptions()

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

Definition at line 221 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 384 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 232 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 262 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 1431 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 835 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 732 of file database_api.cpp.

◆ get_account_count()

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

Definition at line 818 of file database_api.cpp.

◆ 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 1120 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 746 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 498 of file database_api.cpp.

◆ get_all_workers()

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

Definition at line 2358 of file database_api.cpp.

◆ get_asset_count()

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

Definition at line 1002 of file database_api.cpp.

◆ get_assets() [1/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 3095 of file database_api.cpp.

◆ get_assets() [2/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 953 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 1013 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 872 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 2813 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 280 of file database_api.cpp.

◆ get_block_header()

optional< maybe_signed_block_header > graphene::app::database_api_impl::get_block_header ( uint32_t  block_num,
bool  with_witness_signature 
) const

Definition at line 248 of file database_api.cpp.

◆ get_block_header_batch()

map< uint32_t, optional< maybe_signed_block_header > > graphene::app::database_api_impl::get_block_header_batch ( const vector< uint32_t > &  block_nums,
bool  with_witness_signatures 
) const

Definition at line 264 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 1211 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 1240 of file database_api.cpp.

◆ get_chain_id()

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

Definition at line 348 of file database_api.cpp.

◆ get_chain_properties()

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

Definition at line 318 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 1336 of file database_api.cpp.

◆ get_committee_count()

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

Definition at line 2341 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 2286 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 2267 of file database_api.cpp.

◆ get_config()

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

Definition at line 338 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 358 of file database_api.cpp.

◆ get_full_accounts()

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

Definition at line 522 of file database_api.cpp.

◆ get_global_properties()

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

Definition at line 328 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 2912 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 2928 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 2958 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 394 of file database_api.cpp.

◆ get_limit_orders() [1/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 3114 of file database_api.cpp.

◆ get_limit_orders() [2/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 1058 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,
const optional< uint32_t > &  limit,
const optional< limit_order_id_type > &  start_id 
)

Definition at line 1079 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,
const optional< bool > &  subscribe,
const optional< bool > &  with_statistics 
) const

Definition at line 1873 of file database_api.cpp.

◆ get_liquidity_pools_by_asset_x()

template<typename INDEX_TAG , typename... X>
vector<extended_liquidity_pool_object> graphene::app::database_api_impl::get_liquidity_pools_by_asset_x ( const optional< uint32_t > &  olimit,
const optional< liquidity_pool_id_type > &  ostart_id,
const optional< bool > &  with_statistics,
X...  x 
) const
inline

Definition at line 278 of file database_api_impl.hxx.

◆ 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,
const optional< liquidity_pool_id_type > &  start_id,
const optional< bool > &  with_statistics 
) const

Definition at line 1804 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 ( const std::string &  account_name_or_id,
const optional< uint32_t > &  limit,
const optional< asset_id_type > &  start_id,
const optional< bool > &  with_statistics 
) const

Definition at line 1966 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,
const optional< bool > &  subscribe,
const optional< bool > &  with_statistics 
) const

Definition at line 1919 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_next_object_id()

object_id_type graphene::app::database_api_impl::get_next_object_id ( uint8_t  space_id,
uint8_t  type_id,
bool  with_pending_transactions 
) const

Definition at line 369 of file database_api.cpp.

◆ get_objects()

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

Definition at line 140 of file database_api.cpp.

◆ get_order_book()

order_book graphene::app::database_api_impl::get_order_book ( const string &  base,
const string &  quote,
uint32_t  limit 
) const

Definition at line 1450 of file database_api.cpp.

◆ get_order_market() [1/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 374 of file database_api_impl.hxx.

◆ get_order_market() [2/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 368 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 2592 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 2553 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 2777 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 2743 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 2528 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 1267 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 1298 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 335 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 1397 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 1499 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 706 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,
uint32_t  limit 
) const

Definition at line 1536 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,
uint32_t  limit 
) const

Definition at line 1638 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 299 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 2505 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 2516 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 900 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 918 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 317 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 2842 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 2876 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 2196 of file database_api.cpp.

◆ get_witness_count()

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

Definition at line 2250 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 2179 of file database_api.cpp.

◆ get_worker_count()

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

Definition at line 2410 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 2391 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 3222 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 3151 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 452 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 354 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 977 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 2987 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 772 of file database_api.cpp.

◆ lookup_accounts()

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

Definition at line 784 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 1041 of file database_api.cpp.

◆ lookup_committee_member_accounts()

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

Definition at line 2303 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 2428 of file database_api.cpp.

◆ lookup_witness_accounts()

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

Definition at line 2212 of file database_api.cpp.

◆ 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 3284 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 3214 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 3206 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 3188 of file database_api.cpp.

◆ set_auto_subscription()

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

Definition at line 191 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 211 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 201 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 172 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 341 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 1366 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 1382 of file database_api.cpp.

◆ validate_transaction()

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

Definition at line 2676 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 2645 of file database_api.cpp.

◆ verify_authority()

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

Definition at line 2626 of file database_api.cpp.

Member Data Documentation

◆ _applied_block_connection

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

Definition at line 429 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 424 of file database_api_impl.hxx.

◆ _change_connection

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

Definition at line 427 of file database_api_impl.hxx.

◆ _enabled_auto_subscription

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

Definition at line 417 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 432 of file database_api_impl.hxx.

◆ _new_connection

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

Definition at line 426 of file database_api_impl.hxx.

◆ _notify_remove_create

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

Definition at line 416 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 423 of file database_api_impl.hxx.

◆ _pending_trx_connection

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

Definition at line 430 of file database_api_impl.hxx.

◆ _removed_connection

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

Definition at line 428 of file database_api_impl.hxx.

◆ _subscribe_callback

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

Definition at line 422 of file database_api_impl.hxx.

◆ _subscribe_filter

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

Definition at line 419 of file database_api_impl.hxx.

◆ _subscribed_accounts

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

Definition at line 420 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 434 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 435 of file database_api_impl.hxx.

◆ next_object_ids_index

const graphene::api_helper_indexes::next_object_ids_index* graphene::app::database_api_impl::next_object_ids_index

Definition at line 436 of file database_api_impl.hxx.


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