@1llet.xyz/erc4337-gasless-sdk 0.4.41 → 0.4.43
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 +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2314,7 +2314,7 @@ async function getNearQuote(sourceChain, destChain, amount, destToken, sourceTok
|
|
|
2314
2314
|
throw new Error("Recipient address is required for NEAR Quote");
|
|
2315
2315
|
}
|
|
2316
2316
|
const refundAddress = senderAddress || recipient;
|
|
2317
|
-
console.log(`[NearService] Requesting Quote: ${sourceChain} -> ${destChain}`, { amount, sourceAsset, destAsset, options });
|
|
2317
|
+
console.log(`[NearService] Requesting Quote: ${sourceChain} -> ${destChain}`, JSON.stringify({ amount, sourceAsset, destAsset, options }, null, 2));
|
|
2318
2318
|
const quoteRequest = {
|
|
2319
2319
|
dry: options?.dry || false,
|
|
2320
2320
|
swapType: QuoteRequest.swapType.EXACT_INPUT,
|
|
@@ -2352,7 +2352,12 @@ async function getNearSimulation(sourceChain, destChain, amount, destToken, sour
|
|
|
2352
2352
|
const isDev = process.env.NEXT_PUBLIC_ENVIROMENT === "development" || process.env.NODE_ENV === "development";
|
|
2353
2353
|
const usedFee = isDev ? PlatformFees.DEV : PlatformFees.EVM_TO_OTHER;
|
|
2354
2354
|
const MIN_AMOUNT = usedFee;
|
|
2355
|
-
const
|
|
2355
|
+
const sourceConfig = NETWORKS[sourceChain];
|
|
2356
|
+
const sourceAssetInfo = sourceConfig?.crossChainInformation?.nearIntentInformation?.assetsId.find(
|
|
2357
|
+
(a) => a.name === (sourceToken || "USDC")
|
|
2358
|
+
) || sourceConfig?.crossChainInformation?.nearIntentInformation?.assetsId[0];
|
|
2359
|
+
const decimals = sourceAssetInfo?.decimals || (sourceChain === "Stellar" ? 7 : 6);
|
|
2360
|
+
const netAmountBridged = (amountNum - usedFee).toFixed(decimals);
|
|
2356
2361
|
if (parseFloat(netAmountBridged) <= 0) {
|
|
2357
2362
|
return {
|
|
2358
2363
|
success: false,
|