timelock-sdk 0.0.90 → 0.0.92

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
@@ -962,7 +962,7 @@ const useMintPerp = (marketAddr) => {
962
962
  const { tickSpacing } = usePoolData(pool);
963
963
  const { exact: currentTick } = useCurrentTick(pool);
964
964
  const userPerms = operatorAddr ? operators.find((o) => o.operatorAddr.toLowerCase() === operatorAddr.toLowerCase()) : void 0;
965
- const hasEnoughPerms = userPerms && userPerms.canMint && userPerms.canExtend;
965
+ const hasEnoughPerms = userPerms && userPerms.canMint && userPerms.canExtend && userPerms.canExercise;
966
966
  const mintPerp = async (data) => {
967
967
  const { optionType, amount, duration, strikeTick } = data;
968
968
  if (!client || !address) throw new Error("Wallet not connected");
@@ -1011,6 +1011,17 @@ const useClosePerp = () => {
1011
1011
  } });
1012
1012
  };
1013
1013
 
1014
+ //#endregion
1015
+ //#region src/hooks/operators/useOperatorPerps.ts
1016
+ const useOperatorPerms = (operatorAddr, userAddr) => {
1017
+ return (0, wagmi.useReadContract)({
1018
+ abi: require_optionsMarket.optionsMarketAbi,
1019
+ functionName: "operatorPerms",
1020
+ args: [userAddr, operatorAddr],
1021
+ query: { enabled: !!userAddr && !!operatorAddr }
1022
+ });
1023
+ };
1024
+
1014
1025
  //#endregion
1015
1026
  //#region src/hooks/pool/usePriceAtTick.ts
1016
1027
  const usePriceAtTick = (tick, poolAddr) => {
@@ -1265,6 +1276,7 @@ exports.useMaxPositionSize = useMaxPositionSize;
1265
1276
  exports.useMintLiquidity = useMintLiquidity;
1266
1277
  exports.useMintOption = useMintOption;
1267
1278
  exports.useMintPerp = useMintPerp;
1279
+ exports.useOperatorPerms = useOperatorPerms;
1268
1280
  exports.useOptionPnl = useOptionPnl;
1269
1281
  exports.useOptionPremium = useOptionPremium;
1270
1282
  exports.useOptionTimeline = useOptionTimeline;