How to parse a transaction correctly | NEAR data lake indexer

Viewed 18

When I was using the near lake indexer (https://near-indexers.io/docs/projects/near-lake-framework) the data that’s stored on their s3 buckets return files like this:

  • Block.json
  • Shard_(N).json

So my question is: what data should I parse to get the executed transaction information? Because as the doc shows: (https://near-indexers.io/docs/data-flow-and-structures/flow/near-data-flow) "A transaction is first executed to create a receipt and then a receipt is executed in a future block to get receiptExecutionOutcome." Now is this execution outcome created in the next block? If so, how can I go about parsing the transactions whose confirmation is going in future blocks?

For example, let’s say if there was a transaction on my smart contract for method_name: “list_nft”. If this data happens to come in the given block, where will that exist in the shard data?

1 Answers

Now is this execution outcome created in the next block?

Transaction execution outcome is created in the same block, but this outcome only validates the inputs (pre-charges gas fees, subtracts the sender balance for the tokens intended to be sent).

If so, how can I go about parsing the transactions whose confirmation is going in future blocks?

You will need to keep track of that in some local cache. Depending on the needs, you may ignore transactions and only react to execution outcomes (all receipt execution outcomes come with the receipt information in Indexer Framework and Lake Framework).

Indexer for Explorer stores all the transactions and receipts just for reference, while NFT indexer covered in the NEAR Lake tutorial only looks into receipt_execution_outcomes

Related