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