Skip to main content

operations

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

_id

The _id field of this index is represented by the transactions OR smart contract result hash, in a hexadecimal encoding.

Fields

FieldDescription
miniBlockHashThe miniBlockHash field represents the hash of the miniblock in which the transaction was included.
nonceThe nonce field represents the transaction sequence number of the sender address.
roundThe round field represents the round of the block when the transaction was executed.
valueThe value field represents the amount of EGLD to be sent from the sender to the receiver.
receiverThe receiver field represents the destination address of the transaction.
senderThe sender field represents the address of the transaction sender.
receiverShardThe receiverShard field represents the shard ID of the receiver address.
senderShardThe senderShard field represents the shard ID of the sender address.
gasPriceThe gasPrice field represents the amount to be paid for each gas unit.
gasLimitThe gasLimit field represents the maximum gas units the sender is willing to pay for.
gasUsedThe gasUsed field represents the amount of gas used by the transaction.
feeThe fee field represents the amount of EGLD the sender paid for the transaction.
initialPaidFeeThe initialPaidFee field represents the initial amount of EGLD the sender paid for the transaction, before the refund.
dataThe data field holds additional information for a transaction. It can contain a simple message, a function call, an ESDT transfer payload, and so on.
signatureThe signature of the transaction, hex-encoded.
timestampThe timestamp field represents the timestamp of the block in which the transaction was executed.
statusThe status field represents the status of the transaction.
senderUserNameThe senderUserName field represents the username of the sender address.
receiverUserNameThe receiverUserName field represents the username of the receiver address.
hasScResultsThe hasScResults field is true if the transaction has smart contract results.
isScCallThe isScCall field is true if the transaction is a smart contract call.
hasOperationsThe hasOperations field is true if the transaction has smart contract results.
tokensThe tokens field contains a list of ESDT tokens that are transferred based on the data field. The indices from the tokens list are linked with the indices from esdtValues list.
esdtValuesThe esdtValues field contains a list of ESDT values that are transferred based on the data field.
receiversThe receivers field contains a list of receiver addresses in case of ESDTNFTTransfer or MultiESDTTransfer.
receiversShardIDsThe receiversShardIDs field contains a list of receiver addresses' shard IDs.
typeThe type field represents the type of the transaction based on the data field.
operationThe operation field represents the operation of the transaction based on the data field.
functionThe function field holds the name of the function that is called in case of a smart contract call.
isRelayedThe isRelayed field is true if the transaction is a relayed transaction.
versionThe version field represents the version of the transaction.
hasLogsThe hasLogs field is true if the transaction has logs.

This index contains both transactions and smart contract results. This is useful because one can query both of them in a single request.

The unified structure will contain an extra field in order to be able to differentiate between them.

FieldDescription
typeIt can be normal in case of a transaction and unsigned in case of a smart contract result.

Query examples

Fetch the latest transactions of an address

curl --request GET \
--url ${ES_URL}/operations/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"bool": {
"must": [
{
"match": {
"type": "normal"
}
}
],
"should": [
{
"match": {
"sender": "erd..."
}
},
{
"match": {
"receiver": "erd..."
}
},
{
"match": {
"receivers": "erd..."
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}'

Fetch the latest operations of an address

ADDRESS="erd1..."

curl --request GET \
--url ${ES_URL}/operations/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"bool": {
"should": [
{
"match": {
"sender": "${ADDRESS}"
}
},
{
"match": {
"receiver": "${ADDRESS}"
}
},
{
"match": {
"receivers": "${ADDRESS}"
}
}
]
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}'

Fetch all the smart contract results generated by a transaction

curl --request GET \
--url ${ES_URL}/operations/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"bool": {
"must": [
{
"match": {
"originalTxHash": "d6.."
}
},
{
"match": {
"type": "unsigned"
}
}
]
}
}
}'