timelock-sdk 0.0.124 → 0.0.126

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
 
4
- const require_optionUtils = require('./optionUtils-Cv3pCXVh.cjs');
4
+ const require_optionUtils = require('./optionUtils-D1cM5YX1.cjs');
5
5
  const require_optionsMarket = require('./optionsMarket-C8-v8IvX.cjs');
6
6
  const require_singleOwnerVault = require('./singleOwnerVault-gf2zNZVk.cjs');
7
7
  let viem = require("viem");
@@ -1075,11 +1075,7 @@ const useSetOperatorPerms = (marketAddr) => {
1075
1075
  ]
1076
1076
  });
1077
1077
  await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
1078
- queryClient.invalidateQueries({ queryKey: [
1079
- "userOperators",
1080
- address.toLowerCase(),
1081
- marketAddr.toLowerCase()
1082
- ] });
1078
+ queryClient.invalidateQueries({ queryKey: ["userOperators"] });
1083
1079
  queryClient.invalidateQueries({ queryKey: ["readContract"] });
1084
1080
  return hash;
1085
1081
  };
@@ -1203,7 +1199,10 @@ const useOperatorPerms = (marketAddr, userAddr, operatorAddr) => {
1203
1199
  address: marketAddr,
1204
1200
  functionName: "operatorPerms",
1205
1201
  args: [userAddr, operatorAddr],
1206
- query: { enabled: !!userAddr && !!operatorAddr }
1202
+ query: {
1203
+ enabled: !!userAddr && !!operatorAddr,
1204
+ refetchInterval: 5e3
1205
+ }
1207
1206
  });
1208
1207
  const [canExtend, canExercise, canTransfer, canMint, spendingApproval] = data || [];
1209
1208
  const min = (a, b) => a < b ? a : b;
@@ -1230,23 +1229,28 @@ const useOperatorPerms = (marketAddr, userAddr, operatorAddr) => {
1230
1229
 
1231
1230
  //#endregion
1232
1231
  //#region src/hooks/pool/usePriceHistory.ts
1233
- const usePriceHistory = (pool, resolution, startTimestamp, endTimestamp) => {
1232
+ const usePriceHistory = (pool, token, resolution, startTimestamp, endTimestamp) => {
1234
1233
  return (0, __tanstack_react_query.useQuery)({
1235
1234
  queryKey: [
1236
1235
  "priceHistory",
1237
1236
  pool,
1238
1237
  (0, wagmi.useChainId)(),
1238
+ token,
1239
1239
  resolution,
1240
1240
  startTimestamp,
1241
1241
  endTimestamp
1242
1242
  ],
1243
- queryFn: () => require_optionUtils.getPriceHistory(pool, resolution, startTimestamp, endTimestamp),
1243
+ queryFn: () => require_optionUtils.getPriceHistory(pool, token, resolution, startTimestamp, endTimestamp),
1244
1244
  enabled: !!pool && startTimestamp < endTimestamp,
1245
1245
  staleTime: 60 * 1e3,
1246
1246
  gcTime: 300 * 1e3,
1247
1247
  retry: 2
1248
1248
  });
1249
1249
  };
1250
+ const useMarketPriceHistory = (marketAddr, resolution, startTimestamp, endTimestamp) => {
1251
+ const { pool, optionAssetIsToken0 } = useMarketData(marketAddr);
1252
+ return usePriceHistory(pool, optionAssetIsToken0 ? 0 : 1, resolution, startTimestamp, endTimestamp);
1253
+ };
1250
1254
 
1251
1255
  //#endregion
1252
1256
  //#region src/hooks/vault/useVaultData.ts
@@ -1457,6 +1461,7 @@ exports.useExtendOption = useExtendOption;
1457
1461
  exports.useLens = useLens;
1458
1462
  exports.useLiquidityBlocks = useLiquidityBlocks;
1459
1463
  exports.useMarketData = useMarketData;
1464
+ exports.useMarketPriceHistory = useMarketPriceHistory;
1460
1465
  exports.useMaxPositionSize = useMaxPositionSize;
1461
1466
  exports.useMintLiquidity = useMintLiquidity;
1462
1467
  exports.useMintOption = useMintOption;