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

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.
@@ -8842,26 +8842,44 @@ function SolanaTxSendModal(_ref) {
8842
8842
  if (!connection || !tx) {
8843
8843
  return;
8844
8844
  }
8845
+ let signatureResult = '';
8845
8846
  try {
8846
8847
  // Optimize transaction
8847
8848
  const lockedWritableAccounts = sdk.extractWritableAccounts(tx);
8848
8849
  const optimizedTx = await sdk.buildOptimalTransactionFromConnection(tx, lockedWritableAccounts, connection);
8849
- const signature = await sendTransaction(optimizedTx, connection, {
8850
- maxRetries: 5,
8850
+ signatureResult = await sendTransaction(optimizedTx, connection, {
8851
8851
  preflightCommitment: 'confirmed',
8852
8852
  skipPreflight: true
8853
8853
  });
8854
- setSignature(signature);
8855
- dispatch(setSolanaSignature(signature));
8854
+ setSignature(signatureResult);
8855
+ dispatch(setSolanaSignature(signatureResult));
8856
8856
  await connection.confirmTransaction({
8857
8857
  blockhash: optimizedTx.recentBlockhash,
8858
8858
  lastValidBlockHeight: optimizedTx.lastValidBlockHeight,
8859
- signature
8859
+ signature: signatureResult
8860
8860
  });
8861
8861
  handleSuccess({
8862
- signature
8862
+ signature: signatureResult
8863
8863
  });
8864
8864
  } catch (error) {
8865
+ let signatureStatusRetries = 0;
8866
+ while (signatureStatusRetries < 5) {
8867
+ var _result$value, _result$value2;
8868
+ // Attempt to load the signature status using transaction history
8869
+ // eslint-disable-next-line no-await-in-loop
8870
+ await shared.sleep(1000);
8871
+ // eslint-disable-next-line no-await-in-loop
8872
+ const result = await connection.getSignatureStatus(signatureResult, {
8873
+ searchTransactionHistory: true
8874
+ });
8875
+ if ((result === null || result === void 0 || (_result$value = result.value) === null || _result$value === void 0 ? void 0 : _result$value.confirmationStatus) === 'finalized' || (result === null || result === void 0 || (_result$value2 = result.value) === null || _result$value2 === void 0 ? void 0 : _result$value2.confirmationStatus) === 'confirmed') {
8876
+ handleSuccess({
8877
+ signature: signatureResult
8878
+ });
8879
+ return;
8880
+ }
8881
+ signatureStatusRetries += 1;
8882
+ }
8865
8883
  const err = error;
8866
8884
  dispatch(setError({
8867
8885
  errorMessage: (err === null || err === void 0 ? void 0 : err.message) || ''