@huma-finance/widgets 0.0.62-beta.713 → 0.0.62-beta.714

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.
package/dist/index.js CHANGED
@@ -8709,7 +8709,6 @@ function SolanaViewOnExplorer(_ref) {
8709
8709
  });
8710
8710
  }
8711
8711
 
8712
- /* eslint-disable no-await-in-loop */
8713
8712
  function SolanaTxSendModal(_ref) {
8714
8713
  let {
8715
8714
  chainId,
@@ -8730,28 +8729,18 @@ function SolanaTxSendModal(_ref) {
8730
8729
  return;
8731
8730
  }
8732
8731
  try {
8732
+ const latestBlockHash = await connection.getLatestBlockhash();
8733
8733
  const signature = await sendTransaction(tx, connection);
8734
8734
  setSignature(signature);
8735
8735
  dispatch(setSolanaSignature(signature));
8736
- let transactionConfirmed = false;
8737
- for (let i = 0; i < 30; i += 1) {
8738
- var _result$value;
8739
- timeUtil.sleep(1000);
8740
- const result = await connection.getSignatureStatus(signature);
8741
- if (result !== null && result !== void 0 && (_result$value = result.value) !== null && _result$value !== void 0 && _result$value.confirmations) {
8742
- transactionConfirmed = true;
8743
- break;
8744
- }
8745
- }
8746
- if (transactionConfirmed) {
8747
- handleSuccess({
8748
- signature
8749
- });
8750
- } else {
8751
- dispatch(setError({
8752
- errorMessage: 'Transaction failed to confirm in time'
8753
- }));
8754
- }
8736
+ await connection.confirmTransaction({
8737
+ blockhash: latestBlockHash.blockhash,
8738
+ lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8739
+ signature
8740
+ });
8741
+ handleSuccess({
8742
+ signature
8743
+ });
8755
8744
  } catch (error) {
8756
8745
  const err = error;
8757
8746
  dispatch(setError({