helium / helium/helium-program-library

sendAndConfirmWithRetry doesn't return useful information if transaction is not successful

Open
#357 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
163
Forks
59
Avg merge
22h 48m
Merged PRs (30d)
55

Description

**Context**:
At Smart Harvest, an approved third party manufacturer of hotspots, we've built a web app for our users to onboard their hotspots. We're using the `sendAndConfirmWithRetry` function from the `spl-utils` package in this repo to submit transactions to Solana.

**The Issue:**
When the transactions are successful everything is fine. But there are some cases where the transaction will fail, like if the hotspot is already onboarded, not enough SOL or DC available, etc.

If the transaction fails, we don't get any useful information back from the `sendAndConfirmWithRetry` function. **Not even the transaction id.**

We see an error message is logged inside the library:
![image](https://github.com/helium/helium-program-library/assets/6757320/6c68d87a-8211-434d-966c-47eb70387d3e)

But this error isn't passed back to our app. We can only catch this:
![image](https://github.com/helium/helium-program-library/assets/6757320/e33b5531-4742-4698-b815-6f85481f419f)

**Our request:**
Could you please update `sendAndConfirmWithRetry` to return the transaction id and a more helpful error message if the transaction is not successful?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.