@huma-finance/widgets 0.0.62-beta.720 → 0.0.62-beta.722

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,6 +8709,7 @@ function SolanaViewOnExplorer(_ref) {
8709
8709
  });
8710
8710
  }
8711
8711
 
8712
+ /* eslint-disable no-await-in-loop */
8712
8713
  function SolanaTxSendModal(_ref) {
8713
8714
  let {
8714
8715
  chainId,
@@ -8729,18 +8730,28 @@ function SolanaTxSendModal(_ref) {
8729
8730
  return;
8730
8731
  }
8731
8732
  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
- await connection.confirmTransaction({
8737
- blockhash: latestBlockHash.blockhash,
8738
- lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8739
- signature
8740
- });
8741
- handleSuccess({
8742
- signature
8743
- });
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
+ }
8744
8755
  } catch (error) {
8745
8756
  const err = error;
8746
8757
  dispatch(setError({