Skip to main content

accountshistory

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

_id

The _id field of this index is composed in this way: {bech32address}_{timestamp} (example: erd.._1234).

Fields

FieldDescription
addressThe address field holds the address in bech32 encoding.
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).
isSenderThe isSender field is true if the address was the sender when the balance has changed.
timestampThe timestamp field represents the timestamp when the address balance was changed.
isSmartContractThe isSmartContract field is true if the address is a smart contract address.
shardIDThe shardID field represents the shard of the account.

Query examples

Fetch the latest 10 entries for an address sorted by timestamp

curl --request GET \
--url ${ES_URL}/accountshistory/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"match": {
"address": "erd..."
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
],
"size":10
}'