Skip to main content

accounts

This page describes the structure of the accounts index (Elasticsearch), and also depicts a few examples of how to query it.

_id

The _id field of this index is represented by a bech32 encoded address.

Fields

FieldDescription
addressThe address field holds the address in a bech32 encoding. Should be equal to the _id field.
balanceThe balance field holds the amount of EGLD the address possesses. It is a string that also includes the number of decimals. Example: "1500000000000000000" (equivalent to 1.5 EGLD).
balanceNumThe balanceNum field holds the amount of EGLD the address possesses, in a numeric format. Example: 1.5.
nonceThe nonce field represents the sequence number of the address.
shardIDThe shardID field represents the shard where the address belongs to, based on its bytes.
timestampThe timestamp field represents the last moment when the address balance was changed.

Query examples

Fetch addresses sorted by balance

curl --request GET \
--url ${ES_URL}/accounts/_search \
--header 'Content-Type: application/json' \
--data '{
"sort": [
{
"balanceNum": {
"order": "desc"
}
}
],
"size":10
}'

Fetch addresses in a shard, sorted by balance

curl --request GET \
--url ${ES_URL}/accounts/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"match": {
"shardId": "1"
}
},
"sort": [
{
"balanceNum": {
"order": "desc"
}
}
],
"size":10
}'