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

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
@@ -1840,6 +1840,14 @@ async function executeCCTPBridge(sourceChain, amount, crossChainConfig, facilita
1840
1840
  });
1841
1841
  const amountBigInt = BigInt(Math.floor(parseFloat(amount) * 1e6));
1842
1842
  const fee = calculateFee();
1843
+ const minRequired = fee * BigInt(2);
1844
+ if (amountBigInt <= minRequired) {
1845
+ return {
1846
+ success: false,
1847
+ transactionHash: transferHash,
1848
+ errorReason: `Amount too small. Minimum required: ${Number(minRequired) / 1e6} USDC (to cover bridge fees)`
1849
+ };
1850
+ }
1843
1851
  let facilitatorBalance = BigInt(0);
1844
1852
  const maxRetries = 2;
1845
1853
  for (let i = 0; i < maxRetries; i++) {