timelock-sdk 0.0.161 → 0.0.162

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
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
 
4
- const require_optionUtils = require('./optionUtils-CaKlLWf2.cjs');
5
- const require_optionsMarket = require('./optionsMarket-DtjLm46g.cjs');
4
+ const require_optionUtils = require('./optionUtils-R9Y-jxoz.cjs');
5
+ const require_optionsMarket = require('./optionsMarket-CtlBxuj0.cjs');
6
6
  const require_singleOwnerVault = require('./singleOwnerVault-GCpQV7pN.cjs');
7
7
  let viem = require("viem");
8
8
  let react = require("react");
@@ -2522,33 +2522,17 @@ const useUpdateMarketFees = (marketAddr) => {
2522
2522
  //#endregion
2523
2523
  //#region src/hooks/pricing/useMarketPricing.ts
2524
2524
  const useMarketPricing = (marketAddr) => {
2525
+ const { timelockLens } = useLens();
2525
2526
  const { data: { optionPricing } } = useMarketState(marketAddr);
2526
2527
  return (0, wagmi.useReadContract)({
2527
- address: optionPricing,
2528
- abi: [{
2529
- inputs: [],
2530
- name: "readState",
2531
- outputs: [{
2532
- name: "",
2533
- type: "bytes"
2534
- }],
2535
- stateMutability: "view",
2536
- type: "function"
2537
- }],
2538
- functionName: "readState",
2528
+ address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
2529
+ abi: require_optionsMarket.lensAbi,
2530
+ functionName: "getPricingParams",
2539
2531
  query: {
2540
2532
  enabled: !!optionPricing,
2541
- select: (rawData) => {
2542
- const [pricingModel] = (0, viem.decodeAbiParameters)([{
2543
- name: "model",
2544
- type: "uint8"
2545
- }], rawData);
2533
+ select: ([pricingModel, rawData]) => {
2546
2534
  if (pricingModel === 0) {
2547
- const [, logicContract, iv, riskFreeRate, minPremiumDailyRate, minPremiumAmount] = (0, viem.decodeAbiParameters)([
2548
- {
2549
- name: "pricingModel",
2550
- type: "uint8"
2551
- },
2535
+ const [logicContract, iv, riskFreeRate, minPremiumDailyRate, minPremiumAmount] = (0, viem.decodeAbiParameters)([
2552
2536
  {
2553
2537
  name: "logicContract",
2554
2538
  type: "address"
@@ -2579,20 +2563,13 @@ const useMarketPricing = (marketAddr) => {
2579
2563
  minPremiumAmount
2580
2564
  };
2581
2565
  } else if (pricingModel === 1) {
2582
- const [, dailyFundingRate, minFundingAmount] = (0, viem.decodeAbiParameters)([
2583
- {
2584
- name: "pricingModel",
2585
- type: "uint8"
2586
- },
2587
- {
2588
- name: "dailyFundingRate",
2589
- type: "uint32"
2590
- },
2591
- {
2592
- name: "minFundingAmount",
2593
- type: "uint128"
2594
- }
2595
- ], rawData);
2566
+ const [dailyFundingRate, minFundingAmount] = (0, viem.decodeAbiParameters)([{
2567
+ name: "dailyFundingRate",
2568
+ type: "uint32"
2569
+ }, {
2570
+ name: "minFundingAmount",
2571
+ type: "uint128"
2572
+ }], rawData);
2596
2573
  return {
2597
2574
  model: "static",
2598
2575
  dailyFundingRate,