timelock-sdk 0.0.66 → 0.0.68

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.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
 
4
- import { r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-GbBWALCn.js";
5
- import { C as token1ToToken0, D as getUniswapMathLens, E as getTimelockMarket, O as timelockLenses, S as token0ToToken1, T as getTimelockLens, b as roundTickDown, d as wrapPrice, h as getPriceAtTick, k as uniswapMathLenses, l as wrapAmount, m as PRICE_PRECISION, w as getErc20, y as liquiditiesToAmounts } from "./numberUtils-BVUp0GfC.js";
4
+ import { r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-6PlyceXp.js";
5
+ import { A as uniswapMathLenses, C as token0ToToken1, D as getTimelockMarket, E as getTimelockLens, O as getUniswapMathLens, T as getErc20, b as liquiditiesToAmounts, d as wrapPrice, g as getPriceAtTick, h as getNearestValidStrikeTick, k as timelockLenses, l as wrapAmount, m as PRICE_PRECISION, w as token1ToToken0, x as roundTickDown } from "./numberUtils-BdDZHOYj.js";
6
6
  import { n as uniswapV3PoolAbi, t as singleOwnerVaultAbi } from "./singleOwnerVault-BeJChjfJ.js";
7
7
  import { encodeAbiParameters, encodeFunctionData, erc20Abi, maxUint256, zeroAddress } from "viem";
8
8
  import React, { createContext, useContext, useMemo } from "react";
@@ -428,10 +428,9 @@ const useMintOption = (marketAddr) => {
428
428
  if (!client || !address) throw new Error("Wallet not connected");
429
429
  if (!marketAddr) throw new Error("Market address not available");
430
430
  if (!timelockLens) throw new Error("Timelock lens not available");
431
- if (!vault || !payoutAsset) throw new Error("Vault not available");
431
+ if (!vault || !payoutAsset || optionAssetIsToken0 === void 0) throw new Error("Market data not available");
432
432
  if (currentTick === void 0 || !tickSpacing) throw new Error("Pool data not available");
433
- strikeTick = roundTickDown(strikeTick ?? currentTick, tickSpacing);
434
- if (optionType === "CALL" && optionAssetIsToken0 || optionType === "PUT" && !optionAssetIsToken0) strikeTick += tickSpacing;
433
+ strikeTick = getNearestValidStrikeTick(optionType, optionAssetIsToken0, tickSpacing, currentTick, strikeTick);
435
434
  const [premium, protocolFee] = await getTimelockMarket(marketAddr, client).read.calculatePremium([
436
435
  optionType === "CALL" ? 0 : 1,
437
436
  amount,