@huma-finance/widgets 0.0.62-beta.729 → 0.0.62-beta.731

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8843,13 +8843,19 @@ function SolanaTxSendModal(_ref) {
8843
8843
  return;
8844
8844
  }
8845
8845
  try {
8846
- const latestBlockHash = await connection.getLatestBlockhash();
8847
- const signature = await sendTransaction(tx, connection);
8846
+ // Optimize transaction
8847
+ const lockedWritableAccounts = sdk.extractWritableAccounts(tx);
8848
+ const optimizedTx = await sdk.buildOptimalTransactionFromConnection(tx, lockedWritableAccounts, connection);
8849
+ const signature = await sendTransaction(optimizedTx, connection, {
8850
+ maxRetries: 5,
8851
+ preflightCommitment: 'confirmed',
8852
+ skipPreflight: true
8853
+ });
8848
8854
  setSignature(signature);
8849
8855
  dispatch(setSolanaSignature(signature));
8850
8856
  await connection.confirmTransaction({
8851
- blockhash: latestBlockHash.blockhash,
8852
- lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8857
+ blockhash: optimizedTx.recentBlockhash,
8858
+ lastValidBlockHeight: optimizedTx.lastValidBlockHeight,
8853
8859
  signature
8854
8860
  });
8855
8861
  handleSuccess({