timelock-sdk 0.0.50 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abis.cjs +1 -1
- package/dist/abis.d.cts +1 -1
- package/dist/abis.d.ts +1 -1
- package/dist/abis.js +1 -1
- package/dist/client.cjs +12 -6
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +173 -573
- package/dist/client.d.ts +173 -573
- package/dist/client.js +12 -6
- package/dist/client.js.map +1 -1
- package/dist/{index-Bg4UAy7Y.d.cts → index-D_lnxPOC.d.ts} +2 -458
- package/dist/{index-DFXuUhcW.d.ts → index-HQTA4ETi.d.cts} +2 -458
- package/dist/{numberUtils-BKQtAolx.cjs → numberUtils-CkwkoxOr.cjs} +3 -3
- package/dist/{numberUtils-BKQtAolx.cjs.map → numberUtils-CkwkoxOr.cjs.map} +1 -1
- package/dist/{numberUtils-Dk0TuHnT.js → numberUtils-Cznv1Tfa.js} +3 -3
- package/dist/{numberUtils-Dk0TuHnT.js.map → numberUtils-Cznv1Tfa.js.map} +1 -1
- package/dist/{optionsMarket-CvArD6d_.js → optionsMarket-BDBU1gUS.js} +1 -41
- package/dist/optionsMarket-BDBU1gUS.js.map +1 -0
- package/dist/{optionsMarket-PBduSBXF.cjs → optionsMarket-DEFMUI2G.cjs} +1 -41
- package/dist/optionsMarket-DEFMUI2G.cjs.map +1 -0
- package/dist/package.cjs +2 -2
- package/dist/package.d.cts +2 -2
- package/dist/package.d.ts +2 -2
- package/dist/package.js +2 -2
- package/dist/{uniswapMathLens-uDGUc-kg.d.ts → uniswapMathLens-BQ_ArpKd.d.cts} +1 -33
- package/dist/{uniswapMathLens-BiaRFVeY.d.cts → uniswapMathLens-DCuaXAGZ.d.ts} +1 -33
- package/package.json +1 -1
- package/dist/optionsMarket-CvArD6d_.js.map +0 -1
- package/dist/optionsMarket-PBduSBXF.cjs.map +0 -1
package/dist/abis.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_optionsMarket = require('./optionsMarket-
|
|
1
|
+
const require_optionsMarket = require('./optionsMarket-DEFMUI2G.cjs');
|
|
2
2
|
const require_singleOwnerVault = require('./singleOwnerVault-gf2zNZVk.cjs');
|
|
3
3
|
|
|
4
4
|
exports.erc20Abi = require_optionsMarket.erc20Abi;
|
package/dist/abis.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as optionsMarketAbi, r as lensAbi, t as uniswapMathLensAbi } from "./uniswapMathLens-
|
|
1
|
+
import { n as optionsMarketAbi, r as lensAbi, t as uniswapMathLensAbi } from "./uniswapMathLens-BQ_ArpKd.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/abis/erc20.d.ts
|
|
4
4
|
declare const erc20Abi: readonly [{
|
package/dist/abis.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as optionsMarketAbi, r as lensAbi, t as uniswapMathLensAbi } from "./uniswapMathLens-
|
|
1
|
+
import { n as optionsMarketAbi, r as lensAbi, t as uniswapMathLensAbi } from "./uniswapMathLens-DCuaXAGZ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/abis/erc20.d.ts
|
|
4
4
|
declare const erc20Abi: readonly [{
|
package/dist/abis.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as erc20Abi, n as uniswapMathLensAbi, r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-
|
|
1
|
+
import { i as erc20Abi, n as uniswapMathLensAbi, r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-BDBU1gUS.js";
|
|
2
2
|
import { n as uniswapV3PoolAbi, t as singleOwnerVaultAbi } from "./singleOwnerVault-BeJChjfJ.js";
|
|
3
3
|
|
|
4
4
|
export { erc20Abi, lensAbi, optionsMarketAbi, singleOwnerVaultAbi, uniswapMathLensAbi, uniswapV3PoolAbi };
|
package/dist/client.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
const require_numberUtils = require('./numberUtils-
|
|
5
|
-
const require_optionsMarket = require('./optionsMarket-
|
|
4
|
+
const require_numberUtils = require('./numberUtils-CkwkoxOr.cjs');
|
|
5
|
+
const require_optionsMarket = require('./optionsMarket-DEFMUI2G.cjs');
|
|
6
6
|
const require_singleOwnerVault = require('./singleOwnerVault-gf2zNZVk.cjs');
|
|
7
7
|
let viem = require("viem");
|
|
8
8
|
viem = require_numberUtils.__toESM(viem);
|
|
@@ -43,7 +43,8 @@ const GetActiveUserOptionsDocument = graphql_tag.default`
|
|
|
43
43
|
entryPrice
|
|
44
44
|
expiresAt
|
|
45
45
|
createdAt
|
|
46
|
-
|
|
46
|
+
premium
|
|
47
|
+
protocolFee
|
|
47
48
|
realizedPayout
|
|
48
49
|
marketAddr
|
|
49
50
|
liquiditiesAtOpen
|
|
@@ -77,7 +78,8 @@ const GetClosedUserOptionsDocument = graphql_tag.default`
|
|
|
77
78
|
entryPrice
|
|
78
79
|
expiresAt
|
|
79
80
|
createdAt
|
|
80
|
-
|
|
81
|
+
premium
|
|
82
|
+
protocolFee
|
|
81
83
|
realizedPayout
|
|
82
84
|
marketAddr
|
|
83
85
|
liquiditiesAtOpen
|
|
@@ -355,7 +357,10 @@ const useMintOption = (marketAddr) => {
|
|
|
355
357
|
};
|
|
356
358
|
const mintOption = async (optionType, amount, duration, strikeTick) => {
|
|
357
359
|
if (!client) throw new Error("Wallet not connected");
|
|
358
|
-
if (!
|
|
360
|
+
if (!marketAddr) throw new Error("Market address not available");
|
|
361
|
+
if (!timelockLens) throw new Error("Timelock lens not available");
|
|
362
|
+
if (!vault) throw new Error("Vault not available");
|
|
363
|
+
if (currentTick === void 0 || !tickSpacing) throw new Error("Pool data not available");
|
|
359
364
|
strikeTick = require_numberUtils.roundTickDown(strikeTick ?? currentTick, tickSpacing);
|
|
360
365
|
if (optionType === "CALL" && optionAssetIsToken0 || optionType === "PUT" && !optionAssetIsToken0) strikeTick += tickSpacing;
|
|
361
366
|
const [premium, protocolFee] = await require_numberUtils.getTimelockMarket(marketAddr, client).read.calculatePremium([
|
|
@@ -491,7 +496,8 @@ const useUserOptions = (user, active = false) => {
|
|
|
491
496
|
optionType: option.optionType,
|
|
492
497
|
createdAt: /* @__PURE__ */ new Date(Number(option.createdAt) * 1e3),
|
|
493
498
|
expiresAt: /* @__PURE__ */ new Date(Number(option.expiresAt) * 1e3),
|
|
494
|
-
|
|
499
|
+
premium: BigInt(option.premium),
|
|
500
|
+
protocolFee: BigInt(option.protocolFee),
|
|
495
501
|
realizedPayout: BigInt(option.realizedPayout),
|
|
496
502
|
liquiditiesAtOpen: option.liquiditiesAtOpen.map((l) => BigInt(l)),
|
|
497
503
|
liquiditiesCurrent: option.liquiditiesCurrent.map((l) => BigInt(l)),
|