Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The crypto API is available from the full node via websockets.
Get signed blocks.
Generates a Pedersen Commitment: *commit = blind * G + value * G2. The commitment is 33 bytes, the blinding factor is 32 bytes.
Tip: For more information about Pedersen Commitment see: Commitment Scheme
blind
: Sha-256 blind factor type
value
: Positive 64-bit integer value
A 33-byte Pedersen Commitment: commit = blind G + value * G2
Get SHA-256 blind factor type.
blinds_in
: List of SHA-256 blind factor types
non_neg
: 32-bit integer value
A blind factor type.
Gets “range proof” information.
The cli_wallet includes functionality for sending blind transfers in which the values of the input and output amounts are “blinded.”
Note: In the case where a transaction produces two or more outputs, (e.g. an amount to the intended recipient plus “charge” back to the sender), a “range proof” must be supplied to prove that none of the outputs commit to a negative value.
proof
: List of proof’s characters
A range proof info structure with exponent, mantissa, min and max values.
Proves with respect to min_value the range for Pedersen Commitment which has the provided blinding factor and value.
min_value
: Positive 64-bit integer value
commit
: 33-byte pedersen commitment
commit_blind
: Sha-256 blind factor type for the correct digits
nonce
: Sha-256 blind factor type for our non-forged signatures
base10_exp
: Exponents base 10 in range [-1 ; 18] inclusively
min_bits
: 8-bit positive integer, must be in range [0 ; 64] inclusively
actual_value
: 64-bit positive integer, must be greater or equal min_value
A list of characters as proof in proof.
Verifies that commits
+ neg_commits
+ excess
== 0.
commits_in
: List of 33-byte Pedersen Commitments
neg_commits_in
: List of 33-byte Pedersen Commitments
excess
: Sum of two list of 33-byte Pedersen Commitments where sums the first set and subtracts the second
(Boolean) True in event of commits
+ neg_commits
+ excess
== 0, otherwise false
Verifies range proof for 33-byte Pedersen Commitment.
commit
: 33-byte pedersen commitment
proof
: List of characters
A structure with success, min and max values
Verifies range proof rewind for 33-byte Pedersen Commitment.
nonce
: Sha-256 blind refactor type
commit
: 33-byte pedersen commitment
proof
: List of characters
A structure with success, min, max, value_out, blind_out and message_out values.
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 set_auto_subscription)
The objects retrieved, in the order they are mentioned in ids.
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 set_auto_subscription
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
The header of the referenced block, or null if no matching block was foun
Retrieve a full, signed block.
block_num
: Height of the block to be returned
The referenced block, or null if no matching block was found.
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
The transaction at the given position.
txid
: hash of the transaction
The corresponding transaction if found, or null if not found.
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 the graphene::chain::chain_property_object associated with the chain.
Retrieve the current graphene::chain::global_property_object.
Retrieve compile-time constants.
Get the chain ID.
Retrieve the current graphene::chain::dynamic_global_property_object.
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
ID of all accounts that refer to the specified keys.
Get a list of accounts by names or IDs.
This function has semantics identical toget_objects
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)
The accounts corresponding to the provided names or IDs.
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
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)
Map of string from names_or_ids
to the corresponding account.
Get info of an account by name.
name
: Name of the account to retrieve
The account holding the provided name.
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
All accounts that refer to the specified account in their owner or active authorities
Get a list of accounts by name.
This function has semantics identical to get_objects, but doesn’t subscribe
account_names
: Names of the accounts to retrieve
The accounts holding the provided names.
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
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).
Map of account names to corresponding IDs.
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.
Balances of the account.
Semantically equivalent to get_account_balances.
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.
Balances of the account.
addrs
: a list of addresses
All unclaimed balance objects for the 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
A list indicating how much asset in each balance object is available to be claimed.
Return all vesting balance objects owned by an account.
account_name_or_id
: name or ID of an account
All vesting balance objects owned by the account.
Get a list of assets by symbol names or IDs.
Semantically equivalent to get_objects.
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)
The assets corresponding to the provided symbol names or IDs.
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)
The assets found.
Get a list of assets by symbol names or IDs.
Semantically equivalent to get_objects, but doesn’t subscribe.
symbols_or_ids
: symbol names or IDs of the assets to retrieve
The assets corresponding to the provided symbols or IDs
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
Order book of the market.
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
The limit orders, ordered from least price to greatest.
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
The call orders, ordered from earliest to be called to latest
Get forced settlement orders in a given asset.
a
: Symbol or ID of asset being settled
limit
: Maximum number of orders to retrieve
The settle orders, ordered from earliest settlement date to latest.
Get all open margin positions of a given account.
Similar to get_call_orders_by_account, but without pagination.
account_name_or_id
: name or ID of an account
All open margin positions of the 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
The market ticker for the past 24 hours.
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
The market volume over the past 24 hours.
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.
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 get_trade_history_by_sequence to query for the rest.
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.
Recent transactions in the market
Get a list of witnesses by ID.
Semantically equivalent to get_objects, but doesn’t subscribe.
witness_ids
: IDs of the witnesses to retrieve
The witnesses corresponding to the provided IDs.
Get the witness owned by a given account.
account_name_or_id
: The name or ID of the account whose witness should be retrieved
The witness object, or null if the account does not have a witness.
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
Map of witness names to corresponding IDs.
Get the total number of witnesses registered with the blockchain.
Get a list of committee_members by ID.
Semantically equivalent to get_objects, but doesn’t subscribe.
committee_member_ids
: IDs of the committee_members to retrieve
The committee_members corresponding to the provided IDs.
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
The committee_member object, or null if the account does not have a committee_member.
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
Map of committee_member names to corresponding IDs
Get the workers owned by a given account.
account_name_or_id
: The name or ID of the account whose worker should be retrieved
A list of worker objects owned by the account.
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
The referenced objects
The results will be in the same order as the votes. Null will be returned for any vote IDs that are not found.
Get a hexdump of the serialized binary form of a transaction.
trx
: a transaction to get hexdump from
The hexdump of the transaction.
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
A subset of available_keys
that could sign for the given transaction.
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
A set of public keys that could possibly sign for the given transaction.
This method will return the set of all addresses that could possibly sign for a given transaction.
trx
: the transaction to be signed
A set of addresses that could possibly sign for the given transaction.
Check whether a transaction has all of the required signatures
trx
: a transaction to be verified
true if the trx
has all of the required signatures, otherwise throws an exception.
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
true if the passed in keys have enough authority to approve an operation for this account.
Validates a transaction against the current state without broadcasting it on the network.
trx
: a transaction to be validated
A processed_transaction object if the transaction passes the validation, otherwise an exception will be thrown.
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
A list of objects which indicates required fees of each operation
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
A set of proposed transactions that the specified account can act on.
Gets the set of blinded balance objects by commitment ID.
commitments
: a set of commitments to query for
The set of blinded balance objects by commitment ID.
Some of the most interesting API calls for exchanges and gateways are listed in this document.
We will now take a look at some sample outputs for some of the API calls.
List the balances of an account. Each account can have multiple balances, one for each type of asset owned by that account. The returned list will only contain assets for which the account has a nonzero balance.
id
: the name or id of the account whose balances you want
A list of the given account’s balances.
Transfer an amount from one account to another.
from
: the name or id of the account sending the funds
to
: the name or id of the account receiving the funds
amount
: the amount to send (in nominal units to send half of a BTS, specify 0.5)
asset_symbol
: the symbol or id of the asset to send
memo
: a memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size
broadcast
: true to broadcast the transaction on the network
The final parameter True states that the signed transaction will be broadcast. If this parameter is False the transaction will be signed but not broadcast, hence not executed.
The signed transaction transferring funds.
This method works just like transfer, except it always broadcasts and returns the transaction ID (hash) along with the signed transaction.
from
: the name or id of the account sending the funds
to
: the name or id of the account receiving the funds
amount
: the amount to send
asset_symbol
: the symbol or id of the asset to send
memo
: a memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size
The transaction ID (hash) along with the signed transaction transferring funds
Returns the most recent operations on the named account.
This returns a list of operation history objects, which describe activity on the account.
name
: the name or id of the account
limit
: the number of entries to return (starting from the most recent)
A list of operation_history_objects.
Returns the blockchain object corresponding to the given id.
This generic function can be used to retrieve any object from the blockchain that is assigned an ID. Certain types of objects have specialized convenience functions to return their objects e.g., assets have get_asset()
, accounts have get_account()
, but this function will work for any object.
id
: the id of the object to return
The requested object.
Returns information about the given asset.
asset_name_or_id
: the symbol or id of the asset in question
The information about the asset stored in the block chain.
The network broadcast API is available from the full node via web-sockets.
Broadcast a transaction to the network.
The transaction will be checked for validity in the local database prior to broadcasting. If it fails to apply locally, an error will be thrown and the transaction will not be broadcast
trx
: The transaction to broadcast
This version of broadcast transaction registers a callback method that will be called when the transaction is included into a block. The callback method includes the transaction id, block number, and transaction number in the block.
cb
: the callback method
trx
: the transaction
Broadcast a signed block to the network.
block
: The signed block to broadcast.
The network node API is available from the full node via web-sockets.
Return general network information, such as p2p port.
Get status of all current connections to peers.
Return list of potential peers.
Get advanced node parameters, such as desired and max number of connections.
Connect to a new peer
ep
: The IP/Port of the peer to connect to
Set advanced node parameters, such as desired and max number of connections.
params
: a JSON object containing the name/value pairs for the parameters to set
Get grouped limit orders in given market.
base_asset
: ID or symbol of asset being sold
quote_asset
: ID or symbol of asset being purchased
group
: Maximum price diff within each order group, have to be one of configured values
start
: Optional price to indicate the first order group to retrieve
limit
: Maximum number of order groups to retrieve (must not exceed 101)
The grouped limit orders, ordered from best offered price to the worst.
The history API is available from the full node via websockets.
Get operations relevant to the specified account.
account_id_or_name
: The account ID or name whose history should be queried
stop
: ID of the earliest operation to retrieve
limit
: Maximum number of operations to retrieve (must not exceed 100)
start
: ID of the most recent operation to retrieve
A list of operations performed by account, ordered from most recent to oldest.
Get only asked operations relevant to the specified account.
account_id_or_name
: The account ID or name whose history should be queried
operation_type
: The type of the operation we want to get operations in the account ( 0 = transfer , 1 = limit order create, …)
stop
: ID of the earliest operation to retrieve
limit
: Maximum number of operations to retrieve (must not exceed 100)
start
: ID of the most recent operation to retrieve
A list of operations performed by account, ordered from most recent to oldest.
Get operations relevant to the specified account referenced by an event numbering specific to the account. The current number of operations for the account can be found in the account statistics (or use 0 for start).
account_id_or_name
: The account ID or name whose history should be queried
stop
: Sequence number of earliest operation. 0 is default and will query ‘limit’ number of operations.
limit
: Maximum number of operations to retrieve (must not exceed 100)
start
: Sequence number of the most recent operation to retrieve. 0 is default, which will start querying from the most recent operation.
A list of operations performed by account, ordered from most recent to oldest.
Get details of order executions occurred most recently in a trading pair.
a
: Asset symbol or ID in a trading pair
b
: The other asset symbol or ID in the trading pair
limit
: Maximum records to return
a list of order_history objects, in most recent first order
Get OHLCV data of a trading pair in a time range.
a
: Asset symbol or ID in a trading pair
b
: The other asset symbol or ID in the trading pair
bucket_seconds
: Length of each time bucket in seconds.
start
: The start of a time range, E.G. “2018-01-01T00:00:00”
end
: The end of the time range
A list of OHLCV data, in least recent first order.
If there are more than 200 records in the specified time range, the first 200 records will be returned.
Get OHLCV time bucket lengths supported (configured) by this API server.
A list of time bucket lengths in seconds.
For example, if the result contains a number “300” it means this API server supports OHLCV data aggregated in 5-minute buckets.
Note: It needs to be within result of , otherwise no data will be returned