timelock-sdk 0.0.192 → 0.0.193
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/abis.cjs +2 -2
- package/dist/abis.d.cts +364 -79
- package/dist/abis.d.ts +364 -79
- package/dist/abis.js +2 -2
- package/dist/{client-DiPQ92xm.d.ts → client-BOnQ_PaH.d.ts} +419 -195
- package/dist/{client-i-S2ZmAZ.d.cts → client-djFGt-F6.d.cts} +419 -195
- package/dist/client.cjs +20 -11
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +21 -12
- package/dist/client.js.map +1 -1
- package/dist/{factory-DitVXzjQ.cjs → factory-BieDxxUI.cjs} +435 -103
- package/dist/factory-BieDxxUI.cjs.map +1 -0
- package/dist/{factory-y-iVl_er.js → factory-DvHmRBSB.js} +435 -103
- package/dist/factory-DvHmRBSB.js.map +1 -0
- package/dist/{optionUtils-96oUNrzV.js → optionUtils-Bx5iAwn6.js} +9 -28
- package/dist/optionUtils-Bx5iAwn6.js.map +1 -0
- package/dist/{optionUtils-DsqMIDm1.cjs → optionUtils-Cj8yps5O.cjs} +8 -27
- package/dist/optionUtils-Cj8yps5O.cjs.map +1 -0
- package/dist/{optionsMarket-B_dYiAnm.d.ts → optionsMarket-BVrCBIJQ.d.cts} +135 -2
- package/dist/{optionsMarket-B0Om62Sk.d.cts → optionsMarket-MkvkHTLL.d.ts} +135 -2
- 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/dist/{statelessStateView-Cp4eOQME.js → statelessStateView-DW9FOpWt.js} +159 -2
- package/dist/statelessStateView-DW9FOpWt.js.map +1 -0
- package/dist/{statelessStateView-Dl3QIl1g.cjs → statelessStateView-WNW62g3Q.cjs} +159 -2
- package/dist/statelessStateView-WNW62g3Q.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/factory-DitVXzjQ.cjs.map +0 -1
- package/dist/factory-y-iVl_er.js.map +0 -1
- package/dist/optionUtils-96oUNrzV.js.map +0 -1
- package/dist/optionUtils-DsqMIDm1.cjs.map +0 -1
- package/dist/statelessStateView-Cp4eOQME.js.map +0 -1
- package/dist/statelessStateView-Dl3QIl1g.cjs.map +0 -1
package/dist/client.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
const require_optionUtils = require('./optionUtils-
|
|
4
|
-
const require_statelessStateView = require('./statelessStateView-
|
|
5
|
-
const require_factory = require('./factory-
|
|
3
|
+
const require_optionUtils = require('./optionUtils-Cj8yps5O.cjs');
|
|
4
|
+
const require_statelessStateView = require('./statelessStateView-WNW62g3Q.cjs');
|
|
5
|
+
const require_factory = require('./factory-BieDxxUI.cjs');
|
|
6
6
|
let viem = require("viem");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_optionUtils.__toESM(react);
|
|
@@ -612,7 +612,7 @@ const useMintOption = (marketAddr) => {
|
|
|
612
612
|
const { address } = (0, wagmi.useConnection)();
|
|
613
613
|
const { timelockLens } = useLens();
|
|
614
614
|
const { askForApproval } = useApproval();
|
|
615
|
-
const { writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
615
|
+
const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
616
616
|
const mintOption = async ({ optionType, amount, duration, strikeTick, maxSteps = 100 }) => {
|
|
617
617
|
if (!client || !address) throw new Error("Wallet not connected");
|
|
618
618
|
if (!marketAddr) throw new Error("Market address not available");
|
|
@@ -697,7 +697,7 @@ const useExerciseOption = (marketAddr) => {
|
|
|
697
697
|
const queryClient = (0, __tanstack_react_query.useQueryClient)();
|
|
698
698
|
const client = (0, wagmi.useClient)();
|
|
699
699
|
const { address } = (0, wagmi.useConnection)();
|
|
700
|
-
const { writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
700
|
+
const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
701
701
|
const { sqrtPriceX96 } = useCurrentPrice(poolManager, poolKey);
|
|
702
702
|
const exerciseOption = async ({ option, liquidities }) => {
|
|
703
703
|
if (!client || !address) throw new Error("Wallet not connected");
|
|
@@ -907,7 +907,7 @@ const useExtendOption = (marketAddr) => {
|
|
|
907
907
|
const client = (0, wagmi.useClient)();
|
|
908
908
|
const { address } = (0, wagmi.useConnection)();
|
|
909
909
|
const { askForApproval } = useApproval();
|
|
910
|
-
const { writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
910
|
+
const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
911
911
|
const extendOption = async ({ option, duration }) => {
|
|
912
912
|
if (!client || !address) throw new Error("Wallet not connected");
|
|
913
913
|
if (!marketAddr || !payoutAsset) throw new Error("Market address not available");
|
|
@@ -1113,7 +1113,7 @@ const useSetOperatorPerms = (marketAddr) => {
|
|
|
1113
1113
|
const queryClient = (0, __tanstack_react_query.useQueryClient)();
|
|
1114
1114
|
const client = (0, wagmi.useClient)();
|
|
1115
1115
|
const { address } = (0, wagmi.useConnection)();
|
|
1116
|
-
const { writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
1116
|
+
const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
1117
1117
|
const setOperatorPerms = async ({ operator, canExtend, canExercise, canTransfer, canMint, spendingApproval }) => {
|
|
1118
1118
|
if (!client || !address) throw new Error("Wallet not connected");
|
|
1119
1119
|
if (!marketAddr) throw new Error("Market address not available");
|
|
@@ -1367,7 +1367,10 @@ const useBurnLiquidity = (vaultAddr) => {
|
|
|
1367
1367
|
tickLower,
|
|
1368
1368
|
tickUpper,
|
|
1369
1369
|
liquidity,
|
|
1370
|
-
await timelockLens.read.getRefTick([vaultAddr, tickLower])
|
|
1370
|
+
await timelockLens.read.getRefTick([vaultAddr, tickLower]),
|
|
1371
|
+
viem.minInt256,
|
|
1372
|
+
viem.minInt256,
|
|
1373
|
+
viem.maxUint256
|
|
1371
1374
|
]
|
|
1372
1375
|
});
|
|
1373
1376
|
await (0, viem_actions.waitForTransactionReceipt)(client, { hash: hash$1 });
|
|
@@ -1392,7 +1395,10 @@ const useBurnLiquidity = (vaultAddr) => {
|
|
|
1392
1395
|
p.tickLower,
|
|
1393
1396
|
p.tickUpper,
|
|
1394
1397
|
p.liquidity,
|
|
1395
|
-
refTick
|
|
1398
|
+
refTick,
|
|
1399
|
+
viem.minInt256,
|
|
1400
|
+
viem.minInt256,
|
|
1401
|
+
viem.maxUint256
|
|
1396
1402
|
]
|
|
1397
1403
|
}))]
|
|
1398
1404
|
}) });
|
|
@@ -1456,7 +1462,7 @@ const useMintLiquidity = (vaultAddr) => {
|
|
|
1456
1462
|
const { data: { currentTick } = {} } = useCurrentTick(poolManager, poolKey);
|
|
1457
1463
|
const { token0, token1 } = usePoolData(poolManager, poolKey);
|
|
1458
1464
|
const { askForApproval } = useApproval();
|
|
1459
|
-
const { writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
1465
|
+
const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
|
|
1460
1466
|
const processApproval = async (params) => {
|
|
1461
1467
|
if (currentTick === void 0 || !token0 || !token1 || !vaultAddr) throw new Error("Current tick not available");
|
|
1462
1468
|
const { totalAmount0, totalAmount1 } = batchGetAmountsFromLiquidity(params.map((p) => p.tickLower), params.map((p) => p.tickUpper), params.map((p) => p.liquidity), currentTick);
|
|
@@ -1482,7 +1488,10 @@ const useMintLiquidity = (vaultAddr) => {
|
|
|
1482
1488
|
p.tickLower,
|
|
1483
1489
|
p.tickUpper,
|
|
1484
1490
|
p.liquidity,
|
|
1485
|
-
refTicks[i]
|
|
1491
|
+
refTicks[i],
|
|
1492
|
+
viem.maxInt256,
|
|
1493
|
+
viem.maxInt256,
|
|
1494
|
+
viem.maxUint256
|
|
1486
1495
|
]
|
|
1487
1496
|
}))]
|
|
1488
1497
|
}) });
|