@sodax/dapp-kit 1.5.6-beta → 1.5.7-beta
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 +14 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/hooks/dex/useLiquidityAmounts.ts +14 -2
package/dist/index.mjs
CHANGED
|
@@ -2086,7 +2086,13 @@ function useLiquidityAmounts(minPrice, maxPrice, poolData) {
|
|
|
2086
2086
|
}
|
|
2087
2087
|
try {
|
|
2088
2088
|
const amount0BigInt = BigInt(Math.floor(amount0 * 10 ** poolData.token0.decimals));
|
|
2089
|
-
const amount1BigInt = ClService.calculateAmount1FromAmount0(
|
|
2089
|
+
const amount1BigInt = ClService.calculateAmount1FromAmount0(
|
|
2090
|
+
amount0BigInt,
|
|
2091
|
+
tickLower,
|
|
2092
|
+
tickUpper,
|
|
2093
|
+
currentTick,
|
|
2094
|
+
poolData.sqrtPriceX96
|
|
2095
|
+
);
|
|
2090
2096
|
const amount1 = Number(amount1BigInt) / 10 ** poolData.token1.decimals;
|
|
2091
2097
|
setLiquidityToken1Amount(amount1.toFixed(6));
|
|
2092
2098
|
} catch (err) {
|
|
@@ -2108,7 +2114,13 @@ function useLiquidityAmounts(minPrice, maxPrice, poolData) {
|
|
|
2108
2114
|
}
|
|
2109
2115
|
try {
|
|
2110
2116
|
const amount1BigInt = BigInt(Math.floor(amount1 * 10 ** poolData.token1.decimals));
|
|
2111
|
-
const amount0BigInt = ClService.calculateAmount0FromAmount1(
|
|
2117
|
+
const amount0BigInt = ClService.calculateAmount0FromAmount1(
|
|
2118
|
+
amount1BigInt,
|
|
2119
|
+
tickLower,
|
|
2120
|
+
tickUpper,
|
|
2121
|
+
currentTick,
|
|
2122
|
+
poolData.sqrtPriceX96
|
|
2123
|
+
);
|
|
2112
2124
|
const amount0 = Number(amount0BigInt) / 10 ** poolData.token0.decimals;
|
|
2113
2125
|
setLiquidityToken0Amount(amount0.toFixed(6));
|
|
2114
2126
|
} catch (err) {
|