timelock-sdk 0.0.191 → 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.
Files changed (37) hide show
  1. package/dist/abis.cjs +2 -2
  2. package/dist/abis.d.cts +364 -79
  3. package/dist/abis.d.ts +364 -79
  4. package/dist/abis.js +2 -2
  5. package/dist/{client-CEtNglT8.d.cts → client-BOnQ_PaH.d.ts} +378 -150
  6. package/dist/{client-9wbQVrDG.d.ts → client-djFGt-F6.d.cts} +378 -150
  7. package/dist/client.cjs +26 -13
  8. package/dist/client.cjs.map +1 -1
  9. package/dist/client.d.cts +1 -1
  10. package/dist/client.d.ts +1 -1
  11. package/dist/client.js +27 -14
  12. package/dist/client.js.map +1 -1
  13. package/dist/{factory-DitVXzjQ.cjs → factory-BieDxxUI.cjs} +435 -103
  14. package/dist/factory-BieDxxUI.cjs.map +1 -0
  15. package/dist/{factory-y-iVl_er.js → factory-DvHmRBSB.js} +435 -103
  16. package/dist/factory-DvHmRBSB.js.map +1 -0
  17. package/dist/{optionUtils-96oUNrzV.js → optionUtils-Bx5iAwn6.js} +9 -28
  18. package/dist/optionUtils-Bx5iAwn6.js.map +1 -0
  19. package/dist/{optionUtils-DsqMIDm1.cjs → optionUtils-Cj8yps5O.cjs} +8 -27
  20. package/dist/optionUtils-Cj8yps5O.cjs.map +1 -0
  21. package/dist/{optionsMarket-B_dYiAnm.d.ts → optionsMarket-BVrCBIJQ.d.cts} +135 -2
  22. package/dist/{optionsMarket-B0Om62Sk.d.cts → optionsMarket-MkvkHTLL.d.ts} +135 -2
  23. package/dist/package.cjs +1 -1
  24. package/dist/package.d.cts +1 -1
  25. package/dist/package.d.ts +1 -1
  26. package/dist/package.js +1 -1
  27. package/dist/{statelessStateView-Cp4eOQME.js → statelessStateView-DW9FOpWt.js} +159 -2
  28. package/dist/statelessStateView-DW9FOpWt.js.map +1 -0
  29. package/dist/{statelessStateView-Dl3QIl1g.cjs → statelessStateView-WNW62g3Q.cjs} +159 -2
  30. package/dist/statelessStateView-WNW62g3Q.cjs.map +1 -0
  31. package/package.json +1 -1
  32. package/dist/factory-DitVXzjQ.cjs.map +0 -1
  33. package/dist/factory-y-iVl_er.js.map +0 -1
  34. package/dist/optionUtils-96oUNrzV.js.map +0 -1
  35. package/dist/optionUtils-DsqMIDm1.cjs.map +0 -1
  36. package/dist/statelessStateView-Cp4eOQME.js.map +0 -1
  37. 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-DsqMIDm1.cjs');
4
- const require_statelessStateView = require('./statelessStateView-Dl3QIl1g.cjs');
5
- const require_factory = require('./factory-DitVXzjQ.cjs');
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);
@@ -126,7 +126,9 @@ const GetMarketVolumeDocument = graphql_tag.default`
126
126
  address
127
127
  optionsCount
128
128
  tradersCount
129
- volume
129
+ totalVolume
130
+ totalPremium
131
+ totalProfit
130
132
  }
131
133
  }
132
134
  `;
@@ -493,7 +495,9 @@ const useMarketVolume = (marketAddr) => {
493
495
  return {
494
496
  ...result.TimelockMarket[0],
495
497
  address: result.TimelockMarket[0].address,
496
- volume: BigInt(result.TimelockMarket[0].volume),
498
+ totalVolume: BigInt(result.TimelockMarket[0].totalVolume),
499
+ totalPremium: BigInt(result.TimelockMarket[0].totalPremium),
500
+ totalProfit: BigInt(result.TimelockMarket[0].totalProfit),
497
501
  optionsCount: BigInt(result.TimelockMarket[0].optionsCount),
498
502
  tradersCount: BigInt(result.TimelockMarket[0].tradersCount)
499
503
  };
@@ -608,7 +612,7 @@ const useMintOption = (marketAddr) => {
608
612
  const { address } = (0, wagmi.useConnection)();
609
613
  const { timelockLens } = useLens();
610
614
  const { askForApproval } = useApproval();
611
- const { writeContractAsync } = (0, wagmi.useWriteContract)();
615
+ const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
612
616
  const mintOption = async ({ optionType, amount, duration, strikeTick, maxSteps = 100 }) => {
613
617
  if (!client || !address) throw new Error("Wallet not connected");
614
618
  if (!marketAddr) throw new Error("Market address not available");
@@ -693,7 +697,7 @@ const useExerciseOption = (marketAddr) => {
693
697
  const queryClient = (0, __tanstack_react_query.useQueryClient)();
694
698
  const client = (0, wagmi.useClient)();
695
699
  const { address } = (0, wagmi.useConnection)();
696
- const { writeContractAsync } = (0, wagmi.useWriteContract)();
700
+ const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
697
701
  const { sqrtPriceX96 } = useCurrentPrice(poolManager, poolKey);
698
702
  const exerciseOption = async ({ option, liquidities }) => {
699
703
  if (!client || !address) throw new Error("Wallet not connected");
@@ -903,7 +907,7 @@ const useExtendOption = (marketAddr) => {
903
907
  const client = (0, wagmi.useClient)();
904
908
  const { address } = (0, wagmi.useConnection)();
905
909
  const { askForApproval } = useApproval();
906
- const { writeContractAsync } = (0, wagmi.useWriteContract)();
910
+ const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
907
911
  const extendOption = async ({ option, duration }) => {
908
912
  if (!client || !address) throw new Error("Wallet not connected");
909
913
  if (!marketAddr || !payoutAsset) throw new Error("Market address not available");
@@ -1109,7 +1113,7 @@ const useSetOperatorPerms = (marketAddr) => {
1109
1113
  const queryClient = (0, __tanstack_react_query.useQueryClient)();
1110
1114
  const client = (0, wagmi.useClient)();
1111
1115
  const { address } = (0, wagmi.useConnection)();
1112
- const { writeContractAsync } = (0, wagmi.useWriteContract)();
1116
+ const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
1113
1117
  const setOperatorPerms = async ({ operator, canExtend, canExercise, canTransfer, canMint, spendingApproval }) => {
1114
1118
  if (!client || !address) throw new Error("Wallet not connected");
1115
1119
  if (!marketAddr) throw new Error("Market address not available");
@@ -1363,7 +1367,10 @@ const useBurnLiquidity = (vaultAddr) => {
1363
1367
  tickLower,
1364
1368
  tickUpper,
1365
1369
  liquidity,
1366
- await timelockLens.read.getRefTick([vaultAddr, tickLower])
1370
+ await timelockLens.read.getRefTick([vaultAddr, tickLower]),
1371
+ viem.minInt256,
1372
+ viem.minInt256,
1373
+ viem.maxUint256
1367
1374
  ]
1368
1375
  });
1369
1376
  await (0, viem_actions.waitForTransactionReceipt)(client, { hash: hash$1 });
@@ -1388,7 +1395,10 @@ const useBurnLiquidity = (vaultAddr) => {
1388
1395
  p.tickLower,
1389
1396
  p.tickUpper,
1390
1397
  p.liquidity,
1391
- refTick
1398
+ refTick,
1399
+ viem.minInt256,
1400
+ viem.minInt256,
1401
+ viem.maxUint256
1392
1402
  ]
1393
1403
  }))]
1394
1404
  }) });
@@ -1452,7 +1462,7 @@ const useMintLiquidity = (vaultAddr) => {
1452
1462
  const { data: { currentTick } = {} } = useCurrentTick(poolManager, poolKey);
1453
1463
  const { token0, token1 } = usePoolData(poolManager, poolKey);
1454
1464
  const { askForApproval } = useApproval();
1455
- const { writeContractAsync } = (0, wagmi.useWriteContract)();
1465
+ const { mutateAsync: writeContractAsync } = (0, wagmi.useWriteContract)();
1456
1466
  const processApproval = async (params) => {
1457
1467
  if (currentTick === void 0 || !token0 || !token1 || !vaultAddr) throw new Error("Current tick not available");
1458
1468
  const { totalAmount0, totalAmount1 } = batchGetAmountsFromLiquidity(params.map((p) => p.tickLower), params.map((p) => p.tickUpper), params.map((p) => p.liquidity), currentTick);
@@ -1478,7 +1488,10 @@ const useMintLiquidity = (vaultAddr) => {
1478
1488
  p.tickLower,
1479
1489
  p.tickUpper,
1480
1490
  p.liquidity,
1481
- refTicks[i]
1491
+ refTicks[i],
1492
+ viem.maxInt256,
1493
+ viem.maxInt256,
1494
+ viem.maxUint256
1482
1495
  ]
1483
1496
  }))]
1484
1497
  }) });