freshmint icon indicating copy to clipboard operation
freshmint copied to clipboard

Allow Node library users to have full control over the transaction lifecycle

Open psiemens opened this issue 3 years ago • 1 comments

Currently a user can call client.sendAsync, which submits a transaction to Flow and return its transaction ID. They can then poll for the results of that transaction by ID. However, they will need to parse any errors and events themselves, rather than relying on the built-in handlers inside Freshmint.

Some users will need to manage the complete lifecycle of a transaction in order to remain fault tolerant and respond to errors gracefully. We should find a way for the caller to own the transaction lifecycle but still make use of the event parsing functions provided by Freshmint.

psiemens avatar Sep 19 '22 20:09 psiemens

Note: this probably also means improving the error handling logic here: https://github.com/packagelabs/freshmint/blob/alpha/src/lib/transactions.ts#L105

Callers should be able to distinguish between network errors and execution errors, for example, and handle them accordingly.

psiemens avatar Sep 19 '22 20:09 psiemens