BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | List of all members
graphene::app::database_api Class Reference

The database_api class implements the RPC API for the chain database. More...

#include <database_api.hpp>

Public Member Functions

 database_api (graphene::chain::database &db, const application_options *app_options=nullptr)
 
 ~database_api ()
 
fc::variants get_objects (const vector< object_id_type > &ids, optional< bool > subscribe=optional< bool >()) const
 Get the objects corresponding to the provided IDs. More...
 
void set_subscribe_callback (std::function< void(const variant &)> cb, bool notify_remove_create)
 Register a callback handle which then can be used to subscribe to object database changes. More...
 
void set_auto_subscription (bool enable)
 Set auto-subscription behavior of follow-up API queries. More...
 
void set_pending_transaction_callback (std::function< void(const variant &signed_transaction_object)> cb)
 Register a callback handle which will get notified when a transaction is pushed to database. More...
 
void set_block_applied_callback (std::function< void(const variant &block_id)> cb)
 Register a callback handle which will get notified when a block is pushed to database. More...
 
void cancel_all_subscriptions ()
 Stop receiving any notifications. More...
 
optional< maybe_signed_block_headerget_block_header (uint32_t block_num, const optional< bool > &with_witness_signature=optional< bool >()) const
 Retrieve a block header. More...
 
map< uint32_t, optional< maybe_signed_block_header > > get_block_header_batch (const vector< uint32_t > &block_nums, const optional< bool > &with_witness_signatures=optional< bool >()) const
 Retrieve multiple block headers by block numbers. More...
 
optional< signed_blockget_block (uint32_t block_num) const
 Retrieve a full, signed block. More...
 
processed_transaction get_transaction (uint32_t block_num, uint32_t trx_in_block) const
 used to fetch an individual transaction. More...
 
optional< signed_transaction > get_recent_transaction_by_id (const transaction_id_type &txid) const
 
chain_property_object get_chain_properties () const
 Retrieve the graphene::chain::chain_property_object associated with the chain. More...
 
global_property_object get_global_properties () const
 Retrieve the current graphene::chain::global_property_object. More...
 
fc::variant_object get_config () const
 Retrieve compile-time constants. More...
 
chain_id_type get_chain_id () const
 Get the chain ID. More...
 
dynamic_global_property_object get_dynamic_global_properties () const
 Retrieve the current graphene::chain::dynamic_global_property_object. More...
 
object_id_type get_next_object_id (uint8_t space_id, uint8_t type_id, bool with_pending_transactions) const
 Get the next object ID in an object space. More...
 
vector< flat_set< account_id_type > > get_key_references (vector< public_key_type > keys) const
 Get all accounts that refer to the specified public keys in their owner authority, active authorities or memo key. More...
 
bool is_public_key_registered (string public_key) const
 
account_id_type get_account_id_from_string (const std::string &name_or_id) const
 Get account object from a name or ID. More...
 
vector< optional< account_object > > get_accounts (const vector< std::string > &account_names_or_ids, optional< bool > subscribe=optional< bool >()) const
 Get a list of accounts by names or IDs. More...
 
map< string, full_account, std::less<> > get_full_accounts (const vector< string > &names_or_ids, const optional< bool > &subscribe=optional< bool >()) const
 Fetch objects relevant to the specified accounts and optionally subscribe to updates. More...
 
vector< account_statistics_objectget_top_voters (uint32_t limit) const
 Returns vector of voting power sorted by reverse vp_active. More...
 
optional< account_objectget_account_by_name (string name) const
 Get info of an account by name. More...
 
vector< account_id_type > get_account_references (const std::string account_name_or_id) const
 Get all accounts that refer to the specified account in their owner or active authorities. More...
 
vector< optional< account_object > > lookup_account_names (const vector< string > &account_names) const
 Get a list of accounts by name. More...
 
map< string, account_id_type, std::less<> > lookup_accounts (const string &lower_bound_name, uint32_t limit, const optional< bool > &subscribe=optional< bool >()) const
 Get names and IDs for registered accounts. More...
 
vector< assetget_account_balances (const std::string &account_name_or_id, const flat_set< asset_id_type > &assets) const
 Get an account's balances in various assets. More...
 
vector< assetget_named_account_balances (const std::string &name, const flat_set< asset_id_type > &assets) const
 Semantically equivalent to get_account_balances. More...
 
vector< balance_objectget_balance_objects (const vector< address > &addrs) const
 Return all unclaimed balance objects for a list of addresses. More...
 
vector< assetget_vested_balances (const vector< balance_id_type > &objs) const
 Calculate how much assets in the given balance objects are able to be claimed at current head block time. More...
 
vector< vesting_balance_objectget_vesting_balances (const std::string account_name_or_id) const
 Return all vesting balance objects owned by an account. More...
 
uint64_t get_account_count () const
 Get the total number of accounts registered with the blockchain. More...
 
asset_id_type get_asset_id_from_string (const std::string &symbol_or_id) const
 Get asset ID from an asset symbol or ID. More...
 
vector< optional< extended_asset_object > > get_assets (const vector< std::string > &asset_symbols_or_ids, optional< bool > subscribe=optional< bool >()) const
 Get a list of assets by symbol names or IDs. More...
 
vector< extended_asset_objectlist_assets (const string &lower_bound_symbol, uint32_t limit) const
 Get assets alphabetically by symbol name. More...
 
vector< optional< extended_asset_object > > lookup_asset_symbols (const vector< string > &symbols_or_ids) const
 Get a list of assets by symbol names or IDs. More...
 
uint64_t get_asset_count () const
 Get assets count. More...
 
vector< extended_asset_objectget_assets_by_issuer (const std::string &issuer_name_or_id, asset_id_type start, uint32_t limit) const
 Get assets issued (owned) by a given account. More...
 
vector< limit_order_objectget_limit_orders (std::string a, std::string b, uint32_t limit) const
 Get limit orders in a given market. More...
 
vector< limit_order_objectget_limit_orders_by_account (const string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< limit_order_id_type > &start_id=optional< limit_order_id_type >())
 Fetch open limit orders in all markets relevant to the specified account, ordered by ID. More...
 
vector< limit_order_objectget_account_limit_orders (const string &account_name_or_id, const string &base, const string &quote, uint32_t limit=application_options::get_default().api_limit_get_account_limit_orders, optional< limit_order_id_type > ostart_id=optional< limit_order_id_type >(), optional< price > ostart_price=optional< price >())
 Fetch all orders relevant to the specified account and specified market, result orders are sorted descendingly by price. More...
 
vector< call_order_objectget_call_orders (const std::string &a, uint32_t limit) const
 Get call orders (aka margin positions) for a given asset. More...
 
vector< call_order_objectget_call_orders_by_account (const std::string &account_name_or_id, asset_id_type start, uint32_t limit) const
 Get call orders (aka margin positions) of a given account. More...
 
vector< force_settlement_objectget_settle_orders (const std::string &a, uint32_t limit) const
 Get forced settlement orders in a given asset. More...
 
vector< force_settlement_objectget_settle_orders_by_account (const std::string &account_name_or_id, force_settlement_id_type start, uint32_t limit) const
 Get forced settlement orders of a given account. More...
 
vector< collateral_bid_objectget_collateral_bids (const std::string &a, uint32_t limit, uint32_t start) const
 Get collateral_bid_objects for a given asset. More...
 
vector< call_order_objectget_margin_positions (const std::string &account_name_or_id) const
 Get open margin positions of a given account. More...
 
void subscribe_to_market (std::function< void(const variant &)> callback, const std::string &a, const std::string &b)
 Request notification when the active orders in the market between two assets changes. More...
 
void unsubscribe_from_market (const std::string &a, const std::string &b)
 Unsubscribe from updates to a given market. More...
 
market_ticker get_ticker (const string &base, const string &quote) const
 Returns the ticker for the market assetA:assetB. More...
 
market_volume get_24_volume (const string &base, const string &quote) const
 Returns the 24 hour volume for the market assetA:assetB. More...
 
order_book get_order_book (const string &base, const string &quote, uint32_t limit=application_options::get_default().api_limit_get_order_book) const
 Returns the order book for the market base:quote. More...
 
vector< market_tickerget_top_markets (uint32_t limit) const
 Returns vector of tickers sorted by reverse base_volume. More...
 
vector< market_tradeget_trade_history (const string &base, const string &quote, fc::time_point_sec start, fc::time_point_sec stop, uint32_t limit=application_options::get_default().api_limit_get_trade_history) const
 Get market transactions occurred in the market base:quote, ordered by time, most recent first. More...
 
vector< market_tradeget_trade_history_by_sequence (const string &base, const string &quote, int64_t start, fc::time_point_sec stop, uint32_t limit=application_options::get_default().api_limit_get_trade_history_by_sequence) const
 Get market transactions occurred in the market base:quote, ordered by time, most recent first. More...
 
vector< extended_liquidity_pool_objectlist_liquidity_pools (const optional< uint32_t > &limit=optional< uint32_t >(), const optional< liquidity_pool_id_type > &start_id=optional< liquidity_pool_id_type >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools. More...
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_asset_a (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< liquidity_pool_id_type > &start_id=optional< liquidity_pool_id_type >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by the symbol or ID of the first asset in the pool. More...
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_asset_b (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< liquidity_pool_id_type > &start_id=optional< liquidity_pool_id_type >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by the symbol or ID of the second asset in the pool. More...
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_one_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< liquidity_pool_id_type > &start_id=optional< liquidity_pool_id_type >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by the symbol or ID of one asset in the pool. More...
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_both_assets (const std::string &asset_symbol_or_id_a, const std::string &asset_symbol_or_id_b, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< liquidity_pool_id_type > &start_id=optional< liquidity_pool_id_type >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by the symbols or IDs of the two assets in the pool. More...
 
vector< optional< extended_liquidity_pool_object > > get_liquidity_pools (const vector< liquidity_pool_id_type > &ids, const optional< bool > &subscribe=optional< bool >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by their IDs. More...
 
vector< optional< extended_liquidity_pool_object > > get_liquidity_pools_by_share_asset (const vector< std::string > &asset_symbols_or_ids, const optional< bool > &subscribe=optional< bool >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by their share asset symbols or IDs. More...
 
vector< extended_liquidity_pool_objectget_liquidity_pools_by_owner (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< asset_id_type > &start_id=optional< asset_id_type >(), const optional< bool > &with_statistics=false) const
 Get a list of liquidity pools by the name or ID of the owner account. More...
 
vector< optional< witness_object > > get_witnesses (const vector< witness_id_type > &witness_ids) const
 Get a list of witnesses by ID. More...
 
fc::optional< witness_objectget_witness_by_account (const std::string &account_name_or_id) const
 Get the witness owned by a given account. More...
 
map< string, witness_id_type, std::less<> > lookup_witness_accounts (const string &lower_bound_name, uint32_t limit) const
 Get names and IDs for registered witnesses. More...
 
uint64_t get_witness_count () const
 Get the total number of witnesses registered with the blockchain. More...
 
vector< optional< committee_member_object > > get_committee_members (const vector< committee_member_id_type > &committee_member_ids) const
 Get a list of committee_members by ID. More...
 
fc::optional< committee_member_objectget_committee_member_by_account (const string &account_name_or_id) const
 Get the committee_member owned by a given account. More...
 
map< string, committee_member_id_type, std::less<> > lookup_committee_member_accounts (const string &lower_bound_name, uint32_t limit) const
 Get names and IDs for registered committee_members. More...
 
uint64_t get_committee_count () const
 Get the total number of committee registered with the blockchain. More...
 
vector< worker_objectget_all_workers (const optional< bool > &is_expired=optional< bool >()) const
 Get workers. More...
 
vector< worker_objectget_workers_by_account (const std::string &account_name_or_id) const
 Get the workers owned by a given account. More...
 
uint64_t get_worker_count () const
 Get the total number of workers registered with the blockchain. More...
 
vector< variant > lookup_vote_ids (const vector< vote_id_type > &votes) const
 Given a set of votes, return the objects they are voting for. More...
 
std::string get_transaction_hex (const signed_transaction &trx) const
 Get a hexdump of the serialized binary form of a transaction. More...
 
std::string get_transaction_hex_without_sig (const transaction &trx) const
 Get a hexdump of the serialized binary form of a signatures-stripped transaction. More...
 
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
 Verify that the public keys have enough authority to approve an operation for this account. More...
 
processed_transaction validate_transaction (const signed_transaction &trx) const
 Validates a transaction against the current state without broadcasting it on the network. More...
 
vector< fc::variantget_required_fees (const vector< operation > &ops, const std::string &asset_symbol_or_id) const
 For each operation calculate the required fee in the specified asset type. More...
 
vector< proposal_objectget_proposed_transactions (const std::string account_name_or_id) const
 return a set of proposed transactions (aka proposals) that the specified account can add approval to or remove approval from More...
 
vector< blinded_balance_objectget_blinded_balances (const flat_set< commitment_type > &commitments) const
 return the set of blinded balance objects by commitment ID More...
 
vector< withdraw_permission_objectget_withdraw_permissions_by_giver (const std::string account_name_or_id, withdraw_permission_id_type start, uint32_t limit) const
 Get non expired withdraw permission objects for a giver(ex:recurring customer) More...
 
vector< withdraw_permission_objectget_withdraw_permissions_by_recipient (const std::string account_name_or_id, withdraw_permission_id_type start, uint32_t limit) const
 Get non expired withdraw permission objects for a recipient(ex:service provider) More...
 
optional< htlc_objectget_htlc (htlc_id_type id, optional< bool > subscribe=optional< bool >()) const
 Get HTLC object. More...
 
vector< htlc_objectget_htlc_by_from (const std::string account_name_or_id, htlc_id_type start, uint32_t limit) const
 Get non expired HTLC objects using the sender account. More...
 
vector< htlc_objectget_htlc_by_to (const std::string account_name_or_id, htlc_id_type start, uint32_t limit) const
 Get non expired HTLC objects using the receiver account. More...
 
vector< htlc_objectlist_htlcs (const htlc_id_type start, uint32_t limit) const
 Get all HTLCs. More...
 
vector< ticket_objectlist_tickets (const optional< uint32_t > &limit=optional< uint32_t >(), const optional< ticket_id_type > &start_id=optional< ticket_id_type >()) const
 Get a list of tickets. More...
 
vector< ticket_objectget_tickets_by_account (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< ticket_id_type > &start_id=optional< ticket_id_type >()) const
 Get a list of tickets by the name or ID of the owner account. More...
 
vector< samet_fund_objectlist_samet_funds (const optional< uint32_t > &limit=optional< uint32_t >(), const optional< samet_fund_id_type > &start_id=optional< samet_fund_id_type >()) const
 Get a list of SameT Funds. More...
 
vector< samet_fund_objectget_samet_funds_by_owner (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< samet_fund_id_type > &start_id=optional< samet_fund_id_type >()) const
 Get a list of SameT Funds by the name or ID of the owner account. More...
 
vector< samet_fund_objectget_samet_funds_by_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< samet_fund_id_type > &start_id=optional< samet_fund_id_type >()) const
 Get a list of SameT Funds by the symbol or ID of the asset type. More...
 
vector< credit_offer_objectlist_credit_offers (const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_offer_id_type > &start_id=optional< credit_offer_id_type >()) const
 Get a list of credit offers. More...
 
vector< credit_offer_objectget_credit_offers_by_owner (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_offer_id_type > &start_id=optional< credit_offer_id_type >()) const
 Get a list of credit offers by the name or ID of the owner account. More...
 
vector< credit_offer_objectget_credit_offers_by_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_offer_id_type > &start_id=optional< credit_offer_id_type >()) const
 Get a list of credit offers by the symbol or ID of the asset type. More...
 
vector< credit_deal_objectlist_credit_deals (const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_deal_id_type > &start_id=optional< credit_deal_id_type >()) const
 Get a list of credit deals. More...
 
vector< credit_deal_objectget_credit_deals_by_offer_id (const credit_offer_id_type &offer_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_deal_id_type > &start_id=optional< credit_deal_id_type >()) const
 Get a list of credit deals by the ID of a credit offer. More...
 
vector< credit_deal_objectget_credit_deals_by_offer_owner (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_deal_id_type > &start_id=optional< credit_deal_id_type >()) const
 Get a list of credit deals by the name or ID of a credit offer owner account. More...
 
vector< credit_deal_objectget_credit_deals_by_borrower (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_deal_id_type > &start_id=optional< credit_deal_id_type >()) const
 Get a list of credit deals by the name or ID of a borrower account. More...
 
vector< credit_deal_objectget_credit_deals_by_debt_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_deal_id_type > &start_id=optional< credit_deal_id_type >()) const
 Get a list of credit deals by the symbol or ID of the debt asset type. More...
 
vector< credit_deal_objectget_credit_deals_by_collateral_asset (const std::string &asset_symbol_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< credit_deal_id_type > &start_id=optional< credit_deal_id_type >()) const
 Get a list of credit deals by the symbol or ID of the collateral asset type. More...
 

Detailed Description

The database_api class implements the RPC API for the chain database.

This API exposes accessors on the database which query state tracked by a blockchain validating node. This API is read-only; all modifications to the database must be performed via transactions. Transactions are broadcast via the network_broadcast_api.

Definition at line 70 of file database_api.hpp.

Constructor & Destructor Documentation

◆ database_api()

graphene::app::database_api::database_api ( graphene::chain::database db,
const application_options app_options = nullptr 
)

Definition at line 52 of file database_api.cpp.

◆ ~database_api()

graphene::app::database_api::~database_api ( )
default

Member Function Documentation

◆ cancel_all_subscriptions()

void graphene::app::database_api::cancel_all_subscriptions ( )

Stop receiving any notifications.

This unsubscribes from all subscribed markets and objects.

Definition at line 216 of file database_api.cpp.

◆ get_24_volume()

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

Returns the 24 hour volume for the market assetA:assetB.

Parameters
basesymbol name or ID of the base asset
quotesymbol name or ID of the quote asset
Returns
The market volume over the past 24 hours

Definition at line 1426 of file database_api.cpp.

◆ get_account_balances()

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

Get an account's balances in various assets.

Parameters
account_name_or_idname or ID of the account to get balances for
assetsIDs of the assets to get balances of; if empty, get all assets account has a balance in
Returns
Balances of the account

Definition at line 829 of file database_api.cpp.

◆ get_account_by_name()

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

Get info of an account by name.

Parameters
nameName of the account to retrieve
Returns
The account holding the provided name

Definition at line 727 of file database_api.cpp.

◆ get_account_count()

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

Get the total number of accounts registered with the blockchain.

Definition at line 813 of file database_api.cpp.

◆ get_account_id_from_string()

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

Get account object from a name or ID.

Parameters
name_or_idname or ID of the account
Returns
Account ID

Definition at line 487 of file database_api.cpp.

◆ get_account_limit_orders()

vector< limit_order_object > graphene::app::database_api::get_account_limit_orders ( const string &  account_name_or_id,
const string &  base,
const string &  quote,
uint32_t  limit = application_options::get_default().api_limit_get_account_limit_orders,
optional< limit_order_id_type >  ostart_id = optional<limit_order_id_type>(),
optional< price >  ostart_price = optional<price>() 
)

Fetch all orders relevant to the specified account and specified market, result orders are sorted descendingly by price.

Parameters
account_name_or_idThe name or ID of an account to retrieve
baseBase asset
quoteQuote asset
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_account_limit_orders
ostart_idStart order id, fetch orders which price lower than this order, or price equal to this order but order ID greater than this order
ostart_priceFetch orders with price lower than or equal to this price
Returns
List of orders from account_name_or_id to the corresponding account
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. ostart_id and ostart_price can be empty, if so the api will return the "first page" of orders; if ostart_id is specified, its price will be used to do page query preferentially, otherwise the ostart_price will be used; ostart_id and ostart_price may be used cooperatively in case of the order specified by ostart_id was just canceled accidentally, in such case, the result orders' price may lower or equal to ostart_price, but orders' id greater than ostart_id

Definition at line 1113 of file database_api.cpp.

◆ get_account_references()

vector< account_id_type > graphene::app::database_api::get_account_references ( const std::string  account_name_or_id) const

Get all accounts that refer to the specified account in their owner or active authorities.

Parameters
account_name_or_idAccount name or ID to query
Returns
all accounts that refer to the specified account in their owner or active authorities

Definition at line 741 of file database_api.cpp.

◆ get_accounts()

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

Get a list of accounts by names or IDs.

Parameters
account_names_or_idsnames or IDs of the accounts to retrieve
subscribetrue to subscribe to the queried account objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
Returns
The accounts corresponding to the provided names or IDs

This function has semantics identical to get_objects

Definition at line 492 of file database_api.cpp.

◆ get_all_workers()

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

Get workers.

Parameters
is_expirednull for all workers, true for expired workers only, false for non-expired workers only
Returns
A list of worker objects

Definition at line 2353 of file database_api.cpp.

◆ get_asset_count()

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

Get assets count.

Returns
The assets count

Definition at line 997 of file database_api.cpp.

◆ get_asset_id_from_string()

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

Get asset ID from an asset symbol or ID.

Parameters
symbol_or_idsymbol name or ID of the asset
Returns
asset ID

Definition at line 941 of file database_api.cpp.

◆ get_assets()

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

Get a list of assets by symbol names or IDs.

Parameters
asset_symbols_or_idssymbol names or IDs of the assets to retrieve
subscribetrue to subscribe to the queried asset objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
Returns
The assets corresponding to the provided symbol names or IDs

This function has semantics identical to get_objects

Definition at line 946 of file database_api.cpp.

◆ get_assets_by_issuer()

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

Get assets issued (owned) by a given account.

Parameters
issuer_name_or_idAccount name or ID to get objects from
startAsset objects(1.3.X) before this ID will be skipped in results. Pagination purposes.
limitMaximum number of assets to retrieve, must not exceed the configured value of api_limit_get_assets
Returns
The assets issued (owned) by the account

Definition at line 1007 of file database_api.cpp.

◆ get_balance_objects()

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

Return all unclaimed balance objects for a list of addresses.

Parameters
addrsa list of addresses
Returns
all unclaimed balance objects for the addresses

Definition at line 867 of file database_api.cpp.

◆ get_blinded_balances()

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

return the set of blinded balance objects by commitment ID

Parameters
commitmentsa set of commitments to query for
Returns
the set of blinded balance objects by commitment ID

Definition at line 2807 of file database_api.cpp.

◆ get_block()

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

Retrieve a full, signed block.

Parameters
block_numHeight of the block to be returned
Returns
the referenced block, or null if no matching block was found

Definition at line 275 of file database_api.cpp.

◆ get_block_header()

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

Retrieve a block header.

Parameters
block_numHeight of the block whose header should be returned
with_witness_signatureWhether to return witness signature. Optional. If omitted or is false, will not return witness signature.
Returns
header of the referenced block, or null if no matching block was found

Definition at line 241 of file database_api.cpp.

◆ get_block_header_batch()

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

Retrieve multiple block headers by block numbers.

Parameters
block_numsvector containing heights of the blocks whose headers should be returned
with_witness_signaturesWhether to return witness signatures. Optional. If omitted or is false, will not return witness signatures.
Returns
array of headers of the referenced blocks, or null if no matching block was found

Definition at line 257 of file database_api.cpp.

◆ get_call_orders()

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

Get call orders (aka margin positions) for a given asset.

Parameters
asymbol name or ID of the debt asset
limitMaximum number of orders to retrieve, must not exceed the configured value of api_limit_get_call_orders
Returns
The call orders, ordered from earliest to be called to latest

Definition at line 1206 of file database_api.cpp.

◆ get_call_orders_by_account()

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

Get call orders (aka margin positions) of a given account.

Parameters
account_name_or_idAccount name or ID to get objects from
startAsset objects(1.3.X) before this ID will be skipped in results. Pagination purposes.
limitMaximum number of orders to retrieve, must not exceed the configured value of api_limit_get_call_orders
Returns
The call orders of the account

Definition at line 1234 of file database_api.cpp.

◆ get_chain_id()

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

Get the chain ID.

Definition at line 343 of file database_api.cpp.

◆ get_chain_properties()

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

Retrieve the graphene::chain::chain_property_object associated with the chain.

Definition at line 313 of file database_api.cpp.

◆ get_collateral_bids()

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

Get collateral_bid_objects for a given asset.

Parameters
aSymbol or ID of asset
limitMaximum number of objects to retrieve, must not exceed the configured value of api_limit_get_collateral_bids
startskip that many results
Returns
The settle orders, ordered from earliest settlement date to latest

Definition at line 1330 of file database_api.cpp.

◆ get_committee_count()

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

Get the total number of committee registered with the blockchain.

Definition at line 2336 of file database_api.cpp.

◆ get_committee_member_by_account()

fc::optional< committee_member_object > graphene::app::database_api::get_committee_member_by_account ( const string &  account_name_or_id) const

Get the committee_member owned by a given account.

Parameters
account_name_or_idThe name or ID of the account whose committee_member should be retrieved
Returns
The committee_member object, or null if the account does not have a committee_member

Definition at line 2280 of file database_api.cpp.

◆ get_committee_members()

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

Get a list of committee_members by ID.

Parameters
committee_member_idsIDs of the committee_members to retrieve
Returns
The committee_members corresponding to the provided IDs

This function has semantics identical to get_objects, but doesn't subscribe

Definition at line 2261 of file database_api.cpp.

◆ get_config()

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

Retrieve compile-time constants.

Definition at line 333 of file database_api.cpp.

◆ get_credit_deals_by_borrower()

vector< credit_deal_object > graphene::app::database_api::get_credit_deals_by_borrower ( const std::string &  account_name_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_deal_id_type > &  start_id = optional<credit_deal_id_type>() 
) const

Get a list of credit deals by the name or ID of a borrower account.

Parameters
account_name_or_idname or ID of the borrower account
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit deal id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit deals
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2128 of file database_api.cpp.

◆ get_credit_deals_by_collateral_asset()

vector< credit_deal_object > graphene::app::database_api::get_credit_deals_by_collateral_asset ( const std::string &  asset_symbol_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_deal_id_type > &  start_id = optional<credit_deal_id_type>() 
) const

Get a list of credit deals by the symbol or ID of the collateral asset type.

Parameters
asset_symbol_or_idsymbol or ID of the collateral asset type
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit deal id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit deals
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2154 of file database_api.cpp.

◆ get_credit_deals_by_debt_asset()

vector< credit_deal_object > graphene::app::database_api::get_credit_deals_by_debt_asset ( const std::string &  asset_symbol_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_deal_id_type > &  start_id = optional<credit_deal_id_type>() 
) const

Get a list of credit deals by the symbol or ID of the debt asset type.

Parameters
asset_symbol_or_idsymbol or ID of the debt asset type
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit deal id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit deals
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2141 of file database_api.cpp.

◆ get_credit_deals_by_offer_id()

vector< credit_deal_object > graphene::app::database_api::get_credit_deals_by_offer_id ( const credit_offer_id_type &  offer_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_deal_id_type > &  start_id = optional<credit_deal_id_type>() 
) const

Get a list of credit deals by the ID of a credit offer.

Parameters
offer_idID of the credit offer
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit deal id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit deals
Note
  1. If offer_id cannot be tied to a credit offer, an empty list will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2103 of file database_api.cpp.

◆ get_credit_deals_by_offer_owner()

vector< credit_deal_object > graphene::app::database_api::get_credit_deals_by_offer_owner ( const std::string &  account_name_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_deal_id_type > &  start_id = optional<credit_deal_id_type>() 
) const

Get a list of credit deals by the name or ID of a credit offer owner account.

Parameters
account_name_or_idname or ID of the credit offer owner account
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit deal id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit deals
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2115 of file database_api.cpp.

◆ get_credit_offers_by_asset()

vector< credit_offer_object > graphene::app::database_api::get_credit_offers_by_asset ( const std::string &  asset_symbol_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_offer_id_type > &  start_id = optional<credit_offer_id_type>() 
) const

Get a list of credit offers by the symbol or ID of the asset type.

Parameters
asset_symbol_or_idsymbol or ID of the asset type
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit offer id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit offers
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2079 of file database_api.cpp.

◆ get_credit_offers_by_owner()

vector< credit_offer_object > graphene::app::database_api::get_credit_offers_by_owner ( const std::string &  account_name_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_offer_id_type > &  start_id = optional<credit_offer_id_type>() 
) const

Get a list of credit offers by the name or ID of the owner account.

Parameters
account_name_or_idname or ID of the owner account
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit offer id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit offers
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2066 of file database_api.cpp.

◆ get_dynamic_global_properties()

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

Retrieve the current graphene::chain::dynamic_global_property_object.

Definition at line 353 of file database_api.cpp.

◆ get_full_accounts()

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

Fetch objects relevant to the specified accounts and optionally subscribe to updates.

Parameters
names_or_idsEach item must be the name or ID of an account to retrieve, the quantity should not be greater than the configured value of api_limit_get_full_accounts
subscribetrue to subscribe to the queried full account objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
Returns
Map of string from names_or_ids to the corresponding account

This function fetches relevant objects for the given accounts, and subscribes to updates to the given accounts. If any of the strings in names_or_ids cannot be tied to an account, that input will be ignored. Other accounts will be retrieved and subscribed.

Note
The maximum number of accounts allowed to subscribe per connection is configured by the api_limit_get_full_accounts_subscribe option. Exceeded subscriptions will be ignored.
For each object type, the maximum number of objects to return is configured by the api_limit_get_full_accounts_lists option. Exceeded objects need to be queried with other APIs.

Definition at line 516 of file database_api.cpp.

◆ get_global_properties()

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

Retrieve the current graphene::chain::global_property_object.

Definition at line 323 of file database_api.cpp.

◆ get_htlc()

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

Get HTLC object.

Parameters
idHTLC contract id
subscribetrue to subscribe to the queried HTLC objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
Returns
HTLC object for the id

Definition at line 2907 of file database_api.cpp.

◆ get_htlc_by_from()

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

Get non expired HTLC objects using the sender account.

Parameters
account_name_or_idAccount name or ID to get objects from
starthtlc objects before this ID will be skipped in results. Pagination purposes.
limitMaximum number of objects to retrieve, must not exceed the configured value of api_limit_get_htlc_by
Returns
HTLC objects for the account

Definition at line 2922 of file database_api.cpp.

◆ get_htlc_by_to()

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

Get non expired HTLC objects using the receiver account.

Parameters
account_name_or_idAccount name or ID to get objects from
starthtlc objects before this ID will be skipped in results. Pagination purposes.
limitMaximum number of objects to retrieve, must not exceed the configured value of api_limit_get_htlc_by
Returns
HTLC objects for the account

Definition at line 2952 of file database_api.cpp.

◆ get_key_references()

vector< flat_set< account_id_type > > graphene::app::database_api::get_key_references ( vector< public_key_type >  keys) const

Get all accounts that refer to the specified public keys in their owner authority, active authorities or memo key.

Parameters
keysa list of public keys to query, the quantity should not be greater than the configured value of api_limit_get_key_references
Returns
ID of all accounts that refer to the specified keys

Definition at line 386 of file database_api.cpp.

◆ get_limit_orders()

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

Get limit orders in a given market.

Parameters
asymbol or ID of asset being sold
bsymbol or ID of asset being purchased
limitMaximum number of orders to retrieve, must not exceed the configured value of api_limit_get_limit_orders
Returns
The limit orders, ordered from least price to greatest

Definition at line 1053 of file database_api.cpp.

◆ get_limit_orders_by_account()

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

Fetch open limit orders in all markets relevant to the specified account, ordered by ID.

Parameters
account_name_or_idThe name or ID of an account to retrieve
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_limit_orders_by_account
start_idStart order id, fetch orders whose IDs are greater than or equal to this order
Returns
List of limit orders of the specified account
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_limit_orders_by_account will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of orders
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1073 of file database_api.cpp.

◆ get_liquidity_pools()

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

Get a list of liquidity pools by their IDs.

Parameters
idsIDs of the liquidity pools, the quantity should not be greater than the configured value of api_limit_get_liquidity_pools
subscribetrue to subscribe to the queried objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
if an ID in the list can not be found, the corresponding data in the returned list is null.

Definition at line 1862 of file database_api.cpp.

◆ get_liquidity_pools_by_asset_a()

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

Get a list of liquidity pools by the symbol or ID of the first asset in the pool.

Parameters
asset_symbol_or_idsymbol name or ID of the asset
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools
start_idStart liquidity pool id, fetch pools whose IDs are greater than or equal to this ID
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of pools
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1763 of file database_api.cpp.

◆ get_liquidity_pools_by_asset_b()

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

Get a list of liquidity pools by the symbol or ID of the second asset in the pool.

Parameters
asset_symbol_or_idsymbol name or ID of the asset
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools
start_idStart liquidity pool id, fetch pools whose IDs are greater than or equal to this ID
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of pools
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1777 of file database_api.cpp.

◆ get_liquidity_pools_by_both_assets()

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

Get a list of liquidity pools by the symbols or IDs of the two assets in the pool.

Parameters
asset_symbol_or_id_asymbol name or ID of one asset
asset_symbol_or_id_bsymbol name or ID of the other asset
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools
start_idStart liquidity pool id, fetch pools whose IDs are greater than or equal to this ID
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
  1. If asset_symbol_or_id_a or asset_symbol_or_id_b cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of pools
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1843 of file database_api.cpp.

◆ get_liquidity_pools_by_one_asset()

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

Get a list of liquidity pools by the symbol or ID of one asset in the pool.

Parameters
asset_symbol_or_idsymbol name or ID of the asset
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools
start_idStart liquidity pool id, fetch pools whose IDs are greater than or equal to this ID
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of pools
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1791 of file database_api.cpp.

◆ get_liquidity_pools_by_owner()

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

Get a list of liquidity pools by the name or ID of the owner account.

Parameters
account_name_or_idname or ID of the owner account
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools
start_idStart share asset id, fetch pools whose share asset IDs are greater than or equal to this ID
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of pools
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1953 of file database_api.cpp.

◆ get_liquidity_pools_by_share_asset()

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

Get a list of liquidity pools by their share asset symbols or IDs.

Parameters
asset_symbols_or_idssymbol names or IDs of the share assets, the quantity should not be greater than the configured value of api_limit_get_liquidity_pools
subscribetrue to subscribe to the queried objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
with_statisticsWhether to return statistics
Returns
The liquidity pools that the assets are for
Note
if an asset in the list can not be found or is not a share asset of any liquidity pool, the corresponding data in the returned list is null.

Definition at line 1908 of file database_api.cpp.

◆ get_margin_positions()

vector< call_order_object > graphene::app::database_api::get_margin_positions ( const std::string &  account_name_or_id) const

Get open margin positions of a given account.

Parameters
account_name_or_idname or ID of an account
Returns
open margin positions of the account

Similar to get_call_orders_by_account, but only the first page will be returned, the page size is the configured value of api_limit_get_call_orders.

Definition at line 1323 of file database_api.cpp.

◆ get_named_account_balances()

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

Semantically equivalent to get_account_balances.

Definition at line 861 of file database_api.cpp.

◆ get_next_object_id()

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

Get the next object ID in an object space.

Parameters
space_idThe space ID
type_idThe type ID
with_pending_transactionsWhether to include pending transactions
Returns
The next object ID to be assigned
Exceptions
fc::exceptionIf the object space does not exist, or with_pending_transactions is false but the api_helper_indexes plugin is not enabled

Definition at line 363 of file database_api.cpp.

◆ get_objects()

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

Get the objects corresponding to the provided IDs.

Parameters
idsIDs of the objects to retrieve
subscribetrue to subscribe to the queried objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
Returns
The objects retrieved, in the order they are mentioned in ids
Note
operation_history_object (1.11.x) and account_history_object (2.9.x) can not be subscribed.

If any of the provided IDs does not map to an object, a null variant is returned in its position.

Definition at line 135 of file database_api.cpp.

◆ get_order_book()

order_book graphene::app::database_api::get_order_book ( const string &  base,
const string &  quote,
uint32_t  limit = application_options::get_default().api_limit_get_order_book 
) const

Returns the order book for the market base:quote.

Parameters
basesymbol name or ID of the base asset
quotesymbol name or ID of the quote asset
limitdepth of the order book to retrieve, for bids and asks each, capped at the configured value of api_limit_get_order_book and api_limit_get_limit_orders
Returns
Order book of the market

Definition at line 1445 of file database_api.cpp.

◆ get_potential_address_signatures()

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

This method will return the set of all addresses that could possibly sign for a given transaction.

Parameters
trxthe transaction to be signed
Returns
a set of addresses that could possibly sign for the given transaction

Definition at line 2548 of file database_api.cpp.

◆ get_potential_signatures()

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

This method will return the set of all public keys that could possibly sign for a given transaction. This call can be used by wallets to filter their set of public keys to just the relevant subset prior to calling get_required_signatures to get the minimum subset.

Parameters
trxthe transaction to be signed
Returns
a set of public keys that could possibly sign for the given transaction

Definition at line 2544 of file database_api.cpp.

◆ get_proposed_transactions()

vector< proposal_object > graphene::app::database_api::get_proposed_transactions ( const std::string  account_name_or_id) const

return a set of proposed transactions (aka proposals) that the specified account can add approval to or remove approval from

Parameters
account_name_or_idThe name or ID of an account
Returns
a set of proposed transactions that the specified account can act on

Definition at line 2772 of file database_api.cpp.

◆ get_recent_transaction_by_id()

optional< signed_transaction > graphene::app::database_api::get_recent_transaction_by_id ( const transaction_id_type &  txid) const

If the transaction has not expired, this method will return the transaction for the given ID or it will return NULL if it is not known. Just because it is not known does not mean it wasn't included in the blockchain.

Parameters
txidhash of the transaction
Returns
the corresponding transaction if found, or null if not found

Definition at line 290 of file database_api.cpp.

◆ get_required_fees()

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

For each operation calculate the required fee in the specified asset type.

Parameters
opsa list of operations to be query for required fees
asset_symbol_or_idsymbol name or ID of an asset that to be used to pay the fees
Returns
a list of objects which indicates required fees of each operation

Definition at line 2681 of file database_api.cpp.

◆ get_required_signatures()

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

This API will take a partially signed transaction and a set of public keys that the owner has the ability to sign for and return the minimal subset of public keys that should add signatures to the transaction.

Parameters
trxthe transaction to be signed
available_keysa set of public keys
Returns
a subset of available_keys that could sign for the given transaction

Definition at line 2522 of file database_api.cpp.

◆ get_samet_funds_by_asset()

vector< samet_fund_object > graphene::app::database_api::get_samet_funds_by_asset ( const std::string &  asset_symbol_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< samet_fund_id_type > &  start_id = optional<samet_fund_id_type>() 
) const

Get a list of SameT Funds by the symbol or ID of the asset type.

Parameters
asset_symbol_or_idsymbol or ID of the asset type
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_samet_funds
start_idStart SameT Fund id, fetch items whose IDs are greater than or equal to this ID
Returns
The SameT Funds
Note
  1. If asset_symbol_or_id cannot be tied to an asset, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_samet_funds will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2035 of file database_api.cpp.

◆ get_samet_funds_by_owner()

vector< samet_fund_object > graphene::app::database_api::get_samet_funds_by_owner ( const std::string &  account_name_or_id,
const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< samet_fund_id_type > &  start_id = optional<samet_fund_id_type>() 
) const

Get a list of SameT Funds by the name or ID of the owner account.

Parameters
account_name_or_idname or ID of the owner account
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_samet_funds
start_idStart SameT Fund id, fetch items whose IDs are greater than or equal to this ID
Returns
The SameT Funds
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_samet_funds will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of data
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2022 of file database_api.cpp.

◆ get_settle_orders()

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

Get forced settlement orders in a given asset.

Parameters
aSymbol or ID of asset being settled
limitMaximum number of orders to retrieve, must not exceed the configured value of api_limit_get_settle_orders
Returns
The settle orders, ordered from earliest settlement date to latest

Definition at line 1262 of file database_api.cpp.

◆ get_settle_orders_by_account()

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

Get forced settlement orders of a given account.

Parameters
account_name_or_idAccount name or ID to get objects from
startForce settlement objects(1.4.X) before this ID will be skipped in results. Pagination purposes.
limitMaximum number of orders to retrieve, must not exceed the configured value of api_limit_get_settle_orders
Returns
The settle orders, ordered from earliest settlement date to latest
The settle orders of the account

Definition at line 1290 of file database_api.cpp.

◆ get_ticker()

market_ticker graphene::app::database_api::get_ticker ( const string &  base,
const string &  quote 
) const

Returns the ticker for the market assetA:assetB.

Parameters
basesymbol name or ID of the base asset
quotesymbol name or ID of the quote asset
Returns
The market ticker for the past 24 hours.

Definition at line 1392 of file database_api.cpp.

◆ get_tickets_by_account()

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

Get a list of tickets by the name or ID of the owner account.

Parameters
account_name_or_idname or ID of the owner account
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_tickets
start_idStart ticket id, fetch tickets whose IDs are greater than or equal to this ID
Returns
The tickets
Note
  1. If account_name_or_id cannot be tied to an account, an error will be returned
  2. limit can be omitted or be null, if so the configured value of api_limit_get_tickets will be used
  3. start_id can be omitted or be null, if so the api will return the "first page" of tickets
  4. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 3023 of file database_api.cpp.

◆ get_top_markets()

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

Returns vector of tickers sorted by reverse base_volume.

Note
this API is experimental and subject to change in next releases
Parameters
limitMax number of results, must not exceed the configured value of api_limit_get_top_markets
Returns
Desc Sorted ticker vector

Definition at line 1494 of file database_api.cpp.

◆ get_top_voters()

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

Returns vector of voting power sorted by reverse vp_active.

Parameters
limitMaximum number of accounts to retrieve, must not exceed the configured value of api_limit_get_top_voters
Returns
Desc Sorted voting power vector

Definition at line 701 of file database_api.cpp.

◆ get_trade_history()

vector< market_trade > graphene::app::database_api::get_trade_history ( const string &  base,
const string &  quote,
fc::time_point_sec  start,
fc::time_point_sec  stop,
uint32_t  limit = application_options::get_default().api_limit_get_trade_history 
) const

Get market transactions occurred in the market base:quote, ordered by time, most recent first.

Parameters
basesymbol or ID of the base asset
quotesymbol or ID of the quote asset
startStart time as a UNIX timestamp, the latest transactions to retrieve
stopStop time as a UNIX timestamp, the earliest transactions to retrieve
limitMaximum quantity of transactions to retrieve, capped at the configured value of api_limit_get_trade_history
Returns
Transactions in the market
Note
The time must be UTC, timezone offsets are not supported. The range is [stop, start]. In case when there are more transactions than limit occurred in the same second, this API only returns the most recent records, the rest records can be retrieved with the get_trade_history_by_sequence API.

Definition at line 1527 of file database_api.cpp.

◆ get_trade_history_by_sequence()

vector< market_trade > graphene::app::database_api::get_trade_history_by_sequence ( const string &  base,
const string &  quote,
int64_t  start,
fc::time_point_sec  stop,
uint32_t  limit = application_options::get_default().api_limit_get_trade_history_by_sequence 
) const

Get market transactions occurred in the market base:quote, ordered by time, most recent first.

Parameters
basesymbol or ID of the base asset
quotesymbol or ID of the quote asset
startStart sequence as an Integer, the latest transaction to retrieve
stopStop time as a UNIX timestamp, the earliest transactions to retrieve
limitMaximum quantity of transactions to retrieve, capped at the configured value of api_limit_get_trade_history_by_sequence
Returns
Transactions in the market
Note
The time must be UTC, timezone offsets are not supported. The range is [stop, start].

Definition at line 1628 of file database_api.cpp.

◆ get_transaction()

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

used to fetch an individual transaction.

Parameters
block_numheight of the block to fetch
trx_in_blockthe index (sequence number) of the transaction in the block, starts from 0
Returns
the transaction at the given position

Definition at line 285 of file database_api.cpp.

◆ get_transaction_hex()

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

Get a hexdump of the serialized binary form of a transaction.

Parameters
trxa transaction to get hexdump from
Returns
the hexdump of the transaction

Definition at line 2500 of file database_api.cpp.

◆ get_transaction_hex_without_sig()

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

Get a hexdump of the serialized binary form of a signatures-stripped transaction.

Parameters
trxa transaction to get hexdump from
Returns
the hexdump of the transaction without the signatures

Definition at line 2510 of file database_api.cpp.

◆ get_vested_balances()

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

Calculate how much assets in the given balance objects are able to be claimed at current head block time.

Parameters
objsa list of balance object IDs
Returns
a list indicating how much asset in each balance object is available to be claimed

Definition at line 895 of file database_api.cpp.

◆ get_vesting_balances()

vector< vesting_balance_object > graphene::app::database_api::get_vesting_balances ( const std::string  account_name_or_id) const

Return all vesting balance objects owned by an account.

Parameters
account_name_or_idname or ID of an account
Returns
all vesting balance objects owned by the account

Definition at line 913 of file database_api.cpp.

◆ get_withdraw_permissions_by_giver()

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

Get non expired withdraw permission objects for a giver(ex:recurring customer)

Parameters
account_name_or_idAccount name or ID to get objects from
startWithdraw permission objects(1.12.X) before this ID will be skipped in results. Pagination purposes.
limitMaximum number of objects to retrieve, must not exceed the configured value of api_limit_get_withdraw_permissions_by_giver
Returns
Withdraw permission objects for the account

Definition at line 2834 of file database_api.cpp.

◆ get_withdraw_permissions_by_recipient()

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

Get non expired withdraw permission objects for a recipient(ex:service provider)

Parameters
account_name_or_idAccount name or ID to get objects from
startWithdraw permission objects(1.12.X) before this ID will be skipped in results. Pagination purposes.
limitMaximum number of objects to retrieve, must not exceed the configured value of api_limit_get_withdraw_permissions_by_recipient
Returns
Withdraw permission objects for the account

Definition at line 2868 of file database_api.cpp.

◆ get_witness_by_account()

fc::optional< witness_object > graphene::app::database_api::get_witness_by_account ( const std::string &  account_name_or_id) const

Get the witness owned by a given account.

Parameters
account_name_or_idThe name or ID of the account whose witness should be retrieved
Returns
The witness object, or null if the account does not have a witness

Definition at line 2191 of file database_api.cpp.

◆ get_witness_count()

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

Get the total number of witnesses registered with the blockchain.

Definition at line 2245 of file database_api.cpp.

◆ get_witnesses()

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

Get a list of witnesses by ID.

Parameters
witness_idsIDs of the witnesses to retrieve
Returns
The witnesses corresponding to the provided IDs

This function has semantics identical to get_objects, but doesn't subscribe

Definition at line 2174 of file database_api.cpp.

◆ get_worker_count()

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

Get the total number of workers registered with the blockchain.

Definition at line 2405 of file database_api.cpp.

◆ get_workers_by_account()

vector< worker_object > graphene::app::database_api::get_workers_by_account ( const std::string &  account_name_or_id) const

Get the workers owned by a given account.

Parameters
account_name_or_idThe name or ID of the account whose worker should be retrieved
Returns
A list of worker objects owned by the account

Definition at line 2386 of file database_api.cpp.

◆ is_public_key_registered()

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

Determine whether a textual representation of a public key (in Base-58 format) is currently linked to any registered (i.e. non-stealth) account on the blockchain

Parameters
public_keyPublic key
Returns
Whether a public key is known

Definition at line 447 of file database_api.cpp.

◆ list_assets()

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

Get assets alphabetically by symbol name.

Parameters
lower_bound_symbolLower bound of symbol names to retrieve
limitMaximum number of assets to fetch, must not exceed the configured value of api_limit_get_assets
Returns
The assets found

Definition at line 972 of file database_api.cpp.

◆ list_credit_deals()

vector< credit_deal_object > graphene::app::database_api::list_credit_deals ( const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_deal_id_type > &  start_id = optional<credit_deal_id_type>() 
) const

Get a list of credit deals.

Parameters
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit deal id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit deals
Note
  1. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  2. start_id can be omitted or be null, if so the api will return the "first page" of data
  3. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2092 of file database_api.cpp.

◆ list_credit_offers()

vector< credit_offer_object > graphene::app::database_api::list_credit_offers ( const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< credit_offer_id_type > &  start_id = optional<credit_offer_id_type>() 
) const

Get a list of credit offers.

Credit offers and credit deals

Parameters
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers
start_idStart credit offer id, fetch items whose IDs are greater than or equal to this ID
Returns
The credit offers
Note
  1. limit can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be used
  2. start_id can be omitted or be null, if so the api will return the "first page" of data
  3. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2055 of file database_api.cpp.

◆ list_htlcs()

vector< htlc_object > graphene::app::database_api::list_htlcs ( const htlc_id_type  start,
uint32_t  limit 
) const

Get all HTLCs.

Parameters
startLower bound of htlc id to start getting results
limitMaximum number of htlc objects to fetch, must not exceed the configured value of api_limit_list_htlcs
Returns
The htlc object list

Definition at line 2982 of file database_api.cpp.

◆ list_liquidity_pools()

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

Get a list of liquidity pools.

Parameters
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools
start_idStart liquidity pool id, fetch pools whose IDs are greater than or equal to this ID
with_statisticsWhether to return statistics
Returns
The liquidity pools
Note
  1. limit can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be used
  2. start_id can be omitted or be null, if so the api will return the "first page" of pools
  3. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 1752 of file database_api.cpp.

◆ list_samet_funds()

vector< samet_fund_object > graphene::app::database_api::list_samet_funds ( const optional< uint32_t > &  limit = optional<uint32_t>(),
const optional< samet_fund_id_type > &  start_id = optional<samet_fund_id_type>() 
) const

Get a list of SameT Funds.

SameT Funds

Parameters
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_samet_funds
start_idStart SameT Fund id, fetch items whose IDs are greater than or equal to this ID
Returns
The SameT Funds
Note
  1. limit can be omitted or be null, if so the configured value of api_limit_get_samet_funds will be used
  2. start_id can be omitted or be null, if so the api will return the "first page" of data
  3. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 2011 of file database_api.cpp.

◆ list_tickets()

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

Get a list of tickets.

Parameters
limitThe limitation of items each query can fetch, not greater than the configured value of api_limit_get_tickets
start_idStart ticket id, fetch tickets whose IDs are greater than or equal to this ID
Returns
The tickets
Note
  1. limit can be omitted or be null, if so the configured value of api_limit_get_tickets will be used
  2. start_id can be omitted or be null, if so the api will return the "first page" of tickets
  3. One or more optional parameters can be omitted from the end of the parameter list, and the optional parameters in the middle cannot be omitted (but can be null).

Definition at line 3012 of file database_api.cpp.

◆ lookup_account_names()

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

Get a list of accounts by name.

Parameters
account_namesNames of the accounts to retrieve
Returns
The accounts holding the provided names

This function has semantics identical to get_objects, but doesn't subscribe.

Definition at line 767 of file database_api.cpp.

◆ lookup_accounts()

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

Get names and IDs for registered accounts.

Parameters
lower_bound_nameLower bound of the first name to return
limitMaximum number of results to return, must not exceed the configured value of api_limit_lookup_accounts
subscribetrue to subscribe to the queried account objects, false to not subscribe, null to subscribe or not subscribe according to current auto-subscription setting (see set_auto_subscription)
Returns
Map of account names to corresponding IDs
Note
In addition to the common auto-subscription rules, this API will subscribe to the returned account only if limit is 1.

Definition at line 777 of file database_api.cpp.

◆ lookup_asset_symbols()

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

Get a list of assets by symbol names or IDs.

Parameters
symbols_or_idssymbol names or IDs of the assets to retrieve
Returns
The assets corresponding to the provided symbols or IDs

This function has semantics identical to get_objects, but doesn't subscribe

Definition at line 1035 of file database_api.cpp.

◆ lookup_committee_member_accounts()

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

Get names and IDs for registered committee_members.

Parameters
lower_bound_nameLower bound of the first name to return
limitMaximum number of results to return, must not exceed the configured value of api_limit_lookup_committee_member_accounts
Returns
Map of committee_member names to corresponding IDs

Definition at line 2297 of file database_api.cpp.

◆ lookup_vote_ids()

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

Given a set of votes, return the objects they are voting for.

Parameters
votesa list of vote IDs, the quantity should not be greater than the configured value of api_limit_lookup_vote_ids
Returns
the referenced objects

This will be a mixture of committee_member_objects, witness_objects, and worker_objects

The results will be in the same order as the votes. Null will be returned for any vote IDs that are not found.

Definition at line 2423 of file database_api.cpp.

◆ lookup_witness_accounts()

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

Get names and IDs for registered witnesses.

Parameters
lower_bound_nameLower bound of the first name to return
limitMaximum number of results to return, must not exceed the configured value of api_limit_lookup_witness_accounts
Returns
Map of witness names to corresponding IDs

Definition at line 2206 of file database_api.cpp.

◆ set_auto_subscription()

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

Set auto-subscription behavior of follow-up API queries.

Parameters
enablewhether follow-up API queries will automatically subscribe to queried objects

Impacts behavior of these APIs:

  • get_accounts
  • get_assets
  • get_objects
  • lookup_accounts
  • get_full_accounts
  • get_htlc
  • get_liquidity_pools
  • get_liquidity_pools_by_share_asset

Note: auto-subscription is enabled by default

See also
set_subscribe_callback

Definition at line 186 of file database_api.cpp.

◆ set_block_applied_callback()

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

Register a callback handle which will get notified when a block is pushed to database.

Parameters
cbThe callback handle to register

Definition at line 206 of file database_api.cpp.

◆ set_pending_transaction_callback()

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

Register a callback handle which will get notified when a transaction is pushed to database.

Parameters
cbThe callback handle to register

Note: a transaction can be pushed to database and be popped from database several times while processing, before and after included in a block. Everytime when a push is done, the client will be notified.

Definition at line 196 of file database_api.cpp.

◆ set_subscribe_callback()

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

Register a callback handle which then can be used to subscribe to object database changes.

Parameters
cbThe callback handle to register
notify_remove_createWhether subscribe to universal object creation and removal events. If this is set to true, the API server will notify all newly created objects and ID of all newly removed objects to the client, no matter whether client subscribed to the objects. By default, API servers don't allow subscribing to universal events, which can be changed on server startup.

Note: auto-subscription is enabled by default and can be disabled with set_auto_subscription API.

Definition at line 167 of file database_api.cpp.

◆ subscribe_to_market()

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

Request notification when the active orders in the market between two assets changes.

Parameters
callbackCallback method which is called when the market changes
asymbol name or ID of the first asset
bsymbol name or ID of the second asset

Callback will be passed a variant containing a vector<pair<operation, operation_result>>. The vector will contain, in order, the operations which changed the market, and their results.

Definition at line 1360 of file database_api.cpp.

◆ unsubscribe_from_market()

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

Unsubscribe from updates to a given market.

Parameters
asymbol name or ID of the first asset
bsymbol name or ID of the second asset

Definition at line 1377 of file database_api.cpp.

◆ validate_transaction()

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

Validates a transaction against the current state without broadcasting it on the network.

Parameters
trxa transaction to be validated
Returns
a processed_transaction object if the transaction passes the validation, otherwise an exception will be thrown

Definition at line 2671 of file database_api.cpp.

◆ verify_account_authority()

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

Verify that the public keys have enough authority to approve an operation for this account.

Parameters
account_name_or_idname or ID of an account to check
signersthe public keys
Returns
true if the passed in keys have enough authority to approve an operation for this account

Definition at line 2639 of file database_api.cpp.

◆ verify_authority()

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

Check whether a transaction has all of the required signatures

Parameters
trxa transaction to be verified
Returns
true if the trx has all of the required signatures, otherwise throws an exception

Definition at line 2621 of file database_api.cpp.


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