@coti-io/coti-wallet-plugin 0.2.5 → 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.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1523,13 +1523,7 @@ var init_podPortalFees = __esm({
|
|
|
1523
1523
|
return BigInt(gasPriceHex);
|
|
1524
1524
|
};
|
|
1525
1525
|
resolvePodTxGasPrice = async (provider) => {
|
|
1526
|
-
|
|
1527
|
-
try {
|
|
1528
|
-
const feeData = await provider.getFeeData();
|
|
1529
|
-
base = feeData.gasPrice ?? await getPodGasPrice(provider);
|
|
1530
|
-
} catch {
|
|
1531
|
-
base = await getPodGasPrice(provider);
|
|
1532
|
-
}
|
|
1526
|
+
const base = await getPodGasPrice(provider);
|
|
1533
1527
|
return base * POD_GAS_PRICE_BUFFER_BPS / 1000n;
|
|
1534
1528
|
};
|
|
1535
1529
|
getSepoliaGasPrice = resolvePodTxGasPrice;
|
|
@@ -1715,8 +1709,8 @@ var init_podPortalFees = __esm({
|
|
|
1715
1709
|
let supportsEip1559 = false;
|
|
1716
1710
|
if (provider) {
|
|
1717
1711
|
try {
|
|
1718
|
-
const
|
|
1719
|
-
supportsEip1559 =
|
|
1712
|
+
const block = await provider.getBlock("latest");
|
|
1713
|
+
supportsEip1559 = block?.baseFeePerGas != null;
|
|
1720
1714
|
} catch {
|
|
1721
1715
|
supportsEip1559 = false;
|
|
1722
1716
|
}
|
|
@@ -6342,9 +6336,14 @@ var usePrivacyBridgeAllowance = ({
|
|
|
6342
6336
|
}]
|
|
6343
6337
|
});
|
|
6344
6338
|
logger.log("\u{1F510} [Approve] Tx submitted, waiting for confirmation", { txHash: shortHash(rawTxHash) });
|
|
6345
|
-
await waitForTransactionResilient(currentChainId, rawTxHash, {
|
|
6339
|
+
const receipt2 = await waitForTransactionResilient(currentChainId, rawTxHash, {
|
|
6346
6340
|
primary: provider
|
|
6347
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
|
+
}
|
|
6348
6347
|
logger.log("\u{1F510} [Approve] Tx confirmed, refreshing allowance...");
|
|
6349
6348
|
setIsApproving(false);
|
|
6350
6349
|
setToastState((prev) => ({ ...prev, visible: false }));
|
|
@@ -6361,9 +6360,14 @@ var usePrivacyBridgeAllowance = ({
|
|
|
6361
6360
|
title: "Approving...",
|
|
6362
6361
|
message: "Waiting for allowance confirmation..."
|
|
6363
6362
|
});
|
|
6364
|
-
await waitForTransactionResilient(currentChainId, tx.hash, {
|
|
6363
|
+
const receipt = await waitForTransactionResilient(currentChainId, tx.hash, {
|
|
6365
6364
|
primary: provider
|
|
6366
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
|
+
}
|
|
6367
6371
|
await checkAllowance();
|
|
6368
6372
|
setIsApproving(false);
|
|
6369
6373
|
setToastState((prev) => ({ ...prev, visible: false }));
|