timelock-sdk 0.0.45 → 0.0.47
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 +4 -4
- 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 -5
- package/dist/client.js.map +1 -1
- package/package.json +1 -1
package/dist/client.d.cts
CHANGED
|
@@ -2286,8 +2286,8 @@ declare const useMintOption: (marketAddr?: Address) => {
|
|
|
2286
2286
|
//#endregion
|
|
2287
2287
|
//#region src/hooks/market/useOptionPnl.d.ts
|
|
2288
2288
|
declare const useOptionPnl: (option: OptionData) => {
|
|
2289
|
-
unrealizedPayout:
|
|
2290
|
-
displayPnl:
|
|
2289
|
+
unrealizedPayout: Amount | undefined;
|
|
2290
|
+
displayPnl: Amount | undefined;
|
|
2291
2291
|
};
|
|
2292
2292
|
//#endregion
|
|
2293
2293
|
//#region src/hooks/market/useOptionPremium.d.ts
|
package/dist/client.d.ts
CHANGED
|
@@ -2286,8 +2286,8 @@ declare const useMintOption: (marketAddr?: Address) => {
|
|
|
2286
2286
|
//#endregion
|
|
2287
2287
|
//#region src/hooks/market/useOptionPnl.d.ts
|
|
2288
2288
|
declare const useOptionPnl: (option: OptionData) => {
|
|
2289
|
-
unrealizedPayout:
|
|
2290
|
-
displayPnl:
|
|
2289
|
+
unrealizedPayout: Amount | undefined;
|
|
2290
|
+
displayPnl: Amount | undefined;
|
|
2291
2291
|
};
|
|
2292
2292
|
//#endregion
|
|
2293
2293
|
//#region src/hooks/market/useOptionPremium.d.ts
|
package/dist/client.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { lensAbi, optionsMarketAbi } from "./optionsMarket-DyBxHplR.js";
|
|
5
5
|
import { PRICE_PRECISION, getErc20, getPriceAtTick, getTimelockLens, getTimelockMarket, getUniswapMathLens, liquiditiesToAmounts, roundTickDown, timelockLenses, token0ToToken1, token1ToToken0, uniswapMathLenses, wrapAmount, wrapPrice } from "./numberUtils-Dk_yqgfN.js";
|
|
6
6
|
import { singleOwnerVaultAbi, uniswapV3PoolAbi } from "./singleOwnerVault-DMu9pqN1.js";
|
|
7
|
-
import { encodeFunctionData, erc20Abi, maxUint256 } from "viem";
|
|
7
|
+
import { encodeFunctionData, erc20Abi, maxUint256, zeroAddress } from "viem";
|
|
8
8
|
import React, { createContext, useContext, useMemo } from "react";
|
|
9
9
|
import { useAccount, useChainId, useClient, useReadContract, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
10
10
|
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
@@ -388,7 +388,7 @@ const useOptionPnl = (option) => {
|
|
|
388
388
|
const { exact: currentTick } = useCurrentTick(pool);
|
|
389
389
|
const strikeSize = positionSizeCurrent * strikePrice / PRICE_PRECISION;
|
|
390
390
|
const displayPnl = useMemo(() => {
|
|
391
|
-
if (optionAssetIsToken0 === void 0 || currentTick === void 0 || !positionSizeCurrent || !payoutAssetDecimals) return
|
|
391
|
+
if (optionAssetIsToken0 === void 0 || currentTick === void 0 || !positionSizeCurrent || !payoutAssetDecimals) return void 0;
|
|
392
392
|
const delta = (optionAssetIsToken0 ? token0ToToken1(positionSizeCurrent, currentTick) : token1ToToken0(positionSizeCurrent, currentTick)) - strikeSize;
|
|
393
393
|
return wrapAmount(optionType === "CALL" ? delta : -delta, payoutAssetDecimals);
|
|
394
394
|
}, [
|
|
@@ -400,7 +400,7 @@ const useOptionPnl = (option) => {
|
|
|
400
400
|
]);
|
|
401
401
|
return {
|
|
402
402
|
unrealizedPayout: useMemo(() => {
|
|
403
|
-
if (!payoutAssetDecimals || !currentTick || !tickSpacing) return
|
|
403
|
+
if (!payoutAssetDecimals || !currentTick || !tickSpacing) return void 0;
|
|
404
404
|
const [amount0, amount1] = liquiditiesToAmounts(option.liquiditiesCurrent, option.startTick, currentTick, tickSpacing);
|
|
405
405
|
const delta = (optionAssetIsToken0 ? amount1 + token0ToToken1(amount0, currentTick) : amount0 + token1ToToken0(amount1, currentTick)) - strikeSize;
|
|
406
406
|
const pnl = optionType === "CALL" ? delta : -delta;
|
|
@@ -694,8 +694,8 @@ const useLiquidityBlocks = (vaultAddr) => {
|
|
|
694
694
|
address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
|
|
695
695
|
abi: lensAbi,
|
|
696
696
|
functionName: "getAllBlocks",
|
|
697
|
-
args: [vaultAddr],
|
|
698
|
-
query: { enabled: !!vaultAddr
|
|
697
|
+
args: [vaultAddr || zeroAddress],
|
|
698
|
+
query: { enabled: !!vaultAddr }
|
|
699
699
|
});
|
|
700
700
|
return {
|
|
701
701
|
data: blocks,
|