timelock-sdk 0.0.180 → 0.0.182

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
@@ -1156,7 +1156,6 @@ const useMintPerp = (marketAddr) => {
1156
1156
  if (currentTick === void 0) throw new Error("Could not fetch current tick");
1157
1157
  const { data: operators = [] } = await refetchOperators();
1158
1158
  const userPerms = operatorAddr ? operators.find((o) => o.operatorAddr.toLowerCase() === operatorAddr.toLowerCase()) : void 0;
1159
- const hasEnoughPerms = userPerms && userPerms.canMint && userPerms.canExtend && userPerms.canExercise;
1160
1159
  const validStrikeTick = require_optionUtils.getNearestValidStrikeTick(optionType, optionAssetIsToken0, tickSpacing, currentTick, strikeTick);
1161
1160
  const [premium, protocolFee] = await market.read.calculatePremium([
1162
1161
  optionType === "CALL" ? 0 : 1,
@@ -1166,13 +1165,13 @@ const useMintPerp = (marketAddr) => {
1166
1165
  0
1167
1166
  ]);
1168
1167
  const maxPremium = (premium + protocolFee) * 11n / 10n;
1169
- if (!hasEnoughPerms) await setOperatorPerms({
1168
+ if (!(userPerms && userPerms.canMint && userPerms.canExtend && userPerms.canExercise && userPerms.spendingApproval > maxPremium)) await setOperatorPerms({
1170
1169
  operator: operatorAddr,
1171
1170
  canMint: true,
1172
1171
  canExtend: true,
1173
1172
  canExercise: true,
1174
1173
  canTransfer: (userPerms === null || userPerms === void 0 ? void 0 : userPerms.canTransfer) || false,
1175
- spendingApproval: maxPremium
1174
+ spendingApproval: viem.maxUint256
1176
1175
  });
1177
1176
  await askForApproval(payoutAsset, marketAddr, maxPremium);
1178
1177
  await operator.mintPerp({