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/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.cjs +4 -5
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +121 -122
- package/dist/client.d.ts +243 -244
- package/dist/client.js +4 -5
- package/dist/client.js.map +1 -1
- package/dist/{index-DmUTOkWh.d.cts → index-B3zG2vl9.d.ts} +120 -119
- package/dist/{index-WjU9H0Tc.d.ts → index-lyv29QjP.d.cts} +211 -210
- package/dist/{numberUtils-BVUp0GfC.js → numberUtils-BdDZHOYj.js} +9 -4
- package/dist/{numberUtils-BVUp0GfC.js.map → numberUtils-BdDZHOYj.js.map} +1 -1
- package/dist/{numberUtils-BxQ4RnW9.cjs → numberUtils-ByjL6x6B.cjs} +14 -3
- package/dist/{numberUtils-BxQ4RnW9.cjs.map → numberUtils-ByjL6x6B.cjs.map} +1 -1
- package/dist/{optionsMarket-GbBWALCn.js → optionsMarket-6PlyceXp.js} +9 -9
- package/dist/{optionsMarket-GbBWALCn.js.map → optionsMarket-6PlyceXp.js.map} +1 -1
- package/dist/{optionsMarket-BpL6x4be.cjs → optionsMarket-DxGdV3HF.cjs} +9 -9
- package/dist/{optionsMarket-BpL6x4be.cjs.map → optionsMarket-DxGdV3HF.cjs.map} +1 -1
- package/dist/package.cjs +3 -2
- package/dist/package.d.cts +3 -3
- package/dist/package.d.ts +3 -3
- package/dist/package.js +3 -3
- package/dist/{uniswapMathLens-i1P7D19j.d.ts → uniswapMathLens-C54iWXpi.d.ts} +9 -9
- package/dist/{uniswapMathLens-BF5k8KFu.d.cts → uniswapMathLens-CK8C7WOt.d.cts} +9 -9
- package/package.json +1 -1
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-
|
|
5
|
-
import {
|
|
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("
|
|
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 =
|
|
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,
|