timelock-sdk 0.0.146 → 0.0.148

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
 
4
- const require_optionUtils = require('./optionUtils-CFucfVf-.cjs');
5
- const require_optionsMarket = require('./optionsMarket-ohPoVcdm.cjs');
4
+ const require_optionUtils = require('./optionUtils-Cd3aDeDW.cjs');
5
+ const require_optionsMarket = require('./optionsMarket-BvsHPNmm.cjs');
6
6
  const require_singleOwnerVault = require('./singleOwnerVault-GCpQV7pN.cjs');
7
7
  let viem = require("viem");
8
8
  let react = require("react");
@@ -743,7 +743,7 @@ const useMintOption = (marketAddr) => {
743
743
  const { timelockLens } = useLens();
744
744
  const { askForApproval } = useApproval();
745
745
  const { writeContractAsync } = (0, wagmi.useWriteContract)();
746
- const mintOption = async ({ optionType, amount, duration, strikeTick }) => {
746
+ const mintOption = async ({ optionType, amount, duration, strikeTick, maxSteps }) => {
747
747
  if (!client || !address) throw new Error("Wallet not connected");
748
748
  if (!marketAddr) throw new Error("Market address not available");
749
749
  if (!timelockLens) throw new Error("Timelock lens not available");
@@ -751,6 +751,7 @@ const useMintOption = (marketAddr) => {
751
751
  if (!vault || !payoutAsset || optionAssetIsToken0 === void 0) throw new Error("Market data not available");
752
752
  const { data: { exact: currentTick } = {} } = await refetchCurrentTick();
753
753
  if (currentTick === void 0) throw new Error("Could not fetch current tick");
754
+ maxSteps = maxSteps || 100;
754
755
  strikeTick = require_optionUtils.getNearestValidStrikeTick(optionType, optionAssetIsToken0, tickSpacing, currentTick, strikeTick);
755
756
  const [premium, protocolFee] = await require_optionUtils.getTimelockMarket(marketAddr, client).read.calculatePremium([
756
757
  optionType === "CALL" ? 0 : 1,
@@ -771,6 +772,7 @@ const useMintOption = (marketAddr) => {
771
772
  strikeTick,
772
773
  duration,
773
774
  viem.maxUint256,
775
+ maxSteps,
774
776
  await timelockLens.read.getRefTick([vault, strikeTick])
775
777
  ]
776
778
  });