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-CEeCYAvF.d.ts → client-BaTCKa-Q.d.ts} +293 -292
- package/dist/{client-DYEdFtwG.d.cts → client-zn1D8T6b.d.cts} +139 -138
- package/dist/client.cjs +14 -9
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +14 -10
- package/dist/client.js.map +1 -1
- package/dist/{optionUtils-Cv3pCXVh.cjs → optionUtils-D1cM5YX1.cjs} +3 -3
- package/dist/optionUtils-D1cM5YX1.cjs.map +1 -0
- package/dist/{optionUtils-BuQmVUD4.js → optionUtils-Mlp5ZX6W.js} +3 -3
- package/dist/optionUtils-Mlp5ZX6W.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/dist/package.js +1 -1
- package/package.json +1 -1
- package/dist/optionUtils-BuQmVUD4.js.map +0 -1
- package/dist/optionUtils-Cv3pCXVh.cjs.map +0 -1
package/dist/client.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
const require_optionUtils = require('./optionUtils-
|
|
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: {
|
|
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;
|