Skip to main content

scresults

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

_id

Important

The scresults index will be deprecated and removed in the near future. We recommend using the operations index, which contains all the smart contract results data. The only change required in your queries is to include the type field with the value normal to fetch all smart contract results.

Please make the necessary updates to ensure a smooth transition. If you need further assistance, feel free to reach out.

The _id field for this index is composed of hex-encoded smart contract result hash. (example: cbd4692a092226d68fde24840586bdf36b30e02dc4bf2a73516730867545d53c)

Fields

FieldDescription
miniBlockHashThe miniBlockHash field represents the hash of the miniblock in which the smart contract result was included.
nonceThe nonce field represents the transaction sequence number.
gasLimitThe gasLimit field represents the maximum gas units the sender is willing to pay for.
gasPriceThe gasPrice field represents the amount to be paid for each gas unit.
valueThe value field represents the amount of EGLD to be sent from the sender to the receiver.
senderThe sender field represents the address of the smart contract result sender.
receiverThe receiver field represents the destination address of the smart contract result.
senderShardThe senderShard field represents the shard ID of the sender address.
receiverShardThe receiverShard field represents the shard ID of the receiver address.
relayerAddrThe relayerAddr field represents the address of the relayer.
relayedValueThis relayedValue field represents the amount of EGLD to be transferred via the inner transaction's sender.
codeThe code holds the code of the smart contract result.
dataThe data field holds additional information for a smart contract result. It can contain a simple message, a function call, an ESDT transfer payload, and so on.
prevTxHashThe prevTxHash holds the hex encoded hash of the previous transaction.
originalTxHashThe originalTxHash holds the hex encoded hash of the transaction that generated the smart contract result.
callTypeThe callType field holds the type of smart contract call that is done through the smart contract result.
codeMetaDataThe codeMetaData field holds the code metadata.
returnMessageThe returnMessage field holds the message that is returned by a smart contract in case of an error.
timestampThe timestamp field represents the timestamp of the block in which the smart contract result was executed.
statusThe status field holds the execution state of the smart contract result. The execution state can be pending or success.
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 to 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.
operationThe operation field represents the operation of the smart contract result based on the data field.
functionThe function field holds the name of the function that is called in case of a smart contract call.
originalSenderThe originalSender field holds the sender's address of the original transaction.
hasLogsThe hasLogs field is true if the transaction has logs.

Query examples

Fetch all the smart contract results generated by a transaction

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