@1llet.xyz/erc4337-gasless-sdk 0.4.20 → 0.4.21

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 CHANGED
@@ -1789,20 +1789,25 @@ async function processCCTPSettlement(context, crossChainConfig) {
1789
1789
  errorReason: `Invalid deposit transaction: ${e instanceof Error ? e.message : "Unknown error"}`
1790
1790
  };
1791
1791
  }
1792
- }
1793
- let facilitatorBalance = BigInt(0);
1794
- const maxRetries = depositTxHash ? 5 : 1;
1795
- for (let i = 0; i < maxRetries; i++) {
1796
- facilitatorBalance = await publicClient.readContract({
1797
- address: usdcAddress,
1798
- abi: usdcErc3009Abi,
1799
- functionName: "balanceOf",
1800
- args: [facilitatorAccount.address]
1801
- });
1802
- if (facilitatorBalance >= amountBigInt) break;
1803
- if (depositTxHash) await new Promise((r) => setTimeout(r, 2e3));
1804
- }
1805
- if (facilitatorBalance < amountBigInt) {
1792
+ let facilitatorBalance = BigInt(0);
1793
+ const maxRetries = 5;
1794
+ for (let i = 0; i < maxRetries; i++) {
1795
+ facilitatorBalance = await publicClient.readContract({
1796
+ address: usdcAddress,
1797
+ abi: usdcErc3009Abi,
1798
+ functionName: "balanceOf",
1799
+ args: [facilitatorAccount.address]
1800
+ });
1801
+ if (facilitatorBalance >= amountBigInt) break;
1802
+ await new Promise((r) => setTimeout(r, 2e3));
1803
+ }
1804
+ if (facilitatorBalance < amountBigInt) {
1805
+ return {
1806
+ success: false,
1807
+ errorReason: "Deposit verified but facilitator balance insufficient (Funds sent to wrong address?)"
1808
+ };
1809
+ }
1810
+ } else {
1806
1811
  return {
1807
1812
  success: true,
1808
1813
  data: {