timelock-sdk 0.0.132 → 0.0.133
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-VhkUQ-HJ.d.cts → client-BuKYj0pW.d.ts} +3121 -1197
- package/dist/{client-gQvld5wF.d.ts → client-QYPs5kB7.d.cts} +3121 -1197
- package/dist/client.cjs +6 -23
- 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 +6 -23
- package/dist/client.js.map +1 -1
- package/dist/{optionUtils-DTutSZPI.js → optionUtils-CQzUsKpO.js} +3 -3
- package/dist/{optionUtils-DTutSZPI.js.map → optionUtils-CQzUsKpO.js.map} +1 -1
- package/dist/{optionUtils-BQIg6hnc.cjs → optionUtils-OfLzCR6R.cjs} +3 -3
- package/dist/{optionUtils-BQIg6hnc.cjs.map → optionUtils-OfLzCR6R.cjs.map} +1 -1
- package/dist/{optionsMarket-Hq7O-Hry.js → optionsMarket-B2IsvbeA.js} +48 -25
- package/dist/optionsMarket-B2IsvbeA.js.map +1 -0
- package/dist/{optionsMarket-C8-v8IvX.cjs → optionsMarket-C6K82im8.cjs} +48 -25
- package/dist/optionsMarket-C6K82im8.cjs.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-EIuBr8ZZ.d.cts → uniswapMathLens-Be6lFJcD.d.cts} +31 -13
- package/dist/{uniswapMathLens-BGtGI-Nm.d.ts → uniswapMathLens-DHfzEjej.d.ts} +31 -13
- package/package.json +1 -1
- package/dist/optionsMarket-C8-v8IvX.cjs.map +0 -1
- package/dist/optionsMarket-Hq7O-Hry.js.map +0 -1
package/dist/client.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./uniswapMathLens-
|
|
2
|
-
import { $ as OptionEvent, Ct as OptionData, Dt as useCurrentMarket, Et as TimelockProvider, G as useClosedUserPerps, H as useUserOperators, J as useClosePerp, K as useUserPerps, Ot as useTimelockConfig, Q as MintOptionEvent, St as useExerciseOption, Tt as useClosedUserOptions, U as useOperatorPerms, V as useSetOperatorPerms, W as useActiveUserPerps, X as ExerciseOptionEvent, Y as useMintPerp, Z as ExtendEvent, _ as useCurrentPrice, a as batchGetAmountsFromLiquidity, at as useMaxPositionSize, c as useLiquidityBlocks, d as usePriceHistory, et as useOptionTimeline, f as usePriceAtTick, g as useCurrentTick, h as usePoolData, i as useVaultData, it as useMintOption, l as useBurnLiquidity, m as UniswapPoolData, n as useLens, nt as useOptionPremium, o as useMintLiquidity, p as usePriceSqrtPriceX96, q as usePerpsOperator, r as useVaultTVL, rt as useOptionPnl, s as LiquidityBlockData, t as useApproval, tt as useExtendOption, u as useMarketPriceHistory, wt as useActiveUserOptions, xt as useMarketData } from "./client-
|
|
1
|
+
import "./uniswapMathLens-Be6lFJcD.cjs";
|
|
2
|
+
import { $ as OptionEvent, Ct as OptionData, Dt as useCurrentMarket, Et as TimelockProvider, G as useClosedUserPerps, H as useUserOperators, J as useClosePerp, K as useUserPerps, Ot as useTimelockConfig, Q as MintOptionEvent, St as useExerciseOption, Tt as useClosedUserOptions, U as useOperatorPerms, V as useSetOperatorPerms, W as useActiveUserPerps, X as ExerciseOptionEvent, Y as useMintPerp, Z as ExtendEvent, _ as useCurrentPrice, a as batchGetAmountsFromLiquidity, at as useMaxPositionSize, c as useLiquidityBlocks, d as usePriceHistory, et as useOptionTimeline, f as usePriceAtTick, g as useCurrentTick, h as usePoolData, i as useVaultData, it as useMintOption, l as useBurnLiquidity, m as UniswapPoolData, n as useLens, nt as useOptionPremium, o as useMintLiquidity, p as usePriceSqrtPriceX96, q as usePerpsOperator, r as useVaultTVL, rt as useOptionPnl, s as LiquidityBlockData, t as useApproval, tt as useExtendOption, u as useMarketPriceHistory, wt as useActiveUserOptions, xt as useMarketData } from "./client-QYPs5kB7.cjs";
|
|
3
3
|
export { ExerciseOptionEvent, ExtendEvent, LiquidityBlockData, MintOptionEvent, OptionData, OptionEvent, TimelockProvider, UniswapPoolData, batchGetAmountsFromLiquidity, useActiveUserOptions, useActiveUserPerps, useApproval, useBurnLiquidity, useClosePerp, useClosedUserOptions, useClosedUserPerps, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useExtendOption, useLens, useLiquidityBlocks, useMarketData, useMarketPriceHistory, useMaxPositionSize, useMintLiquidity, useMintOption, useMintPerp, useOperatorPerms, useOptionPnl, useOptionPremium, useOptionTimeline, usePerpsOperator, usePoolData, usePriceAtTick, usePriceHistory, usePriceSqrtPriceX96, useSetOperatorPerms, useTimelockConfig, useUserOperators, useUserPerps, useVaultData, useVaultTVL };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./uniswapMathLens-
|
|
2
|
-
import { $ as OptionEvent, Ct as OptionData, Dt as useCurrentMarket, Et as TimelockProvider, G as useClosedUserPerps, H as useUserOperators, J as useClosePerp, K as useUserPerps, Ot as useTimelockConfig, Q as MintOptionEvent, St as useExerciseOption, Tt as useClosedUserOptions, U as useOperatorPerms, V as useSetOperatorPerms, W as useActiveUserPerps, X as ExerciseOptionEvent, Y as useMintPerp, Z as ExtendEvent, _ as useCurrentPrice, a as batchGetAmountsFromLiquidity, at as useMaxPositionSize, c as useLiquidityBlocks, d as usePriceHistory, et as useOptionTimeline, f as usePriceAtTick, g as useCurrentTick, h as usePoolData, i as useVaultData, it as useMintOption, l as useBurnLiquidity, m as UniswapPoolData, n as useLens, nt as useOptionPremium, o as useMintLiquidity, p as usePriceSqrtPriceX96, q as usePerpsOperator, r as useVaultTVL, rt as useOptionPnl, s as LiquidityBlockData, t as useApproval, tt as useExtendOption, u as useMarketPriceHistory, wt as useActiveUserOptions, xt as useMarketData } from "./client-
|
|
1
|
+
import "./uniswapMathLens-DHfzEjej.js";
|
|
2
|
+
import { $ as OptionEvent, Ct as OptionData, Dt as useCurrentMarket, Et as TimelockProvider, G as useClosedUserPerps, H as useUserOperators, J as useClosePerp, K as useUserPerps, Ot as useTimelockConfig, Q as MintOptionEvent, St as useExerciseOption, Tt as useClosedUserOptions, U as useOperatorPerms, V as useSetOperatorPerms, W as useActiveUserPerps, X as ExerciseOptionEvent, Y as useMintPerp, Z as ExtendEvent, _ as useCurrentPrice, a as batchGetAmountsFromLiquidity, at as useMaxPositionSize, c as useLiquidityBlocks, d as usePriceHistory, et as useOptionTimeline, f as usePriceAtTick, g as useCurrentTick, h as usePoolData, i as useVaultData, it as useMintOption, l as useBurnLiquidity, m as UniswapPoolData, n as useLens, nt as useOptionPremium, o as useMintLiquidity, p as usePriceSqrtPriceX96, q as usePerpsOperator, r as useVaultTVL, rt as useOptionPnl, s as LiquidityBlockData, t as useApproval, tt as useExtendOption, u as useMarketPriceHistory, wt as useActiveUserOptions, xt as useMarketData } from "./client-BuKYj0pW.js";
|
|
3
3
|
export { ExerciseOptionEvent, ExtendEvent, LiquidityBlockData, MintOptionEvent, OptionData, OptionEvent, TimelockProvider, UniswapPoolData, batchGetAmountsFromLiquidity, useActiveUserOptions, useActiveUserPerps, useApproval, useBurnLiquidity, useClosePerp, useClosedUserOptions, useClosedUserPerps, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useExtendOption, useLens, useLiquidityBlocks, useMarketData, useMarketPriceHistory, useMaxPositionSize, useMintLiquidity, useMintOption, useMintPerp, useOperatorPerms, useOptionPnl, useOptionPremium, useOptionTimeline, usePerpsOperator, usePoolData, usePriceAtTick, usePriceHistory, usePriceSqrtPriceX96, useSetOperatorPerms, useTimelockConfig, useUserOperators, useUserPerps, useVaultData, useVaultTVL };
|
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 { A as token0ToToken1AtTick, B as timelockLenses, D as roundTickDown, F as getErc20, I as getTimelockLens, L as getTimelockMarket, M as token1ToToken0AtTick, P as getPriceHistory, R as getUniswapMathLens, V as uniswapMathLenses, b as getPriceAtSqrtPriceX96, f as wrapAmount, j as token1ToToken0, k as token0ToToken1, m as wrapPrice, r as EMPTY_ARRAY, t as getPayoutAtPrice, v as getAmountsFromLiquidity, x as getPriceAtTick, y as getNearestValidStrikeTick, z as swappers } from "./optionUtils-
|
|
4
|
+
import { r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-B2IsvbeA.js";
|
|
5
|
+
import { A as token0ToToken1AtTick, B as timelockLenses, D as roundTickDown, F as getErc20, I as getTimelockLens, L as getTimelockMarket, M as token1ToToken0AtTick, P as getPriceHistory, R as getUniswapMathLens, V as uniswapMathLenses, b as getPriceAtSqrtPriceX96, f as wrapAmount, j as token1ToToken0, k as token0ToToken1, m as wrapPrice, r as EMPTY_ARRAY, t as getPayoutAtPrice, v as getAmountsFromLiquidity, x as getPriceAtTick, y as getNearestValidStrikeTick, z as swappers } from "./optionUtils-CQzUsKpO.js";
|
|
6
6
|
import { n as uniswapV3PoolAbi, t as singleOwnerVaultAbi } from "./singleOwnerVault-p81IjmWe.js";
|
|
7
7
|
import { encodeAbiParameters, encodeFunctionData, erc20Abi, maxUint256, zeroAddress } from "viem";
|
|
8
8
|
import React, { createContext, useContext, useEffect, useMemo } from "react";
|
|
@@ -526,42 +526,25 @@ const useExerciseOption = (marketAddr) => {
|
|
|
526
526
|
|
|
527
527
|
//#endregion
|
|
528
528
|
//#region src/hooks/options/useMaxPositionSize.ts
|
|
529
|
-
const useMaxPositionSize = (marketAddr,
|
|
529
|
+
const useMaxPositionSize = (marketAddr, maxBorrowableRange = 100) => {
|
|
530
530
|
const { timelockLens } = useLens();
|
|
531
531
|
const { optionAssetDecimals } = useMarketData(marketAddr);
|
|
532
|
-
const { data
|
|
532
|
+
const { data, ...rest } = useReadContract({
|
|
533
533
|
address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
|
|
534
534
|
abi: lensAbi,
|
|
535
|
-
functionName: "
|
|
535
|
+
functionName: "getMaxATMSizes",
|
|
536
536
|
args: [marketAddr, maxBorrowableRange],
|
|
537
537
|
query: { enabled: !!marketAddr && !!timelockLens },
|
|
538
538
|
gas: 100000000n
|
|
539
539
|
});
|
|
540
|
-
const { data: data1, refetch: refetch1 } = useReadContract({
|
|
541
|
-
address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
|
|
542
|
-
abi: lensAbi,
|
|
543
|
-
functionName: "getMaxPositionSize",
|
|
544
|
-
args: [
|
|
545
|
-
marketAddr,
|
|
546
|
-
strikeTick,
|
|
547
|
-
maxBorrowableRange
|
|
548
|
-
],
|
|
549
|
-
query: { enabled: !!marketAddr && !!timelockLens && strikeTick !== void 0 },
|
|
550
|
-
gas: 100000000n
|
|
551
|
-
});
|
|
552
|
-
const data = strikeTick !== void 0 ? data1 : data0;
|
|
553
540
|
const { maxCallSize, maxPutSize } = useMemo(() => data && optionAssetDecimals ? {
|
|
554
541
|
maxCallSize: wrapAmount(data[0], optionAssetDecimals),
|
|
555
542
|
maxPutSize: wrapAmount(data[1], optionAssetDecimals)
|
|
556
543
|
} : {}, [data, optionAssetDecimals]);
|
|
557
|
-
const refetch = () => {
|
|
558
|
-
refetch0();
|
|
559
|
-
refetch1();
|
|
560
|
-
};
|
|
561
544
|
return {
|
|
562
545
|
maxCallSize,
|
|
563
546
|
maxPutSize,
|
|
564
|
-
|
|
547
|
+
...rest
|
|
565
548
|
};
|
|
566
549
|
};
|
|
567
550
|
|