timelock-sdk 0.0.161 → 0.0.163

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 (42) hide show
  1. package/dist/abis.cjs +1059 -308
  2. package/dist/abis.cjs.map +1 -1
  3. package/dist/abis.d.cts +2967 -766
  4. package/dist/abis.d.ts +2967 -766
  5. package/dist/abis.js +1051 -303
  6. package/dist/abis.js.map +1 -1
  7. package/dist/{client-BKIKRCjR.d.ts → client-CoeY1yLm.d.cts} +4846 -1212
  8. package/dist/{client-CZoaAxx7.d.cts → client-DqVrd4kQ.d.ts} +4504 -870
  9. package/dist/client.cjs +54 -926
  10. package/dist/client.cjs.map +1 -1
  11. package/dist/client.d.cts +2 -2
  12. package/dist/client.d.ts +2 -2
  13. package/dist/client.js +20 -892
  14. package/dist/client.js.map +1 -1
  15. package/dist/factory-DitVXzjQ.cjs +1715 -0
  16. package/dist/factory-DitVXzjQ.cjs.map +1 -0
  17. package/dist/factory-y-iVl_er.js +1697 -0
  18. package/dist/factory-y-iVl_er.js.map +1 -0
  19. package/dist/{optionUtils-CaKlLWf2.cjs → optionUtils-Cuuw6jXD.cjs} +7 -1049
  20. package/dist/optionUtils-Cuuw6jXD.cjs.map +1 -0
  21. package/dist/optionUtils-OyY8qOu0.js +381 -0
  22. package/dist/optionUtils-OyY8qOu0.js.map +1 -0
  23. package/dist/{uniswapMathLens-Ds8UmCMU.d.ts → optionsMarket-2HZ-p_dl.d.ts} +20 -625
  24. package/dist/{uniswapMathLens-BoQxBJoY.d.cts → optionsMarket-c4hgszY_.d.cts} +20 -625
  25. package/dist/package.cjs +2 -2
  26. package/dist/package.d.cts +3 -3
  27. package/dist/package.d.ts +3 -3
  28. package/dist/package.js +2 -2
  29. package/dist/{optionsMarket-BbXpQnpV.js → statelessStateView-CBkcP7CK.js} +1612 -1316
  30. package/dist/statelessStateView-CBkcP7CK.js.map +1 -0
  31. package/dist/{optionsMarket-DtjLm46g.cjs → statelessStateView-XdTJQxsY.cjs} +1613 -1317
  32. package/dist/statelessStateView-XdTJQxsY.cjs.map +1 -0
  33. package/package.json +1 -1
  34. package/dist/optionUtils-CaKlLWf2.cjs.map +0 -1
  35. package/dist/optionUtils-Ci6C7FPN.js +0 -1417
  36. package/dist/optionUtils-Ci6C7FPN.js.map +0 -1
  37. package/dist/optionsMarket-BbXpQnpV.js.map +0 -1
  38. package/dist/optionsMarket-DtjLm46g.cjs.map +0 -1
  39. package/dist/singleOwnerVault-BJyEs_D_.js +0 -847
  40. package/dist/singleOwnerVault-BJyEs_D_.js.map +0 -1
  41. package/dist/singleOwnerVault-GCpQV7pN.cjs +0 -853
  42. package/dist/singleOwnerVault-GCpQV7pN.cjs.map +0 -1
package/dist/client.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
3
 
4
- import { i as erc20Abi$1, r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-BbXpQnpV.js";
5
- import { A as token1ToToken0, B as swappers, D as roundTick, F as getStateView, I as getTimelockLens, L as getTimelockMarket, N as getPriceHistory, O as token0ToToken1, P as getErc20, U as statelessStateViewAbi, V as timelockFactories, b as getPriceAtSqrtPriceX96, f as wrapAmount, j as token1ToToken0AtTick, k as token0ToToken1AtTick, m as wrapPrice, r as EMPTY_ARRAY, t as getPayoutAtPrice, v as getAmountsFromLiquidity, x as getPriceAtTick, y as getNearestValidStrikeTick } from "./optionUtils-Ci6C7FPN.js";
6
- import { t as singleOwnerVaultAbi } from "./singleOwnerVault-BJyEs_D_.js";
4
+ import { i as erc20Abi$1, n as optionsMarketAbi, r as lensAbi, t as statelessStateViewAbi } from "./statelessStateView-CBkcP7CK.js";
5
+ import { A as token1ToToken0, B as swappers, D as roundTick, F as getStateView, I as getTimelockLens, L as getTimelockMarket, N as getPriceHistory, O as token0ToToken1, P as getErc20, V as timelockFactories, b as getPriceAtSqrtPriceX96, f as wrapAmount, j as token1ToToken0AtTick, k as token0ToToken1AtTick, m as wrapPrice, r as EMPTY_ARRAY, t as getPayoutAtPrice, v as getAmountsFromLiquidity, x as getPriceAtTick, y as getNearestValidStrikeTick } from "./optionUtils-OyY8qOu0.js";
6
+ import { n as guardianAbi, r as singleOwnerVaultAbi, t as factoryAbi } from "./factory-y-iVl_er.js";
7
7
  import { decodeAbiParameters, decodeEventLog, encodeAbiParameters, encodeFunctionData, erc20Abi, maxUint256, zeroAddress } from "viem";
8
8
  import React, { createContext, useContext, useEffect, useMemo } from "react";
9
9
  import { GraphQLClient, RequestOptions } from "graphql-request";
@@ -1101,9 +1101,9 @@ const useMintPerp = (marketAddr) => {
1101
1101
  const { address } = useConnection();
1102
1102
  const { operator, address: operatorAddr, signMessage: { mutateAsync: signMessage } } = usePerpsOperator();
1103
1103
  const { askForApproval } = useApproval();
1104
- const { pool, optionAssetIsToken0, payoutAsset } = useMarketData(marketAddr);
1105
- const { tickSpacing } = usePoolData(pool);
1106
- const { refetch: refetchCurrentTick } = useCurrentTick(pool);
1104
+ const { poolManager, poolKey, optionAssetIsToken0, payoutAsset } = useMarketData(marketAddr);
1105
+ const { tickSpacing } = usePoolData(poolManager, poolKey);
1106
+ const { refetch: refetchCurrentTick } = useCurrentTick(poolManager, poolKey);
1107
1107
  const mintPerp = async (data) => {
1108
1108
  const { optionType, amount, duration, strikeTick } = data;
1109
1109
  if (!client || !address) throw new Error("Wallet not connected");
@@ -1550,602 +1550,6 @@ const useGuardianGlobalState = (guardianAddr) => {
1550
1550
  };
1551
1551
  };
1552
1552
 
1553
- //#endregion
1554
- //#region src/abis/guardian.ts
1555
- const guardianAbi = [
1556
- {
1557
- type: "constructor",
1558
- inputs: [],
1559
- stateMutability: "nonpayable"
1560
- },
1561
- {
1562
- type: "function",
1563
- name: "DEFAULT_ADMIN_ROLE",
1564
- inputs: [],
1565
- outputs: [{
1566
- name: "",
1567
- type: "bytes32",
1568
- internalType: "bytes32"
1569
- }],
1570
- stateMutability: "view"
1571
- },
1572
- {
1573
- type: "function",
1574
- name: "MIN_WITHDRAW_INTERVAL",
1575
- inputs: [],
1576
- outputs: [{
1577
- name: "",
1578
- type: "uint256",
1579
- internalType: "uint256"
1580
- }],
1581
- stateMutability: "view"
1582
- },
1583
- {
1584
- type: "function",
1585
- name: "PAUSER_ROLE",
1586
- inputs: [],
1587
- outputs: [{
1588
- name: "",
1589
- type: "bytes32",
1590
- internalType: "bytes32"
1591
- }],
1592
- stateMutability: "view"
1593
- },
1594
- {
1595
- type: "function",
1596
- name: "allowBurn",
1597
- inputs: [{
1598
- name: "vault",
1599
- type: "address",
1600
- internalType: "address"
1601
- }],
1602
- outputs: [{
1603
- name: "",
1604
- type: "bool",
1605
- internalType: "bool"
1606
- }],
1607
- stateMutability: "view"
1608
- },
1609
- {
1610
- type: "function",
1611
- name: "allowEmergencyMarketWithdraw",
1612
- inputs: [{
1613
- name: "market",
1614
- type: "address",
1615
- internalType: "address"
1616
- }],
1617
- outputs: [{
1618
- name: "",
1619
- type: "bool",
1620
- internalType: "bool"
1621
- }],
1622
- stateMutability: "view"
1623
- },
1624
- {
1625
- type: "function",
1626
- name: "allowEmergencyVaultWithdraw",
1627
- inputs: [{
1628
- name: "vault",
1629
- type: "address",
1630
- internalType: "address"
1631
- }],
1632
- outputs: [{
1633
- name: "",
1634
- type: "bool",
1635
- internalType: "bool"
1636
- }],
1637
- stateMutability: "view"
1638
- },
1639
- {
1640
- type: "function",
1641
- name: "allowMint",
1642
- inputs: [{
1643
- name: "vault",
1644
- type: "address",
1645
- internalType: "address"
1646
- }],
1647
- outputs: [{
1648
- name: "",
1649
- type: "bool",
1650
- internalType: "bool"
1651
- }],
1652
- stateMutability: "view"
1653
- },
1654
- {
1655
- type: "function",
1656
- name: "allowTrade",
1657
- inputs: [
1658
- {
1659
- name: "market",
1660
- type: "address",
1661
- internalType: "address"
1662
- },
1663
- {
1664
- name: "owner",
1665
- type: "address",
1666
- internalType: "address"
1667
- },
1668
- {
1669
- name: "sender",
1670
- type: "address",
1671
- internalType: "address"
1672
- }
1673
- ],
1674
- outputs: [{
1675
- name: "",
1676
- type: "bool",
1677
- internalType: "bool"
1678
- }],
1679
- stateMutability: "view"
1680
- },
1681
- {
1682
- type: "function",
1683
- name: "getRoleAdmin",
1684
- inputs: [{
1685
- name: "role",
1686
- type: "bytes32",
1687
- internalType: "bytes32"
1688
- }],
1689
- outputs: [{
1690
- name: "",
1691
- type: "bytes32",
1692
- internalType: "bytes32"
1693
- }],
1694
- stateMutability: "view"
1695
- },
1696
- {
1697
- type: "function",
1698
- name: "globalBurnPaused",
1699
- inputs: [],
1700
- outputs: [{
1701
- name: "paused",
1702
- type: "bool",
1703
- internalType: "bool"
1704
- }, {
1705
- name: "updatedAt",
1706
- type: "uint64",
1707
- internalType: "uint64"
1708
- }],
1709
- stateMutability: "view"
1710
- },
1711
- {
1712
- type: "function",
1713
- name: "globalMintPaused",
1714
- inputs: [],
1715
- outputs: [{
1716
- name: "paused",
1717
- type: "bool",
1718
- internalType: "bool"
1719
- }, {
1720
- name: "updatedAt",
1721
- type: "uint64",
1722
- internalType: "uint64"
1723
- }],
1724
- stateMutability: "view"
1725
- },
1726
- {
1727
- type: "function",
1728
- name: "globalTradingPaused",
1729
- inputs: [],
1730
- outputs: [{
1731
- name: "paused",
1732
- type: "bool",
1733
- internalType: "bool"
1734
- }, {
1735
- name: "updatedAt",
1736
- type: "uint64",
1737
- internalType: "uint64"
1738
- }],
1739
- stateMutability: "view"
1740
- },
1741
- {
1742
- type: "function",
1743
- name: "grantRole",
1744
- inputs: [{
1745
- name: "role",
1746
- type: "bytes32",
1747
- internalType: "bytes32"
1748
- }, {
1749
- name: "account",
1750
- type: "address",
1751
- internalType: "address"
1752
- }],
1753
- outputs: [],
1754
- stateMutability: "nonpayable"
1755
- },
1756
- {
1757
- type: "function",
1758
- name: "hasRole",
1759
- inputs: [{
1760
- name: "role",
1761
- type: "bytes32",
1762
- internalType: "bytes32"
1763
- }, {
1764
- name: "account",
1765
- type: "address",
1766
- internalType: "address"
1767
- }],
1768
- outputs: [{
1769
- name: "",
1770
- type: "bool",
1771
- internalType: "bool"
1772
- }],
1773
- stateMutability: "view"
1774
- },
1775
- {
1776
- type: "function",
1777
- name: "marketTradingPaused",
1778
- inputs: [{
1779
- name: "",
1780
- type: "address",
1781
- internalType: "address"
1782
- }],
1783
- outputs: [{
1784
- name: "paused",
1785
- type: "bool",
1786
- internalType: "bool"
1787
- }, {
1788
- name: "updatedAt",
1789
- type: "uint64",
1790
- internalType: "uint64"
1791
- }],
1792
- stateMutability: "view"
1793
- },
1794
- {
1795
- type: "function",
1796
- name: "operatorsPaused",
1797
- inputs: [{
1798
- name: "",
1799
- type: "address",
1800
- internalType: "address"
1801
- }],
1802
- outputs: [{
1803
- name: "paused",
1804
- type: "bool",
1805
- internalType: "bool"
1806
- }, {
1807
- name: "updatedAt",
1808
- type: "uint64",
1809
- internalType: "uint64"
1810
- }],
1811
- stateMutability: "view"
1812
- },
1813
- {
1814
- type: "function",
1815
- name: "pauseGlobal",
1816
- inputs: [
1817
- {
1818
- name: "mintPaused",
1819
- type: "bool",
1820
- internalType: "bool"
1821
- },
1822
- {
1823
- name: "burnPaused",
1824
- type: "bool",
1825
- internalType: "bool"
1826
- },
1827
- {
1828
- name: "TradingPaused",
1829
- type: "bool",
1830
- internalType: "bool"
1831
- }
1832
- ],
1833
- outputs: [],
1834
- stateMutability: "nonpayable"
1835
- },
1836
- {
1837
- type: "function",
1838
- name: "pauseMarket",
1839
- inputs: [{
1840
- name: "market",
1841
- type: "address",
1842
- internalType: "address"
1843
- }, {
1844
- name: "TradingPaused",
1845
- type: "bool",
1846
- internalType: "bool"
1847
- }],
1848
- outputs: [],
1849
- stateMutability: "nonpayable"
1850
- },
1851
- {
1852
- type: "function",
1853
- name: "pauseOperator",
1854
- inputs: [{
1855
- name: "operator",
1856
- type: "address",
1857
- internalType: "address"
1858
- }, {
1859
- name: "paused",
1860
- type: "bool",
1861
- internalType: "bool"
1862
- }],
1863
- outputs: [],
1864
- stateMutability: "nonpayable"
1865
- },
1866
- {
1867
- type: "function",
1868
- name: "pauseVault",
1869
- inputs: [
1870
- {
1871
- name: "vault",
1872
- type: "address",
1873
- internalType: "address"
1874
- },
1875
- {
1876
- name: "mintPaused",
1877
- type: "bool",
1878
- internalType: "bool"
1879
- },
1880
- {
1881
- name: "burnPaused",
1882
- type: "bool",
1883
- internalType: "bool"
1884
- }
1885
- ],
1886
- outputs: [],
1887
- stateMutability: "nonpayable"
1888
- },
1889
- {
1890
- type: "function",
1891
- name: "renounceRole",
1892
- inputs: [{
1893
- name: "role",
1894
- type: "bytes32",
1895
- internalType: "bytes32"
1896
- }, {
1897
- name: "callerConfirmation",
1898
- type: "address",
1899
- internalType: "address"
1900
- }],
1901
- outputs: [],
1902
- stateMutability: "nonpayable"
1903
- },
1904
- {
1905
- type: "function",
1906
- name: "revokeRole",
1907
- inputs: [{
1908
- name: "role",
1909
- type: "bytes32",
1910
- internalType: "bytes32"
1911
- }, {
1912
- name: "account",
1913
- type: "address",
1914
- internalType: "address"
1915
- }],
1916
- outputs: [],
1917
- stateMutability: "nonpayable"
1918
- },
1919
- {
1920
- type: "function",
1921
- name: "supportsInterface",
1922
- inputs: [{
1923
- name: "interfaceId",
1924
- type: "bytes4",
1925
- internalType: "bytes4"
1926
- }],
1927
- outputs: [{
1928
- name: "",
1929
- type: "bool",
1930
- internalType: "bool"
1931
- }],
1932
- stateMutability: "view"
1933
- },
1934
- {
1935
- type: "function",
1936
- name: "vaultBurnPaused",
1937
- inputs: [{
1938
- name: "",
1939
- type: "address",
1940
- internalType: "address"
1941
- }],
1942
- outputs: [{
1943
- name: "paused",
1944
- type: "bool",
1945
- internalType: "bool"
1946
- }, {
1947
- name: "updatedAt",
1948
- type: "uint64",
1949
- internalType: "uint64"
1950
- }],
1951
- stateMutability: "view"
1952
- },
1953
- {
1954
- type: "function",
1955
- name: "vaultMintPaused",
1956
- inputs: [{
1957
- name: "",
1958
- type: "address",
1959
- internalType: "address"
1960
- }],
1961
- outputs: [{
1962
- name: "paused",
1963
- type: "bool",
1964
- internalType: "bool"
1965
- }, {
1966
- name: "updatedAt",
1967
- type: "uint64",
1968
- internalType: "uint64"
1969
- }],
1970
- stateMutability: "view"
1971
- },
1972
- {
1973
- type: "event",
1974
- name: "PauseGlobal",
1975
- inputs: [
1976
- {
1977
- name: "mintPaused",
1978
- type: "bool",
1979
- indexed: false,
1980
- internalType: "bool"
1981
- },
1982
- {
1983
- name: "burnPaused",
1984
- type: "bool",
1985
- indexed: false,
1986
- internalType: "bool"
1987
- },
1988
- {
1989
- name: "TradingPaused",
1990
- type: "bool",
1991
- indexed: false,
1992
- internalType: "bool"
1993
- }
1994
- ],
1995
- anonymous: false
1996
- },
1997
- {
1998
- type: "event",
1999
- name: "PauseMarket",
2000
- inputs: [{
2001
- name: "market",
2002
- type: "address",
2003
- indexed: true,
2004
- internalType: "address"
2005
- }, {
2006
- name: "paused",
2007
- type: "bool",
2008
- indexed: false,
2009
- internalType: "bool"
2010
- }],
2011
- anonymous: false
2012
- },
2013
- {
2014
- type: "event",
2015
- name: "PauseOperator",
2016
- inputs: [{
2017
- name: "operator",
2018
- type: "address",
2019
- indexed: true,
2020
- internalType: "address"
2021
- }, {
2022
- name: "paused",
2023
- type: "bool",
2024
- indexed: false,
2025
- internalType: "bool"
2026
- }],
2027
- anonymous: false
2028
- },
2029
- {
2030
- type: "event",
2031
- name: "PauseVault",
2032
- inputs: [
2033
- {
2034
- name: "vault",
2035
- type: "address",
2036
- indexed: true,
2037
- internalType: "address"
2038
- },
2039
- {
2040
- name: "mintPaused",
2041
- type: "bool",
2042
- indexed: false,
2043
- internalType: "bool"
2044
- },
2045
- {
2046
- name: "burnPaused",
2047
- type: "bool",
2048
- indexed: false,
2049
- internalType: "bool"
2050
- }
2051
- ],
2052
- anonymous: false
2053
- },
2054
- {
2055
- type: "event",
2056
- name: "RoleAdminChanged",
2057
- inputs: [
2058
- {
2059
- name: "role",
2060
- type: "bytes32",
2061
- indexed: true,
2062
- internalType: "bytes32"
2063
- },
2064
- {
2065
- name: "previousAdminRole",
2066
- type: "bytes32",
2067
- indexed: true,
2068
- internalType: "bytes32"
2069
- },
2070
- {
2071
- name: "newAdminRole",
2072
- type: "bytes32",
2073
- indexed: true,
2074
- internalType: "bytes32"
2075
- }
2076
- ],
2077
- anonymous: false
2078
- },
2079
- {
2080
- type: "event",
2081
- name: "RoleGranted",
2082
- inputs: [
2083
- {
2084
- name: "role",
2085
- type: "bytes32",
2086
- indexed: true,
2087
- internalType: "bytes32"
2088
- },
2089
- {
2090
- name: "account",
2091
- type: "address",
2092
- indexed: true,
2093
- internalType: "address"
2094
- },
2095
- {
2096
- name: "sender",
2097
- type: "address",
2098
- indexed: true,
2099
- internalType: "address"
2100
- }
2101
- ],
2102
- anonymous: false
2103
- },
2104
- {
2105
- type: "event",
2106
- name: "RoleRevoked",
2107
- inputs: [
2108
- {
2109
- name: "role",
2110
- type: "bytes32",
2111
- indexed: true,
2112
- internalType: "bytes32"
2113
- },
2114
- {
2115
- name: "account",
2116
- type: "address",
2117
- indexed: true,
2118
- internalType: "address"
2119
- },
2120
- {
2121
- name: "sender",
2122
- type: "address",
2123
- indexed: true,
2124
- internalType: "address"
2125
- }
2126
- ],
2127
- anonymous: false
2128
- },
2129
- {
2130
- type: "error",
2131
- name: "AccessControlBadConfirmation",
2132
- inputs: []
2133
- },
2134
- {
2135
- type: "error",
2136
- name: "AccessControlUnauthorizedAccount",
2137
- inputs: [{
2138
- name: "account",
2139
- type: "address",
2140
- internalType: "address"
2141
- }, {
2142
- name: "neededRole",
2143
- type: "bytes32",
2144
- internalType: "bytes32"
2145
- }]
2146
- }
2147
- ];
2148
-
2149
1553
  //#endregion
2150
1554
  //#region src/hooks/guardian/usePauseGlobalTrading.ts
2151
1555
  const usePauseGlobalTrading = ({ marketAddr }) => {
@@ -2212,260 +1616,6 @@ const useFeeRates = (feeStrategy) => {
2212
1616
  return data || {};
2213
1617
  };
2214
1618
 
2215
- //#endregion
2216
- //#region src/abis/factory.ts
2217
- const factoryAbi = [
2218
- {
2219
- type: "function",
2220
- name: "deployFeeStrategy",
2221
- inputs: [
2222
- {
2223
- name: "_openingFeeRate",
2224
- type: "uint32",
2225
- internalType: "uint32"
2226
- },
2227
- {
2228
- name: "_baseFeeRate",
2229
- type: "uint32",
2230
- internalType: "uint32"
2231
- },
2232
- {
2233
- name: "_minOpeningFee",
2234
- type: "uint128",
2235
- internalType: "uint128"
2236
- },
2237
- {
2238
- name: "_minBaseFee",
2239
- type: "uint128",
2240
- internalType: "uint128"
2241
- },
2242
- {
2243
- name: "_feeRecipient",
2244
- type: "address",
2245
- internalType: "address"
2246
- }
2247
- ],
2248
- outputs: [{
2249
- name: "",
2250
- type: "address",
2251
- internalType: "contract FeeStrategy"
2252
- }],
2253
- stateMutability: "nonpayable"
2254
- },
2255
- {
2256
- type: "function",
2257
- name: "deployOptionPricing",
2258
- inputs: [
2259
- {
2260
- name: "_logicContract",
2261
- type: "address",
2262
- internalType: "contract StatelessOptionPricing"
2263
- },
2264
- {
2265
- name: "_iv",
2266
- type: "uint32",
2267
- internalType: "uint32"
2268
- },
2269
- {
2270
- name: "_riskFreeRate",
2271
- type: "uint32",
2272
- internalType: "uint32"
2273
- },
2274
- {
2275
- name: "_minPremiumDailyRate",
2276
- type: "uint32",
2277
- internalType: "uint32"
2278
- },
2279
- {
2280
- name: "_minPremiumAmount",
2281
- type: "uint256",
2282
- internalType: "uint256"
2283
- }
2284
- ],
2285
- outputs: [{
2286
- name: "",
2287
- type: "address",
2288
- internalType: "contract OptionPricing"
2289
- }],
2290
- stateMutability: "nonpayable"
2291
- },
2292
- {
2293
- type: "function",
2294
- name: "deployStaticPerpsPricing",
2295
- inputs: [{
2296
- name: "_dailyFundingRate",
2297
- type: "uint32",
2298
- internalType: "uint32"
2299
- }, {
2300
- name: "_minFundingAmount",
2301
- type: "uint128",
2302
- internalType: "uint128"
2303
- }],
2304
- outputs: [{
2305
- name: "",
2306
- type: "address",
2307
- internalType: "contract StaticPerpsPricing"
2308
- }],
2309
- stateMutability: "nonpayable"
2310
- },
2311
- {
2312
- type: "function",
2313
- name: "feeStrategies",
2314
- inputs: [{
2315
- name: "",
2316
- type: "bytes32",
2317
- internalType: "bytes32"
2318
- }],
2319
- outputs: [{
2320
- name: "",
2321
- type: "address",
2322
- internalType: "contract FeeStrategy"
2323
- }],
2324
- stateMutability: "view"
2325
- },
2326
- {
2327
- type: "function",
2328
- name: "optionPricings",
2329
- inputs: [{
2330
- name: "",
2331
- type: "bytes32",
2332
- internalType: "bytes32"
2333
- }],
2334
- outputs: [{
2335
- name: "",
2336
- type: "address",
2337
- internalType: "contract OptionPricing"
2338
- }],
2339
- stateMutability: "view"
2340
- },
2341
- {
2342
- type: "function",
2343
- name: "staticPerpsPricings",
2344
- inputs: [{
2345
- name: "",
2346
- type: "bytes32",
2347
- internalType: "bytes32"
2348
- }],
2349
- outputs: [{
2350
- name: "",
2351
- type: "address",
2352
- internalType: "contract StaticPerpsPricing"
2353
- }],
2354
- stateMutability: "view"
2355
- },
2356
- {
2357
- type: "event",
2358
- name: "DeployFeeStrategy",
2359
- inputs: [
2360
- {
2361
- name: "feeStrategy",
2362
- type: "address",
2363
- indexed: true,
2364
- internalType: "contract FeeStrategy"
2365
- },
2366
- {
2367
- name: "openingFeeRate",
2368
- type: "uint32",
2369
- indexed: false,
2370
- internalType: "uint32"
2371
- },
2372
- {
2373
- name: "baseFeeRate",
2374
- type: "uint32",
2375
- indexed: false,
2376
- internalType: "uint32"
2377
- },
2378
- {
2379
- name: "minOpeningFee",
2380
- type: "uint128",
2381
- indexed: false,
2382
- internalType: "uint128"
2383
- },
2384
- {
2385
- name: "minBaseFee",
2386
- type: "uint128",
2387
- indexed: false,
2388
- internalType: "uint128"
2389
- },
2390
- {
2391
- name: "feeRecipient",
2392
- type: "address",
2393
- indexed: false,
2394
- internalType: "address"
2395
- }
2396
- ],
2397
- anonymous: false
2398
- },
2399
- {
2400
- type: "event",
2401
- name: "DeployOptionPricing",
2402
- inputs: [
2403
- {
2404
- name: "pricing",
2405
- type: "address",
2406
- indexed: true,
2407
- internalType: "contract OptionPricing"
2408
- },
2409
- {
2410
- name: "statelessPricing",
2411
- type: "address",
2412
- indexed: false,
2413
- internalType: "contract StatelessOptionPricing"
2414
- },
2415
- {
2416
- name: "iv",
2417
- type: "uint32",
2418
- indexed: false,
2419
- internalType: "uint32"
2420
- },
2421
- {
2422
- name: "riskFreeRate",
2423
- type: "uint32",
2424
- indexed: false,
2425
- internalType: "uint32"
2426
- },
2427
- {
2428
- name: "minPremiumDailyRate",
2429
- type: "uint32",
2430
- indexed: false,
2431
- internalType: "uint32"
2432
- },
2433
- {
2434
- name: "minPremiumAmount",
2435
- type: "uint256",
2436
- indexed: false,
2437
- internalType: "uint256"
2438
- }
2439
- ],
2440
- anonymous: false
2441
- },
2442
- {
2443
- type: "event",
2444
- name: "DeployStaticPerpsPricing",
2445
- inputs: [
2446
- {
2447
- name: "pricing",
2448
- type: "address",
2449
- indexed: true,
2450
- internalType: "contract StaticPerpsPricing"
2451
- },
2452
- {
2453
- name: "dailyFundingRate",
2454
- type: "uint32",
2455
- indexed: false,
2456
- internalType: "uint32"
2457
- },
2458
- {
2459
- name: "minFundingAmount",
2460
- type: "uint128",
2461
- indexed: false,
2462
- internalType: "uint128"
2463
- }
2464
- ],
2465
- anonymous: false
2466
- }
2467
- ];
2468
-
2469
1619
  //#endregion
2470
1620
  //#region src/hooks/fees/useUpdateMarketFees.ts
2471
1621
  const useUpdateMarketFees = (marketAddr) => {
@@ -2520,33 +1670,18 @@ const useUpdateMarketFees = (marketAddr) => {
2520
1670
  //#endregion
2521
1671
  //#region src/hooks/pricing/useMarketPricing.ts
2522
1672
  const useMarketPricing = (marketAddr) => {
1673
+ const { timelockLens } = useLens();
2523
1674
  const { data: { optionPricing } } = useMarketState(marketAddr);
2524
1675
  return useReadContract({
2525
- address: optionPricing,
2526
- abi: [{
2527
- inputs: [],
2528
- name: "readState",
2529
- outputs: [{
2530
- name: "",
2531
- type: "bytes"
2532
- }],
2533
- stateMutability: "view",
2534
- type: "function"
2535
- }],
2536
- functionName: "readState",
1676
+ address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
1677
+ abi: lensAbi,
1678
+ functionName: "getPricingParams",
1679
+ args: optionPricing ? [optionPricing] : void 0,
2537
1680
  query: {
2538
1681
  enabled: !!optionPricing,
2539
- select: (rawData) => {
2540
- const [pricingModel] = decodeAbiParameters([{
2541
- name: "model",
2542
- type: "uint8"
2543
- }], rawData);
1682
+ select: ([pricingModel, rawData]) => {
2544
1683
  if (pricingModel === 0) {
2545
- const [, logicContract, iv, riskFreeRate, minPremiumDailyRate, minPremiumAmount] = decodeAbiParameters([
2546
- {
2547
- name: "pricingModel",
2548
- type: "uint8"
2549
- },
1684
+ const [logicContract, iv, riskFreeRate, minPremiumDailyRate, minPremiumAmount] = decodeAbiParameters([
2550
1685
  {
2551
1686
  name: "logicContract",
2552
1687
  type: "address"
@@ -2577,20 +1712,13 @@ const useMarketPricing = (marketAddr) => {
2577
1712
  minPremiumAmount
2578
1713
  };
2579
1714
  } else if (pricingModel === 1) {
2580
- const [, dailyFundingRate, minFundingAmount] = decodeAbiParameters([
2581
- {
2582
- name: "pricingModel",
2583
- type: "uint8"
2584
- },
2585
- {
2586
- name: "dailyFundingRate",
2587
- type: "uint32"
2588
- },
2589
- {
2590
- name: "minFundingAmount",
2591
- type: "uint128"
2592
- }
2593
- ], rawData);
1715
+ const [dailyFundingRate, minFundingAmount] = decodeAbiParameters([{
1716
+ name: "dailyFundingRate",
1717
+ type: "uint32"
1718
+ }, {
1719
+ name: "minFundingAmount",
1720
+ type: "uint128"
1721
+ }], rawData);
2594
1722
  return {
2595
1723
  model: "static",
2596
1724
  dailyFundingRate,