@t2000/cli 0.46.13 → 0.46.15
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/{chunk-PUT73QY7.js → chunk-4W7T24L5.js} +7 -3
- package/dist/{chunk-PUT73QY7.js.map → chunk-4W7T24L5.js.map} +1 -1
- package/dist/{dist-G4HFQNSF.js → dist-LZGRHEQB.js} +8 -4
- package/dist/{dist-G4HFQNSF.js.map → dist-LZGRHEQB.js.map} +1 -1
- package/dist/{dist-7KHAKQT2.js → dist-Y7A6L6BS.js} +2 -2
- package/dist/index.js +3 -3
- package/package.json +3 -3
- /package/dist/{dist-7KHAKQT2.js.map → dist-Y7A6L6BS.js.map} +0 -0
|
@@ -60540,7 +60540,7 @@ async function findSwapRoute(params) {
|
|
|
60540
60540
|
amountIn: routerData.amountIn.toString(),
|
|
60541
60541
|
amountOut: routerData.amountOut.toString(),
|
|
60542
60542
|
byAmountIn: params.byAmountIn,
|
|
60543
|
-
priceImpact: routerData.deviationRatio,
|
|
60543
|
+
priceImpact: normalizePriceImpact(routerData.deviationRatio),
|
|
60544
60544
|
insufficientLiquidity: true
|
|
60545
60545
|
};
|
|
60546
60546
|
}
|
|
@@ -60553,10 +60553,14 @@ async function findSwapRoute(params) {
|
|
|
60553
60553
|
amountIn: routerData.amountIn.toString(),
|
|
60554
60554
|
amountOut: routerData.amountOut.toString(),
|
|
60555
60555
|
byAmountIn: params.byAmountIn,
|
|
60556
|
-
priceImpact: routerData.deviationRatio,
|
|
60556
|
+
priceImpact: normalizePriceImpact(routerData.deviationRatio),
|
|
60557
60557
|
insufficientLiquidity: false
|
|
60558
60558
|
};
|
|
60559
60559
|
}
|
|
60560
|
+
function normalizePriceImpact(value) {
|
|
60561
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
60562
|
+
return Number.isFinite(n) ? n : 0;
|
|
60563
|
+
}
|
|
60560
60564
|
async function buildSwapTx(params) {
|
|
60561
60565
|
const client = getClient(params.walletAddress);
|
|
60562
60566
|
const clampedSlippage = Math.max(1e-3, Math.min(params.slippage, 0.05));
|
|
@@ -67576,4 +67580,4 @@ axios/dist/node/axios.cjs:
|
|
|
67576
67580
|
@scure/bip39/index.js:
|
|
67577
67581
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
67578
67582
|
*/
|
|
67579
|
-
//# sourceMappingURL=chunk-
|
|
67583
|
+
//# sourceMappingURL=chunk-4W7T24L5.js.map
|