group DatabaseAPI

Summary

Members Descriptions
public fc::variantsget_objects(const vector< object_id_type > & ids) const Get the objects corresponding to the provided IDs.
public voidset_subscribe_callback(std::function< void(const variant &)> cb,bool clear_filter) #### Parameters
public voidset_pending_transaction_callback(std::function< void(const variant &)> cb) #### Parameters
public voidset_block_applied_callback(std::function< void(const variant &block_id)> cb) #### Parameters
public voidset_content_update_callback(std::function< void()> cb,const string & URI) #### Parameters
public voidcancel_all_subscriptions() Stop receiving any notifications

This unsubscribes from all subscribed markets and objects.
public optional< block_header >get_block_header(uint32_t block_num) const Retrieve a block header.
public optional< signed_block >get_block(uint32_t block_num) const Retrieve a full, signed block.
public processed_transactionget_transaction(uint32_t block_num,uint32_t trx_in_block) const used to fetch an individual transaction.
public optional< signed_transaction >get_recent_transaction_by_id(const transaction_id_type & id) 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.
public chain_property_objectget_chain_properties() const Retrieve the chain_property_object associated with the chain.
public global_property_objectget_global_properties() const Retrieve the current global_property_object.
public fc::variant_objectget_config() const Retrieve compile-time constants.
public chain_id_typeget_chain_id() const Get the chain ID.
public dynamic_global_property_objectget_dynamic_global_properties() const Retrieve the current dynamic_global_property_object.
public vector< vector< account_id_type > >get_key_references(vector< public_key_type > key) const Get all accounts that refer to the key in their owner or active authorities.
public vector< optional< account_object > >get_accounts(const vector< account_id_type > & account_ids) const Get a list of accounts by ID.
public std::map< string, full_account >get_full_accounts(const vector< string > & names_or_ids,bool subscribe) Fetch all objects relevant to the specified accounts and subscribe to updates.
public optional< account_object >get_account_by_name(string name) const Get an account by name.
public vector< account_id_type >get_account_references(account_id_type account_id) const Get all accounts that refer to the account id in their owner or active authorities.
public vector< optional< account_object > >lookup_account_names(const vector< string > & account_names) const Get a list of accounts by name.
public map< string, account_id_type >lookup_accounts(const string & lower_bound_name,uint32_t limit) const Get names and IDs for registered accounts.
public vector< account_object >search_accounts(const string & search_term,const string order,const object_id_type & id,uint32_t limit) const Get names and IDs for registered accounts that match search term.
public vector< asset >get_account_balances(account_id_type id,const flat_set< asset_id_type > & assets) const Get an account's balances in various assets.
public vector< asset >get_named_account_balances(const std::string & name,const flat_set< asset_id_type > & assets) const Semantically equivalent to get_account_balances, but takes a name instead of an ID.
public vector< vesting_balance_object >get_vesting_balances(account_id_type account_id) const Get information about a vesting balance object.
public uint64_tget_account_count() const Get the total number of accounts registered with the blockchain.
public vector< optional< asset_object > >get_assets(const vector< asset_id_type > & asset_ids) const Get a list of assets by ID.
public vector< asset_object >list_assets(const string & lower_bound_symbol,uint32_t limit) const Get assets alphabetically by symbol name.
public vector< optional< asset_object > >lookup_asset_symbols(const vector< string > & symbols_or_ids) const Get a list of assets by symbol.
public assetprice_to_dct(asset price) const Converts asset into DCT, using actual price feed.
public vector< optional< miner_object > >get_miners(const vector< miner_id_type > & miner_ids) const Get a list of miners by ID.
public fc::optional< miner_object >get_miner_by_account(account_id_type account) const Get the miner owned by a given account.
public map< string, miner_id_type >lookup_miner_accounts(const string & lower_bound_name,uint32_t limit) const Get names and IDs for registered miners.
public uint64_tget_miner_count() const Get the total number of miners registered with the blockchain.
public vector< variant >lookup_vote_ids(const vector< vote_id_type > & votes) const Given a set of votes, return the objects they are voting for.
public std::stringget_transaction_hex(const signed_transaction & trx) const Get a hexdump of the serialized binary form of a transaction.
public set< public_key_type >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.
public set< public_key_type >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.
public boolverify_authority(const signed_transaction & trx) const #### Returns
public boolverify_account_authority(const string & name_or_id,const flat_set< public_key_type > & signers) const #### Returns
public processed_transactionvalidate_transaction(const signed_transaction & trx) const Validates a transaction against the current state without broadcasting it on the network.
public vector< fc::variant >get_required_fees(const vector< operation > & ops,asset_id_type id) const For each operation calculate the required fee in the specified asset type. If the asset type does not have a valid core_exchange_rate.
public vector< proposal_object >get_proposed_transactions(account_id_type id) const Get the set of proposed transactions relevant to the specified account id.
public real_supplyget_real_supply() const Return current core asset supply.
public vector< account_id_type >list_publishing_managers(const string & lower_bound_name,uint32_t limit) const Get a list of accounts holding publishing manager status.
public vector< buying_object >get_open_buyings() const Get a list of open buyings.
public vector< buying_object >get_open_buyings_by_URI(const string & URI) const Get a list of open buyings by URI.
public vector< buying_object >get_open_buyings_by_consumer(const account_id_type & consumer) const Get a list of open buyings by consumer.
public vector< buying_object >get_buying_history_objects_by_consumer(const account_id_type & consumer) const Get history buying objects by consumer.
public vector< buying_object >get_buying_objects_by_consumer(const account_id_type & consumer,const string & order,const object_id_type & id,const string & term,uint32_t count) const Get buying objects (open or history) by consumer.
public optional< buying_object >get_buying_by_consumer_URI(const account_id_type & consumer,const string & URI) const Get buying (open or history) by consumer and URI.
public vector< buying_object >search_feedback(const string & user,const string & URI,const object_id_type & id,uint32_t count) const Search for term in contents (author, title and description)
public optional< content_object >get_content(const string & URI) const Get a content by URI.
public content_keysgenerate_content_keys(vector< account_id_type > const & seeders) const Generate keys for new content submission.
public vector< content_summary >search_content(const string & term,const string & order,const string & user,const string & region_code,const object_id_type & id,const string & type,uint32_t count) const Search for term in contents (author, title and description)
public vector< seeder_object >list_seeders_by_price(uint32_t count) const Get a list of seeders by price, in increasing order.
public vector< seeder_object >list_publishers_by_price(uint32_t count) const Get a list of seeders by price, in increasing order. Same method as list_seeders_by_price, kept for compatibility.
public optional< seeder_object >get_seeder(account_id_type aid) const Get a seeder by ID.
public optional< vector< seeder_object > >list_seeders_by_upload(const uint32_t count) const Get a list of seeders by total upload, in decreasing order.
public vector< seeder_object >list_seeders_by_region(const string region_code) const Get a list of seeders by region code.
public vector< seeder_object >list_seeders_by_rating(const uint32_t count) const Get a list of seeders by rating, in decreasing order.
public optional< subscription_object >get_subscription(const subscription_id_type & sid) const Get a subscription object by ID.
public vector< subscription_object >list_active_subscriptions_by_consumer(const account_id_type & account,const uint32_t count) const Get a list of active (not expired) subscriptions subscribed by account (consumer)
public vector< subscription_object >list_subscriptions_by_consumer(const account_id_type & account,const uint32_t count) const Get a list of subscriptions subscribed by account (consumer)
public vector< subscription_object >list_active_subscriptions_by_author(const account_id_type & account,const uint32_t count) const Get a list of active (not expired) subscriptions to account (author)
public vector< subscription_object >list_subscriptions_by_author(const account_id_type & account,const uint32_t count) const Get a list of subscriptions subscribed to account (author)

Members

public fc::variantsget_objects(const vector< object_id_type > & ids) const

Get the objects corresponding to the provided IDs.

Parameters

  • ids IDs of the objects to retrieve

Returns

The objects retrieved, in the order they are mentioned in ids

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

public voidset_subscribe_callback(std::function< void(const variant &)> cb,bool clear_filter)

Parameters

  • cb

  • clear_filter

public voidset_pending_transaction_callback(std::function< void(const variant &)> cb)

Parameters

  • cb

public voidset_block_applied_callback(std::function< void(const variant &block_id)> cb)

Parameters

  • cb

public voidset_content_update_callback(std::function< void()> cb,const string & URI)

Parameters

  • URI Content we are monitoring

  • cb Callback

public voidcancel_all_subscriptions()

Stop receiving any notifications

This unsubscribes from all subscribed markets and objects.

public optional< block_header >get_block_header(uint32_t block_num) const

Retrieve a block header.

Parameters

  • block_num Height of the block whose header should be returned

Returns

header of the referenced block, or null if no matching block was found

public optional< signed_block >get_block(uint32_t block_num) const

Retrieve a full, signed block.

Parameters

  • block_num Height of the block to be returned

Returns

the referenced block, or null if no matching block was found

public processed_transactionget_transaction(uint32_t block_num,uint32_t trx_in_block) const

used to fetch an individual transaction.

Parameters

  • block_num id of the block

  • trx_in_block Specifies the position of the transaction within the block

public optional< signed_transaction >get_recent_transaction_by_id(const transaction_id_type & id) 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

  • id ID of the transaction to retrieve

public chain_property_objectget_chain_properties() const

Retrieve the chain_property_object associated with the chain.

public global_property_objectget_global_properties() const

Retrieve the current global_property_object.

public fc::variant_objectget_config() const

Retrieve compile-time constants.

public chain_id_typeget_chain_id() const

Get the chain ID.

public dynamic_global_property_objectget_dynamic_global_properties() const

Retrieve the current dynamic_global_property_object.

public vector< vector< account_id_type > >get_key_references(vector< public_key_type > key) const

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

Parameters

  • key List of public keys

Returns

List of lists of account IDs. One list of account IDs per public key

public vector< optional< account_object > >get_accounts(const vector< account_id_type > & account_ids) const

Get a list of accounts by ID.

Parameters

  • account_ids IDs of the accounts to retrieve

Returns

The accounts corresponding to the provided IDs

This function has semantics identical to get_objects

public std::map< string, full_account >get_full_accounts(const vector< string > & names_or_ids,bool subscribe)

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

Parameters

  • subscribe true to subscribe to updates

  • names_or_ids Each item must be the name or ID of an account to retrieve

Returns

Map of string from names_or_ids to the corresponding account

This function fetches all 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. All other accounts will be retrieved and subscribed.

public optional< account_object >get_account_by_name(string name) const

Get an account by name.

Parameters

  • name Name of the account to retrieve

Returns

The account_object corresponding to the provided name, or null if no matching content was found

public vector< account_id_type >get_account_references(account_id_type account_id) const

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

Parameters

  • account_id

Returns

List of account IDs

public vector< optional< account_object > >lookup_account_names(const vector< string > & account_names) const

Get a list of accounts by name.

Parameters

  • account_names Names of the accounts to retrieve

Returns

The accounts holding the provided names

This function has semantics identical to get_objects

public map< string, account_id_type >lookup_accounts(const string & lower_bound_name,uint32_t limit) const

Get names and IDs for registered accounts.

Parameters

  • lower_bound_name Lower bound of the first name to return

  • limit Maximum number of results to return must not exceed 1000

Returns

Map of account names to corresponding IDs

public vector< account_object >search_accounts(const string & search_term,const string order,const object_id_type & id,uint32_t limit) const

Get names and IDs for registered accounts that match search term.

Parameters

  • search_term will try to partially match account name or id

  • limit Maximum number of results to return must not exceed 1000

Returns

Map of account names to corresponding IDs

public vector< asset >get_account_balances(account_id_type id,const flat_set< asset_id_type > & assets) const

Get an account's balances in various assets.

Parameters

  • id 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

Returns

Balances of the account

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

Semantically equivalent to get_account_balances, but takes a name instead of an ID.

Parameters

  • name of the account to get balances for IDs of the assets to get balances of; if empty, get all assets account has a balance in

public vector< vesting_balance_object >get_vesting_balances(account_id_type account_id) const

Get information about a vesting balance object.

Parameters

  • account_id An account ID.

public uint64_tget_account_count() const

Get the total number of accounts registered with the blockchain.

public vector< optional< asset_object > >get_assets(const vector< asset_id_type > & asset_ids) const

Get a list of assets by ID.

Parameters

  • asset_ids IDs of the assets to retrieve

Returns

The assets corresponding to the provided IDs

This function has semantics identical to get_objects

public vector< asset_object >list_assets(const string & lower_bound_symbol,uint32_t limit) const

Get assets alphabetically by symbol name.

Parameters

  • lower_bound_symbol Lower bound of symbol names to retrieve

  • limit Maximum number of assets to fetch (must not exceed 100)

Returns

The assets found

public vector< optional< asset_object > >lookup_asset_symbols(const vector< string > & symbols_or_ids) const

Get a list of assets by symbol.

Parameters

  • symbols_or_ids Symbols or stringified IDs of the assets to retrieve

Returns

The assets corresponding to the provided symbols or IDs

This function has semantics identical to get_objects

public assetprice_to_dct(asset price) const

Converts asset into DCT, using actual price feed.

Parameters

  • price asset in DCT, monitored asset or user issued asset

Returns

price in DCT

public vector< optional< miner_object > >get_miners(const vector< miner_id_type > & miner_ids) const

Get a list of miners by ID.

Parameters

  • miner_ids IDs of the miners to retrieve

Returns

The miners corresponding to the provided IDs

This function has semantics identical to get_objects

public fc::optional< miner_object >get_miner_by_account(account_id_type account) const

Get the miner owned by a given account.

Parameters

  • account The ID of the account whose miner should be retrieved

Returns

The miner object, or null if the account does not have a miner

public map< string, miner_id_type >lookup_miner_accounts(const string & lower_bound_name,uint32_t limit) const

Get names and IDs for registered miners.

Parameters

  • lower_bound_name Lower bound of the first name to return

  • limit Maximum number of results to return must not exceed 1000

Returns

Map of miner names to corresponding IDs

public uint64_tget_miner_count() const

Get the total number of miners registered with the blockchain.

public vector< variant >lookup_vote_ids(const vector< vote_id_type > & votes) const

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

Parameters

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

public std::stringget_transaction_hex(const signed_transaction & trx) const

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

Parameters

  • trx

Returns

public set< public_key_type >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

  • trx

  • available_keys Set of available public keys

public set< public_key_type >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

  • trx

public boolverify_authority(const signed_transaction & trx) const

Returns

true if the trx has all of the required signatures, otherwise throws an exception

Parameters

  • trx

public boolverify_account_authority(const string & name_or_id,const flat_set< public_key_type > & signers) const

Returns

true if the signers have enough authority to authorize an account

Parameters

  • name_or_id The name or id of the account

  • signers Set of public keys

public processed_transactionvalidate_transaction(const signed_transaction & trx) const

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

Parameters

  • trx

public vector< fc::variant >get_required_fees(const vector< operation > & ops,asset_id_type id) const

For each operation calculate the required fee in the specified asset type. If the asset type does not have a valid core_exchange_rate.

Parameters

  • ops The set of operations

  • id The asset ID

public vector< proposal_object >get_proposed_transactions(account_id_type id) const

Get the set of proposed transactions relevant to the specified account id.

Parameters

  • id The account ID

Returns

Set of proposed transactions

public real_supplyget_real_supply() const

Return current core asset supply.

Returns

current supply

public vector< account_id_type >list_publishing_managers(const string & lower_bound_name,uint32_t limit) const

Get a list of accounts holding publishing manager status.

Parameters

  • lower_bound_name The name of the first account to return. If the named account does not exist, the list will start at the account that comes after lowerbound

  • limit The maximum number of accounts to return (max: 100)

Returns

List of accounts

public vector< buying_object >get_open_buyings() const

Get a list of open buyings.

Returns

The buying_objects

public vector< buying_object >get_open_buyings_by_URI(const string & URI) const

Get a list of open buyings by URI.

Parameters

  • URI URI of the buyings to retrieve

Returns

The buyings corresponding to the provided URI

public vector< buying_object >get_open_buyings_by_consumer(const account_id_type & consumer) const

Get a list of open buyings by consumer.

Parameters

  • consumer Consumer of the buyings to retrieve

Returns

The buyings corresponding to the provided consumer

public vector< buying_object >get_buying_history_objects_by_consumer(const account_id_type & consumer) const

Get history buying objects by consumer.

Parameters

  • consumer Consumer of the history buyings to retrieve

Returns

History buying objects corresponding to the provided consumer

public vector< buying_object >get_buying_objects_by_consumer(const account_id_type & consumer,const string & order,const object_id_type & id,const string & term,uint32_t count) const

Get buying objects (open or history) by consumer.

Parameters

  • consumer Consumer of the buyings to retrieve

  • order Ordering field

  • id The id of buying object to start searching from

  • term Search term

  • count Maximum number of contents to fetch (must not exceed 100)

Returns

Buying objects corresponding to the provided consumer

public optional< buying_object >get_buying_by_consumer_URI(const account_id_type & consumer,const string & URI) const

Get buying (open or history) by consumer and URI.

Parameters

  • consumer Consumer of the buying to retrieve

  • URI URI of the buying to retrieve

Returns

Buying object corresponding to the provided consumer and URI

public vector< buying_object >search_feedback(const string & user,const string & URI,const object_id_type & id,uint32_t count) const

Search for term in contents (author, title and description)

Parameters

  • user Feedback author

  • URI the content object uri

  • id The id of feedback object to start searching from

  • count Maximum number of feedbacks to fetch

Returns

The feedback found

public optional< content_object >get_content(const string & URI) const

Get a content by URI.

Parameters

  • URI URI of the content to retrieve

Returns

The content corresponding to the provided URI, or null if no matching content was found

public content_keysgenerate_content_keys(vector< account_id_type > const & seeders) const

Generate keys for new content submission.

Parameters

  • seeders list of seeder account IDs

Returns

generated key and key parts

public vector< content_summary >search_content(const string & term,const string & order,const string & user,const string & region_code,const object_id_type & id,const string & type,uint32_t count) const

Search for term in contents (author, title and description)

Parameters

  • term Search term

  • order Ordering field

  • user Content owner

  • region Two letter region code

  • id The id of content object to start searching from

  • type the application and content type to be filtered

  • count Maximum number of contents to fetch (must not exceed 100)

Returns

The contents found

public vector< seeder_object >list_seeders_by_price(uint32_t count) const

Get a list of seeders by price, in increasing order.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public vector< seeder_object >list_publishers_by_price(uint32_t count) const

Get a list of seeders by price, in increasing order. Same method as list_seeders_by_price, kept for compatibility.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public optional< seeder_object >get_seeder(account_id_type aid) const

Get a seeder by ID.

Parameters

  • ID ID of the seeder to retrieve

Returns

The seeder corresponding to the provided ID, or null if no matching content was found

public optional< vector< seeder_object > >list_seeders_by_upload(const uint32_t count) const

Get a list of seeders by total upload, in decreasing order.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public vector< seeder_object >list_seeders_by_region(const string region_code) const

Get a list of seeders by region code.

Parameters

  • region_code Region code of seeders to retrieve

Returns

The seeders found

public vector< seeder_object >list_seeders_by_rating(const uint32_t count) const

Get a list of seeders by rating, in decreasing order.

Parameters

  • count Maximum number of seeders to retrieve

Returns

The seeders found

public optional< subscription_object >get_subscription(const subscription_id_type & sid) const

Get a subscription object by ID.

Parameters

  • sid ID of the subscription to retrieve

Returns

The subscription object corresponding to the provided ID, or null if no matching subscription was found

public vector< subscription_object >list_active_subscriptions_by_consumer(const account_id_type & account,const uint32_t count) const

Get a list of active (not expired) subscriptions subscribed by account (consumer)

Parameters

  • URI_begin Lower bound of URI strings to retrieve

  • count Maximum number of subscription objects to fetch (must not exceed 100)

Returns

The list of subscription objects corresponding to the provided consumer

public vector< subscription_object >list_subscriptions_by_consumer(const account_id_type & account,const uint32_t count) const

Get a list of subscriptions subscribed by account (consumer)

Parameters

  • URI_begin Lower bound of URI strings to retrieve

  • count Maximum number of subscription objects to fetch (must not exceed 100)

Returns

The contents found

public vector< subscription_object >list_active_subscriptions_by_author(const account_id_type & account,const uint32_t count) const

Get a list of active (not expired) subscriptions to account (author)

Parameters

  • URI_begin Lower bound of URI strings to retrieve

  • count Maximum number of subscription objects to fetch (must not exceed 100)

Returns

The contents found

public vector< subscription_object >list_subscriptions_by_author(const account_id_type & account,const uint32_t count) const

Get a list of subscriptions subscribed to account (author)

Parameters

  • URI_begin Lower bound of URI strings to retrieve

  • count Maximum number of subscription objects to fetch (must not exceed 100)

Returns

The contents found