2

I am writing a block explorer in order to find deposits. I found out that there are two way for getting receipts.

  1. Receipts you get from chunk rpc call which have no status.
  2. Receipts you get from EXPERIMENTAL_tx_status which have status.

Can I end up with trouble if I consider first scenario valid? Do failed receipts stay on blockchain or not?

Unfortunately second scenario is slower, you have to query every tx of a block.

Thanks

Amin Talebi
  • 363
  • 1
  • 7

1 Answers1

2

The first scenario is legit unless you need a status. Receipts themselves cannot be successful or failed. The status is about the Execution of the receipt and only an ExecutionOutcome for a specific Receipt can have a status.

In order to get just the Receipts is to grab them from chunk, but if you want to know statuses you'll need to come up with something else because there is no method to get the ExecutionOutcome through the RPC.

You might want to consider writing an indexer

khorolets
  • 666
  • 3
  • 8
  • so if I see a receipt with `transfer` action I can be sure that funds has arrived and consider it as a valid deposit (without checking the status), right? – Amin Talebi Jan 26 '22 at 10:08
  • 1
    @AminTalebi of course not. Think of Receipt as of "task" that should be executed and unless you know the ExecutionOutcome for the "task" is "SuccessValue" you cannot be sure. – khorolets Jan 26 '22 at 10:22