timelock-sdk 0.0.48 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.cts CHANGED
@@ -2292,10 +2292,14 @@ declare const useOptionPnl: (option: OptionData) => {
2292
2292
  //#endregion
2293
2293
  //#region src/hooks/market/useOptionPremium.d.ts
2294
2294
  declare const useOptionPremium: (marketAddr: Address | undefined, optionType: "CALL" | "PUT", optionAmount: bigint, duration: number, strikeTick?: number) => {
2295
+ premium?: undefined;
2296
+ protocolFee?: undefined;
2297
+ totalPremium?: undefined;
2298
+ } | {
2295
2299
  premium: Amount;
2296
2300
  protocolFee: Amount;
2297
2301
  totalPremium: Amount;
2298
- } | undefined;
2302
+ };
2299
2303
  //#endregion
2300
2304
  //#region src/hooks/pool/useCurrentPrice.d.ts
2301
2305
  declare const useCurrentPrice: (poolAddr?: Address) => {
package/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./uniswapMathLens-uDGUc-kg.js";
2
- import { D as TimelockMarketData, O as UniswapMathLens, d as Amount } from "./index-DiDvh-kv.js";
3
- import * as viem0 from "viem";
2
+ import { D as TimelockMarketData, O as UniswapMathLens, d as Amount } from "./index-DFXuUhcW.js";
3
+ import * as viem249 from "viem";
4
4
  import { Address } from "viem";
5
5
  import React, { ReactNode } from "react";
6
6
  import { GraphQLClient, RequestOptions } from "graphql-request";
@@ -2292,10 +2292,14 @@ declare const useOptionPnl: (option: OptionData) => {
2292
2292
  //#endregion
2293
2293
  //#region src/hooks/market/useOptionPremium.d.ts
2294
2294
  declare const useOptionPremium: (marketAddr: Address | undefined, optionType: "CALL" | "PUT", optionAmount: bigint, duration: number, strikeTick?: number) => {
2295
+ premium?: undefined;
2296
+ protocolFee?: undefined;
2297
+ totalPremium?: undefined;
2298
+ } | {
2295
2299
  premium: Amount;
2296
2300
  protocolFee: Amount;
2297
2301
  totalPremium: Amount;
2298
- } | undefined;
2302
+ };
2299
2303
  //#endregion
2300
2304
  //#region src/hooks/pool/useCurrentPrice.d.ts
2301
2305
  declare const useCurrentPrice: (poolAddr?: Address) => {
@@ -2361,7 +2365,7 @@ declare const useBurnLiquidity: (vaultAddr?: Address) => {
2361
2365
  //#region src/hooks/vault/useLiquidityBlocks.d.ts
2362
2366
  type LiquidityBlockData = ReturnType<typeof useLiquidityBlocks>['data'][0];
2363
2367
  declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2364
- error: viem0.ReadContractErrorType;
2368
+ error: viem249.ReadContractErrorType;
2365
2369
  isError: true;
2366
2370
  isPending: false;
2367
2371
  isLoading: false;
@@ -2373,7 +2377,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2373
2377
  dataUpdatedAt: number;
2374
2378
  errorUpdatedAt: number;
2375
2379
  failureCount: number;
2376
- failureReason: viem0.ReadContractErrorType | null;
2380
+ failureReason: viem249.ReadContractErrorType | null;
2377
2381
  errorUpdateCount: number;
2378
2382
  isFetched: boolean;
2379
2383
  isFetchedAfterMount: boolean;
@@ -2393,7 +2397,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2393
2397
  totalAmount1: bigint;
2394
2398
  borrowedAmount0: bigint;
2395
2399
  borrowedAmount1: bigint;
2396
- }[], viem0.ReadContractErrorType>>;
2400
+ }[], viem249.ReadContractErrorType>>;
2397
2401
  fetchStatus: _tanstack_query_core0.FetchStatus;
2398
2402
  promise: Promise<readonly {
2399
2403
  tickLower: number;
@@ -2431,7 +2435,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2431
2435
  dataUpdatedAt: number;
2432
2436
  errorUpdatedAt: number;
2433
2437
  failureCount: number;
2434
- failureReason: viem0.ReadContractErrorType | null;
2438
+ failureReason: viem249.ReadContractErrorType | null;
2435
2439
  errorUpdateCount: number;
2436
2440
  isFetched: boolean;
2437
2441
  isFetchedAfterMount: boolean;
@@ -2451,7 +2455,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2451
2455
  totalAmount1: bigint;
2452
2456
  borrowedAmount0: bigint;
2453
2457
  borrowedAmount1: bigint;
2454
- }[], viem0.ReadContractErrorType>>;
2458
+ }[], viem249.ReadContractErrorType>>;
2455
2459
  fetchStatus: _tanstack_query_core0.FetchStatus;
2456
2460
  promise: Promise<readonly {
2457
2461
  tickLower: number;
@@ -2477,7 +2481,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2477
2481
  borrowedAmount1: bigint;
2478
2482
  }[];
2479
2483
  } | {
2480
- error: viem0.ReadContractErrorType;
2484
+ error: viem249.ReadContractErrorType;
2481
2485
  isError: true;
2482
2486
  isPending: false;
2483
2487
  isLoading: false;
@@ -2489,7 +2493,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2489
2493
  dataUpdatedAt: number;
2490
2494
  errorUpdatedAt: number;
2491
2495
  failureCount: number;
2492
- failureReason: viem0.ReadContractErrorType | null;
2496
+ failureReason: viem249.ReadContractErrorType | null;
2493
2497
  errorUpdateCount: number;
2494
2498
  isFetched: boolean;
2495
2499
  isFetchedAfterMount: boolean;
@@ -2509,7 +2513,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2509
2513
  totalAmount1: bigint;
2510
2514
  borrowedAmount0: bigint;
2511
2515
  borrowedAmount1: bigint;
2512
- }[], viem0.ReadContractErrorType>>;
2516
+ }[], viem249.ReadContractErrorType>>;
2513
2517
  fetchStatus: _tanstack_query_core0.FetchStatus;
2514
2518
  promise: Promise<readonly {
2515
2519
  tickLower: number;
@@ -2547,7 +2551,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2547
2551
  dataUpdatedAt: number;
2548
2552
  errorUpdatedAt: number;
2549
2553
  failureCount: number;
2550
- failureReason: viem0.ReadContractErrorType | null;
2554
+ failureReason: viem249.ReadContractErrorType | null;
2551
2555
  errorUpdateCount: number;
2552
2556
  isFetched: boolean;
2553
2557
  isFetchedAfterMount: boolean;
@@ -2567,7 +2571,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2567
2571
  totalAmount1: bigint;
2568
2572
  borrowedAmount0: bigint;
2569
2573
  borrowedAmount1: bigint;
2570
- }[], viem0.ReadContractErrorType>>;
2574
+ }[], viem249.ReadContractErrorType>>;
2571
2575
  fetchStatus: _tanstack_query_core0.FetchStatus;
2572
2576
  promise: Promise<readonly {
2573
2577
  tickLower: number;
@@ -2604,7 +2608,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2604
2608
  dataUpdatedAt: number;
2605
2609
  errorUpdatedAt: number;
2606
2610
  failureCount: number;
2607
- failureReason: viem0.ReadContractErrorType | null;
2611
+ failureReason: viem249.ReadContractErrorType | null;
2608
2612
  errorUpdateCount: number;
2609
2613
  isFetched: boolean;
2610
2614
  isFetchedAfterMount: boolean;
@@ -2625,7 +2629,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2625
2629
  totalAmount1: bigint;
2626
2630
  borrowedAmount0: bigint;
2627
2631
  borrowedAmount1: bigint;
2628
- }[], viem0.ReadContractErrorType>>;
2632
+ }[], viem249.ReadContractErrorType>>;
2629
2633
  fetchStatus: _tanstack_query_core0.FetchStatus;
2630
2634
  promise: Promise<readonly {
2631
2635
  tickLower: number;
@@ -2663,7 +2667,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2663
2667
  dataUpdatedAt: number;
2664
2668
  errorUpdatedAt: number;
2665
2669
  failureCount: number;
2666
- failureReason: viem0.ReadContractErrorType | null;
2670
+ failureReason: viem249.ReadContractErrorType | null;
2667
2671
  errorUpdateCount: number;
2668
2672
  isFetched: boolean;
2669
2673
  isFetchedAfterMount: boolean;
@@ -2683,7 +2687,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2683
2687
  totalAmount1: bigint;
2684
2688
  borrowedAmount0: bigint;
2685
2689
  borrowedAmount1: bigint;
2686
- }[], viem0.ReadContractErrorType>>;
2690
+ }[], viem249.ReadContractErrorType>>;
2687
2691
  fetchStatus: _tanstack_query_core0.FetchStatus;
2688
2692
  promise: Promise<readonly {
2689
2693
  tickLower: number;
@@ -2756,14 +2760,14 @@ declare const useVaultTVL: (vaultAddr?: Address) => {
2756
2760
  borrowedAmount0: Amount;
2757
2761
  borrowedAmount1: Amount;
2758
2762
  blocksCount: bigint;
2759
- refetch: (options?: _tanstack_query_core0.RefetchOptions) => Promise<_tanstack_query_core0.QueryObserverResult<readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint], viem0.ReadContractErrorType>>;
2763
+ refetch: (options?: _tanstack_query_core0.RefetchOptions) => Promise<_tanstack_query_core0.QueryObserverResult<readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint], viem249.ReadContractErrorType>>;
2760
2764
  };
2761
2765
  //#endregion
2762
2766
  //#region src/hooks/useLens.d.ts
2763
2767
  declare const useLens: () => {
2764
2768
  timelockLens: {
2765
2769
  read: {
2766
- batchGetRefTick: (args: readonly [`0x${string}`, readonly number[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
2770
+ batchGetRefTick: (args: readonly [`0x${string}`, readonly number[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
2767
2771
  readonly type: "function";
2768
2772
  readonly name: "batchGetRefTick";
2769
2773
  readonly inputs: readonly [{
@@ -3469,7 +3473,7 @@ declare const useLens: () => {
3469
3473
  }];
3470
3474
  readonly stateMutability: "view";
3471
3475
  }], "batchGetRefTick", readonly [`0x${string}`, readonly number[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly number[]>;
3472
- getAllBlocks: (args: readonly [`0x${string}`], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
3476
+ getAllBlocks: (args: readonly [`0x${string}`], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
3473
3477
  readonly type: "function";
3474
3478
  readonly name: "batchGetRefTick";
3475
3479
  readonly inputs: readonly [{
@@ -4185,7 +4189,7 @@ declare const useLens: () => {
4185
4189
  borrowedAmount0: bigint;
4186
4190
  borrowedAmount1: bigint;
4187
4191
  }[]>;
4188
- getExpiredOptions: (args: readonly [`0x${string}`, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
4192
+ getExpiredOptions: (args: readonly [`0x${string}`, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
4189
4193
  readonly type: "function";
4190
4194
  readonly name: "batchGetRefTick";
4191
4195
  readonly inputs: readonly [{
@@ -4910,7 +4914,7 @@ declare const useLens: () => {
4910
4914
  createdAt: bigint;
4911
4915
  liquidities: readonly bigint[];
4912
4916
  }[], bigint, boolean]>;
4913
- getLiquidityAtTick: (args: readonly [`0x${string}`, number], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
4917
+ getLiquidityAtTick: (args: readonly [`0x${string}`, number], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
4914
4918
  readonly type: "function";
4915
4919
  readonly name: "batchGetRefTick";
4916
4920
  readonly inputs: readonly [{
@@ -5616,7 +5620,7 @@ declare const useLens: () => {
5616
5620
  }];
5617
5621
  readonly stateMutability: "view";
5618
5622
  }], "getLiquidityAtTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
5619
- getMarketData: (args: readonly [`0x${string}`], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
5623
+ getMarketData: (args: readonly [`0x${string}`], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
5620
5624
  readonly type: "function";
5621
5625
  readonly name: "batchGetRefTick";
5622
5626
  readonly inputs: readonly [{
@@ -6335,7 +6339,7 @@ declare const useLens: () => {
6335
6339
  payoutAssetName: string;
6336
6340
  optionsCount: bigint;
6337
6341
  }>;
6338
- getMaxPositionSize: (args: readonly [`0x${string}`, number, number], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
6342
+ getMaxPositionSize: (args: readonly [`0x${string}`, number, number], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
6339
6343
  readonly type: "function";
6340
6344
  readonly name: "batchGetRefTick";
6341
6345
  readonly inputs: readonly [{
@@ -7041,7 +7045,7 @@ declare const useLens: () => {
7041
7045
  }];
7042
7046
  readonly stateMutability: "view";
7043
7047
  }], "getMaxPositionSize", readonly [`0x${string}`, number, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
7044
- getMaxPositionSizeAtCurrentTick: (args: readonly [`0x${string}`, number], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
7048
+ getMaxPositionSizeAtCurrentTick: (args: readonly [`0x${string}`, number], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
7045
7049
  readonly type: "function";
7046
7050
  readonly name: "batchGetRefTick";
7047
7051
  readonly inputs: readonly [{
@@ -7747,7 +7751,7 @@ declare const useLens: () => {
7747
7751
  }];
7748
7752
  readonly stateMutability: "view";
7749
7753
  }], "getMaxPositionSizeAtCurrentTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
7750
- getOptionData: (args: readonly [`0x${string}`, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
7754
+ getOptionData: (args: readonly [`0x${string}`, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
7751
7755
  readonly type: "function";
7752
7756
  readonly name: "batchGetRefTick";
7753
7757
  readonly inputs: readonly [{
@@ -8472,7 +8476,7 @@ declare const useLens: () => {
8472
8476
  createdAt: bigint;
8473
8477
  liquidities: readonly bigint[];
8474
8478
  }>;
8475
- getOptionsData: (args: readonly [`0x${string}`, readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
8479
+ getOptionsData: (args: readonly [`0x${string}`, readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
8476
8480
  readonly type: "function";
8477
8481
  readonly name: "batchGetRefTick";
8478
8482
  readonly inputs: readonly [{
@@ -9197,7 +9201,7 @@ declare const useLens: () => {
9197
9201
  createdAt: bigint;
9198
9202
  liquidities: readonly bigint[];
9199
9203
  }[]>;
9200
- getPoolData: (args: readonly [`0x${string}`], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
9204
+ getPoolData: (args: readonly [`0x${string}`], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
9201
9205
  readonly type: "function";
9202
9206
  readonly name: "batchGetRefTick";
9203
9207
  readonly inputs: readonly [{
@@ -9914,7 +9918,7 @@ declare const useLens: () => {
9914
9918
  tickSpacing: number;
9915
9919
  fee: number;
9916
9920
  }>;
9917
- getRefTick: (args: readonly [`0x${string}`, number], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
9921
+ getRefTick: (args: readonly [`0x${string}`, number], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
9918
9922
  readonly type: "function";
9919
9923
  readonly name: "batchGetRefTick";
9920
9924
  readonly inputs: readonly [{
@@ -10620,7 +10624,7 @@ declare const useLens: () => {
10620
10624
  }];
10621
10625
  readonly stateMutability: "view";
10622
10626
  }], "getRefTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<number>;
10623
- getUserOptions: (args: readonly [`0x${string}`, `0x${string}`, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
10627
+ getUserOptions: (args: readonly [`0x${string}`, `0x${string}`, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
10624
10628
  readonly type: "function";
10625
10629
  readonly name: "batchGetRefTick";
10626
10630
  readonly inputs: readonly [{
@@ -11345,7 +11349,7 @@ declare const useLens: () => {
11345
11349
  createdAt: bigint;
11346
11350
  liquidities: readonly bigint[];
11347
11351
  }[], bigint, boolean]>;
11348
- getVaultTVL: (args: readonly [`0x${string}`], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
11352
+ getVaultTVL: (args: readonly [`0x${string}`], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
11349
11353
  readonly type: "function";
11350
11354
  readonly name: "batchGetRefTick";
11351
11355
  readonly inputs: readonly [{
@@ -12762,7 +12766,7 @@ declare const useLens: () => {
12762
12766
  } | undefined;
12763
12767
  uniswapLens: {
12764
12768
  read: {
12765
- batchGetAmount0ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
12769
+ batchGetAmount0ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
12766
12770
  readonly type: "function";
12767
12771
  readonly name: "batchGetAmount0ForLiquidity";
12768
12772
  readonly inputs: readonly [{
@@ -13383,7 +13387,7 @@ declare const useLens: () => {
13383
13387
  }];
13384
13388
  readonly stateMutability: "pure";
13385
13389
  }], "batchGetAmount0ForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
13386
- batchGetAmount0ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
13390
+ batchGetAmount0ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
13387
13391
  readonly type: "function";
13388
13392
  readonly name: "batchGetAmount0ForLiquidity";
13389
13393
  readonly inputs: readonly [{
@@ -14004,7 +14008,7 @@ declare const useLens: () => {
14004
14008
  }];
14005
14009
  readonly stateMutability: "pure";
14006
14010
  }], "batchGetAmount0ForLiquidityTicks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
14007
- batchGetAmount1ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
14011
+ batchGetAmount1ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
14008
14012
  readonly type: "function";
14009
14013
  readonly name: "batchGetAmount0ForLiquidity";
14010
14014
  readonly inputs: readonly [{
@@ -14625,7 +14629,7 @@ declare const useLens: () => {
14625
14629
  }];
14626
14630
  readonly stateMutability: "pure";
14627
14631
  }], "batchGetAmount1ForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
14628
- batchGetAmount1ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
14632
+ batchGetAmount1ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
14629
14633
  readonly type: "function";
14630
14634
  readonly name: "batchGetAmount0ForLiquidity";
14631
14635
  readonly inputs: readonly [{
@@ -15246,7 +15250,7 @@ declare const useLens: () => {
15246
15250
  }];
15247
15251
  readonly stateMutability: "pure";
15248
15252
  }], "batchGetAmount1ForLiquidityTicks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
15249
- batchGetAmountsForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
15253
+ batchGetAmountsForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
15250
15254
  readonly type: "function";
15251
15255
  readonly name: "batchGetAmount0ForLiquidity";
15252
15256
  readonly inputs: readonly [{
@@ -15867,7 +15871,7 @@ declare const useLens: () => {
15867
15871
  }];
15868
15872
  readonly stateMutability: "pure";
15869
15873
  }], "batchGetAmountsForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [readonly bigint[], readonly bigint[]]>;
15870
- batchGetAmountsForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
15874
+ batchGetAmountsForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
15871
15875
  readonly type: "function";
15872
15876
  readonly name: "batchGetAmount0ForLiquidity";
15873
15877
  readonly inputs: readonly [{
@@ -16488,7 +16492,7 @@ declare const useLens: () => {
16488
16492
  }];
16489
16493
  readonly stateMutability: "pure";
16490
16494
  }], "batchGetAmountsForLiquidityTicks", readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [readonly bigint[], readonly bigint[]]>;
16491
- batchGetLiquidityForAmount0: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
16495
+ batchGetLiquidityForAmount0: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
16492
16496
  readonly type: "function";
16493
16497
  readonly name: "batchGetAmount0ForLiquidity";
16494
16498
  readonly inputs: readonly [{
@@ -17109,7 +17113,7 @@ declare const useLens: () => {
17109
17113
  }];
17110
17114
  readonly stateMutability: "pure";
17111
17115
  }], "batchGetLiquidityForAmount0", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
17112
- batchGetLiquidityForAmount0Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
17116
+ batchGetLiquidityForAmount0Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
17113
17117
  readonly type: "function";
17114
17118
  readonly name: "batchGetAmount0ForLiquidity";
17115
17119
  readonly inputs: readonly [{
@@ -17730,7 +17734,7 @@ declare const useLens: () => {
17730
17734
  }];
17731
17735
  readonly stateMutability: "pure";
17732
17736
  }], "batchGetLiquidityForAmount0Ticks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
17733
- batchGetLiquidityForAmount1: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
17737
+ batchGetLiquidityForAmount1: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
17734
17738
  readonly type: "function";
17735
17739
  readonly name: "batchGetAmount0ForLiquidity";
17736
17740
  readonly inputs: readonly [{
@@ -18351,7 +18355,7 @@ declare const useLens: () => {
18351
18355
  }];
18352
18356
  readonly stateMutability: "pure";
18353
18357
  }], "batchGetLiquidityForAmount1", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
18354
- batchGetLiquidityForAmount1Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
18358
+ batchGetLiquidityForAmount1Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
18355
18359
  readonly type: "function";
18356
18360
  readonly name: "batchGetAmount0ForLiquidity";
18357
18361
  readonly inputs: readonly [{
@@ -18972,7 +18976,7 @@ declare const useLens: () => {
18972
18976
  }];
18973
18977
  readonly stateMutability: "pure";
18974
18978
  }], "batchGetLiquidityForAmount1Ticks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
18975
- batchGetLiquidityForAmounts: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
18979
+ batchGetLiquidityForAmounts: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
18976
18980
  readonly type: "function";
18977
18981
  readonly name: "batchGetAmount0ForLiquidity";
18978
18982
  readonly inputs: readonly [{
@@ -19593,7 +19597,7 @@ declare const useLens: () => {
19593
19597
  }];
19594
19598
  readonly stateMutability: "pure";
19595
19599
  }], "batchGetLiquidityForAmounts", readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
19596
- batchGetLiquidityForAmountsTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
19600
+ batchGetLiquidityForAmountsTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
19597
19601
  readonly type: "function";
19598
19602
  readonly name: "batchGetAmount0ForLiquidity";
19599
19603
  readonly inputs: readonly [{
@@ -20214,7 +20218,7 @@ declare const useLens: () => {
20214
20218
  }];
20215
20219
  readonly stateMutability: "pure";
20216
20220
  }], "batchGetLiquidityForAmountsTicks", readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
20217
- batchGetPriceAtTick: (args: readonly [readonly number[]], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
20221
+ batchGetPriceAtTick: (args: readonly [readonly number[]], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
20218
20222
  readonly type: "function";
20219
20223
  readonly name: "batchGetAmount0ForLiquidity";
20220
20224
  readonly inputs: readonly [{
@@ -20835,7 +20839,7 @@ declare const useLens: () => {
20835
20839
  }];
20836
20840
  readonly stateMutability: "pure";
20837
20841
  }], "batchGetPriceAtTick", readonly [readonly number[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
20838
- getAmount0ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
20842
+ getAmount0ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
20839
20843
  readonly type: "function";
20840
20844
  readonly name: "batchGetAmount0ForLiquidity";
20841
20845
  readonly inputs: readonly [{
@@ -21456,7 +21460,7 @@ declare const useLens: () => {
21456
21460
  }];
21457
21461
  readonly stateMutability: "pure";
21458
21462
  }], "getAmount0ForLiquidity", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
21459
- getAmount0ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
21463
+ getAmount0ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
21460
21464
  readonly type: "function";
21461
21465
  readonly name: "batchGetAmount0ForLiquidity";
21462
21466
  readonly inputs: readonly [{
@@ -22077,7 +22081,7 @@ declare const useLens: () => {
22077
22081
  }];
22078
22082
  readonly stateMutability: "pure";
22079
22083
  }], "getAmount0ForLiquidityTicks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
22080
- getAmount1ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
22084
+ getAmount1ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
22081
22085
  readonly type: "function";
22082
22086
  readonly name: "batchGetAmount0ForLiquidity";
22083
22087
  readonly inputs: readonly [{
@@ -22698,7 +22702,7 @@ declare const useLens: () => {
22698
22702
  }];
22699
22703
  readonly stateMutability: "pure";
22700
22704
  }], "getAmount1ForLiquidity", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
22701
- getAmount1ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
22705
+ getAmount1ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
22702
22706
  readonly type: "function";
22703
22707
  readonly name: "batchGetAmount0ForLiquidity";
22704
22708
  readonly inputs: readonly [{
@@ -23319,7 +23323,7 @@ declare const useLens: () => {
23319
23323
  }];
23320
23324
  readonly stateMutability: "pure";
23321
23325
  }], "getAmount1ForLiquidityTicks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
23322
- getAmountsForLiquidity: (args: readonly [bigint, bigint, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
23326
+ getAmountsForLiquidity: (args: readonly [bigint, bigint, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
23323
23327
  readonly type: "function";
23324
23328
  readonly name: "batchGetAmount0ForLiquidity";
23325
23329
  readonly inputs: readonly [{
@@ -23940,7 +23944,7 @@ declare const useLens: () => {
23940
23944
  }];
23941
23945
  readonly stateMutability: "pure";
23942
23946
  }], "getAmountsForLiquidity", readonly [bigint, bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
23943
- getAmountsForLiquidityTicks: (args: readonly [number, number, number, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
23947
+ getAmountsForLiquidityTicks: (args: readonly [number, number, number, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
23944
23948
  readonly type: "function";
23945
23949
  readonly name: "batchGetAmount0ForLiquidity";
23946
23950
  readonly inputs: readonly [{
@@ -24561,7 +24565,7 @@ declare const useLens: () => {
24561
24565
  }];
24562
24566
  readonly stateMutability: "pure";
24563
24567
  }], "getAmountsForLiquidityTicks", readonly [number, number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
24564
- getLiquidityForAmount0: (args: readonly [bigint, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
24568
+ getLiquidityForAmount0: (args: readonly [bigint, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
24565
24569
  readonly type: "function";
24566
24570
  readonly name: "batchGetAmount0ForLiquidity";
24567
24571
  readonly inputs: readonly [{
@@ -25182,7 +25186,7 @@ declare const useLens: () => {
25182
25186
  }];
25183
25187
  readonly stateMutability: "pure";
25184
25188
  }], "getLiquidityForAmount0", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
25185
- getLiquidityForAmount0Ticks: (args: readonly [number, number, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
25189
+ getLiquidityForAmount0Ticks: (args: readonly [number, number, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
25186
25190
  readonly type: "function";
25187
25191
  readonly name: "batchGetAmount0ForLiquidity";
25188
25192
  readonly inputs: readonly [{
@@ -25803,7 +25807,7 @@ declare const useLens: () => {
25803
25807
  }];
25804
25808
  readonly stateMutability: "pure";
25805
25809
  }], "getLiquidityForAmount0Ticks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
25806
- getLiquidityForAmount1: (args: readonly [bigint, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
25810
+ getLiquidityForAmount1: (args: readonly [bigint, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
25807
25811
  readonly type: "function";
25808
25812
  readonly name: "batchGetAmount0ForLiquidity";
25809
25813
  readonly inputs: readonly [{
@@ -26424,7 +26428,7 @@ declare const useLens: () => {
26424
26428
  }];
26425
26429
  readonly stateMutability: "pure";
26426
26430
  }], "getLiquidityForAmount1", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
26427
- getLiquidityForAmount1Ticks: (args: readonly [number, number, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
26431
+ getLiquidityForAmount1Ticks: (args: readonly [number, number, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
26428
26432
  readonly type: "function";
26429
26433
  readonly name: "batchGetAmount0ForLiquidity";
26430
26434
  readonly inputs: readonly [{
@@ -27045,7 +27049,7 @@ declare const useLens: () => {
27045
27049
  }];
27046
27050
  readonly stateMutability: "pure";
27047
27051
  }], "getLiquidityForAmount1Ticks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
27048
- getLiquidityForAmounts: (args: readonly [bigint, bigint, bigint, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
27052
+ getLiquidityForAmounts: (args: readonly [bigint, bigint, bigint, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
27049
27053
  readonly type: "function";
27050
27054
  readonly name: "batchGetAmount0ForLiquidity";
27051
27055
  readonly inputs: readonly [{
@@ -27666,7 +27670,7 @@ declare const useLens: () => {
27666
27670
  }];
27667
27671
  readonly stateMutability: "pure";
27668
27672
  }], "getLiquidityForAmounts", readonly [bigint, bigint, bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
27669
- getLiquidityForAmountsTicks: (args: readonly [number, number, number, bigint, bigint], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
27673
+ getLiquidityForAmountsTicks: (args: readonly [number, number, number, bigint, bigint], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
27670
27674
  readonly type: "function";
27671
27675
  readonly name: "batchGetAmount0ForLiquidity";
27672
27676
  readonly inputs: readonly [{
@@ -28287,7 +28291,7 @@ declare const useLens: () => {
28287
28291
  }];
28288
28292
  readonly stateMutability: "pure";
28289
28293
  }], "getLiquidityForAmountsTicks", readonly [number, number, number, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
28290
- getPriceAtTick: (args: readonly [number], options?: viem0.Prettify<viem0.UnionOmit<viem0.ReadContractParameters<readonly [{
28294
+ getPriceAtTick: (args: readonly [number], options?: viem249.Prettify<viem249.UnionOmit<viem249.ReadContractParameters<readonly [{
28291
28295
  readonly type: "function";
28292
28296
  readonly name: "batchGetAmount0ForLiquidity";
28293
28297
  readonly inputs: readonly [{
package/dist/client.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { r as lensAbi, t as optionsMarketAbi } from "./optionsMarket-CvArD6d_.js";
5
5
  import { C as token1ToToken0, D as getUniswapMathLens, E as getTimelockMarket, O as timelockLenses, S as token0ToToken1, T as getTimelockLens, b as roundTickDown, d as wrapPrice, h as getPriceAtTick, k as uniswapMathLenses, l as wrapAmount, m as PRICE_PRECISION, w as getErc20, y as liquiditiesToAmounts } from "./numberUtils-Dk0TuHnT.js";
6
6
  import { n as uniswapV3PoolAbi, t as singleOwnerVaultAbi } from "./singleOwnerVault-BeJChjfJ.js";
7
- import { encodeFunctionData, erc20Abi, maxUint256, zeroAddress } from "viem";
7
+ import { encodeAbiParameters, encodeFunctionData, erc20Abi, maxUint256, zeroAddress } from "viem";
8
8
  import React, { createContext, useContext, useMemo } from "react";
9
9
  import { useAccount, useChainId, useClient, useReadContract, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
10
10
  import { GraphQLClient, RequestOptions } from "graphql-request";
@@ -210,16 +210,33 @@ const useLens = () => {
210
210
  }), [client]);
211
211
  };
212
212
 
213
+ //#endregion
214
+ //#region src/hooks/pool/usePoolData.ts
215
+ const usePoolData = (poolAddr) => {
216
+ const { timelockLens } = useLens();
217
+ const client = useClient();
218
+ const { data } = useReadContract({
219
+ address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
220
+ abi: lensAbi,
221
+ functionName: "getPoolData",
222
+ args: poolAddr ? [poolAddr] : void 0,
223
+ query: { enabled: !!poolAddr && !!client }
224
+ });
225
+ return data || {};
226
+ };
227
+
213
228
  //#endregion
214
229
  //#region src/hooks/market/useExerciseOption.ts
230
+ const swapper = "0xc396aa907F8De0c32460050B8Adbf047186C504d";
215
231
  const useExerciseOption = (marketAddr) => {
216
- const { vault } = useMarketData(marketAddr);
232
+ const { vault, pool } = useMarketData(marketAddr);
233
+ const { fee } = usePoolData(pool);
217
234
  const { timelockLens } = useLens();
218
235
  const client = useClient();
219
236
  const { writeContractAsync, data: hash, isPending, error } = useWriteContract();
220
237
  const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
221
238
  const exerciseOption = async (option, liquidities) => {
222
- if (!client || !timelockLens || !vault || !marketAddr) throw new Error("Wallet not connected");
239
+ if (!client || !timelockLens || !vault || !marketAddr || !fee) throw new Error("Wallet not connected");
223
240
  const refTick = await timelockLens.read.getRefTick([vault, option.startTick]);
224
241
  const hash$1 = await writeContractAsync({
225
242
  address: marketAddr,
@@ -229,6 +246,8 @@ const useExerciseOption = (marketAddr) => {
229
246
  option.optionId,
230
247
  liquidities,
231
248
  0n,
249
+ swapper,
250
+ encodeAbiParameters([{ type: "uint24" }], [fee]),
232
251
  refTick
233
252
  ]
234
253
  });
@@ -287,21 +306,6 @@ const useMaxPositionSize = (marketAddr, strikeTick, maxBorrowableRange = 100) =>
287
306
  };
288
307
  };
289
308
 
290
- //#endregion
291
- //#region src/hooks/pool/usePoolData.ts
292
- const usePoolData = (poolAddr) => {
293
- const { timelockLens } = useLens();
294
- const client = useClient();
295
- const { data } = useReadContract({
296
- address: timelockLens === null || timelockLens === void 0 ? void 0 : timelockLens.address,
297
- abi: lensAbi,
298
- functionName: "getPoolData",
299
- args: poolAddr ? [poolAddr] : void 0,
300
- query: { enabled: !!poolAddr && !!client }
301
- });
302
- return data || {};
303
- };
304
-
305
309
  //#endregion
306
310
  //#region src/hooks/pool/useCurrentTick.ts
307
311
  const useCurrentTick = (poolAddr) => {
@@ -347,12 +351,13 @@ const useMintOption = (marketAddr) => {
347
351
  if (!timelockLens || !vault || !marketAddr || !currentTick || !tickSpacing) throw new Error("Lowest tick lower not available");
348
352
  strikeTick = roundTickDown(strikeTick ?? currentTick, tickSpacing);
349
353
  if (optionType === "CALL" && optionAssetIsToken0 || optionType === "PUT" && !optionAssetIsToken0) strikeTick += tickSpacing;
350
- await askForApproval(await getTimelockMarket(marketAddr, client).read.calculatePremium([
354
+ const [premium, protocolFee] = await getTimelockMarket(marketAddr, client).read.calculatePremium([
351
355
  optionType === "CALL" ? 0 : 1,
352
356
  amount,
353
357
  strikeTick,
354
- BigInt(duration)
355
- ]));
358
+ duration
359
+ ]);
360
+ await askForApproval(premium + protocolFee);
356
361
  const hash$1 = await writeContractAsync({
357
362
  address: marketAddr,
358
363
  abi: optionsMarketAbi,
@@ -361,8 +366,9 @@ const useMintOption = (marketAddr) => {
361
366
  optionType === "CALL" ? 0 : 1,
362
367
  amount,
363
368
  strikeTick,
364
- BigInt(duration),
369
+ duration,
365
370
  BigInt(1e69),
371
+ false,
366
372
  await timelockLens.read.getRefTick([vault, strikeTick])
367
373
  ]
368
374
  });
@@ -446,7 +452,7 @@ const useOptionPremium = (marketAddr, optionType, optionAmount, duration, strike
446
452
  query: { enabled: strikeTickRounded !== void 0 }
447
453
  });
448
454
  return useMemo(() => {
449
- if (premium === void 0 || protocolFee === void 0 || payoutAssetDecimals === void 0) return;
455
+ if (premium === void 0 || protocolFee === void 0 || payoutAssetDecimals === void 0) return {};
450
456
  return {
451
457
  premium: wrapAmount(premium, payoutAssetDecimals),
452
458
  protocolFee: wrapAmount(protocolFee, payoutAssetDecimals),