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/abis.cjs +1 -1
- package/dist/abis.d.cts +1 -1
- package/dist/abis.d.ts +1 -1
- package/dist/abis.js +1 -1
- package/dist/{client--xA1te-V.d.ts → client-CuKpzxpi.d.ts} +379 -378
- package/dist/{client-jAKjSAlA.d.cts → client-X8wiNH4U.d.cts} +390 -389
- package/dist/client.cjs +5 -3
- 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 -3
- package/dist/client.js.map +1 -1
- package/dist/{optionUtils-CFucfVf-.cjs → optionUtils-Cd3aDeDW.cjs} +2 -2
- package/dist/{optionUtils-CFucfVf-.cjs.map → optionUtils-Cd3aDeDW.cjs.map} +1 -1
- package/dist/{optionUtils-DuJzVAs5.js → optionUtils-oXYx-RlH.js} +2 -2
- package/dist/{optionUtils-DuJzVAs5.js.map → optionUtils-oXYx-RlH.js.map} +1 -1
- package/dist/{optionsMarket-ohPoVcdm.cjs → optionsMarket-BvsHPNmm.cjs} +73 -35
- package/dist/optionsMarket-BvsHPNmm.cjs.map +1 -0
- package/dist/{optionsMarket-DpvbjVFL.js → optionsMarket-GXvAI9ym.js} +73 -35
- package/dist/optionsMarket-GXvAI9ym.js.map +1 -0
- package/dist/package.cjs +2 -2
- package/dist/package.d.cts +2 -2
- package/dist/package.d.ts +2 -2
- package/dist/package.js +2 -2
- package/dist/{uniswapMathLens-29cU_Tnv.d.ts → uniswapMathLens-DLVBzRq6.d.ts} +61 -26
- package/dist/{uniswapMathLens-X6H7QwrK.d.cts → uniswapMathLens-NRnucfmK.d.cts} +61 -26
- package/package.json +1 -1
- package/dist/optionsMarket-DpvbjVFL.js.map +0 -1
- package/dist/optionsMarket-ohPoVcdm.cjs.map +0 -1
package/dist/client.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
const require_optionUtils = require('./optionUtils-
|
|
5
|
-
const require_optionsMarket = require('./optionsMarket-
|
|
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
|
});
|