Database API
Last updated
Was this helpful?
Last updated
Was this helpful?
The database API is available from the full node via web-sockets.
Get the objects corresponding to the provided IDs.
If any of the provided IDs does not map to an object, a null variant is returned in its position.
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 )
Register a callback handle which then can be used to subscribe to object database changes.
Note: auto-subscription is enabled by default and can be disabled with
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.
Register a callback handle which will get notified when a transaction is pushed to database.
Note: A transaction can be pushed to the database and be popped from the database several times while processing, before and after,, included in a block. Every time a push is done, the client will be notified.
cb
: The callback handle to register
Register a callback handle which will get notified when a block is pushed to database.
cb
: The callback handle to register
Stop receiving any notifications.
This unsubscribes from all subscribed markets and objects.
Retrieve a block header.
block_num
: Height of the block whose header should be returned
Retrieve a full, signed block.
block_num
: Height of the block to be returned
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
txid
: hash of the transaction
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.
Retrieve compile-time constants.
Get the chain ID.
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
Get a list of accounts by names or IDs.
account_names_or_ids
: names or IDs of the accounts to retrieve
Fetch all objects relevant to the specified accounts and optionally subscribe to updates.
This function fetches all relevant objects for the given accounts, and subscribes to updates to the given accounts. If any of the strings innames_or_ids
cannot be tied to an account, that input will be ignored. All other accounts will be retrieved and subscribed.
names_or_ids
: Each item must be the name or ID of an account to retrieve
Get info of an account by name.
name
: Name of the account to retrieve
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
Get a list of accounts by name.
account_names
: Names of the accounts to retrieve
Get names and IDs for registered accounts.
Note: In addition to the common auto-subscription rules, this API will subscribe to the returned account only if limit
is 1.
lower_bound_name
: Lower bound of the first name to return
limit
: Maximum number of results to return must not exceed 1000
Get the total number of accounts registered with the blockchain.
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.
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.
addrs
: a list of addresses
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
Return all vesting balance objects owned by an account.
account_name_or_id
: name or ID of an account
Get a list of assets by symbol names or IDs.
asset_symbols_or_ids
: symbol names or IDs of the assets to retrieve
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 101)
Get a list of assets by symbol names or IDs.
symbols_or_ids
: symbol names or IDs of the assets to retrieve
Returns the order book for the market base
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 50
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
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
Get forced settlement orders in a given asset.
a
: Symbol or ID of asset being settled
limit
: Maximum number of orders to retrieve
Get all open margin positions of a given account.
account_name_or_id
: name or ID of an account
Request notification when the active orders in the market between two assets changes.
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
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
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
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
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
Returns recent trades for the market base:quote, ordered by time, most recent first.
Note: Currently, timezone offsets are not supported. The time must be UTC.
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 trade to retrieve
stop
: Stop time as a UNIX timestamp, the earliest trade to retrieve
limit
: Number of transactions to retrieve, capped at 100.
Get a list of witnesses by ID.
witness_ids
: IDs of the witnesses to retrieve
Get the witness owned by a given account.
account_name_or_id
: The name or ID of the account whose witness should be retrieved
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 1000
Get the total number of witnesses registered with the blockchain.
Get a list of committee_members by ID.
committee_member_ids
: IDs of the committee_members to retrieve
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
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 1000
Get the workers owned by a given account.
account_name_or_id
: The name or ID of the account whose worker should be retrieved
Given a set of votes, returns the objects they are voting for.
This will be a mixture of committee_member_objects
, witness_objects
, and worker_objects
votes
: a list of vote IDs
Get a hexdump of the serialized binary form of a transaction.
trx
: a transaction to get hexdump from
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
trx
: the transaction to be signed
This method will return the set of all addresses that could possibly sign for a given transaction.
trx
: the transaction to be signed
Check whether a transaction has all of the required signatures
trx
: a transaction to be verified
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
Validates a transaction against the current state without broadcasting it on the network.
trx
: a transaction to be validated
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
Gets a set of proposed transactions (proposals) that the specified account can add approval to or remove approval from.
account_name_or_id
: The name or ID of an account
Gets the set of blinded balance objects by commitment ID.
commitments
: a set of commitments to query for
Retrieve the associated with the chain.
Retrieve the current .
Retrieve the current .
This function has semantics identical to ****
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 )
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 )
This function has semantics identical to, but doesn’t subscribe
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 ).
Semantically equivalent to .
Semantically equivalent to .
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 )
Semantically equivalent to , but doesn’t subscribe.
Similar to , but without pagination.
The range is [stop, start). In case there are more than 100 trades occurring in the same second, this API only returns the first 100 records; use to query for the rest.
Semantically equivalent to , but doesn’t subscribe.
Semantically equivalent to , but doesn’t subscribe.
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 to get the minimum subset.