timelock-sdk 0.0.114 → 0.0.116
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-BFaMKjtt.d.ts → client-C1AigaVu.d.cts} +292 -292
- package/dist/{client-dmXFiQFn.d.cts → client-CxAAahmW.d.ts} +6 -6
- package/dist/client.cjs +11 -7
- 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 +11 -7
- package/dist/client.js.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-ChJFZ6hc.js";
|
|
2
2
|
import * as viem0 from "viem";
|
|
3
3
|
import { Address, Client, GetContractReturnType, Hex, 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
|
|
@@ -31862,11 +31862,11 @@ declare class PerpsOperator {
|
|
|
31862
31862
|
closed: boolean;
|
|
31863
31863
|
}[]>;
|
|
31864
31864
|
mintPerp: (body: MintPerpBody) => Promise<{
|
|
31865
|
-
txHash: string
|
|
31865
|
+
txHash: `0x${string}`;
|
|
31866
31866
|
optionId: bigint;
|
|
31867
31867
|
}>;
|
|
31868
31868
|
exercisePerp: (body: ExercisePerpBody) => Promise<{
|
|
31869
|
-
txHash: string
|
|
31869
|
+
txHash: `0x${string}`;
|
|
31870
31870
|
optionId: bigint;
|
|
31871
31871
|
}>;
|
|
31872
31872
|
}
|
|
@@ -62862,4 +62862,4 @@ declare const useApproval: () => {
|
|
|
62862
62862
|
};
|
|
62863
62863
|
//#endregion
|
|
62864
62864
|
export { EMPTY_ARRAY as $, token1ToToken0 as A, uniswapMathLenses as At, useClosedUserPerps as B, getTickAtPrice as C, TimelockMarketData as Ct, roundTickDown as D, getTimelockMarket as Dt, liquiditiesToAmounts as E, getTimelockLens as Et, getPriceHistory as F, OptionTimelineData as G, usePerpsOperator as H, useSetOperatorPerms as I, useOptionPremium as J, useOptionTimeline as K, useUserOperators as L, PriceDataPoint as M, PriceResolution as N, roundTickUp as O, getUniswapMathLens as Ot, getCurrentPrice as P, Amount as Q, useOperatorPerms as R, getPriceSqrtPriceX96 as S, TimelockMarket as St, liquiditiesToAmount1 as T, getErc20 as Tt, useClosePerp as U, useUserPerps as V, useMintPerp as W, useMintOption as X, useOptionPnl as Y, useMaxPositionSize as Z, getPayoutAtTick as _, useClosedUserOptions as _t, batchGetAmountsFromLiquidity as a, scalePrice as at, getNearestValidStrikeTick as b, useTimelockConfig as bt, useLiquidityBlocks as c, wrapAmount as ct, usePriceAtTick as d, wrapPriceUnscaled as dt, formatAmount as et, usePriceSqrtPriceX96 as f, zero as ft, useCurrentPrice as g, useActiveUserOptions as gt, useCurrentTick as h, OptionData as ht, useVaultData as i, scaleAmount as it, PriceData as j, token0ToToken1 as k, timelockLenses as kt, useBurnLiquidity as l, wrapAmountUnscaled as lt, usePoolData as m, useExerciseOption as mt, useLens as n, formatUSD as nt, useMintLiquidity as o, unscaleAmount as ot, UniswapPoolData as p, useMarketData as pt, useExtendOption as q, useVaultTVL as r, formatVagueAmount as rt, LiquidityBlockData as s, unscalePrice as st, useApproval as t, formatCondensed as tt, usePriceHistory as u, wrapPrice as ut, PRICE_PRECISION as v, TimelockProvider as vt, liquiditiesToAmount0 as w, UniswapMathLens as wt, getPriceAtTick as x, TimelockLens as xt, getAmountsFromLiquidity as y, useCurrentMarket as yt, useActiveUserPerps as z };
|
|
62865
|
-
//# sourceMappingURL=client-
|
|
62865
|
+
//# sourceMappingURL=client-CxAAahmW.d.ts.map
|
package/dist/client.cjs
CHANGED
|
@@ -523,7 +523,7 @@ const useExerciseOption = (marketAddr) => {
|
|
|
523
523
|
]
|
|
524
524
|
});
|
|
525
525
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
|
|
526
|
-
await sleep(
|
|
526
|
+
await sleep(400);
|
|
527
527
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
528
528
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
529
529
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -660,7 +660,7 @@ const useMintOption = (marketAddr) => {
|
|
|
660
660
|
]
|
|
661
661
|
});
|
|
662
662
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
|
|
663
|
-
await sleep(
|
|
663
|
+
await sleep(400);
|
|
664
664
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
665
665
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
666
666
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -834,7 +834,7 @@ const useExtendOption = (marketAddr) => {
|
|
|
834
834
|
]
|
|
835
835
|
});
|
|
836
836
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
|
|
837
|
-
await sleep(
|
|
837
|
+
await sleep(400);
|
|
838
838
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
839
839
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
840
840
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -1094,14 +1094,15 @@ const useMintPerp = (marketAddr) => {
|
|
|
1094
1094
|
spendingApproval: maxPremium
|
|
1095
1095
|
});
|
|
1096
1096
|
await askForApproval(payoutAsset, marketAddr, maxPremium);
|
|
1097
|
-
await operator.mintPerp({
|
|
1097
|
+
const { txHash } = await operator.mintPerp({
|
|
1098
1098
|
marketAddr,
|
|
1099
1099
|
amount,
|
|
1100
1100
|
optionType,
|
|
1101
1101
|
duration,
|
|
1102
1102
|
strikeTick: validStrikeTick
|
|
1103
1103
|
});
|
|
1104
|
-
await
|
|
1104
|
+
await (0, viem_actions.waitForTransactionReceipt)(client, { hash: txHash });
|
|
1105
|
+
await sleep(400);
|
|
1105
1106
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1106
1107
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1107
1108
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|
|
@@ -1113,12 +1114,15 @@ const useMintPerp = (marketAddr) => {
|
|
|
1113
1114
|
//#region src/hooks/perps/useClosePerp.ts
|
|
1114
1115
|
const useClosePerp = () => {
|
|
1115
1116
|
const queryClient = (0, __tanstack_react_query.useQueryClient)();
|
|
1117
|
+
const client = (0, wagmi.useClient)();
|
|
1116
1118
|
const { operator, signMessage: { mutateAsync: signMessage } } = usePerpsOperator();
|
|
1117
1119
|
return (0, __tanstack_react_query.useMutation)({ mutationFn: async (body) => {
|
|
1118
1120
|
if (!operator) throw new Error("Operator not connected");
|
|
1121
|
+
if (!client) throw new Error("No RPC client");
|
|
1119
1122
|
if (!operator.auth) await signMessage();
|
|
1120
|
-
await operator.exercisePerp(body);
|
|
1121
|
-
await
|
|
1123
|
+
const { txHash } = await operator.exercisePerp(body);
|
|
1124
|
+
await (0, viem_actions.waitForTransactionReceipt)(client, { hash: txHash });
|
|
1125
|
+
await sleep(400);
|
|
1122
1126
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1123
1127
|
queryClient.invalidateQueries({ queryKey: ["userOptions"] });
|
|
1124
1128
|
queryClient.invalidateQueries({ queryKey: ["readContract"] });
|