timelock-sdk 0.0.102 → 0.0.103
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.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "./uniswapMathLens-B_cHjOOB.cjs";
|
|
2
|
-
import { B as OptionTimelineData, F as useUserOperators, G as useMintOption, H as useExtendOption, I as useOperatorPerms, K as useMaxPositionSize, L as usePerpsOperator, P as useSetOperatorPerms, R as useClosePerp, U as useOptionPremium, V as useOptionTimeline, W as useOptionPnl, a as batchGetAmountsFromLiquidity, c as useLiquidityBlocks, ct as useMarketData, d as usePriceAtTick, dt as useActiveUserOptions, f as UniswapPoolData, ft as useClosedUserOptions, h as useCurrentPrice, ht as useTimelockConfig, i as useVaultData, l as useBurnLiquidity, lt as useExerciseOption, m as useCurrentTick, mt as useCurrentMarket, n as useLens, o as useMintLiquidity, p as usePoolData, pt as TimelockProvider, r as useVaultTVL, s as LiquidityBlockData, t as useApproval, u as usePriceHistory, ut as OptionData, z as useMintPerp } from "./client-
|
|
2
|
+
import { B as OptionTimelineData, F as useUserOperators, G as useMintOption, H as useExtendOption, I as useOperatorPerms, K as useMaxPositionSize, L as usePerpsOperator, P as useSetOperatorPerms, R as useClosePerp, U as useOptionPremium, V as useOptionTimeline, W as useOptionPnl, a as batchGetAmountsFromLiquidity, c as useLiquidityBlocks, ct as useMarketData, d as usePriceAtTick, dt as useActiveUserOptions, f as UniswapPoolData, ft as useClosedUserOptions, h as useCurrentPrice, ht as useTimelockConfig, i as useVaultData, l as useBurnLiquidity, lt as useExerciseOption, m as useCurrentTick, mt as useCurrentMarket, n as useLens, o as useMintLiquidity, p as usePoolData, pt as TimelockProvider, r as useVaultTVL, s as LiquidityBlockData, t as useApproval, u as usePriceHistory, ut as OptionData, z as useMintPerp } from "./client-uwDDNqle.cjs";
|
|
3
3
|
export { LiquidityBlockData, OptionData, OptionTimelineData, TimelockProvider, UniswapPoolData, batchGetAmountsFromLiquidity, useActiveUserOptions, useApproval, useBurnLiquidity, useClosePerp, useClosedUserOptions, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useExtendOption, useLens, useLiquidityBlocks, useMarketData, useMaxPositionSize, useMintLiquidity, useMintOption, useMintPerp, useOperatorPerms, useOptionPnl, useOptionPremium, useOptionTimeline, usePerpsOperator, usePoolData, usePriceAtTick, usePriceHistory, useSetOperatorPerms, useTimelockConfig, useUserOperators, useVaultData, useVaultTVL };
|
package/dist/client.js
CHANGED
|
@@ -5,7 +5,7 @@ import { r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-DBuVI-kl.js
|
|
|
5
5
|
import { A as getErc20, D as token1ToToken0, E as token0ToToken1, F as uniswapMathLenses, M as getTimelockMarket, N as getUniswapMathLens, P as timelockLenses, _ as getAmountsFromLiquidity, d as wrapAmount, j as getTimelockLens, k as getPriceHistory, n as EMPTY_ARRAY, p as wrapPrice, t as getPayoutAtTick, v as getNearestValidStrikeTick, w as roundTickDown, y as getPriceAtTick } from "./optionUtils-BkogxEAT.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
|
-
import React, { createContext,
|
|
8
|
+
import React, { createContext, useContext, useEffect, useMemo } from "react";
|
|
9
9
|
import { useAccount, useChainId, useClient, useReadContract, useSignMessage, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
10
10
|
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
11
11
|
import gql from "graphql-tag";
|
|
@@ -827,7 +827,7 @@ var PerpsOperator = class {
|
|
|
827
827
|
return address;
|
|
828
828
|
}
|
|
829
829
|
async genAuthMessage(userAddr) {
|
|
830
|
-
const { message } = await this.#request("api/auth/
|
|
830
|
+
const { message } = await this.#request("api/auth/gen", { userAddr });
|
|
831
831
|
return message;
|
|
832
832
|
}
|
|
833
833
|
async validateAuthMessage(authMessage, signature) {
|
|
@@ -950,14 +950,14 @@ const usePerpsOperator = () => {
|
|
|
950
950
|
return {
|
|
951
951
|
operator,
|
|
952
952
|
address,
|
|
953
|
-
signMessage: useMutation({ mutationFn:
|
|
953
|
+
signMessage: useMutation({ mutationFn: async () => {
|
|
954
954
|
if (!operator) throw new Error("Operator not initialized");
|
|
955
955
|
if (!userAddr) throw new Error("Wallet not connected");
|
|
956
956
|
const message = await operator.genAuthMessage(userAddr);
|
|
957
957
|
const signature = await signMessageAsync({ message });
|
|
958
958
|
saveSignature(userAddr, message, signature);
|
|
959
959
|
operator.setAuth(message, signature);
|
|
960
|
-
}
|
|
960
|
+
} })
|
|
961
961
|
};
|
|
962
962
|
};
|
|
963
963
|
|
|
@@ -1047,10 +1047,7 @@ const useMintPerp = (marketAddr) => {
|
|
|
1047
1047
|
if (!operator || !operatorAddr) throw new Error("Operator address not found");
|
|
1048
1048
|
if (!tickSpacing || currentTick === void 0) throw new Error("Pool data not found");
|
|
1049
1049
|
if (optionAssetIsToken0 === void 0 || !payoutAsset) throw new Error("Market data not found");
|
|
1050
|
-
if (!operator.auth)
|
|
1051
|
-
console.log("here");
|
|
1052
|
-
await signMessage();
|
|
1053
|
-
}
|
|
1050
|
+
if (!operator.auth) await signMessage();
|
|
1054
1051
|
if (!hasEnoughPerms) await setOperatorPerms({
|
|
1055
1052
|
operator: operatorAddr,
|
|
1056
1053
|
canMint: true,
|