@1llet.xyz/erc4337-gasless-sdk 0.4.18 → 0.4.19
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 +8 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1834,6 +1834,14 @@ async function executeCCTPBridge(sourceChain, amount, crossChainConfig, facilita
|
|
|
1834
1834
|
});
|
|
1835
1835
|
const amountBigInt = BigInt(Math.floor(parseFloat(amount) * 1e6));
|
|
1836
1836
|
const fee = calculateFee();
|
|
1837
|
+
const minRequired = fee * BigInt(2);
|
|
1838
|
+
if (amountBigInt <= minRequired) {
|
|
1839
|
+
return {
|
|
1840
|
+
success: false,
|
|
1841
|
+
transactionHash: transferHash,
|
|
1842
|
+
errorReason: `Amount too small. Minimum required: ${Number(minRequired) / 1e6} USDC (to cover bridge fees)`
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1837
1845
|
let facilitatorBalance = BigInt(0);
|
|
1838
1846
|
const maxRetries = 2;
|
|
1839
1847
|
for (let i = 0; i < maxRetries; i++) {
|