BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
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_header > | get_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_block > | get_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_object > | get_top_voters (uint32_t limit) const |
Returns vector of voting power sorted by reverse vp_active. More... | |
optional< account_object > | get_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< asset > | 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. More... | |
vector< asset > | get_named_account_balances (const std::string &name, const flat_set< asset_id_type > &assets) const |
Semantically equivalent to get_account_balances. More... | |
vector< balance_object > | get_balance_objects (const vector< address > &addrs) const |
Return all unclaimed balance objects for a list of addresses. More... | |
vector< asset > | 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. More... | |
vector< vesting_balance_object > | get_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_object > | list_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_object > | 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. More... | |
vector< limit_order_object > | get_limit_orders (std::string a, std::string b, uint32_t limit) const |
Get limit orders in a given market. More... | |
vector< limit_order_object > | 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. More... | |
vector< limit_order_object > | get_account_limit_orders (const string &account_name_or_id, const string &base, const string "e, 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_object > | get_call_orders (const std::string &a, uint32_t limit) const |
Get call orders (aka margin positions) for a given asset. More... | |
vector< call_order_object > | 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. More... | |
vector< force_settlement_object > | get_settle_orders (const std::string &a, uint32_t limit) const |
Get forced settlement orders in a given asset. More... | |
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 |
Get forced settlement orders of a given account. More... | |
vector< collateral_bid_object > | get_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_object > | get_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 "e) const |
Returns the ticker for the market assetA:assetB. More... | |
market_volume | get_24_volume (const string &base, const string "e) const |
Returns the 24 hour volume for the market assetA:assetB. More... | |
order_book | get_order_book (const string &base, const string "e, 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_ticker > | get_top_markets (uint32_t limit) const |
Returns vector of tickers sorted by reverse base_volume. More... | |
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=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_trade > | get_trade_history_by_sequence (const string &base, const string "e, 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_object > | 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. More... | |
vector< extended_liquidity_pool_object > | 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. More... | |
vector< extended_liquidity_pool_object > | 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. More... | |
vector< extended_liquidity_pool_object > | 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. More... | |
vector< extended_liquidity_pool_object > | 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. 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_object > | 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. 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_object > | get_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_object > | get_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_object > | get_all_workers (const optional< bool > &is_expired=optional< bool >()) const |
Get workers. More... | |
vector< worker_object > | get_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::variant > | 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. More... | |
vector< proposal_object > | 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 More... | |
vector< blinded_balance_object > | get_blinded_balances (const flat_set< commitment_type > &commitments) const |
return the set of blinded balance objects by commitment ID More... | |
vector< withdraw_permission_object > | 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) More... | |
vector< withdraw_permission_object > | 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) More... | |
optional< htlc_object > | get_htlc (htlc_id_type id, optional< bool > subscribe=optional< bool >()) const |
Get HTLC object. More... | |
vector< htlc_object > | 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. More... | |
vector< htlc_object > | 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. More... | |
vector< htlc_object > | list_htlcs (const htlc_id_type start, uint32_t limit) const |
Get all HTLCs. More... | |
vector< ticket_object > | 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. More... | |
vector< ticket_object > | 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. More... | |
vector< samet_fund_object > | 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. More... | |
vector< samet_fund_object > | 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. More... | |
vector< samet_fund_object > | 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. More... | |
vector< credit_offer_object > | 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. More... | |
vector< credit_offer_object > | 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. More... | |
vector< credit_offer_object > | 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. More... | |
vector< credit_deal_object > | 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. More... | |
vector< credit_deal_object > | 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. More... | |
vector< credit_deal_object > | 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. More... | |
vector< credit_deal_object > | 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. More... | |
vector< credit_deal_object > | 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. More... | |
vector< credit_deal_object > | 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. More... | |
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.
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.
|
default |
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.
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.
base | symbol name or ID of the base asset |
quote | symbol name or ID of the quote asset |
Definition at line 1426 of file database_api.cpp.
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.
account_name_or_id | name or ID of the account to get balances for |
assets | IDs of the assets to get balances of; if empty, get all assets account has a balance in |
Definition at line 829 of file database_api.cpp.
optional< account_object > graphene::app::database_api::get_account_by_name | ( | string | name | ) | const |
Get info of an account by name.
name | Name of the account to retrieve |
Definition at line 727 of file database_api.cpp.
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.
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.
name_or_id | name or ID of the account |
Definition at line 487 of file database_api.cpp.
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.
account_name_or_id | The name or ID of an account to retrieve |
base | Base asset |
quote | Quote asset |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_account_limit_orders |
ostart_id | Start order id, fetch orders which price lower than this order, or price equal to this order but order ID greater than this order |
ostart_price | Fetch orders with price lower than or equal to this price |
account_name_or_id
to the corresponding accountaccount_name_or_id
cannot be tied to an account, an error will be returnedostart_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.
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.
account_name_or_id | Account name or ID to query |
Definition at line 741 of file database_api.cpp.
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.
account_names_or_ids | names or IDs of the accounts to retrieve |
subscribe | true 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) |
This function has semantics identical to get_objects
Definition at line 492 of file database_api.cpp.
vector< worker_object > graphene::app::database_api::get_all_workers | ( | const optional< bool > & | is_expired = optional<bool>() | ) | const |
Get workers.
is_expired | null for all workers, true for expired workers only, false for non-expired workers only |
Definition at line 2353 of file database_api.cpp.
uint64_t graphene::app::database_api::get_asset_count | ( | ) | const |
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.
symbol_or_id | symbol name or ID of the asset |
Definition at line 941 of file database_api.cpp.
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.
asset_symbols_or_ids | symbol names or IDs of the assets to retrieve |
subscribe | true 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) |
This function has semantics identical to get_objects
Definition at line 946 of file database_api.cpp.
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.
issuer_name_or_id | Account name or ID to get objects from |
start | Asset objects(1.3.X) before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of assets to retrieve, must not exceed the configured value of api_limit_get_assets |
Definition at line 1007 of file database_api.cpp.
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.
addrs | a list of addresses |
Definition at line 867 of file database_api.cpp.
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
commitments | a set of commitments to query for |
Definition at line 2807 of file database_api.cpp.
optional< signed_block > graphene::app::database_api::get_block | ( | uint32_t | block_num | ) | const |
Retrieve a full, signed block.
block_num | Height of the block to be returned |
Definition at line 275 of file database_api.cpp.
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.
block_num | Height of the block whose header should be returned |
with_witness_signature | Whether to return witness signature. Optional. If omitted or is false, will not return witness signature. |
Definition at line 241 of file database_api.cpp.
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.
block_nums | vector containing heights of the blocks whose headers should be returned |
with_witness_signatures | Whether to return witness signatures. Optional. If omitted or is false, will not return witness signatures. |
Definition at line 257 of file database_api.cpp.
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.
a | symbol name or ID of the debt asset |
limit | Maximum number of orders to retrieve, must not exceed the configured value of api_limit_get_call_orders |
Definition at line 1206 of file database_api.cpp.
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.
account_name_or_id | Account name or ID to get objects from |
start | Asset objects(1.3.X) before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of orders to retrieve, must not exceed the configured value of api_limit_get_call_orders |
Definition at line 1234 of file database_api.cpp.
chain_id_type graphene::app::database_api::get_chain_id | ( | ) | const |
Get the chain ID.
Definition at line 343 of file database_api.cpp.
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.
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.
a | Symbol or ID of asset |
limit | Maximum number of objects to retrieve, must not exceed the configured value of api_limit_get_collateral_bids |
start | skip that many results |
Definition at line 1330 of file database_api.cpp.
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.
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.
account_name_or_id | The name or ID of the account whose committee_member should be retrieved |
Definition at line 2280 of file database_api.cpp.
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.
committee_member_ids | IDs of the committee_members to retrieve |
This function has semantics identical to get_objects, but doesn't subscribe
Definition at line 2261 of file database_api.cpp.
fc::variant_object graphene::app::database_api::get_config | ( | ) | const |
Retrieve compile-time constants.
Definition at line 333 of file database_api.cpp.
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.
account_name_or_id | name or ID of the borrower account |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit deal id, fetch items whose IDs are greater than or equal to this ID |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2128 of file database_api.cpp.
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.
asset_symbol_or_id | symbol or ID of the collateral asset type |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit deal id, fetch items whose IDs are greater than or equal to this ID |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2154 of file database_api.cpp.
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.
asset_symbol_or_id | symbol or ID of the debt asset type |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit deal id, fetch items whose IDs are greater than or equal to this ID |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2141 of file database_api.cpp.
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.
offer_id | ID of the credit offer |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit deal id, fetch items whose IDs are greater than or equal to this ID |
offer_id
cannot be tied to a credit offer, an empty list will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2103 of file database_api.cpp.
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.
account_name_or_id | name or ID of the credit offer owner account |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit deal id, fetch items whose IDs are greater than or equal to this ID |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2115 of file database_api.cpp.
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.
asset_symbol_or_id | symbol or ID of the asset type |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit offer id, fetch items whose IDs are greater than or equal to this ID |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2079 of file database_api.cpp.
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.
account_name_or_id | name or ID of the owner account |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit offer id, fetch items whose IDs are greater than or equal to this ID |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2066 of file database_api.cpp.
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.
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.
names_or_ids | Each 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 |
subscribe | true 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) |
names_or_ids
to the corresponding accountThis 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.
Definition at line 516 of file database_api.cpp.
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.
optional< htlc_object > graphene::app::database_api::get_htlc | ( | htlc_id_type | id, |
optional< bool > | subscribe = optional<bool>() |
||
) | const |
Get HTLC object.
id | HTLC contract id |
subscribe | true 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) |
Definition at line 2907 of file database_api.cpp.
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.
account_name_or_id | Account name or ID to get objects from |
start | htlc objects before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of objects to retrieve, must not exceed the configured value of api_limit_get_htlc_by |
Definition at line 2922 of file database_api.cpp.
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.
account_name_or_id | Account name or ID to get objects from |
start | htlc objects before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of objects to retrieve, must not exceed the configured value of api_limit_get_htlc_by |
Definition at line 2952 of file database_api.cpp.
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.
keys | a list of public keys to query, the quantity should not be greater than the configured value of api_limit_get_key_references |
Definition at line 386 of file database_api.cpp.
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.
a | symbol or ID of asset being sold |
b | symbol or ID of asset being purchased |
limit | Maximum number of orders to retrieve, must not exceed the configured value of api_limit_get_limit_orders |
Definition at line 1053 of file database_api.cpp.
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.
account_name_or_id | The name or ID of an account to retrieve |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_limit_orders_by_account |
start_id | Start order id, fetch orders whose IDs are greater than or equal to this order |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_limit_orders_by_account will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of ordersDefinition at line 1073 of file database_api.cpp.
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.
ids | IDs of the liquidity pools, the quantity should not be greater than the configured value of api_limit_get_liquidity_pools |
subscribe | true 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_statistics | Whether to return statistics |
Definition at line 1862 of file database_api.cpp.
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.
asset_symbol_or_id | symbol name or ID of the asset |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools |
start_id | Start liquidity pool id, fetch pools whose IDs are greater than or equal to this ID |
with_statistics | Whether to return statistics |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of poolsDefinition at line 1763 of file database_api.cpp.
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.
asset_symbol_or_id | symbol name or ID of the asset |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools |
start_id | Start liquidity pool id, fetch pools whose IDs are greater than or equal to this ID |
with_statistics | Whether to return statistics |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of poolsDefinition at line 1777 of file database_api.cpp.
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.
asset_symbol_or_id_a | symbol name or ID of one asset |
asset_symbol_or_id_b | symbol name or ID of the other asset |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools |
start_id | Start liquidity pool id, fetch pools whose IDs are greater than or equal to this ID |
with_statistics | Whether to return statistics |
asset_symbol_or_id_a
or asset_symbol_or_id_b
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of poolsDefinition at line 1843 of file database_api.cpp.
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.
asset_symbol_or_id | symbol name or ID of the asset |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools |
start_id | Start liquidity pool id, fetch pools whose IDs are greater than or equal to this ID |
with_statistics | Whether to return statistics |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of poolsDefinition at line 1791 of file database_api.cpp.
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.
account_name_or_id | name or ID of the owner account |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools |
start_id | Start share asset id, fetch pools whose share asset IDs are greater than or equal to this ID |
with_statistics | Whether to return statistics |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of poolsDefinition at line 1953 of file database_api.cpp.
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.
asset_symbols_or_ids | symbol names or IDs of the share assets, the quantity should not be greater than the configured value of api_limit_get_liquidity_pools |
subscribe | true 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_statistics | Whether to return statistics |
Definition at line 1908 of file database_api.cpp.
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.
account_name_or_id | name or ID of an 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.
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.
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.
space_id | The space ID |
type_id | The type ID |
with_pending_transactions | Whether to include pending transactions |
fc::exception | If 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.
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.
ids | IDs of the objects to retrieve |
subscribe | true 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) |
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.
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.
base | symbol name or ID of the base asset |
quote | symbol name or ID of the quote asset |
limit | depth 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 |
Definition at line 1445 of file database_api.cpp.
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.
trx | the transaction to be signed |
Definition at line 2548 of file database_api.cpp.
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.
trx | the transaction to be signed |
Definition at line 2544 of file database_api.cpp.
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
account_name_or_id | The name or ID of an account |
Definition at line 2772 of file database_api.cpp.
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.
txid | hash of the transaction |
Definition at line 290 of file database_api.cpp.
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.
ops | a list of operations to be query for required fees |
asset_symbol_or_id | symbol name or ID of an asset that to be used to pay the fees |
Definition at line 2681 of file database_api.cpp.
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.
trx | the transaction to be signed |
available_keys | a set of public keys |
available_keys
that could sign for the given transaction Definition at line 2522 of file database_api.cpp.
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.
asset_symbol_or_id | symbol or ID of the asset type |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_samet_funds |
start_id | Start SameT Fund id, fetch items whose IDs are greater than or equal to this ID |
asset_symbol_or_id
cannot be tied to an asset, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_samet_funds will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2035 of file database_api.cpp.
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.
account_name_or_id | name or ID of the owner account |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_samet_funds |
start_id | Start SameT Fund id, fetch items whose IDs are greater than or equal to this ID |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_samet_funds will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2022 of file database_api.cpp.
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.
a | Symbol or ID of asset being settled |
limit | Maximum number of orders to retrieve, must not exceed the configured value of api_limit_get_settle_orders |
Definition at line 1262 of file database_api.cpp.
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.
account_name_or_id | Account name or ID to get objects from |
start | Force settlement objects(1.4.X) before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of orders to retrieve, must not exceed the configured value of api_limit_get_settle_orders |
Definition at line 1290 of file database_api.cpp.
market_ticker graphene::app::database_api::get_ticker | ( | const string & | base, |
const string & | quote | ||
) | const |
Returns the ticker for the market assetA:assetB.
base | symbol name or ID of the base asset |
quote | symbol name or ID of the quote asset |
Definition at line 1392 of file database_api.cpp.
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.
account_name_or_id | name or ID of the owner account |
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_tickets |
start_id | Start ticket id, fetch tickets whose IDs are greater than or equal to this ID |
account_name_or_id
cannot be tied to an account, an error will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_tickets will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of ticketsDefinition at line 3023 of file database_api.cpp.
vector< market_ticker > graphene::app::database_api::get_top_markets | ( | uint32_t | limit | ) | const |
Returns vector of tickers sorted by reverse base_volume.
limit | Max number of results, must not exceed the configured value of api_limit_get_top_markets |
Definition at line 1494 of file database_api.cpp.
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.
limit | Maximum number of accounts to retrieve, must not exceed the configured value of api_limit_get_top_voters |
Definition at line 701 of file database_api.cpp.
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.
base | symbol or ID of the base asset |
quote | symbol or ID of the quote asset |
start | Start time as a UNIX timestamp, the latest transactions to retrieve |
stop | Stop time as a UNIX timestamp, the earliest transactions to retrieve |
limit | Maximum quantity of transactions to retrieve, capped at the configured value of api_limit_get_trade_history |
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.
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.
base | symbol or ID of the base asset |
quote | symbol or ID of the quote asset |
start | Start sequence as an Integer, the latest transaction to retrieve |
stop | Stop time as a UNIX timestamp, the earliest transactions to retrieve |
limit | Maximum quantity of transactions to retrieve, capped at the configured value of api_limit_get_trade_history_by_sequence |
Definition at line 1628 of file database_api.cpp.
processed_transaction graphene::app::database_api::get_transaction | ( | uint32_t | block_num, |
uint32_t | trx_in_block | ||
) | const |
used to fetch an individual transaction.
block_num | height of the block to fetch |
trx_in_block | the index (sequence number) of the transaction in the block, starts from 0 |
Definition at line 285 of file database_api.cpp.
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.
trx | a transaction to get hexdump from |
Definition at line 2500 of file database_api.cpp.
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.
trx | a transaction to get hexdump from |
Definition at line 2510 of file database_api.cpp.
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.
objs | a list of balance object IDs |
Definition at line 895 of file database_api.cpp.
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.
account_name_or_id | name or ID of an account |
Definition at line 913 of file database_api.cpp.
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)
account_name_or_id | Account name or ID to get objects from |
start | Withdraw permission objects(1.12.X) before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of objects to retrieve, must not exceed the configured value of api_limit_get_withdraw_permissions_by_giver |
Definition at line 2834 of file database_api.cpp.
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)
account_name_or_id | Account name or ID to get objects from |
start | Withdraw permission objects(1.12.X) before this ID will be skipped in results. Pagination purposes. |
limit | Maximum number of objects to retrieve, must not exceed the configured value of api_limit_get_withdraw_permissions_by_recipient |
Definition at line 2868 of file database_api.cpp.
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.
account_name_or_id | The name or ID of the account whose witness should be retrieved |
Definition at line 2191 of file database_api.cpp.
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.
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.
witness_ids | IDs of the witnesses to retrieve |
This function has semantics identical to get_objects, but doesn't subscribe
Definition at line 2174 of file database_api.cpp.
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.
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.
account_name_or_id | The name or ID of the account whose worker should be retrieved |
Definition at line 2386 of file database_api.cpp.
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
public_key | Public key |
Definition at line 447 of file database_api.cpp.
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.
lower_bound_symbol | Lower bound of symbol names to retrieve |
limit | Maximum number of assets to fetch, must not exceed the configured value of api_limit_get_assets |
Definition at line 972 of file database_api.cpp.
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.
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit deal id, fetch items whose IDs are greater than or equal to this ID |
limit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2092 of file database_api.cpp.
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
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_credit_offers |
start_id | Start credit offer id, fetch items whose IDs are greater than or equal to this ID |
limit
can be omitted or be null, if so the configured value of api_limit_get_credit_offers will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2055 of file database_api.cpp.
vector< htlc_object > graphene::app::database_api::list_htlcs | ( | const htlc_id_type | start, |
uint32_t | limit | ||
) | const |
Get all HTLCs.
start | Lower bound of htlc id to start getting results |
limit | Maximum number of htlc objects to fetch, must not exceed the configured value of api_limit_list_htlcs |
Definition at line 2982 of file database_api.cpp.
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.
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_liquidity_pools |
start_id | Start liquidity pool id, fetch pools whose IDs are greater than or equal to this ID |
with_statistics | Whether to return statistics |
limit
can be omitted or be null, if so the configured value of api_limit_get_liquidity_pools will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of poolsDefinition at line 1752 of file database_api.cpp.
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
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_samet_funds |
start_id | Start SameT Fund id, fetch items whose IDs are greater than or equal to this ID |
limit
can be omitted or be null, if so the configured value of api_limit_get_samet_funds will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of dataDefinition at line 2011 of file database_api.cpp.
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.
limit | The limitation of items each query can fetch, not greater than the configured value of api_limit_get_tickets |
start_id | Start ticket id, fetch tickets whose IDs are greater than or equal to this ID |
limit
can be omitted or be null, if so the configured value of api_limit_get_tickets will be usedstart_id
can be omitted or be null, if so the api will return the "first page" of ticketsDefinition at line 3012 of file database_api.cpp.
vector< optional< account_object > > graphene::app::database_api::lookup_account_names | ( | const vector< string > & | account_names | ) | const |
Get a list of accounts by name.
account_names | Names of the accounts to retrieve |
This function has semantics identical to get_objects, but doesn't subscribe.
Definition at line 767 of file database_api.cpp.
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.
lower_bound_name | Lower bound of the first name to return |
limit | Maximum number of results to return, must not exceed the configured value of api_limit_lookup_accounts |
subscribe | true 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) |
limit
is 1. Definition at line 777 of file database_api.cpp.
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.
symbols_or_ids | symbol names or IDs of the assets to retrieve |
This function has semantics identical to get_objects, but doesn't subscribe
Definition at line 1035 of file database_api.cpp.
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.
lower_bound_name | Lower bound of the first name to return |
limit | Maximum number of results to return, must not exceed the configured value of api_limit_lookup_committee_member_accounts |
Definition at line 2297 of file database_api.cpp.
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.
votes | a list of vote IDs, the quantity should not be greater than the configured value of api_limit_lookup_vote_ids |
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.
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.
lower_bound_name | Lower bound of the first name to return |
limit | Maximum number of results to return, must not exceed the configured value of api_limit_lookup_witness_accounts |
Definition at line 2206 of file database_api.cpp.
void graphene::app::database_api::set_auto_subscription | ( | bool | enable | ) |
Set auto-subscription behavior of follow-up API queries.
enable | whether follow-up API queries will automatically subscribe to queried objects |
Impacts behavior of these APIs:
Note: auto-subscription is enabled by default
Definition at line 186 of file database_api.cpp.
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.
cb | The callback handle to register |
Definition at line 206 of file database_api.cpp.
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.
cb | The 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.
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.
cb | The callback handle to register |
notify_remove_create | Whether 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.
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.
callback | Callback method which is called when the market changes |
a | symbol name or ID of the first asset |
b | symbol 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.
void graphene::app::database_api::unsubscribe_from_market | ( | const std::string & | a, |
const std::string & | b | ||
) |
Unsubscribe from updates to a given market.
a | symbol name or ID of the first asset |
b | symbol name or ID of the second asset |
Definition at line 1377 of file database_api.cpp.
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.
trx | a transaction to be validated |
Definition at line 2671 of file database_api.cpp.
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.
account_name_or_id | name or ID of an account to check |
signers | the public keys |
Definition at line 2639 of file database_api.cpp.
bool graphene::app::database_api::verify_authority | ( | const signed_transaction & | trx | ) | const |
Check whether a transaction has all of the required signatures
trx | a transaction to be verified |
trx
has all of the required signatures, otherwise throws an exception Definition at line 2621 of file database_api.cpp.