Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Checked and fixed query documentation #1971

Merged
merged 3 commits into from
Dec 26, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions docs/source/api/queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ Purpose
-------

In a case when a list of transactions per account is needed, `GetAccountTransactions` query can be formed.
.. note:: This query uses pagination for query responses.

.. note:: This query uses pagination for quicker and more convenient query responses.

Request Schema
--------------
Expand Down Expand Up @@ -232,7 +233,7 @@ Request Structure

"Account ID", "account id to request transactions from", "<account_name>@<domain_id>", "makoto@soramitsu"
"Page size", "size of the page to be returned by the query, if the response contains fewer transactions than a page size, then next tx hash will be empty in response", "page_size > 0", "5"
"First tx hash", "hash of the first transaction in the page. If that field is not set — then the first transactions are returned", "hash in hex format", "bddd58404d1315e0eb27902c5d7c8eb0602c16238f005773df406bc191308929"
"First tx_hash", "hash of the first transaction in the page. If that field is not set — then the first transactions are returned", "hash in hex format", "bddd58404d1315e0eb27902c5d7c8eb0602c16238f005773df406bc191308929"
LiraLemur marked this conversation as resolved.
Show resolved Hide resolved

Response Schema
---------------
Expand Down Expand Up @@ -265,6 +266,7 @@ Purpose
-------

`GetAccountAssetTransactions` query returns all transactions associated with given account and asset.

.. note:: This query uses pagination for query responses.

Request Schema
Expand Down Expand Up @@ -358,7 +360,7 @@ Response Schema
message AccountAsset {
string asset_id = 1;
string account_id = 2;
Amount balance = 3;
string balance = 3;
}

Response Structure
Expand All @@ -370,15 +372,15 @@ Response Structure

"Asset ID", "identifier of asset used for checking the balance", "<asset_name>#<domain_id>", "jpy#japan"
"Account ID", "account which has this balance", "<account_name>@<domain_id>", "makoto@soramitsu"
"Balance", "balance of the asset", "Not less than 0", "200.20"
"Balance", "balance of the asset", "No less than 0", "200.20"

Get Account Detail
^^^^^^^^^^^^^^^^^^

Purpose
-------

To get details of the account, `GetAccountDetail` query can be used. Account details are key-value pairs, splitted into writers categories. Writers are accounts, which added the corresponding account detail. Example of such structure is:
To get details of the account, `GetAccountDetail` query can be used. Account details are key-value pairs, splitted into writers categories. Writers are accounts, that added the corresponding account detail. Example of such structure is:

.. code-block:: json

Expand Down Expand Up @@ -447,7 +449,7 @@ Response Structure
Usage Examples
--------------

Let's again consider the example of details from the beginning and see, how different variants of `GetAccountDetail` queries will change the resulting response.
Again, let's consider the example of details from the beginning and see how different variants of `GetAccountDetail` queries will change the resulting response.

.. code-block:: json

Expand Down Expand Up @@ -513,7 +515,7 @@ Now, the response will contain all details about this account, added by one spec

**account_id, key and writer are set**

Lastly, if all three field are set, result will contain details, added the specific writer and under the specific key, for example, if we asked for key "age" and writer "account@a_domain", we would get:
Finally, if all three field are set, result will contain details, added the specific writer and under the specific key, for example, if we asked for key "age" and writer "account@a_domain", we would get:

.. code-block:: json

Expand All @@ -529,7 +531,7 @@ Get Asset Info
Purpose
-------

In order to know precision for given asset, and other related info in the future, such as a description of the asset, etc. user can send `GetAssetInfo` query.
In order to know precision for given asset, and other information related to it (in the future - at the moment the option is not implemented), such as a description of the asset, etc. user can send `GetAssetInfo` query.
LiraLemur marked this conversation as resolved.
Show resolved Hide resolved

Request Schema
--------------
Expand Down Expand Up @@ -572,7 +574,7 @@ Response Structure
:header: "Field", "Description", "Constraint", "Example"
:widths: 15, 30, 20, 15

"Asset ID", "identifier of asset used for checking the balance", "<asset_name>#<domain_id>", "jpy"
"Asset ID", "identifier of asset used for checking the balance", "<asset_name>#<domain_id>", "jpy#japan"
"Domain ID", "domain related to this asset", "RFC1035 [#f1]_, RFC1123 [#f2]_", "japan"
"Precision", "number of digits after comma", "0 <= precision <= 255", "2"

Expand Down