@coti-io/coti-wallet-plugin 0.2.6 → 0.2.7
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 +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6494,9 +6494,14 @@ var usePrivacyBridgeAllowance = ({
|
|
|
6494
6494
|
}]
|
|
6495
6495
|
});
|
|
6496
6496
|
logger.log("\u{1F510} [Approve] Tx submitted, waiting for confirmation", { txHash: shortHash(rawTxHash) });
|
|
6497
|
-
await waitForTransactionResilient(currentChainId, rawTxHash, {
|
|
6497
|
+
const receipt2 = await waitForTransactionResilient(currentChainId, rawTxHash, {
|
|
6498
6498
|
primary: provider
|
|
6499
6499
|
});
|
|
6500
|
+
if (!receipt2 || receipt2.status !== 1) {
|
|
6501
|
+
const failed = new Error("Approval transaction failed");
|
|
6502
|
+
failed.txHash = typeof rawTxHash === "string" ? rawTxHash : receipt2?.hash;
|
|
6503
|
+
throw failed;
|
|
6504
|
+
}
|
|
6500
6505
|
logger.log("\u{1F510} [Approve] Tx confirmed, refreshing allowance...");
|
|
6501
6506
|
setIsApproving(false);
|
|
6502
6507
|
setToastState((prev) => ({ ...prev, visible: false }));
|
|
@@ -6513,9 +6518,14 @@ var usePrivacyBridgeAllowance = ({
|
|
|
6513
6518
|
title: "Approving...",
|
|
6514
6519
|
message: "Waiting for allowance confirmation..."
|
|
6515
6520
|
});
|
|
6516
|
-
await waitForTransactionResilient(currentChainId, tx.hash, {
|
|
6521
|
+
const receipt = await waitForTransactionResilient(currentChainId, tx.hash, {
|
|
6517
6522
|
primary: provider
|
|
6518
6523
|
});
|
|
6524
|
+
if (!receipt || receipt.status !== 1) {
|
|
6525
|
+
const failed = new Error("Approval transaction failed");
|
|
6526
|
+
failed.txHash = tx.hash || receipt?.hash;
|
|
6527
|
+
throw failed;
|
|
6528
|
+
}
|
|
6519
6529
|
await checkAllowance();
|
|
6520
6530
|
setIsApproving(false);
|
|
6521
6531
|
setToastState((prev) => ({ ...prev, visible: false }));
|