@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.mjs
CHANGED
|
@@ -6336,9 +6336,14 @@ var usePrivacyBridgeAllowance = ({
|
|
|
6336
6336
|
}]
|
|
6337
6337
|
});
|
|
6338
6338
|
logger.log("\u{1F510} [Approve] Tx submitted, waiting for confirmation", { txHash: shortHash(rawTxHash) });
|
|
6339
|
-
await waitForTransactionResilient(currentChainId, rawTxHash, {
|
|
6339
|
+
const receipt2 = await waitForTransactionResilient(currentChainId, rawTxHash, {
|
|
6340
6340
|
primary: provider
|
|
6341
6341
|
});
|
|
6342
|
+
if (!receipt2 || receipt2.status !== 1) {
|
|
6343
|
+
const failed = new Error("Approval transaction failed");
|
|
6344
|
+
failed.txHash = typeof rawTxHash === "string" ? rawTxHash : receipt2?.hash;
|
|
6345
|
+
throw failed;
|
|
6346
|
+
}
|
|
6342
6347
|
logger.log("\u{1F510} [Approve] Tx confirmed, refreshing allowance...");
|
|
6343
6348
|
setIsApproving(false);
|
|
6344
6349
|
setToastState((prev) => ({ ...prev, visible: false }));
|
|
@@ -6355,9 +6360,14 @@ var usePrivacyBridgeAllowance = ({
|
|
|
6355
6360
|
title: "Approving...",
|
|
6356
6361
|
message: "Waiting for allowance confirmation..."
|
|
6357
6362
|
});
|
|
6358
|
-
await waitForTransactionResilient(currentChainId, tx.hash, {
|
|
6363
|
+
const receipt = await waitForTransactionResilient(currentChainId, tx.hash, {
|
|
6359
6364
|
primary: provider
|
|
6360
6365
|
});
|
|
6366
|
+
if (!receipt || receipt.status !== 1) {
|
|
6367
|
+
const failed = new Error("Approval transaction failed");
|
|
6368
|
+
failed.txHash = tx.hash || receipt?.hash;
|
|
6369
|
+
throw failed;
|
|
6370
|
+
}
|
|
6361
6371
|
await checkAllowance();
|
|
6362
6372
|
setIsApproving(false);
|
|
6363
6373
|
setToastState((prev) => ({ ...prev, visible: false }));
|