timelock-sdk 0.0.45 → 0.0.47
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/client.cjs +4 -4
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +5 -5
- package/dist/client.js.map +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -395,7 +395,7 @@ const useOptionPnl = (option) => {
|
|
|
395
395
|
const { exact: currentTick } = useCurrentTick(pool);
|
|
396
396
|
const strikeSize = positionSizeCurrent * strikePrice / require_numberUtils.PRICE_PRECISION;
|
|
397
397
|
const displayPnl = (0, react.useMemo)(() => {
|
|
398
|
-
if (optionAssetIsToken0 === void 0 || currentTick === void 0 || !positionSizeCurrent || !payoutAssetDecimals) return
|
|
398
|
+
if (optionAssetIsToken0 === void 0 || currentTick === void 0 || !positionSizeCurrent || !payoutAssetDecimals) return void 0;
|
|
399
399
|
const delta = (optionAssetIsToken0 ? require_numberUtils.token0ToToken1(positionSizeCurrent, currentTick) : require_numberUtils.token1ToToken0(positionSizeCurrent, currentTick)) - strikeSize;
|
|
400
400
|
return require_numberUtils.wrapAmount(optionType === "CALL" ? delta : -delta, payoutAssetDecimals);
|
|
401
401
|
}, [
|
|
@@ -407,7 +407,7 @@ const useOptionPnl = (option) => {
|
|
|
407
407
|
]);
|
|
408
408
|
return {
|
|
409
409
|
unrealizedPayout: (0, react.useMemo)(() => {
|
|
410
|
-
if (!payoutAssetDecimals || !currentTick || !tickSpacing) return
|
|
410
|
+
if (!payoutAssetDecimals || !currentTick || !tickSpacing) return void 0;
|
|
411
411
|
const [amount0, amount1] = require_numberUtils.liquiditiesToAmounts(option.liquiditiesCurrent, option.startTick, currentTick, tickSpacing);
|
|
412
412
|
const delta = (optionAssetIsToken0 ? amount1 + require_numberUtils.token0ToToken1(amount0, currentTick) : amount0 + require_numberUtils.token1ToToken0(amount1, currentTick)) - strikeSize;
|
|
413
413
|
const pnl = optionType === "CALL" ? delta : -delta;
|
|
@@ -701,8 +701,8 @@ const useLiquidityBlocks = (vaultAddr) => {
|
|
|
701
701
|
address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
|
|
702
702
|
abi: require_optionsMarket.lensAbi,
|
|
703
703
|
functionName: "getAllBlocks",
|
|
704
|
-
args: [vaultAddr],
|
|
705
|
-
query: { enabled: !!vaultAddr
|
|
704
|
+
args: [vaultAddr || viem.zeroAddress],
|
|
705
|
+
query: { enabled: !!vaultAddr }
|
|
706
706
|
});
|
|
707
707
|
return {
|
|
708
708
|
data: blocks,
|