How to pre-compute the receipt_id/is the receipt_id pre-computed based on the transaction/transaction hash?

79 Views Asked by At

I'm trying to link some receipts to the transactions it came from. I don't see a way from the docs to query a receipt and get the transaction it's associated with (there is only an RPC endpoint for transaction->receipt https://docs.near.org/api/rpc/transactions#transaction-status-with-receipts)

I also saw this code blob from nearcore which seems to imply that I could do this without an RPC call by pre-computing it from a transaction.

EDIT: I found out how from digging through nearcore.

The hash is created with this function which is called by a create_receipt_id_from_transaction function.

0

There are 0 best solutions below