@huma-finance/widgets 0.0.62-beta.730 → 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.
- package/dist/cjs/index.cjs +27 -7
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/SolanaTxSendModal.tsx +30 -7
package/dist/cjs/index.cjs
CHANGED
|
@@ -8842,24 +8842,44 @@ function SolanaTxSendModal(_ref) {
|
|
|
8842
8842
|
if (!connection || !tx) {
|
|
8843
8843
|
return;
|
|
8844
8844
|
}
|
|
8845
|
+
let signatureResult = '';
|
|
8845
8846
|
try {
|
|
8847
|
+
// Optimize transaction
|
|
8846
8848
|
const lockedWritableAccounts = sdk.extractWritableAccounts(tx);
|
|
8847
8849
|
const optimizedTx = await sdk.buildOptimalTransactionFromConnection(tx, lockedWritableAccounts, connection);
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8850
|
+
signatureResult = await sendTransaction(optimizedTx, connection, {
|
|
8851
|
+
preflightCommitment: 'confirmed',
|
|
8852
|
+
skipPreflight: true
|
|
8851
8853
|
});
|
|
8852
|
-
setSignature(
|
|
8853
|
-
dispatch(setSolanaSignature(
|
|
8854
|
+
setSignature(signatureResult);
|
|
8855
|
+
dispatch(setSolanaSignature(signatureResult));
|
|
8854
8856
|
await connection.confirmTransaction({
|
|
8855
8857
|
blockhash: optimizedTx.recentBlockhash,
|
|
8856
8858
|
lastValidBlockHeight: optimizedTx.lastValidBlockHeight,
|
|
8857
|
-
signature
|
|
8859
|
+
signature: signatureResult
|
|
8858
8860
|
});
|
|
8859
8861
|
handleSuccess({
|
|
8860
|
-
signature
|
|
8862
|
+
signature: signatureResult
|
|
8861
8863
|
});
|
|
8862
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
|
+
}
|
|
8863
8883
|
const err = error;
|
|
8864
8884
|
dispatch(setError({
|
|
8865
8885
|
errorMessage: (err === null || err === void 0 ? void 0 : err.message) || ''
|