Skip to main content

accountsesdt

This page describes the structure of the accounts-esdt 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}-{tokenIdentifier}-{nonce} (example: erd..-abcd-0123-01).

Fields

FieldDescription
identifierThe identifier field consists of token field and the nonce field hex encoded (example: TOKEN-01abdc-01).
addressThe address field holds the address in bech32 encoding.
balanceThe balance field holds the amount of ESDT token the address possesses. It includes the number of decimals.
balanceNumThe balanceNum field holds the amount of ESDT tokens the address possesses, in a numeric format.
dataThe data field is a structure that contains extra data about a token, such as the creator of an NFT.
tokenNonceThe tokenNonce field holds the sequence number of the token. This field is empty in the case of FungibleESDT.
tokenThe token field holds the name of the token.
timestampThe timestamp field represents the timestamp when the address balance was changed.
typeThe type field represents the type of the ESDT token. It can be FungibleESDT, NonFungibleESDT, SemiFungibleESDT, or MetaESDT.
frozenThe frozen field is set to true when the address possesses a current ESDT token that is in a frozen state.

Docs with a non-empty tokenNonce field will have the data field populated with the following structure:

data fieldsDescription
urisThe uris field holds a list of URIs.
creatorThe creator field holds the bech32 encoded address of the token's creator.
whiteListedStorageThe whiteListedStorage field is true if the token has white-listed storage. An NFT/SFT has white-listed storage if the URI belongs to one of the allowed decentralized storage services, such as IPFS or Pinata.
attributesThe attributes field contains the attributes of the token.
nonEmptyURIsThe nonEmptyURIs field is true if the token has non empty uris.

Query examples

Fetch addresses that hold a specific token, sorted by balance (top holders of a token)

curl --request GET \
--url ${ES_URL}/accountsesdt/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"match": {
"token": {
"query": "MY-TOKEN-aaabbb",
"operator": "AND"
}
}
},
"sort": [
{
"balanceNum": {
"order": "desc"
}
}
],
"size":10
}'

Fetch all the ESDT tokens in an address wallet

curl --request GET \
--url ${ES_URL}/accountsesdt/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"match": {
"address":"erd.."
}
}
}'