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

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.
@@ -8726,6 +8726,7 @@ function SolanaViewOnExplorer(_ref) {
8726
8726
  });
8727
8727
  }
8728
8728
 
8729
+ /* eslint-disable no-await-in-loop */
8729
8730
  function SolanaTxSendModal(_ref) {
8730
8731
  let {
8731
8732
  chainId,
@@ -8746,18 +8747,28 @@ function SolanaTxSendModal(_ref) {
8746
8747
  return;
8747
8748
  }
8748
8749
  try {
8749
- const latestBlockHash = await connection.getLatestBlockhash();
8750
8750
  const signature = await sendTransaction(tx, connection);
8751
8751
  setSignature(signature);
8752
8752
  dispatch(setSolanaSignature(signature));
8753
- await connection.confirmTransaction({
8754
- blockhash: latestBlockHash.blockhash,
8755
- lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8756
- signature
8757
- });
8758
- handleSuccess({
8759
- signature
8760
- });
8753
+ let transactionConfirmed = false;
8754
+ for (let i = 0; i < 30; i += 1) {
8755
+ var _result$value;
8756
+ shared.timeUtil.sleep(1000);
8757
+ const result = await connection.getSignatureStatus(signature);
8758
+ if (result !== null && result !== void 0 && (_result$value = result.value) !== null && _result$value !== void 0 && _result$value.confirmations) {
8759
+ transactionConfirmed = true;
8760
+ break;
8761
+ }
8762
+ }
8763
+ if (transactionConfirmed) {
8764
+ handleSuccess({
8765
+ signature
8766
+ });
8767
+ } else {
8768
+ dispatch(setError({
8769
+ errorMessage: 'Transaction failed to confirm in time'
8770
+ }));
8771
+ }
8761
8772
  } catch (error) {
8762
8773
  const err = error;
8763
8774
  dispatch(setError({