timelock-sdk 0.0.83 → 0.0.85
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-Dtm1qie2.d.ts → client-B_AKg-I4.d.cts} +158 -158
- package/dist/{client-GoHd57RL.d.cts → client-BjjoSITU.d.ts} +4 -4
- package/dist/client.cjs +6 -6
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +6 -6
- package/dist/client.js.map +1 -1
- package/dist/optionUtils-CoIk8zAr.js.map +1 -1
- package/dist/optionUtils-DAjhbiQ5.cjs.map +1 -1
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { n as optionsMarketAbi, r as lensAbi, t as uniswapMathLensAbi } from "./uniswapMathLens-
|
|
1
|
+
import { n as optionsMarketAbi, r as lensAbi, t as uniswapMathLensAbi } from "./uniswapMathLens-C54iWXpi.js";
|
|
2
2
|
import * as viem0 from "viem";
|
|
3
3
|
import { Address, Client, GetContractReturnType, PublicClient } from "viem";
|
|
4
|
+
import Big from "big.js";
|
|
4
5
|
import React, { ReactNode } from "react";
|
|
5
|
-
import "graphql";
|
|
6
6
|
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
7
7
|
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
8
8
|
import { NonUndefinedGuard } from "@tanstack/react-query";
|
|
9
|
+
import "graphql";
|
|
9
10
|
import * as _tanstack_query_core0 from "@tanstack/query-core";
|
|
10
|
-
import Big from "big.js";
|
|
11
11
|
import * as _wagmi_core0 from "@wagmi/core";
|
|
12
12
|
|
|
13
13
|
//#region src/generated/graphql.d.ts
|
|
@@ -62627,4 +62627,4 @@ declare const useApproval: () => {
|
|
|
62627
62627
|
};
|
|
62628
62628
|
//#endregion
|
|
62629
62629
|
export { scalePrice as $, PriceDataPoint as A, useOptionTimeline as B, liquiditiesToAmount1 as C, timelockLenses as Ct, token0ToToken1 as D, roundTickUp as E, useUserOperators as F, useMaxPositionSize as G, useOptionPremium as H, usePerpsOperator as I, formatAmount as J, Amount as K, useClosePerp as L, getCurrentPrice as M, getPriceHistory as N, token1ToToken0 as O, useSetOperatorPerms as P, scaleAmount as Q, useMintPerp as R, liquiditiesToAmount0 as S, getUniswapMathLens as St, roundTickDown as T, useOptionPnl as U, useExtendOption as V, useMintOption as W, formatUSD as X, formatCondensed as Y, formatVagueAmount as Z, PRICE_PRECISION as _, TimelockMarketData as _t, batchGetAmountsFromLiquidity as a, wrapPriceUnscaled as at, getPriceAtTick as b, getTimelockLens as bt, useLiquidityBlocks as c, useExerciseOption as ct, usePriceAtTick as d, useClosedUserOptions as dt, unscaleAmount as et, UniswapPoolData as f, TimelockProvider as ft, getPayoutAtTick as g, TimelockMarket as gt, useCurrentPrice as h, TimelockLens as ht, useVaultData as i, wrapPrice as it, PriceResolution as j, PriceData as k, useBurnLiquidity as l, OptionData as lt, useCurrentTick as m, useTimelockConfig as mt, useLens as n, wrapAmount as nt, useMintLiquidity as o, zero as ot, usePoolData as p, useCurrentMarket as pt, EMPTY_ARRAY as q, useVaultTVL as r, wrapAmountUnscaled as rt, LiquidityBlockData as s, useMarketData as st, useApproval as t, unscalePrice as tt, usePriceHistory as u, useActiveUserOptions as ut, getAmountsFromLiquidity as v, UniswapMathLens as vt, liquiditiesToAmounts as w, uniswapMathLenses as wt, getTickAtPrice as x, getTimelockMarket as xt, getNearestValidStrikeTick as y, getErc20 as yt, OptionTimelineData as z };
|
|
62630
|
-
//# sourceMappingURL=client-
|
|
62630
|
+
//# sourceMappingURL=client-BjjoSITU.d.ts.map
|
package/dist/client.cjs
CHANGED
|
@@ -386,7 +386,7 @@ const usePoolData = (poolAddr) => {
|
|
|
386
386
|
|
|
387
387
|
//#endregion
|
|
388
388
|
//#region src/hooks/options/useExerciseOption.ts
|
|
389
|
-
const swapper = "
|
|
389
|
+
const swapper = "0x2c79DD9797C35A3D966C2716739542a282BB5540";
|
|
390
390
|
const useExerciseOption = (marketAddr) => {
|
|
391
391
|
const { vault, pool } = useMarketData(marketAddr);
|
|
392
392
|
const { fee } = usePoolData(pool);
|
|
@@ -557,16 +557,16 @@ const useMintOption = (marketAddr) => {
|
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/hooks/options/useOptionPnl.ts
|
|
559
559
|
const useOptionPnl = (option) => {
|
|
560
|
-
const { marketAddr, optionType,
|
|
560
|
+
const { marketAddr, optionType, strikeTick, positionSizeCurrent } = option;
|
|
561
561
|
const { pool, optionAssetIsToken0, payoutAssetDecimals, tickSpacing } = useMarketData(marketAddr);
|
|
562
562
|
const { exact: currentTick } = useCurrentTick(pool);
|
|
563
563
|
const displayPnl = (0, react.useMemo)(() => {
|
|
564
564
|
if (optionAssetIsToken0 === void 0 || currentTick === void 0 || !payoutAssetDecimals) return void 0;
|
|
565
|
-
const
|
|
566
|
-
const delta = (optionAssetIsToken0 ? require_optionUtils.token0ToToken1(positionSizeCurrent, currentTick) : require_optionUtils.token1ToToken0(positionSizeCurrent, currentTick)) -
|
|
565
|
+
const strikeSize = optionAssetIsToken0 ? require_optionUtils.token0ToToken1(positionSizeCurrent, strikeTick) : require_optionUtils.token1ToToken0(positionSizeCurrent, strikeTick);
|
|
566
|
+
const delta = (optionAssetIsToken0 ? require_optionUtils.token0ToToken1(positionSizeCurrent, currentTick) : require_optionUtils.token1ToToken0(positionSizeCurrent, currentTick)) - strikeSize;
|
|
567
567
|
return require_optionUtils.wrapAmount(optionType === "CALL" ? delta : -delta, payoutAssetDecimals);
|
|
568
568
|
}, [
|
|
569
|
-
|
|
569
|
+
strikeTick,
|
|
570
570
|
optionType,
|
|
571
571
|
optionAssetIsToken0,
|
|
572
572
|
currentTick,
|
|
@@ -1015,7 +1015,7 @@ const useClosePerp = () => {
|
|
|
1015
1015
|
//#region src/hooks/pool/usePriceAtTick.ts
|
|
1016
1016
|
const usePriceAtTick = (tick, poolAddr) => {
|
|
1017
1017
|
const { token0Decimals, token1Decimals } = usePoolData(poolAddr);
|
|
1018
|
-
const priceBigInt = (0, react.useMemo)(() => tick ? require_optionUtils.getPriceAtTick(tick) : void 0, [tick]);
|
|
1018
|
+
const priceBigInt = (0, react.useMemo)(() => tick !== void 0 ? require_optionUtils.getPriceAtTick(tick) : void 0, [tick]);
|
|
1019
1019
|
return (0, react.useMemo)(() => priceBigInt && token0Decimals && token1Decimals ? require_optionUtils.wrapPrice(priceBigInt, token0Decimals, token1Decimals) : void 0, [
|
|
1020
1020
|
priceBigInt,
|
|
1021
1021
|
token0Decimals,
|