timelock-sdk 0.0.107 → 0.0.109

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
@@ -419,6 +419,7 @@ const useExerciseOption = (marketAddr) => {
419
419
  });
420
420
  await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
421
421
  queryClient.invalidateQueries({ queryKey: ["userOptions", address.toLowerCase()] });
422
+ queryClient.invalidateQueries({ queryKey: ["readContract"] });
422
423
  return hash;
423
424
  };
424
425
  return (0, __tanstack_react_query.useMutation)({ mutationFn: exerciseOption });
@@ -551,6 +552,7 @@ const useMintOption = (marketAddr) => {
551
552
  });
552
553
  await (0, viem_actions.waitForTransactionReceipt)(client, { hash });
553
554
  queryClient.invalidateQueries({ queryKey: ["userOptions", address.toLowerCase()] });
555
+ queryClient.invalidateQueries({ queryKey: ["readContract"] });
554
556
  return hash;
555
557
  };
556
558
  return (0, __tanstack_react_query.useMutation)({ mutationFn: mintOption });
@@ -942,7 +944,7 @@ const usePerpsOperator = () => {
942
944
  try {
943
945
  const { address: address$1, validUntil } = await operator.validateAuthMessage(message, signature);
944
946
  if (validUntil < Date.now()) throw new Error("Signature expired");
945
- if (address$1 !== userAddr) throw new Error("Valid signature but different user address");
947
+ if (address$1.toLowerCase() !== userAddr.toLowerCase()) throw new Error("Valid signature but different user address");
946
948
  operator.setAuth(message, signature);
947
949
  } catch (error) {
948
950
  clearSignature(userAddr);
@@ -1082,6 +1084,7 @@ const useMintPerp = (marketAddr) => {
1082
1084
  strikeTick: validStrikeTick
1083
1085
  });
1084
1086
  queryClient.invalidateQueries({ queryKey: ["userOptions", address.toLowerCase()] });
1087
+ queryClient.invalidateQueries({ queryKey: ["readContract"] });
1085
1088
  };
1086
1089
  return (0, __tanstack_react_query.useMutation)({ mutationFn: mintPerp });
1087
1090
  };
@@ -1089,11 +1092,15 @@ const useMintPerp = (marketAddr) => {
1089
1092
  //#endregion
1090
1093
  //#region src/hooks/perps/useClosePerp.ts
1091
1094
  const useClosePerp = () => {
1095
+ const queryClient = (0, __tanstack_react_query.useQueryClient)();
1096
+ const { address } = (0, wagmi.useAccount)();
1092
1097
  const { operator, signMessage: { mutateAsync: signMessage } } = usePerpsOperator();
1093
1098
  return (0, __tanstack_react_query.useMutation)({ mutationFn: async (body) => {
1094
1099
  if (!operator) throw new Error("Operator not connected");
1095
1100
  if (!operator.auth) await signMessage();
1096
- return await operator.exercisePerp(body);
1101
+ await operator.exercisePerp(body);
1102
+ queryClient.invalidateQueries({ queryKey: ["userOptions", address === null || address === void 0 ? void 0 : address.toLowerCase()] });
1103
+ queryClient.invalidateQueries({ queryKey: ["readContract"] });
1097
1104
  } });
1098
1105
  };
1099
1106