timelock-sdk 0.0.115 → 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.
@@ -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-BOmeI-gW.d.ts.map
62865
+ //# sourceMappingURL=client-CxAAahmW.d.ts.map
package/dist/client.cjs CHANGED
@@ -1094,13 +1094,14 @@ 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 (0, viem_actions.waitForTransactionReceipt)(client, { hash: txHash });
1104
1105
  await sleep(400);
1105
1106
  queryClient.invalidateQueries({ queryKey: ["userOptions"] });
1106
1107
  queryClient.invalidateQueries({ queryKey: ["userOptions"] });
@@ -1113,11 +1114,14 @@ 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);
1123
+ const { txHash } = await operator.exercisePerp(body);
1124
+ await (0, viem_actions.waitForTransactionReceipt)(client, { hash: txHash });
1121
1125
  await sleep(400);
1122
1126
  queryClient.invalidateQueries({ queryKey: ["userOptions"] });
1123
1127
  queryClient.invalidateQueries({ queryKey: ["userOptions"] });