timelock-sdk 0.0.64 → 0.0.66

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.
@@ -1,4 +1,4 @@
1
- import { i as erc20Abi$1, n as uniswapMathLensAbi, r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-DD4CWMqv.js";
1
+ import { i as erc20Abi$1, n as uniswapMathLensAbi, r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-GbBWALCn.js";
2
2
  import { getContract } from "viem";
3
3
  import { monadTestnet } from "viem/chains";
4
4
  import { SqrtPriceMath, TickMath } from "@uniswap/v3-sdk";
@@ -28,7 +28,7 @@ const getTimelockLens = (client) => getContract({
28
28
  address: timelockLenses[client.chain.id],
29
29
  client
30
30
  });
31
- const timelockLenses = { [monadTestnet.id]: "0xe5e1Df4B781D4162702F6a28a38a0f441A86f9Fa" };
31
+ const timelockLenses = { [monadTestnet.id]: "0xa1461178F613d5d3550191FA9E1730B6e0d98593" };
32
32
  const uniswapMathLenses = { [monadTestnet.id]: "0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95" };
33
33
 
34
34
  //#endregion
@@ -213,4 +213,4 @@ const formatUSD = (value) => {
213
213
 
214
214
  //#endregion
215
215
  export { token1ToToken0 as C, getUniswapMathLens as D, getTimelockMarket as E, timelockLenses as O, token0ToToken1 as S, getTimelockLens as T, liquiditiesToAmount0 as _, scaleAmount as a, roundTickDown as b, unscalePrice as c, wrapPrice as d, wrapPriceUnscaled as f, getTickAtPrice as g, getPriceAtTick as h, formatVagueAmount as i, uniswapMathLenses as k, wrapAmount as l, PRICE_PRECISION as m, formatCondensed as n, scalePrice as o, zero as p, formatUSD as r, unscaleAmount as s, formatAmount as t, wrapAmountUnscaled as u, liquiditiesToAmount1 as v, getErc20 as w, roundTickUp as x, liquiditiesToAmounts as y };
216
- //# sourceMappingURL=numberUtils-Dd7vdmeQ.js.map
216
+ //# sourceMappingURL=numberUtils-BVUp0GfC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"numberUtils-Dd7vdmeQ.js","names":["erc20Abi","timelockLenses: Record<number, Address>","uniswapMathLenses: Record<number, Address>","zero: Amount"],"sources":["../src/lib/contracts.ts","../src/lib/liquidityUtils.ts","../src/lib/numberUtils.ts"],"sourcesContent":["import type {Address, Client, PublicClient, GetContractReturnType} from 'viem';\nimport {getContract} from 'viem';\nimport {monadTestnet} from 'viem/chains';\n\nimport {erc20Abi} from '~/abis/erc20';\nimport {lensAbi} from '~/abis/lens';\nimport {uniswapMathLensAbi} from '~/abis/uniswapMathLens';\nimport {optionsMarketAbi} from '~/abis/optionsMarket';\n\nexport type TimelockMarket = GetContractReturnType<\n typeof optionsMarketAbi,\n Client,\n Address\n>;\nexport type TimelockLens = GetContractReturnType<\n typeof lensAbi,\n Client,\n Address\n>;\nexport type UniswapMathLens = GetContractReturnType<\n typeof uniswapMathLensAbi,\n Client,\n Address\n>;\n\nexport type TimelockMarketData = Awaited<\n ReturnType<TimelockLens['read']['getMarketData']>\n> & {address: Address};\n\nexport const getErc20 = (address: Address, client: Client) =>\n getContract({abi: erc20Abi, address, client});\n\nexport const getTimelockMarket = (\n address: Address,\n client: Client,\n): TimelockMarket => {\n return getContract({abi: optionsMarketAbi, address, client});\n};\n\nexport const getUniswapMathLens = (client: Client | PublicClient) =>\n getContract({\n abi: uniswapMathLensAbi,\n address: uniswapMathLenses[client.chain!.id],\n client,\n });\n\nexport const getTimelockLens = (client: Client | PublicClient) =>\n getContract({\n abi: lensAbi,\n address: timelockLenses[client.chain!.id],\n client,\n });\n\nexport const timelockLenses: Record<number, Address> = {\n [monadTestnet.id]: '0xe5e1Df4B781D4162702F6a28a38a0f441A86f9Fa',\n};\nexport const uniswapMathLenses: Record<number, Address> = {\n [monadTestnet.id]: '0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95',\n};\n","import {SqrtPriceMath, TickMath} from '@uniswap/v3-sdk';\nimport Big from 'big.js';\nimport JSBI from 'jsbi';\n\nexport const PRICE_PRECISION = BigInt(1e18);\n\nexport const getPriceAtTick = (tick: number) => {\n const sqrtRatioX96 = BigInt(TickMath.getSqrtRatioAtTick(tick).toString());\n\n const priceX192 = sqrtRatioX96 * sqrtRatioX96;\n const price = (priceX192 * PRICE_PRECISION) / BigInt(2 ** 192);\n\n return price;\n};\n\nexport const getTickAtPrice = (price: bigint) => {\n const priceX192 = (price * BigInt(2 ** 192)) / PRICE_PRECISION;\n const sqrtPriceX96 = JSBI.BigInt(\n new Big(priceX192.toString()).sqrt().toFixed(0),\n );\n return TickMath.getTickAtSqrtRatio(sqrtPriceX96);\n};\n\nexport const roundTickDown = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem >= 0) return tick - rem;\n return tick - rem - spacing;\n};\n\nexport const roundTickUp = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem === 0) return tick;\n if (rem > 0) return tick - rem + spacing;\n return tick - rem;\n};\n\nexport const token0ToToken1 = (amount0: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount0 * price) / PRICE_PRECISION;\n};\n\nexport const token1ToToken0 = (amount1: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount1 * PRICE_PRECISION) / price;\n};\n\nexport const liquiditiesToAmount0 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount0 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount0Delta = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(amount0Delta.toString());\n }\n return amount0;\n};\n\nexport const liquiditiesToAmount1 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount1 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount1Delta = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(amount1Delta.toString());\n }\n return amount1;\n};\n\nexport const liquiditiesToAmounts = (\n liquidities: bigint[],\n startTick: number,\n currentTick: number,\n tickSpacing: number,\n) => {\n let amount0 = 0n;\n let amount1 = 0n;\n\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(currentTick);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n if (currentTick < tickLower) {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n } else if (currentTick >= tickUpper) {\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(delta1.toString());\n } else {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n amount1 += BigInt(delta1.toString());\n }\n }\n return [amount0, amount1];\n};\n","import Big from 'big.js';\n\nexport type Amount = {\n scaled: bigint;\n unscaled: Big;\n decimals: number;\n formatted: string;\n};\n\nexport const zero: Amount = {\n scaled: 0n,\n unscaled: Big(0),\n decimals: 18,\n formatted: '0',\n};\n\nexport const wrapAmount = (scaled: bigint, decimals: number): Amount => {\n const unscaled = unscaleAmount(scaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapAmountUnscaled = (\n unscaled: Big | number | string,\n decimals: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scaleAmount(unscaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapPrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n): Amount => {\n const unscaled = unscalePrice(scaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const wrapPriceUnscaled = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scalePrice(unscaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const unscaleAmount = (scaled: bigint, decimals: number) => {\n return new Big(scaled.toString()).div(new Big(10).pow(decimals));\n};\n\nexport const scaleAmount = (\n unscaled: Big | number | string,\n decimals: number,\n) => {\n return BigInt(\n Big(unscaled).mul(new Big(10).pow(decimals)).round().toFixed(0),\n );\n};\n\nexport const unscalePrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return new Big(scaled.toString())\n .mul(new Big(10).pow(decimals0))\n .div(new Big(10).pow(decimals1))\n .div(new Big(10).pow(precision));\n};\n\nexport const scalePrice = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return BigInt(\n Big(unscaled)\n .mul(new Big(10).pow(precision))\n .mul(new Big(10).pow(decimals1))\n .div(new Big(10).pow(decimals0))\n .round()\n .toFixed(0),\n );\n};\n\nexport const formatAmount = (value?: Big | number | string) => {\n if (value === undefined) return '-';\n // return value < 1 ? value.toPrecision(2) : value.toFixed(2);\n return formatCondensed(Big(value).toFixed(100));\n};\n\nexport const formatVagueAmount = (value: number | bigint) => {\n value = Number(value);\n if (value === 0) return '0';\n\n const formatted = value.toExponential(2);\n return formatted.replace(/\\.?0+e/, 'e').replace(/e\\+/, 'e');\n};\n\nexport const formatCondensed = (\n input: string | number,\n decimals = 2,\n): string => {\n const str = (typeof input === 'number' ? input.toFixed(20) : input)\n .replace(/(\\.\\d*?)0+$/, '$1')\n .replace(/\\.$/, '');\n\n const [whole, decimal] = str.split('.');\n\n const formattedWhole = whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n if (!decimal) return formattedWhole;\n\n const leadingZeroMatch = decimal.match(/^(0{3,})/);\n\n if (leadingZeroMatch) {\n const zeroCount = leadingZeroMatch[1].length;\n const subscript = toSubscript(zeroCount.toString());\n const remaining = decimal.slice(zeroCount);\n\n const twoDigits = remaining.slice(0, decimals);\n return `${formattedWhole}.0${subscript}${twoDigits}`;\n } else {\n // No subscript needed, find first 2 significant digits\n const nonZeroStart = decimal.search(/[1-9]/); // Find first non-zero digit\n\n if (nonZeroStart === -1) {\n return formattedWhole; // All zeros\n }\n const significantPart = decimal.slice(nonZeroStart);\n const twoDigits = significantPart.slice(0, decimals);\n const leadingZeros = decimal.slice(0, nonZeroStart);\n\n return `${formattedWhole}.${leadingZeros}${twoDigits}`;\n }\n};\n\nconst toSubscript = (input: string) => {\n return input.replace(/[0-9]/g, m => '₀₁₂₃₄₅₆₇₈₉'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;AAGxB,QADkB,MAAM,cAAc,EAAE,CACvB,QAAQ,UAAU,IAAI,CAAC,QAAQ,OAAO,IAAI;;AAG7D,MAAa,mBACX,OACA,WAAW,MACA;CAKX,MAAM,CAAC,OAAO,YAJD,OAAO,UAAU,WAAW,MAAM,QAAQ,GAAG,GAAG,OAC1D,QAAQ,eAAe,KAAK,CAC5B,QAAQ,OAAO,GAAG,CAEQ,MAAM,IAAI;CAEvC,MAAM,iBAAiB,MAAM,QAAQ,yBAAyB,IAAI;AAClE,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,mBAAmB,QAAQ,MAAM,WAAW;AAElD,KAAI,kBAAkB;EACpB,MAAM,YAAY,iBAAiB,GAAG;AAKtC,SAAO,GAAG,eAAe,IAJP,YAAY,UAAU,UAAU,CAAC,GACjC,QAAQ,MAAM,UAAU,CAEd,MAAM,GAAG,SAAS;QAEzC;EAEL,MAAM,eAAe,QAAQ,OAAO,QAAQ;AAE5C,MAAI,iBAAiB,GACnB,QAAO;EAGT,MAAM,YADkB,QAAQ,MAAM,aAAa,CACjB,MAAM,GAAG,SAAS;AAGpD,SAAO,GAAG,eAAe,GAFJ,QAAQ,MAAM,GAAG,aAAa,GAER;;;AAI/C,MAAM,eAAe,UAAkB;AACrC,QAAO,MAAM,QAAQ,WAAU,MAAK,aAAa,CAAC,GAAG;;AAGvD,MAAa,aAAa,UAAyC;AACjE,QAAO,MAAM,aAAa,MAAM"}
1
+ {"version":3,"file":"numberUtils-BVUp0GfC.js","names":["erc20Abi","timelockLenses: Record<number, Address>","uniswapMathLenses: Record<number, Address>","zero: Amount"],"sources":["../src/lib/contracts.ts","../src/lib/liquidityUtils.ts","../src/lib/numberUtils.ts"],"sourcesContent":["import type {Address, Client, PublicClient, GetContractReturnType} from 'viem';\nimport {getContract} from 'viem';\nimport {monadTestnet} from 'viem/chains';\n\nimport {erc20Abi} from '~/abis/erc20';\nimport {lensAbi} from '~/abis/lens';\nimport {uniswapMathLensAbi} from '~/abis/uniswapMathLens';\nimport {optionsMarketAbi} from '~/abis/optionsMarket';\n\nexport type TimelockMarket = GetContractReturnType<\n typeof optionsMarketAbi,\n Client,\n Address\n>;\nexport type TimelockLens = GetContractReturnType<\n typeof lensAbi,\n Client,\n Address\n>;\nexport type UniswapMathLens = GetContractReturnType<\n typeof uniswapMathLensAbi,\n Client,\n Address\n>;\n\nexport type TimelockMarketData = Awaited<\n ReturnType<TimelockLens['read']['getMarketData']>\n> & {address: Address};\n\nexport const getErc20 = (address: Address, client: Client) =>\n getContract({abi: erc20Abi, address, client});\n\nexport const getTimelockMarket = (\n address: Address,\n client: Client,\n): TimelockMarket => {\n return getContract({abi: optionsMarketAbi, address, client});\n};\n\nexport const getUniswapMathLens = (client: Client | PublicClient) =>\n getContract({\n abi: uniswapMathLensAbi,\n address: uniswapMathLenses[client.chain!.id],\n client,\n });\n\nexport const getTimelockLens = (client: Client | PublicClient) =>\n getContract({\n abi: lensAbi,\n address: timelockLenses[client.chain!.id],\n client,\n });\n\nexport const timelockLenses: Record<number, Address> = {\n [monadTestnet.id]: '0xa1461178F613d5d3550191FA9E1730B6e0d98593',\n};\nexport const uniswapMathLenses: Record<number, Address> = {\n [monadTestnet.id]: '0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95',\n};\n","import {SqrtPriceMath, TickMath} from '@uniswap/v3-sdk';\nimport Big from 'big.js';\nimport JSBI from 'jsbi';\n\nexport const PRICE_PRECISION = BigInt(1e18);\n\nexport const getPriceAtTick = (tick: number) => {\n const sqrtRatioX96 = BigInt(TickMath.getSqrtRatioAtTick(tick).toString());\n\n const priceX192 = sqrtRatioX96 * sqrtRatioX96;\n const price = (priceX192 * PRICE_PRECISION) / BigInt(2 ** 192);\n\n return price;\n};\n\nexport const getTickAtPrice = (price: bigint) => {\n const priceX192 = (price * BigInt(2 ** 192)) / PRICE_PRECISION;\n const sqrtPriceX96 = JSBI.BigInt(\n new Big(priceX192.toString()).sqrt().toFixed(0),\n );\n return TickMath.getTickAtSqrtRatio(sqrtPriceX96);\n};\n\nexport const roundTickDown = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem >= 0) return tick - rem;\n return tick - rem - spacing;\n};\n\nexport const roundTickUp = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem === 0) return tick;\n if (rem > 0) return tick - rem + spacing;\n return tick - rem;\n};\n\nexport const token0ToToken1 = (amount0: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount0 * price) / PRICE_PRECISION;\n};\n\nexport const token1ToToken0 = (amount1: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount1 * PRICE_PRECISION) / price;\n};\n\nexport const liquiditiesToAmount0 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount0 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount0Delta = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(amount0Delta.toString());\n }\n return amount0;\n};\n\nexport const liquiditiesToAmount1 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount1 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount1Delta = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(amount1Delta.toString());\n }\n return amount1;\n};\n\nexport const liquiditiesToAmounts = (\n liquidities: bigint[],\n startTick: number,\n currentTick: number,\n tickSpacing: number,\n) => {\n let amount0 = 0n;\n let amount1 = 0n;\n\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(currentTick);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n if (currentTick < tickLower) {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n } else if (currentTick >= tickUpper) {\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(delta1.toString());\n } else {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n amount1 += BigInt(delta1.toString());\n }\n }\n return [amount0, amount1];\n};\n","import Big from 'big.js';\n\nexport type Amount = {\n scaled: bigint;\n unscaled: Big;\n decimals: number;\n formatted: string;\n};\n\nexport const zero: Amount = {\n scaled: 0n,\n unscaled: Big(0),\n decimals: 18,\n formatted: '0',\n};\n\nexport const wrapAmount = (scaled: bigint, decimals: number): Amount => {\n const unscaled = unscaleAmount(scaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapAmountUnscaled = (\n unscaled: Big | number | string,\n decimals: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scaleAmount(unscaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapPrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n): Amount => {\n const unscaled = unscalePrice(scaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const wrapPriceUnscaled = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scalePrice(unscaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const unscaleAmount = (scaled: bigint, decimals: number) => {\n return new Big(scaled.toString()).div(new Big(10).pow(decimals));\n};\n\nexport const scaleAmount = (\n unscaled: Big | number | string,\n decimals: number,\n) => {\n return BigInt(\n Big(unscaled).mul(new Big(10).pow(decimals)).round().toFixed(0),\n );\n};\n\nexport const unscalePrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return new Big(scaled.toString())\n .mul(new Big(10).pow(decimals0))\n .div(new Big(10).pow(decimals1))\n .div(new Big(10).pow(precision));\n};\n\nexport const scalePrice = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return BigInt(\n Big(unscaled)\n .mul(new Big(10).pow(precision))\n .mul(new Big(10).pow(decimals1))\n .div(new Big(10).pow(decimals0))\n .round()\n .toFixed(0),\n );\n};\n\nexport const formatAmount = (value?: Big | number | string) => {\n if (value === undefined) return '-';\n // return value < 1 ? value.toPrecision(2) : value.toFixed(2);\n return formatCondensed(Big(value).toFixed(100));\n};\n\nexport const formatVagueAmount = (value: number | bigint) => {\n value = Number(value);\n if (value === 0) return '0';\n\n const formatted = value.toExponential(2);\n return formatted.replace(/\\.?0+e/, 'e').replace(/e\\+/, 'e');\n};\n\nexport const formatCondensed = (\n input: string | number,\n decimals = 2,\n): string => {\n const str = (typeof input === 'number' ? input.toFixed(20) : input)\n .replace(/(\\.\\d*?)0+$/, '$1')\n .replace(/\\.$/, '');\n\n const [whole, decimal] = str.split('.');\n\n const formattedWhole = whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n if (!decimal) return formattedWhole;\n\n const leadingZeroMatch = decimal.match(/^(0{3,})/);\n\n if (leadingZeroMatch) {\n const zeroCount = leadingZeroMatch[1].length;\n const subscript = toSubscript(zeroCount.toString());\n const remaining = decimal.slice(zeroCount);\n\n const twoDigits = remaining.slice(0, decimals);\n return `${formattedWhole}.0${subscript}${twoDigits}`;\n } else {\n // No subscript needed, find first 2 significant digits\n const nonZeroStart = decimal.search(/[1-9]/); // Find first non-zero digit\n\n if (nonZeroStart === -1) {\n return formattedWhole; // All zeros\n }\n const significantPart = decimal.slice(nonZeroStart);\n const twoDigits = significantPart.slice(0, decimals);\n const leadingZeros = decimal.slice(0, nonZeroStart);\n\n return `${formattedWhole}.${leadingZeros}${twoDigits}`;\n }\n};\n\nconst toSubscript = (input: string) => {\n return input.replace(/[0-9]/g, m => '₀₁₂₃₄₅₆₇₈₉'[+m]);\n};\n\nexport const formatUSD = (value: Big | string | number): string => {\n return '$' + formatAmount(value);\n};\n"],"mappings":";;;;;;;;AA6BA,MAAa,YAAY,SAAkB,WACzC,YAAY;CAAC,KAAKA;CAAU;CAAS;CAAO,CAAC;AAE/C,MAAa,qBACX,SACA,WACmB;AACnB,QAAO,YAAY;EAAC,KAAK;EAAkB;EAAS;EAAO,CAAC;;AAG9D,MAAa,sBAAsB,WACjC,YAAY;CACV,KAAK;CACL,SAAS,kBAAkB,OAAO,MAAO;CACzC;CACD,CAAC;AAEJ,MAAa,mBAAmB,W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mB,QAAQ,MAAM,WAAW;AAElD,KAAI,kBAAkB;EACpB,MAAM,YAAY,iBAAiB,GAAG;AAKtC,SAAO,GAAG,eAAe,IAJP,YAAY,UAAU,UAAU,CAAC,GACjC,QAAQ,MAAM,UAAU,CAEd,MAAM,GAAG,SAAS;QAEzC;EAEL,MAAM,eAAe,QAAQ,OAAO,QAAQ;AAE5C,MAAI,iBAAiB,GACnB,QAAO;EAGT,MAAM,YADkB,QAAQ,MAAM,aAAa,CACjB,MAAM,GAAG,SAAS;AAGpD,SAAO,GAAG,eAAe,GAFJ,QAAQ,MAAM,GAAG,aAAa,GAER;;;AAI/C,MAAM,eAAe,UAAkB;AACrC,QAAO,MAAM,QAAQ,WAAU,MAAK,aAAa,CAAC,GAAG;;AAGvD,MAAa,aAAa,UAAyC;AACjE,QAAO,MAAM,aAAa,MAAM"}
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  }) : target, mod));
22
22
 
23
23
  //#endregion
24
- const require_optionsMarket = require('./optionsMarket-D192aXEZ.cjs');
24
+ const require_optionsMarket = require('./optionsMarket-BpL6x4be.cjs');
25
25
  let viem = require("viem");
26
26
  viem = __toESM(viem);
27
27
  let viem_chains = require("viem/chains");
@@ -56,7 +56,7 @@ const getTimelockLens = (client) => (0, viem.getContract)({
56
56
  address: timelockLenses[client.chain.id],
57
57
  client
58
58
  });
59
- const timelockLenses = { [viem_chains.monadTestnet.id]: "0xe5e1Df4B781D4162702F6a28a38a0f441A86f9Fa" };
59
+ const timelockLenses = { [viem_chains.monadTestnet.id]: "0xa1461178F613d5d3550191FA9E1730B6e0d98593" };
60
60
  const uniswapMathLenses = { [viem_chains.monadTestnet.id]: "0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95" };
61
61
 
62
62
  //#endregion
@@ -420,4 +420,4 @@ Object.defineProperty(exports, 'zero', {
420
420
  return zero;
421
421
  }
422
422
  });
423
- //# sourceMappingURL=numberUtils-CmVB4kX7.cjs.map
423
+ //# sourceMappingURL=numberUtils-BxQ4RnW9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"numberUtils-CmVB4kX7.cjs","names":["erc20Abi","optionsMarketAbi","uniswapMathLensAbi","lensAbi","timelockLenses: Record<number, Address>","monadTestnet","uniswapMathLenses: Record<number, Address>","TickMath","JSBI","Big","SqrtPriceMath","zero: Amount","Big"],"sources":["../src/lib/contracts.ts","../src/lib/liquidityUtils.ts","../src/lib/numberUtils.ts"],"sourcesContent":["import type {Address, Client, PublicClient, GetContractReturnType} from 'viem';\nimport {getContract} from 'viem';\nimport {monadTestnet} from 'viem/chains';\n\nimport {erc20Abi} from '~/abis/erc20';\nimport {lensAbi} from '~/abis/lens';\nimport {uniswapMathLensAbi} from '~/abis/uniswapMathLens';\nimport {optionsMarketAbi} from '~/abis/optionsMarket';\n\nexport type TimelockMarket = GetContractReturnType<\n typeof optionsMarketAbi,\n Client,\n Address\n>;\nexport type TimelockLens = GetContractReturnType<\n typeof lensAbi,\n Client,\n Address\n>;\nexport type UniswapMathLens = GetContractReturnType<\n typeof uniswapMathLensAbi,\n Client,\n Address\n>;\n\nexport type TimelockMarketData = Awaited<\n ReturnType<TimelockLens['read']['getMarketData']>\n> & {address: Address};\n\nexport const getErc20 = (address: Address, client: Client) =>\n getContract({abi: erc20Abi, address, client});\n\nexport const getTimelockMarket = (\n address: Address,\n client: Client,\n): TimelockMarket => {\n return getContract({abi: optionsMarketAbi, address, client});\n};\n\nexport const getUniswapMathLens = (client: Client | PublicClient) =>\n getContract({\n abi: uniswapMathLensAbi,\n address: uniswapMathLenses[client.chain!.id],\n client,\n });\n\nexport const getTimelockLens = (client: Client | PublicClient) =>\n getContract({\n abi: lensAbi,\n address: timelockLenses[client.chain!.id],\n client,\n });\n\nexport const timelockLenses: Record<number, Address> = {\n [monadTestnet.id]: '0xe5e1Df4B781D4162702F6a28a38a0f441A86f9Fa',\n};\nexport const uniswapMathLenses: Record<number, Address> = {\n [monadTestnet.id]: '0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95',\n};\n","import {SqrtPriceMath, TickMath} from '@uniswap/v3-sdk';\nimport Big from 'big.js';\nimport JSBI from 'jsbi';\n\nexport const PRICE_PRECISION = BigInt(1e18);\n\nexport const getPriceAtTick = (tick: number) => {\n const sqrtRatioX96 = BigInt(TickMath.getSqrtRatioAtTick(tick).toString());\n\n const priceX192 = sqrtRatioX96 * sqrtRatioX96;\n const price = (priceX192 * PRICE_PRECISION) / BigInt(2 ** 192);\n\n return price;\n};\n\nexport const getTickAtPrice = (price: bigint) => {\n const priceX192 = (price * BigInt(2 ** 192)) / PRICE_PRECISION;\n const sqrtPriceX96 = JSBI.BigInt(\n new Big(priceX192.toString()).sqrt().toFixed(0),\n );\n return TickMath.getTickAtSqrtRatio(sqrtPriceX96);\n};\n\nexport const roundTickDown = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem >= 0) return tick - rem;\n return tick - rem - spacing;\n};\n\nexport const roundTickUp = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem === 0) return tick;\n if (rem > 0) return tick - rem + spacing;\n return tick - rem;\n};\n\nexport const token0ToToken1 = (amount0: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount0 * price) / PRICE_PRECISION;\n};\n\nexport const token1ToToken0 = (amount1: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount1 * PRICE_PRECISION) / price;\n};\n\nexport const liquiditiesToAmount0 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount0 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount0Delta = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(amount0Delta.toString());\n }\n return amount0;\n};\n\nexport const liquiditiesToAmount1 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount1 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount1Delta = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(amount1Delta.toString());\n }\n return amount1;\n};\n\nexport const liquiditiesToAmounts = (\n liquidities: bigint[],\n startTick: number,\n currentTick: number,\n tickSpacing: number,\n) => {\n let amount0 = 0n;\n let amount1 = 0n;\n\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(currentTick);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n if (currentTick < tickLower) {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n } else if (currentTick >= tickUpper) {\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(delta1.toString());\n } else {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n amount1 += BigInt(delta1.toString());\n }\n }\n return [amount0, amount1];\n};\n","import Big from 'big.js';\n\nexport type Amount = {\n scaled: bigint;\n unscaled: Big;\n decimals: number;\n formatted: string;\n};\n\nexport const zero: Amount = {\n scaled: 0n,\n unscaled: Big(0),\n decimals: 18,\n formatted: '0',\n};\n\nexport const wrapAmount = (scaled: bigint, decimals: number): Amount => {\n const unscaled = unscaleAmount(scaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapAmountUnscaled = (\n unscaled: Big | number | string,\n decimals: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scaleAmount(unscaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapPrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n): Amount => {\n const unscaled = unscalePrice(scaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const wrapPriceUnscaled = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scalePrice(unscaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const unscaleAmount = (scaled: bigint, decimals: number) => {\n return new Big(scaled.toString()).div(new Big(10).pow(decimals));\n};\n\nexport const scaleAmount = (\n unscaled: Big | number | string,\n decimals: number,\n) => {\n return BigInt(\n Big(unscaled).mul(new Big(10).pow(decimals)).round().toFixed(0),\n );\n};\n\nexport const unscalePrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return new Big(scaled.toString())\n .mul(new Big(10).pow(decimals0))\n .div(new Big(10).pow(decimals1))\n .div(new Big(10).pow(precision));\n};\n\nexport const scalePrice = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return BigInt(\n Big(unscaled)\n .mul(new Big(10).pow(precision))\n .mul(new Big(10).pow(decimals1))\n .div(new Big(10).pow(decimals0))\n .round()\n .toFixed(0),\n );\n};\n\nexport const formatAmount = (value?: Big | number | string) => {\n if (value === undefined) return '-';\n // return value < 1 ? value.toPrecision(2) : value.toFixed(2);\n return formatCondensed(Big(value).toFixed(100));\n};\n\nexport const formatVagueAmount = (value: number | bigint) => {\n value = Number(value);\n if (value === 0) return '0';\n\n const formatted = value.toExponential(2);\n return formatted.replace(/\\.?0+e/, 'e').replace(/e\\+/, 'e');\n};\n\nexport const formatCondensed = (\n input: string | number,\n decimals = 2,\n): string => {\n const str = (typeof input === 'number' ? input.toFixed(20) : input)\n .replace(/(\\.\\d*?)0+$/, '$1')\n .replace(/\\.$/, '');\n\n const [whole, decimal] = str.split('.');\n\n const formattedWhole = whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n if (!decimal) return formattedWhole;\n\n const leadingZeroMatch = decimal.match(/^(0{3,})/);\n\n if (leadingZeroMatch) {\n const zeroCount = leadingZeroMatch[1].length;\n const subscript = toSubscript(zeroCount.toString());\n const remaining = decimal.slice(zeroCount);\n\n const twoDigits = remaining.slice(0, decimals);\n return `${formattedWhole}.0${subscript}${twoDigits}`;\n } else {\n // No subscript needed, find first 2 significant digits\n const nonZeroStart = decimal.search(/[1-9]/); // Find first non-zero digit\n\n if (nonZeroStart === -1) {\n return formattedWhole; // All zeros\n }\n const significantPart = decimal.slice(nonZeroStart);\n const twoDigits = significantPart.slice(0, decimals);\n const leadingZeros = decimal.slice(0, nonZeroStart);\n\n return `${formattedWhole}.${leadingZeros}${twoDigits}`;\n }\n};\n\nconst toSubscript = (input: string) => {\n return input.replace(/[0-9]/g, m => '₀₁₂₃₄₅₆₇₈₉'[+m]);\n};\n\nexport const formatUSD = (value: Big | string | number): string => {\n return '$' + formatAmount(value);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAa,YAAY,SAAkB,iCAC7B;CAAC,KAAKA;CAAU;CAAS;CAAO,CAAC;AAE/C,MAAa,qBACX,SACA,WACmB;AACnB,8BAAmB;EAAC,KAAKC;EAAkB;EAAS;EAAO,CAAC;;AAG9D,MAAa,sBAAsB,iCACrB;CACV,KAAKC;CACL,SAAS,kBAAkB,OAAO,MAAO;CACzC;CACD,CAAC;AAEJ,MAAa,mBAAmB,iCAClB;CACV,KAAKC;CACL,SAAS,eAAe,OAAO,MAAO;CACtC;CACD,CAAC;AAEJ,MAAaC,iBAA0C,GACpDC,yBAAa,KAAK,8CACpB;AACD,MAAaC,oBAA6C,GACvDD,yBAAa,KAAK,8CACpB;;;;ACtDD,MAAa,kBAAkB,OAAO,kBAAK;AAE3C,MAAa,kBAAkB,SAAiB;CAC9C,MAAM,eAAe,OAAOE,0BAAS,mBAAmB,KAAK,CAAC,UAAU,CAAC;AAKzE,QAHkB,eAAe,eACN,kBAAmB,OAAO,KAAK,IAAI;;AAKhE,MAAa,kBAAkB,UAAkB;CAC/C,MAAM,YAAa,QAAQ,OAAO,KAAK,IAAI,GAAI;CAC/C,MAAM,eAAeC,aAAK,OACxB,IAAIC,eAAI,UAAU,UAAU,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAChD;AACD,QAAOF,0BAAS,mBAAmB,aAAa;;AAGlD,MAAa,iBAAiB,MAAc,YAAoB;CAC9D,MAAM,MAAM,OAAO;AACnB,KAAI,OAAO,EAAG,QAAO,OAAO;AAC5B,QAAO,OAAO,MAAM;;AAGtB,MAAa,eAAe,MAAc,YAA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AkC;AAC7D,KAAI,UAAU,OAAW,QAAO;AAEhC,QAAO,oCAAoB,MAAM,CAAC,QAAQ,IAAI,CAAC;;AAGjD,MAAa,qBAAqB,UAA2B;AAC3D,SAAQ,OAAO,MAAM;AACrB,KAAI,UAAU,EAAG,QAAO;AAGxB,QADkB,MAAM,cAAc,EAAE,CACvB,QAAQ,UAAU,IAAI,CAAC,QAAQ,OAAO,IAAI;;AAG7D,MAAa,mBACX,OACA,WAAW,MACA;CAKX,MAAM,CAAC,OAAO,YAJD,OAAO,UAAU,WAAW,MAAM,QAAQ,GAAG,GAAG,OAC1D,QAAQ,eAAe,KAAK,CAC5B,QAAQ,OAAO,GAAG,CAEQ,MAAM,IAAI;CAEvC,MAAM,iBAAiB,MAAM,QAAQ,yBAAyB,IAAI;AAClE,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,mBAAmB,QAAQ,MAAM,WAAW;AAElD,KAAI,kBAAkB;EACpB,MAAM,YAAY,iBAAiB,GAAG;AAKtC,SAAO,GAAG,eAAe,IAJP,YAAY,UAAU,UAAU,CAAC,GACjC,QAAQ,MAAM,UAAU,CAEd,MAAM,GAAG,SAAS;QAEzC;EAEL,MAAM,eAAe,QAAQ,OAAO,QAAQ;AAE5C,MAAI,iBAAiB,GACnB,QAAO;EAGT,MAAM,YADkB,QAAQ,MAAM,aAAa,CACjB,MAAM,GAAG,SAAS;AAGpD,SAAO,GAAG,eAAe,GAFJ,QAAQ,MAAM,GAAG,aAAa,GAER;;;AAI/C,MAAM,eAAe,UAAkB;AACrC,QAAO,MAAM,QAAQ,WAAU,MAAK,aAAa,CAAC,GAAG;;AAGvD,MAAa,aAAa,UAAyC;AACjE,QAAO,MAAM,aAAa,MAAM"}
1
+ {"version":3,"file":"numberUtils-BxQ4RnW9.cjs","names":["erc20Abi","optionsMarketAbi","uniswapMathLensAbi","lensAbi","timelockLenses: Record<number, Address>","monadTestnet","uniswapMathLenses: Record<number, Address>","TickMath","JSBI","Big","SqrtPriceMath","zero: Amount","Big"],"sources":["../src/lib/contracts.ts","../src/lib/liquidityUtils.ts","../src/lib/numberUtils.ts"],"sourcesContent":["import type {Address, Client, PublicClient, GetContractReturnType} from 'viem';\nimport {getContract} from 'viem';\nimport {monadTestnet} from 'viem/chains';\n\nimport {erc20Abi} from '~/abis/erc20';\nimport {lensAbi} from '~/abis/lens';\nimport {uniswapMathLensAbi} from '~/abis/uniswapMathLens';\nimport {optionsMarketAbi} from '~/abis/optionsMarket';\n\nexport type TimelockMarket = GetContractReturnType<\n typeof optionsMarketAbi,\n Client,\n Address\n>;\nexport type TimelockLens = GetContractReturnType<\n typeof lensAbi,\n Client,\n Address\n>;\nexport type UniswapMathLens = GetContractReturnType<\n typeof uniswapMathLensAbi,\n Client,\n Address\n>;\n\nexport type TimelockMarketData = Awaited<\n ReturnType<TimelockLens['read']['getMarketData']>\n> & {address: Address};\n\nexport const getErc20 = (address: Address, client: Client) =>\n getContract({abi: erc20Abi, address, client});\n\nexport const getTimelockMarket = (\n address: Address,\n client: Client,\n): TimelockMarket => {\n return getContract({abi: optionsMarketAbi, address, client});\n};\n\nexport const getUniswapMathLens = (client: Client | PublicClient) =>\n getContract({\n abi: uniswapMathLensAbi,\n address: uniswapMathLenses[client.chain!.id],\n client,\n });\n\nexport const getTimelockLens = (client: Client | PublicClient) =>\n getContract({\n abi: lensAbi,\n address: timelockLenses[client.chain!.id],\n client,\n });\n\nexport const timelockLenses: Record<number, Address> = {\n [monadTestnet.id]: '0xa1461178F613d5d3550191FA9E1730B6e0d98593',\n};\nexport const uniswapMathLenses: Record<number, Address> = {\n [monadTestnet.id]: '0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95',\n};\n","import {SqrtPriceMath, TickMath} from '@uniswap/v3-sdk';\nimport Big from 'big.js';\nimport JSBI from 'jsbi';\n\nexport const PRICE_PRECISION = BigInt(1e18);\n\nexport const getPriceAtTick = (tick: number) => {\n const sqrtRatioX96 = BigInt(TickMath.getSqrtRatioAtTick(tick).toString());\n\n const priceX192 = sqrtRatioX96 * sqrtRatioX96;\n const price = (priceX192 * PRICE_PRECISION) / BigInt(2 ** 192);\n\n return price;\n};\n\nexport const getTickAtPrice = (price: bigint) => {\n const priceX192 = (price * BigInt(2 ** 192)) / PRICE_PRECISION;\n const sqrtPriceX96 = JSBI.BigInt(\n new Big(priceX192.toString()).sqrt().toFixed(0),\n );\n return TickMath.getTickAtSqrtRatio(sqrtPriceX96);\n};\n\nexport const roundTickDown = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem >= 0) return tick - rem;\n return tick - rem - spacing;\n};\n\nexport const roundTickUp = (tick: number, spacing: number) => {\n const rem = tick % spacing;\n if (rem === 0) return tick;\n if (rem > 0) return tick - rem + spacing;\n return tick - rem;\n};\n\nexport const token0ToToken1 = (amount0: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount0 * price) / PRICE_PRECISION;\n};\n\nexport const token1ToToken0 = (amount1: bigint, tick: number) => {\n const price = getPriceAtTick(tick);\n return (amount1 * PRICE_PRECISION) / price;\n};\n\nexport const liquiditiesToAmount0 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount0 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount0Delta = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(amount0Delta.toString());\n }\n return amount0;\n};\n\nexport const liquiditiesToAmount1 = (\n liquidities: bigint[],\n startTick: number,\n tickSpacing: number,\n) => {\n let amount1 = BigInt(0);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n const amount1Delta = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(amount1Delta.toString());\n }\n return amount1;\n};\n\nexport const liquiditiesToAmounts = (\n liquidities: bigint[],\n startTick: number,\n currentTick: number,\n tickSpacing: number,\n) => {\n let amount0 = 0n;\n let amount1 = 0n;\n\n const sqrtRatioX96 = TickMath.getSqrtRatioAtTick(currentTick);\n\n for (let i = 0; i < liquidities.length; i++) {\n const liquidity = liquidities[i];\n if (liquidity === BigInt(0)) continue;\n\n const tickLower = startTick + tickSpacing * i;\n const tickUpper = tickLower + tickSpacing;\n\n const sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(tickLower);\n const sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(tickUpper);\n const liquidityJSBI = JSBI.BigInt(liquidity.toString());\n\n if (currentTick < tickLower) {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n } else if (currentTick >= tickUpper) {\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n amount1 += BigInt(delta1.toString());\n } else {\n const delta0 = SqrtPriceMath.getAmount0Delta(\n sqrtRatioX96,\n sqrtRatioBX96,\n liquidityJSBI,\n false,\n );\n const delta1 = SqrtPriceMath.getAmount1Delta(\n sqrtRatioAX96,\n sqrtRatioX96,\n liquidityJSBI,\n false,\n );\n amount0 += BigInt(delta0.toString());\n amount1 += BigInt(delta1.toString());\n }\n }\n return [amount0, amount1];\n};\n","import Big from 'big.js';\n\nexport type Amount = {\n scaled: bigint;\n unscaled: Big;\n decimals: number;\n formatted: string;\n};\n\nexport const zero: Amount = {\n scaled: 0n,\n unscaled: Big(0),\n decimals: 18,\n formatted: '0',\n};\n\nexport const wrapAmount = (scaled: bigint, decimals: number): Amount => {\n const unscaled = unscaleAmount(scaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapAmountUnscaled = (\n unscaled: Big | number | string,\n decimals: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scaleAmount(unscaled, decimals);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals, formatted};\n};\n\nexport const wrapPrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n): Amount => {\n const unscaled = unscalePrice(scaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const wrapPriceUnscaled = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n): Amount => {\n unscaled = Big(unscaled);\n const scaled = scalePrice(unscaled, decimals0, decimals1);\n const formatted = formatAmount(unscaled);\n return {scaled, unscaled, decimals: 36 + decimals1 - decimals0, formatted};\n};\n\nexport const unscaleAmount = (scaled: bigint, decimals: number) => {\n return new Big(scaled.toString()).div(new Big(10).pow(decimals));\n};\n\nexport const scaleAmount = (\n unscaled: Big | number | string,\n decimals: number,\n) => {\n return BigInt(\n Big(unscaled).mul(new Big(10).pow(decimals)).round().toFixed(0),\n );\n};\n\nexport const unscalePrice = (\n scaled: bigint,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return new Big(scaled.toString())\n .mul(new Big(10).pow(decimals0))\n .div(new Big(10).pow(decimals1))\n .div(new Big(10).pow(precision));\n};\n\nexport const scalePrice = (\n unscaled: Big | number | string,\n decimals0: number,\n decimals1: number,\n precision = 18,\n) => {\n return BigInt(\n Big(unscaled)\n .mul(new Big(10).pow(precision))\n .mul(new Big(10).pow(decimals1))\n .div(new Big(10).pow(decimals0))\n .round()\n .toFixed(0),\n );\n};\n\nexport const formatAmount = (value?: Big | number | string) => {\n if (value === undefined) return '-';\n // return value < 1 ? value.toPrecision(2) : value.toFixed(2);\n return formatCondensed(Big(value).toFixed(100));\n};\n\nexport const formatVagueAmount = (value: number | bigint) => {\n value = Number(value);\n if (value === 0) return '0';\n\n const formatted = value.toExponential(2);\n return formatted.replace(/\\.?0+e/, 'e').replace(/e\\+/, 'e');\n};\n\nexport const formatCondensed = (\n input: string | number,\n decimals = 2,\n): string => {\n const str = (typeof input === 'number' ? input.toFixed(20) : input)\n .replace(/(\\.\\d*?)0+$/, '$1')\n .replace(/\\.$/, '');\n\n const [whole, decimal] = str.split('.');\n\n const formattedWhole = whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n if (!decimal) return formattedWhole;\n\n const leadingZeroMatch = decimal.match(/^(0{3,})/);\n\n if (leadingZeroMatch) {\n const zeroCount = leadingZeroMatch[1].length;\n const subscript = toSubscript(zeroCount.toString());\n const remaining = decimal.slice(zeroCount);\n\n const twoDigits = remaining.slice(0, decimals);\n return `${formattedWhole}.0${subscript}${twoDigits}`;\n } else {\n // No subscript needed, find first 2 significant digits\n const nonZeroStart = decimal.search(/[1-9]/); // Find first non-zero digit\n\n if (nonZeroStart === -1) {\n return formattedWhole; // All zeros\n }\n const significantPart = decimal.slice(nonZeroStart);\n const twoDigits = significantPart.slice(0, decimals);\n const leadingZeros = decimal.slice(0, nonZeroStart);\n\n return `${formattedWhole}.${leadingZeros}${twoDigits}`;\n }\n};\n\nconst toSubscript = (input: string) => {\n return input.replace(/[0-9]/g, m => '₀₁₂₃₄₅₆₇₈₉'[+m]);\n};\n\nexport const formatUSD = (value: Big | string | number): string => {\n return '$' + formatAmount(value);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AQ,OAAO,IAAI;;AAG7D,MAAa,mBACX,OACA,WAAW,MACA;CAKX,MAAM,CAAC,OAAO,YAJD,OAAO,UAAU,WAAW,MAAM,QAAQ,GAAG,GAAG,OAC1D,QAAQ,eAAe,KAAK,CAC5B,QAAQ,OAAO,GAAG,CAEQ,MAAM,IAAI;CAEvC,MAAM,iBAAiB,MAAM,QAAQ,yBAAyB,IAAI;AAClE,KAAI,CAAC,QAAS,QAAO;CAErB,MAAM,mBAAmB,QAAQ,MAAM,WAAW;AAElD,KAAI,kBAAkB;EACpB,MAAM,YAAY,iBAAiB,GAAG;AAKtC,SAAO,GAAG,eAAe,IAJP,YAAY,UAAU,UAAU,CAAC,GACjC,QAAQ,MAAM,UAAU,CAEd,MAAM,GAAG,SAAS;QAEzC;EAEL,MAAM,eAAe,QAAQ,OAAO,QAAQ;AAE5C,MAAI,iBAAiB,GACnB,QAAO;EAGT,MAAM,YADkB,QAAQ,MAAM,aAAa,CACjB,MAAM,GAAG,SAAS;AAGpD,SAAO,GAAG,eAAe,GAFJ,QAAQ,MAAM,GAAG,aAAa,GAER;;;AAI/C,MAAM,eAAe,UAAkB;AACrC,QAAO,MAAM,QAAQ,WAAU,MAAK,aAAa,CAAC,GAAG;;AAGvD,MAAa,aAAa,UAAyC;AACjE,QAAO,MAAM,aAAa,MAAM"}
@@ -323,7 +323,7 @@ const lensAbi = [
323
323
  internalType: "uint8"
324
324
  },
325
325
  {
326
- name: "leftTick",
326
+ name: "startTick",
327
327
  type: "int24",
328
328
  internalType: "int24"
329
329
  },
@@ -589,7 +589,7 @@ const lensAbi = [
589
589
  internalType: "uint8"
590
590
  },
591
591
  {
592
- name: "leftTick",
592
+ name: "startTick",
593
593
  type: "int24",
594
594
  internalType: "int24"
595
595
  },
@@ -690,7 +690,7 @@ const lensAbi = [
690
690
  internalType: "uint8"
691
691
  },
692
692
  {
693
- name: "leftTick",
693
+ name: "startTick",
694
694
  type: "int24",
695
695
  internalType: "int24"
696
696
  },
@@ -891,7 +891,7 @@ const lensAbi = [
891
891
  internalType: "uint8"
892
892
  },
893
893
  {
894
- name: "leftTick",
894
+ name: "startTick",
895
895
  type: "int24",
896
896
  internalType: "int24"
897
897
  },
@@ -2839,4 +2839,4 @@ Object.defineProperty(exports, 'uniswapMathLensAbi', {
2839
2839
  return uniswapMathLensAbi;
2840
2840
  }
2841
2841
  });
2842
- //# sourceMappingURL=optionsMarket-D192aXEZ.cjs.map
2842
+ //# sourceMappingURL=optionsMarket-BpL6x4be.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionsMarket-BpL6x4be.cjs","names":[],"sources":["../src/abis/erc20.ts","../src/abis/lens.ts","../src/abis/uniswapMathLens.ts","../src/abis/optionsMarket.ts"],"sourcesContent":["export const erc20Abi = [\n {\n type: 'constructor',\n inputs: [\n {name: 'name_', type: 'string', internalType: 'string'},\n {name: 'symbol_', type: 'string', internalType: 'string'},\n ],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'allowance',\n inputs: [\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'spender', type: 'address', internalType: 'address'},\n ],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'approve',\n inputs: [\n {name: 'spender', type: 'address', internalType: 'address'},\n {name: 'amount', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: '', type: 'bool', internalType: 'bool'}],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'balanceOf',\n inputs: [{name: 'account', type: 'address', internalType: 'address'}],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'decimals',\n inputs: [],\n outputs: [{name: '', type: 'uint8', internalType: 'uint8'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'decreaseAllowance',\n inputs: [\n {name: 'spender', type: 'address', internalType: 'address'},\n {\n name: 'subtractedValue',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n outputs: [{name: '', type: 'bool', internalType: 'bool'}],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'increaseAllowance',\n inputs: [\n {name: 'spender', type: 'address', internalType: 'address'},\n {name: 'addedValue', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: '', type: 'bool', internalType: 'bool'}],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'name',\n inputs: [],\n outputs: [{name: '', type: 'string', internalType: 'string'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'symbol',\n inputs: [],\n outputs: [{name: '', type: 'string', internalType: 'string'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'totalSupply',\n inputs: [],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'transfer',\n inputs: [\n {name: 'to', type: 'address', internalType: 'address'},\n {name: 'amount', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: '', type: 'bool', internalType: 'bool'}],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'transferFrom',\n inputs: [\n {name: 'from', type: 'address', internalType: 'address'},\n {name: 'to', type: 'address', internalType: 'address'},\n {name: 'amount', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: '', type: 'bool', internalType: 'bool'}],\n stateMutability: 'nonpayable',\n },\n] as const;\n","export const lensAbi = [\n {\n type: 'function',\n name: 'batchGetRefTick',\n inputs: [\n {\n name: 'vault',\n type: 'address',\n internalType: 'contract TimelockSingleOwnerVault',\n },\n {name: 'tickLower', type: 'int24[]', internalType: 'int24[]'},\n ],\n outputs: [{name: 'refTicks', type: 'int24[]', internalType: 'int24[]'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getAllBlocks',\n inputs: [\n {\n name: 'vault',\n type: 'address',\n internalType: 'contract TimelockVaultCore',\n },\n ],\n outputs: [\n {\n name: 'blocks',\n type: 'tuple[]',\n internalType: 'struct TimelockLens.LiquidityBlockData[]',\n components: [\n {name: 'tickLower', type: 'int24', internalType: 'int24'},\n {name: 'tickUpper', type: 'int24', internalType: 'int24'},\n {\n name: 'prevTickLower',\n type: 'int24',\n internalType: 'int24',\n },\n {\n name: 'totalLiquidity',\n type: 'uint128',\n internalType: 'uint128',\n },\n {\n name: 'borrowedLiquidity',\n type: 'uint128',\n internalType: 'uint128',\n },\n {\n name: 'totalAmount0',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'totalAmount1',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'borrowedAmount0',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'borrowedAmount1',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getExpiredOptions',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n {name: 'startId', type: 'uint256', internalType: 'uint256'},\n {name: 'limit', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [\n {\n name: 'expiredOptions',\n type: 'tuple[]',\n internalType: 'struct TimelockLens.OptionData[]',\n components: [\n {\n name: 'optionId',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {name: 'startTick', type: 'int24', internalType: 'int24'},\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'entryTick', type: 'int24', internalType: 'int24'},\n {\n name: 'strikePrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'entryPrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'positionSize',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'netOptionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'expiresAt', type: 'uint64', internalType: 'uint64'},\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n },\n {name: 'nextStartId', type: 'uint256', internalType: 'uint256'},\n {name: 'hasMore', type: 'bool', internalType: 'bool'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getLiquidityAtTick',\n inputs: [\n {\n name: 'vault',\n type: 'address',\n internalType: 'contract TimelockSingleOwnerVault',\n },\n {name: 'tickLower', type: 'int24', internalType: 'int24'},\n ],\n outputs: [\n {\n name: 'totalLiquidity',\n type: 'uint128',\n internalType: 'uint128',\n },\n {\n name: 'borrowedLiquidity',\n type: 'uint128',\n internalType: 'uint128',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getMarketData',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n ],\n outputs: [\n {\n name: 'marketData',\n type: 'tuple',\n internalType: 'struct TimelockLens.TimelockMarketData',\n components: [\n {\n name: 'optionAssetIsToken0',\n type: 'bool',\n internalType: 'bool',\n },\n {\n name: 'vault',\n type: 'address',\n internalType: 'contract ITimelockVault',\n },\n {\n name: 'pool',\n type: 'address',\n internalType: 'contract IUniswapV3Pool',\n },\n {\n name: 'optionAsset',\n type: 'address',\n internalType: 'address',\n },\n {\n name: 'payoutAsset',\n type: 'address',\n internalType: 'address',\n },\n {\n name: 'optionAssetDecimals',\n type: 'uint8',\n internalType: 'uint8',\n },\n {\n name: 'payoutAssetDecimals',\n type: 'uint8',\n internalType: 'uint8',\n },\n {\n name: 'optionAssetSymbol',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'payoutAssetSymbol',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'optionAssetName',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'payoutAssetName',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'optionsCount',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getMaxPositionSize',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {\n name: 'maxBorrowableRange',\n type: 'int24',\n internalType: 'int24',\n },\n ],\n outputs: [\n {name: 'maxCallSize', type: 'uint256', internalType: 'uint256'},\n {name: 'maxPutSize', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getMaxPositionSizeAtCurrentTick',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n {\n name: 'maxBorrowableRange',\n type: 'int24',\n internalType: 'int24',\n },\n ],\n outputs: [\n {name: 'maxCallSize', type: 'uint256', internalType: 'uint256'},\n {name: 'maxPutSize', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getOptionData',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n {name: 'optionId', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [\n {\n name: '',\n type: 'tuple',\n internalType: 'struct TimelockLens.OptionData',\n components: [\n {\n name: 'optionId',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {name: 'startTick', type: 'int24', internalType: 'int24'},\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'entryTick', type: 'int24', internalType: 'int24'},\n {\n name: 'strikePrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'entryPrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'positionSize',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'netOptionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'expiresAt', type: 'uint64', internalType: 'uint64'},\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getOptionsData',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n {\n name: 'optionIds',\n type: 'uint256[]',\n internalType: 'uint256[]',\n },\n ],\n outputs: [\n {\n name: 'optionsData',\n type: 'tuple[]',\n internalType: 'struct TimelockLens.OptionData[]',\n components: [\n {\n name: 'optionId',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {name: 'startTick', type: 'int24', internalType: 'int24'},\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'entryTick', type: 'int24', internalType: 'int24'},\n {\n name: 'strikePrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'entryPrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'positionSize',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'netOptionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'expiresAt', type: 'uint64', internalType: 'uint64'},\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getPoolData',\n inputs: [\n {\n name: 'pool',\n type: 'address',\n internalType: 'contract IUniswapV3Pool',\n },\n ],\n outputs: [\n {\n name: 'poolData',\n type: 'tuple',\n internalType: 'struct TimelockLens.UniswapPoolData',\n components: [\n {name: 'token0', type: 'address', internalType: 'address'},\n {name: 'token1', type: 'address', internalType: 'address'},\n {\n name: 'token0Decimals',\n type: 'uint8',\n internalType: 'uint8',\n },\n {\n name: 'token1Decimals',\n type: 'uint8',\n internalType: 'uint8',\n },\n {\n name: 'token0Symbol',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'token1Symbol',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'token0Name',\n type: 'string',\n internalType: 'string',\n },\n {\n name: 'token1Name',\n type: 'string',\n internalType: 'string',\n },\n {name: 'tickSpacing', type: 'int24', internalType: 'int24'},\n {name: 'fee', type: 'uint24', internalType: 'uint24'},\n ],\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getRefTick',\n inputs: [\n {\n name: 'vault',\n type: 'address',\n internalType: 'contract TimelockSingleOwnerVault',\n },\n {name: 'tickLower', type: 'int24', internalType: 'int24'},\n ],\n outputs: [{name: 'refTick', type: 'int24', internalType: 'int24'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getUserOptions',\n inputs: [\n {\n name: 'market',\n type: 'address',\n internalType: 'contract TimelockOptionsMarket',\n },\n {name: 'user', type: 'address', internalType: 'address'},\n {name: 'startId', type: 'uint256', internalType: 'uint256'},\n {name: 'limit', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [\n {\n name: 'userOptions',\n type: 'tuple[]',\n internalType: 'struct TimelockLens.OptionData[]',\n components: [\n {\n name: 'optionId',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {name: 'startTick', type: 'int24', internalType: 'int24'},\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'entryTick', type: 'int24', internalType: 'int24'},\n {\n name: 'strikePrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'entryPrice',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'positionSize',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'netOptionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'expiresAt', type: 'uint64', internalType: 'uint64'},\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n },\n {name: 'nextStartId', type: 'uint256', internalType: 'uint256'},\n {name: 'hasMore', type: 'bool', internalType: 'bool'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getVaultTVL',\n inputs: [\n {\n name: 'vault',\n type: 'address',\n internalType: 'contract TimelockVaultCore',\n },\n ],\n outputs: [\n {\n name: 'totalAmount0',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'totalAmount1',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'borrowedAmount0',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'borrowedAmount1',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'tvl0', type: 'uint256', internalType: 'uint256'},\n {name: 'tvl1', type: 'uint256', internalType: 'uint256'},\n {name: 'blocksCount', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'view',\n },\n] as const;\n","export const uniswapMathLensAbi = [\n {\n type: 'function',\n name: 'batchGetAmount0ForLiquidity',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'liquidity',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n outputs: [{name: 'amounts0', type: 'uint256[]', internalType: 'uint256[]'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetAmount0ForLiquidityTicks',\n inputs: [\n {name: 'tickA', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickB', type: 'int24[]', internalType: 'int24[]'},\n {\n name: 'liquidity',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n outputs: [{name: 'amounts0', type: 'uint256[]', internalType: 'uint256[]'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetAmount1ForLiquidity',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'liquidity',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n outputs: [{name: 'amounts1', type: 'uint256[]', internalType: 'uint256[]'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetAmount1ForLiquidityTicks',\n inputs: [\n {name: 'tickA', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickB', type: 'int24[]', internalType: 'int24[]'},\n {\n name: 'liquidity',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n outputs: [{name: 'amounts1', type: 'uint256[]', internalType: 'uint256[]'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetAmountsForLiquidity',\n inputs: [\n {\n name: 'sqrtRatioX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioAX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'liquidity',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n outputs: [\n {\n name: 'amounts0',\n type: 'uint256[]',\n internalType: 'uint256[]',\n },\n {name: 'amounts1', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetAmountsForLiquidityTicks',\n inputs: [\n {name: 'tick', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickA', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickB', type: 'int24[]', internalType: 'int24[]'},\n {\n name: 'liquidity',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n outputs: [\n {\n name: 'amounts0',\n type: 'uint256[]',\n internalType: 'uint256[]',\n },\n {name: 'amounts1', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetLiquidityForAmount0',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {name: 'amount0', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n outputs: [\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetLiquidityForAmount0Ticks',\n inputs: [\n {name: 'tickA', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickB', type: 'int24[]', internalType: 'int24[]'},\n {name: 'amount0', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n outputs: [\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetLiquidityForAmount1',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {name: 'amount1', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n outputs: [\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetLiquidityForAmount1Ticks',\n inputs: [\n {name: 'tickA', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickB', type: 'int24[]', internalType: 'int24[]'},\n {name: 'amount1', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n outputs: [\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetLiquidityForAmounts',\n inputs: [\n {\n name: 'sqrtRatioX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioAX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160[]',\n internalType: 'uint160[]',\n },\n {name: 'amount0', type: 'uint256[]', internalType: 'uint256[]'},\n {name: 'amount1', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n outputs: [\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetLiquidityForAmountsTicks',\n inputs: [\n {name: 'tick', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickA', type: 'int24[]', internalType: 'int24[]'},\n {name: 'tickB', type: 'int24[]', internalType: 'int24[]'},\n {name: 'amount0', type: 'uint256[]', internalType: 'uint256[]'},\n {name: 'amount1', type: 'uint256[]', internalType: 'uint256[]'},\n ],\n outputs: [\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'batchGetPriceAtTick',\n inputs: [{name: 'ticks', type: 'int24[]', internalType: 'int24[]'}],\n outputs: [{name: 'prices', type: 'uint256[]', internalType: 'uint256[]'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getAmount0ForLiquidity',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {name: 'liquidity', type: 'uint128', internalType: 'uint128'},\n ],\n outputs: [{name: 'amount0', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getAmount0ForLiquidityTicks',\n inputs: [\n {name: 'tickA', type: 'int24', internalType: 'int24'},\n {name: 'tickB', type: 'int24', internalType: 'int24'},\n {name: 'liquidity', type: 'uint128', internalType: 'uint128'},\n ],\n outputs: [{name: 'amount0', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getAmount1ForLiquidity',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {name: 'liquidity', type: 'uint128', internalType: 'uint128'},\n ],\n outputs: [{name: 'amount1', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getAmount1ForLiquidityTicks',\n inputs: [\n {name: 'tickA', type: 'int24', internalType: 'int24'},\n {name: 'tickB', type: 'int24', internalType: 'int24'},\n {name: 'liquidity', type: 'uint128', internalType: 'uint128'},\n ],\n outputs: [{name: 'amount1', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getAmountsForLiquidity',\n inputs: [\n {\n name: 'sqrtRatioX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioAX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {name: 'liquidity', type: 'uint128', internalType: 'uint128'},\n ],\n outputs: [\n {name: 'amount0', type: 'uint256', internalType: 'uint256'},\n {name: 'amount1', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getAmountsForLiquidityTicks',\n inputs: [\n {name: 'tick', type: 'int24', internalType: 'int24'},\n {name: 'tickA', type: 'int24', internalType: 'int24'},\n {name: 'tickB', type: 'int24', internalType: 'int24'},\n {name: 'liquidity', type: 'uint128', internalType: 'uint128'},\n ],\n outputs: [\n {name: 'amount0', type: 'uint256', internalType: 'uint256'},\n {name: 'amount1', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getLiquidityForAmount0',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {name: 'amount0', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: 'liquidity', type: 'uint128', internalType: 'uint128'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getLiquidityForAmount0Ticks',\n inputs: [\n {name: 'tickA', type: 'int24', internalType: 'int24'},\n {name: 'tickB', type: 'int24', internalType: 'int24'},\n {name: 'amount0', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: 'liquidity', type: 'uint128', internalType: 'uint128'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getLiquidityForAmount1',\n inputs: [\n {\n name: 'sqrtRatioAX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {name: 'amount1', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: 'liquidity', type: 'uint128', internalType: 'uint128'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getLiquidityForAmount1Ticks',\n inputs: [\n {name: 'tickA', type: 'int24', internalType: 'int24'},\n {name: 'tickB', type: 'int24', internalType: 'int24'},\n {name: 'amount1', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: 'liquidity', type: 'uint128', internalType: 'uint128'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getLiquidityForAmounts',\n inputs: [\n {\n name: 'sqrtRatioX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioAX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {\n name: 'sqrtRatioBX96',\n type: 'uint160',\n internalType: 'uint160',\n },\n {name: 'amount0', type: 'uint256', internalType: 'uint256'},\n {name: 'amount1', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: 'liquidity', type: 'uint128', internalType: 'uint128'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getLiquidityForAmountsTicks',\n inputs: [\n {name: 'tick', type: 'int24', internalType: 'int24'},\n {name: 'tickA', type: 'int24', internalType: 'int24'},\n {name: 'tickB', type: 'int24', internalType: 'int24'},\n {name: 'amount0', type: 'uint256', internalType: 'uint256'},\n {name: 'amount1', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [{name: 'liquidity', type: 'uint128', internalType: 'uint128'}],\n stateMutability: 'pure',\n },\n {\n type: 'function',\n name: 'getPriceAtTick',\n inputs: [{name: 'tick', type: 'int24', internalType: 'int24'}],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'pure',\n },\n] as const;\n","export const optionsMarketAbi = [\n {\n type: 'constructor',\n inputs: [\n {\n name: '_vault',\n type: 'address',\n internalType: 'contract ITimelockVault',\n },\n {\n name: '_optionPricing',\n type: 'address',\n internalType: 'contract IOptionPricing',\n },\n {\n name: '_feeStrategy',\n type: 'address',\n internalType: 'contract IFeeStrategy',\n },\n {\n name: '_feeRecipient',\n type: 'address',\n internalType: 'address',\n },\n {\n name: '_guardian',\n type: 'address',\n internalType: 'contract TimelockGuardian',\n },\n {\n name: '_optionAssetIsToken0',\n type: 'bool',\n internalType: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'DUST_THRESHOLD',\n inputs: [],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'MAX_STEPS',\n inputs: [],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'calculatePremium',\n inputs: [\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {\n name: 'optionAmount',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'addedDuration', type: 'uint32', internalType: 'uint32'},\n {\n name: 'remainingDuration',\n type: 'uint32',\n internalType: 'uint32',\n },\n ],\n outputs: [\n {name: 'premium', type: 'uint256', internalType: 'uint256'},\n {name: 'protocolFee', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'emergencyWithdraw',\n inputs: [\n {\n name: 'tokens',\n type: 'address[]',\n internalType: 'contract IERC20[]',\n },\n ],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'exerciseOption',\n inputs: [\n {name: 'optionId', type: 'uint256', internalType: 'uint256'},\n {\n name: 'liquidities',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n {name: 'minPayout', type: 'uint256', internalType: 'uint256'},\n {\n name: 'swapper',\n type: 'address',\n internalType: 'contract ISwapper',\n },\n {name: 'swapperData', type: 'bytes', internalType: 'bytes'},\n {name: 'refTick', type: 'int24', internalType: 'int24'},\n ],\n outputs: [{name: 'payout', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'extendOption',\n inputs: [\n {name: 'optionId', type: 'uint256', internalType: 'uint256'},\n {name: 'addedDuration', type: 'uint32', internalType: 'uint32'},\n {name: 'maxPremium', type: 'uint256', internalType: 'uint256'},\n ],\n outputs: [\n {name: 'premium', type: 'uint256', internalType: 'uint256'},\n {name: 'protocolFee', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'feeRecipient',\n inputs: [],\n outputs: [{name: '', type: 'address', internalType: 'address'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'feeStrategy',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'address',\n internalType: 'contract IFeeStrategy',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getOption',\n inputs: [{name: 'optionId', type: 'uint256', internalType: 'uint256'}],\n outputs: [\n {\n name: '',\n type: 'tuple',\n internalType: 'struct TimelockOptionsMarket.OptionData',\n components: [\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'entryTick', type: 'int24', internalType: 'int24'},\n {name: 'expiresAt', type: 'uint32', internalType: 'uint32'},\n ],\n },\n {name: '', type: 'uint128[]', internalType: 'uint128[]'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'guardian',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'address',\n internalType: 'contract TimelockGuardian',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'liquiditiesToAmounts',\n inputs: [\n {name: 'startTick', type: 'int24', internalType: 'int24'},\n {\n name: 'liquiditys',\n type: 'uint128[]',\n internalType: 'uint128[]',\n },\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n ],\n outputs: [\n {\n name: 'optionAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetToRepay',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'optionAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {\n name: 'payoutAssetBorrowed',\n type: 'uint256',\n internalType: 'uint256',\n },\n {name: 'currentTick', type: 'int24', internalType: 'int24'},\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'mintOption',\n inputs: [\n {name: 'owner', type: 'address', internalType: 'address'},\n {name: 'optionType', type: 'uint8', internalType: 'uint8'},\n {name: 'amount', type: 'uint256', internalType: 'uint256'},\n {name: 'strikeTick', type: 'int24', internalType: 'int24'},\n {name: 'duration', type: 'uint32', internalType: 'uint32'},\n {name: 'maxPremium', type: 'uint256', internalType: 'uint256'},\n {name: 'refTick', type: 'int24', internalType: 'int24'},\n ],\n outputs: [\n {name: 'optionId', type: 'uint256', internalType: 'uint256'},\n {name: 'finalAmount', type: 'uint256', internalType: 'uint256'},\n {name: 'premium', type: 'uint256', internalType: 'uint256'},\n {name: 'protocolFee', type: 'uint256', internalType: 'uint256'},\n ],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'multicall',\n inputs: [{name: 'data', type: 'bytes[]', internalType: 'bytes[]'}],\n outputs: [{name: 'results', type: 'bytes[]', internalType: 'bytes[]'}],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'nextOptionId',\n inputs: [],\n outputs: [{name: '', type: 'uint256', internalType: 'uint256'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'operatorPerms',\n inputs: [\n {name: '', type: 'address', internalType: 'address'},\n {name: '', type: 'address', internalType: 'address'},\n ],\n outputs: [\n {name: 'canExtend', type: 'bool', internalType: 'bool'},\n {name: 'canExercise', type: 'bool', internalType: 'bool'},\n {name: 'canTransfer', type: 'bool', internalType: 'bool'},\n {name: 'canMint', type: 'bool', internalType: 'bool'},\n {\n name: 'spendingApproval',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'optionAsset',\n inputs: [],\n outputs: [{name: '', type: 'address', internalType: 'contract IERC20'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'optionAssetIsToken0',\n inputs: [],\n outputs: [{name: '', type: 'bool', internalType: 'bool'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'optionPricing',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'address',\n internalType: 'contract IOptionPricing',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'owner',\n inputs: [],\n outputs: [{name: '', type: 'address', internalType: 'address'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'payoutAsset',\n inputs: [],\n outputs: [{name: '', type: 'address', internalType: 'contract IERC20'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'pool',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'address',\n internalType: 'contract IUniswapV3Pool',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'renounceOwnership',\n inputs: [],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'setOperatorPerms',\n inputs: [\n {name: 'operator', type: 'address', internalType: 'address'},\n {name: 'canExtend', type: 'bool', internalType: 'bool'},\n {name: 'canExercise', type: 'bool', internalType: 'bool'},\n {name: 'canTransfer', type: 'bool', internalType: 'bool'},\n {name: 'canMint', type: 'bool', internalType: 'bool'},\n {\n name: 'spendingApproval',\n type: 'uint256',\n internalType: 'uint256',\n },\n ],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'tickSpacing',\n inputs: [],\n outputs: [{name: '', type: 'int24', internalType: 'int24'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'token0',\n inputs: [],\n outputs: [{name: '', type: 'address', internalType: 'contract IERC20'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'token1',\n inputs: [],\n outputs: [{name: '', type: 'address', internalType: 'contract IERC20'}],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'transferOption',\n inputs: [\n {name: 'optionId', type: 'uint256', internalType: 'uint256'},\n {name: 'to', type: 'address', internalType: 'address'},\n ],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'transferOwnership',\n inputs: [{name: 'newOwner', type: 'address', internalType: 'address'}],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'updateAddresses',\n inputs: [\n {\n name: '_optionPricing',\n type: 'address',\n internalType: 'contract IOptionPricing',\n },\n {\n name: '_feeStrategy',\n type: 'address',\n internalType: 'contract IFeeStrategy',\n },\n {\n name: '_feeRecipient',\n type: 'address',\n internalType: 'address',\n },\n ],\n outputs: [],\n stateMutability: 'nonpayable',\n },\n {\n type: 'function',\n name: 'vault',\n inputs: [],\n outputs: [\n {\n name: '',\n type: 'address',\n internalType: 'contract ITimelockVault',\n },\n ],\n stateMutability: 'view',\n },\n {\n type: 'event',\n name: 'AddressesUpdated',\n inputs: [\n {\n name: 'optionPricing',\n type: 'address',\n indexed: false,\n internalType: 'contract IOptionPricing',\n },\n {\n name: 'feeStrategy',\n type: 'address',\n indexed: false,\n internalType: 'contract IFeeStrategy',\n },\n {\n name: 'feeRecipient',\n type: 'address',\n indexed: false,\n internalType: 'address',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'EmergencyWithdraw',\n inputs: [\n {\n name: 'tokens',\n type: 'address[]',\n indexed: false,\n internalType: 'contract IERC20[]',\n },\n {\n name: 'balances',\n type: 'uint256[]',\n indexed: false,\n internalType: 'uint256[]',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'ExerciseOption',\n inputs: [\n {\n name: 'optionId',\n type: 'uint256',\n indexed: true,\n internalType: 'uint256',\n },\n {\n name: 'liquidities',\n type: 'uint128[]',\n indexed: false,\n internalType: 'uint128[]',\n },\n {\n name: 'currentTick',\n type: 'int24',\n indexed: false,\n internalType: 'int24',\n },\n {\n name: 'payout',\n type: 'uint256',\n indexed: false,\n internalType: 'uint256',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'ExtendOption',\n inputs: [\n {\n name: 'optionId',\n type: 'uint256',\n indexed: true,\n internalType: 'uint256',\n },\n {\n name: 'premium',\n type: 'uint256',\n indexed: false,\n internalType: 'uint256',\n },\n {\n name: 'protocolFee',\n type: 'uint256',\n indexed: false,\n internalType: 'uint256',\n },\n {\n name: 'currentTick',\n type: 'int24',\n indexed: false,\n internalType: 'int24',\n },\n {\n name: 'addedDuration',\n type: 'uint32',\n indexed: false,\n internalType: 'uint32',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'MintOption',\n inputs: [\n {\n name: 'optionId',\n type: 'uint256',\n indexed: true,\n internalType: 'uint256',\n },\n {\n name: 'owner',\n type: 'address',\n indexed: true,\n internalType: 'address',\n },\n {\n name: 'optionType',\n type: 'uint8',\n indexed: false,\n internalType: 'uint8',\n },\n {\n name: 'strikeTick',\n type: 'int24',\n indexed: false,\n internalType: 'int24',\n },\n {\n name: 'currentTick',\n type: 'int24',\n indexed: false,\n internalType: 'int24',\n },\n {\n name: 'expiresAt',\n type: 'uint32',\n indexed: false,\n internalType: 'uint32',\n },\n {\n name: 'premium',\n type: 'uint256',\n indexed: false,\n internalType: 'uint256',\n },\n {\n name: 'protocolFee',\n type: 'uint256',\n indexed: false,\n internalType: 'uint256',\n },\n {\n name: 'liquidities',\n type: 'uint128[]',\n indexed: false,\n internalType: 'uint128[]',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'OwnershipTransferred',\n inputs: [\n {\n name: 'previousOwner',\n type: 'address',\n indexed: true,\n internalType: 'address',\n },\n {\n name: 'newOwner',\n type: 'address',\n indexed: true,\n internalType: 'address',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'TransferOption',\n inputs: [\n {\n name: 'optionId',\n type: 'uint256',\n indexed: true,\n internalType: 'uint256',\n },\n {\n name: 'to',\n type: 'address',\n indexed: true,\n internalType: 'address',\n },\n ],\n anonymous: false,\n },\n {\n type: 'event',\n name: 'UpdateOperatorPerms',\n inputs: [\n {\n name: 'owner',\n type: 'address',\n indexed: true,\n internalType: 'address',\n },\n {\n name: 'operator',\n type: 'address',\n indexed: true,\n internalType: 'address',\n },\n {\n name: 'canExtend',\n type: 'bool',\n indexed: false,\n internalType: 'bool',\n },\n {\n name: 'canExercise',\n type: 'bool',\n indexed: false,\n internalType: 'bool',\n },\n {\n name: 'canTransfer',\n type: 'bool',\n indexed: false,\n internalType: 'bool',\n },\n {\n name: 'canMint',\n type: 'bool',\n indexed: false,\n internalType: 'bool',\n },\n {\n name: 'spendingApproval',\n type: 'uint256',\n indexed: false,\n internalType: 'uint256',\n },\n ],\n anonymous: false,\n },\n {\n type: 'error',\n name: 'AddressEmptyCode',\n inputs: [{name: 'target', type: 'address', internalType: 'address'}],\n },\n {type: 'error', name: 'FailedCall', inputs: []},\n {type: 'error', name: 'InsufficientLiquidity', inputs: []},\n {type: 'error', name: 'InvalidAmount', inputs: []},\n {type: 'error', name: 'InvalidArrayLength', inputs: []},\n {type: 'error', name: 'InvalidDuration', inputs: []},\n {type: 'error', name: 'InvalidOptionType', inputs: []},\n {\n type: 'error',\n name: 'InvalidTickRange',\n inputs: [\n {name: 'tickLower', type: 'int24', internalType: 'int24'},\n {name: 'tickUpper', type: 'int24', internalType: 'int24'},\n ],\n },\n {type: 'error', name: 'NotAuthorized', inputs: []},\n {type: 'error', name: 'NotEnoughPayout', inputs: []},\n {type: 'error', name: 'OperatorBlacklisted', inputs: []},\n {type: 'error', name: 'OptionExpired', inputs: []},\n {type: 'error', name: 'OptionNotFound', inputs: []},\n {\n type: 'error',\n name: 'OwnableInvalidOwner',\n inputs: [{name: 'owner', type: 'address', internalType: 'address'}],\n },\n {\n type: 'error',\n name: 'OwnableUnauthorizedAccount',\n inputs: [{name: 'account', type: 'address', internalType: 'address'}],\n },\n {type: 'error', name: 'PremiumTooHigh', inputs: []},\n {type: 'error', name: 'ReentrancyGuardReentrantCall', inputs: []},\n {\n type: 'error',\n name: 'SafeERC20FailedOperation',\n inputs: [{name: 'token', type: 'address', internalType: 'address'}],\n },\n {type: 'error', name: 'SwapFailed', inputs: []},\n {type: 'error', name: 'TradingPaused', inputs: []},\n {type: 'error', name: 'WithdrawNotAllowed', inputs: []},\n {type: 'error', name: 'ZeroAddress', inputs: []},\n] as const;\n"],"mappings":";;AAAA,MAAa,WAAW;CACtB;EACE,MAAM;EACN,QAAQ,CACN;GAAC,MAAM;GAAS,MAAM;GAAU,cAAc;GAAS,EACvD;GAAC,MAAM;GAAW,MAAM;GAAU,cAAc;GAAS,CAC1D;EACD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GAAC,MAAM;GAAS,MAAM;GAAW,cAAc;GAAU,EACzD;GAAC,MAAM;GAAW,MAAM;GAAW,cAAc;GAAU,CAC5D;EACD,SAAS,CAAC;GAAC,MAAM;GAAI,MAAM;GAAW,cAAc;GAAU,CAAC;EAC/D,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GAAC,MAAM;GAAW,MAAM;GAAW,cAAc;GAAU,EAC3D;GAAC,MAAM;GAAU,MAAM;GAAW,cAAc;GAAU,CAC3D;EACD,SAAS,CAAC;GAAC,MAAM;GAAI,MAAM;GAAQ,cAAc;GAAO,CAAC;EACzD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CAAC;GAAC,MAAM;GAAW,MAAM;GAAW,cAAc;GAAU,CAAC;EACrE,SAAS,CAAC;GAAC,MAAM;GAAI,MAAM;GAAW,cAAc;GAAU,CAAC;EAC/D,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,EAAE;EACV,SAAS,CAAC;GAAC,MAAM;GAAI,MAAM;GAAS,cAAc;GAAQ,CAAC;EAC3D,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GAAC,MAAM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KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACF;GACF,CACF;EACD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ;GACN;IACE,MAAM;IACN,MAAM;IACN,cAAc;IACf;GACD;IAAC,MAAM;IAAc,MAAM;IAAS,cAAc;IAAQ;GAC1D;IACE,MAAM;IACN,MAAM;IACN,cAAc;IACf;GACF;EACD,SAAS,CACP;GAAC,MAAM;GAAe,MAAM;GAAW,cAAc;GAAU,EAC/D;GAAC,MAAM;GAAc,MAAM;GAAW,cAAc;GAAU,CAC/D;EACD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACf,EACD;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACf,CACF;EACD,SAAS,CACP;GAAC,MAAM;GAAe,MAAM;GAAW,cAAc;GAAU,EAC/D;GAAC,MAAM;GAAc,MAAM;GAAW,cAAc;GAAU,CAC/D;EACD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACf,EACD;GAAC,MAAM;GAAY,MAAM;GAAW,cAAc;GAAU,CAC7D;EACD,SAAS,CACP;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACd,YAAY;IACV;KACE,MAAM;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,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KAAC,MAAM;KAAa,MAAM;KAAU,cAAc;KAAS;IAC3D;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACF;GACF,CACF;EACD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACf,CACF;EACD,SAAS,CACP;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACd,YAAY;IACV;KAAC,MAAM;KAAU,MAAM;KAAW,cAAc;KAAU;IAC1D;KAAC,MAAM;KAAU,MAAM;KAAW,cAAc;KAAU;IAC1D;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KACE,MAAM;KACN,MAAM;KACN,cAAc;KACf;IACD;KAAC,MAAM;KAAe,MAAM;KAAS,cAAc;KAAQ;IAC3D;KAAC,MAAM;KAAO,MAAM;KAAU,cAAc;KAAS;IACtD;GACF,CACF;EACD,iBAAiB;EAClB;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GACE,MAAM;GACN,MAAM;GACN,cAAc;GACf,EACD;GAAC,MAAM;GAAa,MAAM;GAAS,cAAc;GAAQ,CAC1D;EACD,SAAS,CAAC;GAAC,MA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;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACF;EACD,WAAW;EACZ;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ,CACN;GACE,MAAM;GACN,MAAM;GACN,SAAS;GACT,cAAc;GACf,EACD;GACE,MAAM;GACN,MAAM;GACN,SAAS;GACT,cAAc;GACf,CACF;EACD,WAAW;EACZ;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ;GACN;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACF;EACD,WAAW;EACZ;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ;GACN;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACF;EACD,WAAW;EACZ;CACD;EACE,MAAM;EACN,MAAM;EACN,QAAQ;GACN;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,MAAM;IACN,SAAS;IACT,cAAc;IACf;GACD;IACE,MAAM;IACN,M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
322
  internalType: "uint8"
323
323
  },
324
324
  {
325
- name: "leftTick",
325
+ name: "startTick",
326
326
  type: "int24",
327
327
  internalType: "int24"
328
328
  },
@@ -588,7 +588,7 @@ const lensAbi = [
588
588
  internalType: "uint8"
589
589
  },
590
590
  {
591
- name: "leftTick",
591
+ name: "startTick",
592
592
  type: "int24",
593
593
  internalType: "int24"
594
594
  },
@@ -689,7 +689,7 @@ const lensAbi = [
689
689
  internalType: "uint8"
690
690
  },
691
691
  {
692
- name: "leftTick",
692
+ name: "startTick",
693
693
  type: "int24",
694
694
  internalType: "int24"
695
695
  },
@@ -890,7 +890,7 @@ const lensAbi = [
890
890
  internalType: "uint8"
891
891
  },
892
892
  {
893
- name: "leftTick",
893
+ name: "startTick",
894
894
  type: "int24",
895
895
  internalType: "int24"
896
896
  },
@@ -2815,4 +2815,4 @@ const optionsMarketAbi = [
2815
2815
 
2816
2816
  //#endregion
2817
2817
  export { erc20Abi as i, uniswapMathLensAbi as n, lensAbi as r, optionsMarketAbi as t };
2818
- //# sourceMappingURL=optionsMarket-DD4CWMqv.js.map
2818
+ //# sourceMappingURL=optionsMarket-GbBWALCn.js.map