timelock-sdk 0.0.112 → 0.0.113

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
@@ -1080,14 +1080,6 @@ const useMintPerp = (marketAddr) => {
1080
1080
  if (!tickSpacing || currentTick === void 0) throw new Error("Pool data not found");
1081
1081
  if (optionAssetIsToken0 === void 0 || !payoutAsset) throw new Error("Market data not found");
1082
1082
  if (!operator.auth) await signMessage();
1083
- if (!hasEnoughPerms) await setOperatorPerms({
1084
- operator: operatorAddr,
1085
- canMint: true,
1086
- canExtend: true,
1087
- canExercise: true,
1088
- canTransfer: (userPerms === null || userPerms === void 0 ? void 0 : userPerms.canTransfer) || false,
1089
- spendingApproval: viem.maxUint256
1090
- });
1091
1083
  const market = require_optionUtils.getTimelockMarket(marketAddr, client);
1092
1084
  const validStrikeTick = require_optionUtils.getNearestValidStrikeTick(optionType, optionAssetIsToken0, tickSpacing, currentTick, strikeTick);
1093
1085
  const [premium, protocolFee] = await market.read.calculatePremium([
@@ -1097,7 +1089,16 @@ const useMintPerp = (marketAddr) => {
1097
1089
  duration,
1098
1090
  0
1099
1091
  ]);
1100
- await askForApproval(payoutAsset, marketAddr, (premium + protocolFee) * 11n / 10n);
1092
+ const maxPremium = (premium + protocolFee) * 11n / 10n;
1093
+ if (!hasEnoughPerms) await setOperatorPerms({
1094
+ operator: operatorAddr,
1095
+ canMint: true,
1096
+ canExtend: true,
1097
+ canExercise: true,
1098
+ canTransfer: (userPerms === null || userPerms === void 0 ? void 0 : userPerms.canTransfer) || false,
1099
+ spendingApproval: maxPremium
1100
+ });
1101
+ await askForApproval(payoutAsset, marketAddr, maxPremium);
1101
1102
  await operator.mintPerp({
1102
1103
  marketAddr,
1103
1104
  amount,