fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

Use receipts from `TransactionStatus`

Open nedsalk opened this issue 1 year ago • 5 comments

Discussed in https://github.com/FuelLabs/fuels-ts/discussions/1588

Originally posted by nedsalk December 15, 2023 Post fuel-core v0.22.0, the node now returns receipts with a TransactionStatus, so we can use them right away instead of running another fetch. From my understanding, this will only become relevant after #1374 is merged, because we're currently using the getTransactionWithReceipts endpoint.

The way to go about implementing this is to use the TransactionRequest sent to the node in provider.sendTransaction because it contains the same transaction as the one that's fetched from the node inside of TransactionResponse via getTransactionWithReceipts, only that after fetching it from the node the receipts are there as well.

Because the receipts can now be received from the subscription directly, the same transaction summary can be generated based off of the TransactionRequest and the receipts received from the subscription. A working implementation can be found on this branch.

nedsalk avatar Jan 15 '24 09:01 nedsalk

Blocked by merge #1615 and #1495.

nedsalk avatar Jan 15 '24 13:01 nedsalk

The only utility for a discussion is to discuss something before it becomes an issue.

arboleya avatar Jan 16 '24 14:01 arboleya

This was first an issue, but you wanted it turned it into a discussion because some things were unclear and I couldn't properly formulate how to introduce it into the code base at that time. The plan was to ask the frontend team's inputs on how to introduce it. In the meantime I figured out how to do it and turned it back into an issue. The discussion's purpose wasn't to figure out "Should we do this?" but "How do we do this?" When I realized how, I figured that it can be turned into an issue again.

nedsalk avatar Jan 16 '24 15:01 nedsalk

So the discussion is not needed anymore.

arboleya avatar Jan 16 '24 15:01 arboleya

Blocked by:

  • https://github.com/FuelLabs/fuel-core/issues/1724

nedsalk avatar Mar 04 '24 17:03 nedsalk

Unblocked by:

  • https://github.com/FuelLabs/fuel-core/pull/2061

arboleya avatar Aug 08 '24 15:08 arboleya