BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
29 #define GET_REQUIRED_FEES_MAX_RECURSION 4
33 using market_queue_type = std::map< std::pair<graphene::chain::asset_id_type, graphene::chain::asset_id_type>,
34 std::vector<fc::variant> >;
53 optional<maybe_signed_block_header>
get_block_header( uint32_t block_num,
bool with_witness_signature )
const;
55 const vector<uint32_t>& block_nums,
bool with_witness_signatures )
const;
56 optional<signed_block>
get_block(uint32_t block_num)
const;
65 object_id_type
get_next_object_id( uint8_t space_id, uint8_t type_id,
bool with_pending_transactions )
const;
68 vector<flat_set<account_id_type>>
get_key_references( vector<public_key_type> key )
const;
72 vector<optional<account_object>>
get_accounts(
const vector<std::string>& account_names_or_ids,
73 optional<bool> subscribe )
const;
74 map<string, full_account, std::less<>>
get_full_accounts(
const vector<string>& names_or_ids,
75 const optional<bool>& subscribe );
76 vector<account_statistics_object>
get_top_voters(uint32_t limit)
const;
80 map<string, account_id_type, std::less<>>
lookup_accounts(
const string& lower_bound_name,
82 const optional<bool>& subscribe )
const;
87 const flat_set<asset_id_type>& assets )
const;
91 vector<vesting_balance_object>
get_vesting_balances(
const std::string account_id_or_name )
const;
95 vector<optional<extended_asset_object>>
get_assets(
const vector<std::string>& asset_symbols_or_ids,
96 optional<bool> subscribe )
const;
97 vector<extended_asset_object>
list_assets(
const string& lower_bound_symbol, uint32_t limit)
const;
98 vector<optional<extended_asset_object>>
lookup_asset_symbols(
const vector<string>& symbols_or_ids)
const;
100 asset_id_type start, uint32_t limit)
const;
103 vector<limit_order_object>
get_limit_orders(
const std::string& a,
const std::string& b,
104 uint32_t limit)
const;
106 const optional<uint32_t>& limit,
107 const optional<limit_order_id_type>& start_id );
110 const string "e, uint32_t limit,
111 optional<limit_order_id_type> ostart_id,
112 optional<price> ostart_price );
113 vector<call_order_object>
get_call_orders(
const std::string& a, uint32_t limit)
const;
115 asset_id_type start, uint32_t limit)
const;
116 vector<force_settlement_object>
get_settle_orders(
const std::string& a, uint32_t limit)
const;
118 force_settlement_id_type start,
119 uint32_t limit)
const;
121 uint32_t limit, uint32_t start)
const;
124 const std::string& a,
const std::string& b );
128 bool skip_order_book =
false )
const;
131 uint32_t limit )
const;
135 uint32_t limit )
const;
138 uint32_t limit )
const;
142 const std::string& asset_symbol_or_id,
143 const optional<uint32_t>& limit,
144 const optional<liquidity_pool_id_type>& start_id,
145 const optional<bool>& with_statistics )
const;
147 const vector<liquidity_pool_id_type>& ids,
148 const optional<bool>& subscribe,
149 const optional<bool>& with_statistics )
const;
151 const vector<std::string>& asset_symbols_or_ids,
152 const optional<bool>& subscribe,
153 const optional<bool>& with_statistics )
const;
155 const std::string& account_name_or_id,
156 const optional<uint32_t>& limit,
157 const optional<asset_id_type>& start_id,
158 const optional<bool>& with_statistics )
const;
161 vector<optional<witness_object>>
get_witnesses(
const vector<witness_id_type>& witness_ids)
const;
164 const string& lower_bound_name, uint32_t limit )
const;
169 const vector<committee_member_id_type>& committee_member_ids )
const;
171 const std::string& account_id_or_name )
const;
173 const string& lower_bound_name, uint32_t limit )
const;
177 vector<worker_object>
get_all_workers(
const optional<bool>& is_expired )
const;
182 vector<variant>
lookup_vote_ids(
const vector<vote_id_type>& votes )
const;
189 const flat_set<public_key_type>& available_keys )
const;
194 const flat_set<public_key_type>& signers )
const;
197 const std::string& asset_id_or_symbol )
const;
203 vector<blinded_balance_object>
get_blinded_balances(
const flat_set<commitment_type>& commitments )
const;
207 withdraw_permission_id_type start,
208 uint32_t limit )
const;
210 withdraw_permission_id_type start,
211 uint32_t limit )
const;
214 optional<htlc_object>
get_htlc( htlc_id_type
id, optional<bool> subscribe )
const;
216 htlc_id_type start, uint32_t limit )
const;
217 vector<htlc_object>
get_htlc_by_to(
const std::string account_id_or_name,
218 htlc_id_type start, uint32_t limit)
const;
219 vector<htlc_object>
list_htlcs(
const htlc_id_type lower_bound_id, uint32_t limit)
const;
231 template<
class ASSET>
234 asset_id_type
id = a.
get_id();
246 vector<optional<extended_asset_object>>
get_assets(
const vector<asset_id_type>& asset_ids,
254 vector<limit_order_object>
get_limit_orders(
const asset_id_type a,
const asset_id_type b,
255 const uint32_t limit )
const;
264 liquidity_pool_id_type
id = a.
get_id();
277 template <
typename INDEX_TAG,
typename... X>
279 const optional<uint32_t>& olimit,
280 const optional<liquidity_pool_id_type>& ostart_id,
281 const optional<bool>& with_statistics,
286 uint32_t limit = olimit.valid() ? *olimit : configured_limit;
288 "limit can not be greater than ${configured_limit}",
289 (
"configured_limit", configured_limit) );
291 bool with_stats = ( with_statistics.valid() && *with_statistics );
293 vector<extended_liquidity_pool_object> results;
295 liquidity_pool_id_type start_pool_id = ostart_id.valid() ? *ostart_id : liquidity_pool_id_type();
296 object_id_type start_id { start_pool_id };
303 results.reserve( limit );
304 for ( ; lower_itr != upper_itr && results.size() < limit; ++lower_itr )
321 if( subscribe.valid() )
370 return order.get_market();
377 asset_id_type backing_id =
order.balance.asset_id(
_db ).bitasset_data(
_db ).options.short_backing_asset;
378 auto tmp = std::make_pair(
order.balance.asset_id, backing_id );
379 if( tmp.first > tmp.second ) std::swap( tmp.first, tmp.second );
386 const T*
order =
dynamic_cast<const T*
>(obj);
393 queue[market].emplace_back( full_object ? obj->to_variant() :
fc::variant(obj->id, 1) );
401 const vector<object_id_type>& ids,
402 const flat_set<account_id_type>& impacted_accounts,
406 void on_objects_new(
const vector<object_id_type>& ids,
const flat_set<account_id_type>& impacted_accounts);
407 void on_objects_changed(
const vector<object_id_type>& ids,
const flat_set<account_id_type>& impacted_accounts);
408 void on_objects_removed(
const vector<object_id_type>& ids,
const vector<const object*>& objs,
409 const flat_set<account_id_type>& impacted_accounts);
fc::variants get_objects(const vector< object_id_type > &ids, optional< bool > subscribe) const
optional< share_type > total_in_collateral
Stores ticker data for liquidity pools.
map< string, committee_member_id_type, std::less<> > lookup_committee_member_accounts(const string &lower_bound_name, uint32_t limit) const
vector< limit_order_object > get_limit_orders_by_account(const string &account_name_or_id, const optional< uint32_t > &limit, const optional< limit_order_id_type > &start_id)
optional< signed_block > get_block(uint32_t block_num) const
order_book get_order_book(const string &base, const string "e, uint32_t limit) const
uint64_t get_witness_count() const
An order-perserving dictionary of variant's.
boost::signals2::scoped_connection _removed_connection
vector< optional< committee_member_object > > get_committee_members(const vector< committee_member_id_type > &committee_member_ids) 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
std::function< void(const fc::variant &)> _subscribe_callback
Maintains global state information (committee_member list, current fees)
vector< optional< account_object > > lookup_account_names(const vector< string > &account_names) const
tracks the blockchain state in an extensible manner
uint64_t get_asset_count() const
vector< limit_order_object > get_account_limit_orders(const string &account_name_or_id, const string &base, const string "e, uint32_t limit, optional< limit_order_id_type > ostart_id, optional< price > ostart_price)
vector< blinded_balance_object > get_blinded_balances(const flat_set< commitment_type > &commitments) const
bool verify_account_authority(const string &account_name_or_id, const flat_set< public_key_type > &signers) const
void unsubscribe_from_market(const std::string &a, const std::string &b)
vector< extended_asset_object > list_assets(const string &lower_bound_symbol, uint32_t limit) const
optional< asset_bitasset_data_id_type > bitasset_data_id
Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() return...
vector< fc::variant > get_required_fees(const vector< operation > &ops, const std::string &asset_id_or_symbol) const
vector< htlc_object > list_htlcs(const htlc_id_type lower_bound_id, uint32_t limit) const
optional< maybe_signed_block_header > get_block_header(uint32_t block_num, bool with_witness_signature) const
vector< extended_liquidity_pool_object > 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
vector< variant > lookup_vote_ids(const vector< vote_id_type > &votes) const
bool is_public_key_registered(string public_key) const
void subscribe_to_item(const T &item) const
vector< vesting_balance_object > get_vesting_balances(const std::string account_id_or_name) const
dynamic_global_property_object get_dynamic_global_properties() const
void set_block_applied_callback(std::function< void(const variant &block_id)> cb)
const graphene::api_helper_indexes::next_object_ids_index * next_object_ids_index
vector< worker_object > get_workers_by_account(const std::string &account_id_or_name) const
vector< optional< extended_asset_object > > lookup_asset_symbols(const vector< string > &symbols_or_ids) const
const application_options * _app_options
void set_auto_subscription(bool enable)
void set_pending_transaction_callback(std::function< void(const variant &)> cb)
auto call_end_or_upper_bound(const T &t) const
vector< collateral_bid_object > get_collateral_bids(const std::string &asset, uint32_t limit, uint32_t start) const
vector< market_ticker > get_top_markets(uint32_t limit) const
vector< market_trade > get_trade_history(const string &base, const string "e, fc::time_point_sec start, fc::time_point_sec stop, uint32_t limit) const
processed_transaction validate_transaction(const signed_transaction &trx) const
optional< htlc_object > get_htlc(htlc_id_type id, optional< bool > subscribe) const
bool _notify_remove_create
optional< share_type > total_backing_collateral
share_type get_amount_in_collateral(const asset_id_type &asset) const
map< string, account_id_type, std::less<> > lookup_accounts(const string &lower_bound_name, uint32_t limit, const optional< bool > &subscribe) const
vector< force_settlement_object > get_settle_orders_by_account(const std::string &account_name_or_id, force_settlement_id_type start, uint32_t limit) const
This secondary index tracks how much of each asset is locked up as collateral for MPAs,...
uint64_t get_worker_count() const
optional< account_object > get_account_by_name(string name) const
set< public_key_type > get_potential_signatures(const signed_transaction &trx) const
chain_id_type get_chain_id() const
const std::pair< asset_id_type, asset_id_type > get_order_market(const T &order)
void cancel_all_subscriptions(bool reset_callback, bool reset_market_subscriptions)
const T * find(const object_id_type &id) const
extended_asset_object extend_asset(ASSET &&a) const
vector< extended_liquidity_pool_object > 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
vector< asset > get_named_account_balances(const std::string &name, const flat_set< asset_id_type > &assets) const
bool get_whether_to_subscribe(optional< bool > subscribe) const
share_type get_backing_collateral(const asset_id_type &asset) const
std::map< std::pair< graphene::chain::asset_id_type, graphene::chain::asset_id_type >, std::vector< fc::variant > > market_queue_type
vector< extended_asset_object > get_assets_by_issuer(const std::string &issuer_name_or_id, asset_id_type start, uint32_t limit) const
const object & get(object_id_type id) const
std::vector< variant > variants
global_property_object get_global_properties() const
void on_objects_changed(const vector< object_id_type > &ids, const flat_set< account_id_type > &impacted_accounts)
vector< withdraw_permission_object > get_withdraw_permissions_by_giver(const std::string account_id_or_name, withdraw_permission_id_type start, uint32_t limit) const
void set_subscribe_callback(std::function< void(const variant &)> cb, bool notify_remove_create)
vector< call_order_object > get_call_orders(const std::string &a, uint32_t limit) const
bool verify_authority(const signed_transaction &trx) const
vector< account_statistics_object > get_top_voters(uint32_t limit) const
std::string get_transaction_hex(const signed_transaction &trx) const
uint64_t get_committee_count() const
vector< call_order_object > get_call_orders_by_account(const std::string &account_name_or_id, asset_id_type start, uint32_t limit) const
market_ticker get_ticker(const string &base, const string "e, bool skip_order_book=false) const
virtual bool contains(const unsigned char *key_begin, const std::size_t length) const
market_volume get_24_volume(const string &base, const string "e) const
uint32_t api_limit_get_liquidity_pools
fc::optional< committee_member_object > get_committee_member_by_account(const std::string &account_id_or_name) const
vector< char > get_subscription_key(const object_id_type &item) const
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)
map< string, witness_id_type, std::less<> > lookup_witness_accounts(const string &lower_bound_name, uint32_t limit) const
database_api_impl(graphene::chain::database &db, const application_options *app_options)
const graphene::api_helper_indexes::amount_in_collateral_index * amount_in_collateral_index
vector< htlc_object > get_htlc_by_to(const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const
const graphene::api_helper_indexes::asset_in_liquidity_pools_index * asset_in_liquidity_pools_index
optional< liquidity_pool_ticker_object > statistics
extended_liquidity_pool_object extend_liquidity_pool(LP &&a, bool with_stats) const
fc::bloom_filter _subscribe_filter
boost::signals2::scoped_connection _applied_block_connection
bool is_impacted_account(const flat_set< account_id_type > &accounts)
uint64_t get_account_count() const
chain_property_object get_chain_properties() const
void insert(const unsigned char *key_begin, const std::size_t &length)
fc::optional< witness_object > get_witness_by_account(const std::string &account_id_or_name) const
vector< optional< witness_object > > get_witnesses(const vector< witness_id_type > &witness_ids) const
This secondary index tracks the next ID of all object types.
map< uint32_t, optional< maybe_signed_block_header > > get_block_header_batch(const vector< uint32_t > &block_nums, bool with_witness_signatures) const
void on_objects_new(const vector< object_id_type > &ids, const flat_set< account_id_type > &impacted_accounts)
object_id_type get_next_object_id(uint8_t space_id, uint8_t type_id, bool with_pending_transactions) const
void on_objects_removed(const vector< object_id_type > &ids, const vector< const object * > &objs, const flat_set< account_id_type > &impacted_accounts)
void broadcast_market_updates(const market_queue_type &queue)
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
captures the result of evaluating the operations contained in the transaction
void broadcast_updates(const vector< variant > &updates)
vector< force_settlement_object > get_settle_orders(const std::string &a, uint32_t limit) const
boost::signals2::scoped_connection scoped_connection
std::function< void(const fc::variant &)> _pending_trx_callback
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
fc::variant_object get_config() const
bool has_market_history_plugin
vector< limit_order_object > get_limit_orders(const std::string &a, const std::string &b, uint32_t limit) const
bool _enabled_auto_subscription
boost::signals2::scoped_connection _new_connection
const std::pair< asset_id_type, asset_id_type > get_order_market(const force_settlement_object &order)
vector< extended_liquidity_pool_object > 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
vector< proposal_object > get_proposed_transactions(const std::string account_id_or_name) const
virtual ~database_api_impl()
Maintains global state information (committee_member list, current fees)
tracks bitassets scheduled for force settlement at some point in the future.
map< string, full_account, std::less<> > get_full_accounts(const vector< string > &names_or_ids, const optional< bool > &subscribe)
processed_transaction get_transaction(uint32_t block_num, uint32_t trx_in_block) const
void subscribe_to_market(std::function< void(const variant &)> callback, const std::string &a, const std::string &b)
vector< market_trade > get_trade_history_by_sequence(const string &base, const string "e, int64_t start, fc::time_point_sec stop, uint32_t limit) const
This secondary index maintains a map to make it easier to find liquidity pools by any asset in the po...
object_id< SpaceID, TypeID > get_id() const
vector< asset > get_vested_balances(const vector< balance_id_type > &objs) const
void enqueue_if_subscribed_to_market(const object *obj, market_queue_type &queue, bool full_object=true)
graphene::chain::database & _db
set< public_key_type > get_required_signatures(const signed_transaction &trx, const flat_set< public_key_type > &available_keys) const
set< address > get_potential_address_signatures(const signed_transaction &trx) const
provides stack-based nullable value similar to boost::optional
std::function< void(const fc::variant &)> _block_applied_callback
bool is_subscribed_to_item(const T &item) const
boost::signals2::scoped_connection _pending_trx_connection
vector< asset > get_account_balances(const std::string &account_name_or_id, const flat_set< asset_id_type > &assets) const
const IndexType & get_index_type() const
vector< optional< account_object > > get_accounts(const vector< std::string > &account_names_or_ids, optional< bool > subscribe) const
boost::signals2::scoped_connection _change_connection
map< pair< asset_id_type, asset_id_type >, std::function< void(const variant &)> > _market_subscriptions
vector< htlc_object > get_htlc_by_from(const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const
vector< withdraw_permission_object > get_withdraw_permissions_by_recipient(const std::string account_id_or_name, withdraw_permission_id_type start, uint32_t limit) const
vector< optional< extended_asset_object > > get_assets(const vector< std::string > &asset_symbols_or_ids, optional< bool > subscribe) const
vector< balance_object > get_balance_objects(const vector< address > &addrs) const
vector< account_id_type > get_account_references(const std::string account_id_or_name) const
auto make_tuple_if_multiple(X x) const
vector< worker_object > get_all_workers(const optional< bool > &is_expired) const
void pack(Stream &s, const flat_set< T, A... > &value, uint32_t _max_depth)
std::string get_transaction_hex_without_sig(const transaction &trx) const
std::set< account_id_type > _subscribed_accounts
vector< flat_set< account_id_type > > get_key_references(vector< public_key_type > key) 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