Skip to content

Conversation

Woody4618
Copy link
Contributor

@Woody4618 Woody4618 commented Jan 29, 2025

  • Added a new helper to make sending transactions only one line: sendTransactionWithRetryAndPriorityFees

Examples usage:

    const initTransaction = await program.methods.initialize().transaction();

    await sendTransaction(
      connection,
      initTransaction,
      [keyPair],
      10000 // priority fee
    );

- Added a new helper to make sending transactions only one line: sendTransactionWithRetryAndPriorityFees
- Its cleaner
- Covered some potential edge cases if transaction already signed or has computeInstructions already
* );
* ```
*/
export async function sendTransactionWithRetry(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no longer exporting this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be confusing people and they will think the sendTransactionWithRetry is better than sendTransaction. SendTransaction uses sendwithRetry internally

Copy link
Member

@nickfrosty nickfrosty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)
The BN change also seems to fix the anchor issue!

@nickfrosty nickfrosty merged commit 4fffc8f into main Jan 31, 2025
1 check passed
@nickfrosty nickfrosty deleted the improve-send-transaction-helpers branch February 24, 2025 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants