@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.
@@ -8726,7 +8726,6 @@ function SolanaViewOnExplorer(_ref) {
8726
8726
  });
8727
8727
  }
8728
8728
 
8729
- /* eslint-disable no-await-in-loop */
8730
8729
  function SolanaTxSendModal(_ref) {
8731
8730
  let {
8732
8731
  chainId,
@@ -8747,28 +8746,18 @@ function SolanaTxSendModal(_ref) {
8747
8746
  return;
8748
8747
  }
8749
8748
  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
- 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
- }
8753
+ await connection.confirmTransaction({
8754
+ blockhash: latestBlockHash.blockhash,
8755
+ lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8756
+ signature
8757
+ });
8758
+ handleSuccess({
8759
+ signature
8760
+ });
8772
8761
  } catch (error) {
8773
8762
  const err = error;
8774
8763
  dispatch(setError({