timelock-sdk 0.0.36 → 0.0.37

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
@@ -1,6 +1,6 @@
1
1
  import "./uniswapMathLens-B1MIL2yT.cjs";
2
- import { Amount, TimelockMarketData, UniswapMathLens } from "./index-B7b3c8cu.cjs";
3
- import * as viem116 from "viem";
2
+ import { Amount, TimelockMarketData, UniswapMathLens } from "./index-CA5kB-yT.cjs";
3
+ import * as viem366 from "viem";
4
4
  import { Address } from "viem";
5
5
  import React, { ReactNode } from "react";
6
6
  import "graphql";
@@ -2343,20 +2343,7 @@ interface PriceDataPoint {
2343
2343
  type PriceResolution = '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
2344
2344
  //#endregion
2345
2345
  //#region src/hooks/pool/usePriceHistory.d.ts
2346
- interface UsePriceHistoryParams {
2347
- poolAddress?: Address;
2348
- resolution: PriceResolution;
2349
- startTimestamp: number;
2350
- endTimestamp: number;
2351
- enabled?: boolean;
2352
- }
2353
- declare const usePriceHistory: ({
2354
- poolAddress,
2355
- resolution,
2356
- startTimestamp,
2357
- endTimestamp,
2358
- enabled
2359
- }: UsePriceHistoryParams) => _tanstack_react_query0.UseQueryResult<PriceDataPoint[], Error>;
2346
+ declare const usePriceHistory: (pool: Address | undefined, resolution: PriceResolution, startTimestamp: Date, endTimestamp: Date) => _tanstack_react_query0.UseQueryResult<PriceDataPoint[], Error>;
2360
2347
  //#endregion
2361
2348
  //#region src/hooks/vault/useBurnLiquidity.d.ts
2362
2349
  interface BurnPosition {
@@ -2378,7 +2365,7 @@ declare const useBurnLiquidity: (vaultAddr?: Address) => {
2378
2365
  //#region src/hooks/vault/useLiquidityBlocks.d.ts
2379
2366
  type LiquidityBlockData = ReturnType<typeof useLiquidityBlocks>['data'][0];
2380
2367
  declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2381
- error: viem116.ReadContractErrorType;
2368
+ error: viem366.ReadContractErrorType;
2382
2369
  isError: true;
2383
2370
  isPending: false;
2384
2371
  isLoading: false;
@@ -2390,7 +2377,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2390
2377
  dataUpdatedAt: number;
2391
2378
  errorUpdatedAt: number;
2392
2379
  failureCount: number;
2393
- failureReason: viem116.ReadContractErrorType | null;
2380
+ failureReason: viem366.ReadContractErrorType | null;
2394
2381
  errorUpdateCount: number;
2395
2382
  isFetched: boolean;
2396
2383
  isFetchedAfterMount: boolean;
@@ -2410,7 +2397,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2410
2397
  totalAmount1: bigint;
2411
2398
  borrowedAmount0: bigint;
2412
2399
  borrowedAmount1: bigint;
2413
- }[], viem116.ReadContractErrorType>>;
2400
+ }[], viem366.ReadContractErrorType>>;
2414
2401
  fetchStatus: _tanstack_query_core0.FetchStatus;
2415
2402
  promise: Promise<readonly {
2416
2403
  tickLower: number;
@@ -2448,7 +2435,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2448
2435
  dataUpdatedAt: number;
2449
2436
  errorUpdatedAt: number;
2450
2437
  failureCount: number;
2451
- failureReason: viem116.ReadContractErrorType | null;
2438
+ failureReason: viem366.ReadContractErrorType | null;
2452
2439
  errorUpdateCount: number;
2453
2440
  isFetched: boolean;
2454
2441
  isFetchedAfterMount: boolean;
@@ -2468,7 +2455,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2468
2455
  totalAmount1: bigint;
2469
2456
  borrowedAmount0: bigint;
2470
2457
  borrowedAmount1: bigint;
2471
- }[], viem116.ReadContractErrorType>>;
2458
+ }[], viem366.ReadContractErrorType>>;
2472
2459
  fetchStatus: _tanstack_query_core0.FetchStatus;
2473
2460
  promise: Promise<readonly {
2474
2461
  tickLower: number;
@@ -2494,7 +2481,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2494
2481
  borrowedAmount1: bigint;
2495
2482
  }[];
2496
2483
  } | {
2497
- error: viem116.ReadContractErrorType;
2484
+ error: viem366.ReadContractErrorType;
2498
2485
  isError: true;
2499
2486
  isPending: false;
2500
2487
  isLoading: false;
@@ -2506,7 +2493,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2506
2493
  dataUpdatedAt: number;
2507
2494
  errorUpdatedAt: number;
2508
2495
  failureCount: number;
2509
- failureReason: viem116.ReadContractErrorType | null;
2496
+ failureReason: viem366.ReadContractErrorType | null;
2510
2497
  errorUpdateCount: number;
2511
2498
  isFetched: boolean;
2512
2499
  isFetchedAfterMount: boolean;
@@ -2526,7 +2513,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2526
2513
  totalAmount1: bigint;
2527
2514
  borrowedAmount0: bigint;
2528
2515
  borrowedAmount1: bigint;
2529
- }[], viem116.ReadContractErrorType>>;
2516
+ }[], viem366.ReadContractErrorType>>;
2530
2517
  fetchStatus: _tanstack_query_core0.FetchStatus;
2531
2518
  promise: Promise<readonly {
2532
2519
  tickLower: number;
@@ -2564,7 +2551,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2564
2551
  dataUpdatedAt: number;
2565
2552
  errorUpdatedAt: number;
2566
2553
  failureCount: number;
2567
- failureReason: viem116.ReadContractErrorType | null;
2554
+ failureReason: viem366.ReadContractErrorType | null;
2568
2555
  errorUpdateCount: number;
2569
2556
  isFetched: boolean;
2570
2557
  isFetchedAfterMount: boolean;
@@ -2584,7 +2571,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2584
2571
  totalAmount1: bigint;
2585
2572
  borrowedAmount0: bigint;
2586
2573
  borrowedAmount1: bigint;
2587
- }[], viem116.ReadContractErrorType>>;
2574
+ }[], viem366.ReadContractErrorType>>;
2588
2575
  fetchStatus: _tanstack_query_core0.FetchStatus;
2589
2576
  promise: Promise<readonly {
2590
2577
  tickLower: number;
@@ -2621,7 +2608,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2621
2608
  dataUpdatedAt: number;
2622
2609
  errorUpdatedAt: number;
2623
2610
  failureCount: number;
2624
- failureReason: viem116.ReadContractErrorType | null;
2611
+ failureReason: viem366.ReadContractErrorType | null;
2625
2612
  errorUpdateCount: number;
2626
2613
  isFetched: boolean;
2627
2614
  isFetchedAfterMount: boolean;
@@ -2642,7 +2629,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2642
2629
  totalAmount1: bigint;
2643
2630
  borrowedAmount0: bigint;
2644
2631
  borrowedAmount1: bigint;
2645
- }[], viem116.ReadContractErrorType>>;
2632
+ }[], viem366.ReadContractErrorType>>;
2646
2633
  fetchStatus: _tanstack_query_core0.FetchStatus;
2647
2634
  promise: Promise<readonly {
2648
2635
  tickLower: number;
@@ -2680,7 +2667,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2680
2667
  dataUpdatedAt: number;
2681
2668
  errorUpdatedAt: number;
2682
2669
  failureCount: number;
2683
- failureReason: viem116.ReadContractErrorType | null;
2670
+ failureReason: viem366.ReadContractErrorType | null;
2684
2671
  errorUpdateCount: number;
2685
2672
  isFetched: boolean;
2686
2673
  isFetchedAfterMount: boolean;
@@ -2700,7 +2687,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
2700
2687
  totalAmount1: bigint;
2701
2688
  borrowedAmount0: bigint;
2702
2689
  borrowedAmount1: bigint;
2703
- }[], viem116.ReadContractErrorType>>;
2690
+ }[], viem366.ReadContractErrorType>>;
2704
2691
  fetchStatus: _tanstack_query_core0.FetchStatus;
2705
2692
  promise: Promise<readonly {
2706
2693
  tickLower: number;
@@ -2773,14 +2760,14 @@ declare const useVaultTVL: (vaultAddr?: Address) => {
2773
2760
  borrowedAmount0: Amount;
2774
2761
  borrowedAmount1: Amount;
2775
2762
  blocksCount: bigint;
2776
- refetch: (options?: _tanstack_query_core0.RefetchOptions) => Promise<_tanstack_query_core0.QueryObserverResult<readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint], viem116.ReadContractErrorType>>;
2763
+ refetch: (options?: _tanstack_query_core0.RefetchOptions) => Promise<_tanstack_query_core0.QueryObserverResult<readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint], viem366.ReadContractErrorType>>;
2777
2764
  };
2778
2765
  //#endregion
2779
2766
  //#region src/hooks/useLens.d.ts
2780
2767
  declare const useLens: () => {
2781
2768
  timelockLens: {
2782
2769
  read: {
2783
- batchGetRefTick: (args: readonly [`0x${string}`, readonly number[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
2770
+ batchGetRefTick: (args: readonly [`0x${string}`, readonly number[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
2784
2771
  readonly type: "function";
2785
2772
  readonly name: "batchGetRefTick";
2786
2773
  readonly inputs: readonly [{
@@ -3486,7 +3473,7 @@ declare const useLens: () => {
3486
3473
  }];
3487
3474
  readonly stateMutability: "view";
3488
3475
  }], "batchGetRefTick", readonly [`0x${string}`, readonly number[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly number[]>;
3489
- getAllBlocks: (args: readonly [`0x${string}`], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
3476
+ getAllBlocks: (args: readonly [`0x${string}`], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
3490
3477
  readonly type: "function";
3491
3478
  readonly name: "batchGetRefTick";
3492
3479
  readonly inputs: readonly [{
@@ -4202,7 +4189,7 @@ declare const useLens: () => {
4202
4189
  borrowedAmount0: bigint;
4203
4190
  borrowedAmount1: bigint;
4204
4191
  }[]>;
4205
- getExpiredOptions: (args: readonly [`0x${string}`, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
4192
+ getExpiredOptions: (args: readonly [`0x${string}`, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
4206
4193
  readonly type: "function";
4207
4194
  readonly name: "batchGetRefTick";
4208
4195
  readonly inputs: readonly [{
@@ -4927,7 +4914,7 @@ declare const useLens: () => {
4927
4914
  createdAt: bigint;
4928
4915
  liquidities: readonly bigint[];
4929
4916
  }[], bigint, boolean]>;
4930
- getLiquidityAtTick: (args: readonly [`0x${string}`, number], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
4917
+ getLiquidityAtTick: (args: readonly [`0x${string}`, number], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
4931
4918
  readonly type: "function";
4932
4919
  readonly name: "batchGetRefTick";
4933
4920
  readonly inputs: readonly [{
@@ -5633,7 +5620,7 @@ declare const useLens: () => {
5633
5620
  }];
5634
5621
  readonly stateMutability: "view";
5635
5622
  }], "getLiquidityAtTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
5636
- getMarketData: (args: readonly [`0x${string}`], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
5623
+ getMarketData: (args: readonly [`0x${string}`], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
5637
5624
  readonly type: "function";
5638
5625
  readonly name: "batchGetRefTick";
5639
5626
  readonly inputs: readonly [{
@@ -6352,7 +6339,7 @@ declare const useLens: () => {
6352
6339
  payoutAssetName: string;
6353
6340
  optionsCount: bigint;
6354
6341
  }>;
6355
- getMaxPositionSize: (args: readonly [`0x${string}`, number, number], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
6342
+ getMaxPositionSize: (args: readonly [`0x${string}`, number, number], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
6356
6343
  readonly type: "function";
6357
6344
  readonly name: "batchGetRefTick";
6358
6345
  readonly inputs: readonly [{
@@ -7058,7 +7045,7 @@ declare const useLens: () => {
7058
7045
  }];
7059
7046
  readonly stateMutability: "view";
7060
7047
  }], "getMaxPositionSize", readonly [`0x${string}`, number, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
7061
- getMaxPositionSizeAtCurrentTick: (args: readonly [`0x${string}`, number], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
7048
+ getMaxPositionSizeAtCurrentTick: (args: readonly [`0x${string}`, number], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
7062
7049
  readonly type: "function";
7063
7050
  readonly name: "batchGetRefTick";
7064
7051
  readonly inputs: readonly [{
@@ -7764,7 +7751,7 @@ declare const useLens: () => {
7764
7751
  }];
7765
7752
  readonly stateMutability: "view";
7766
7753
  }], "getMaxPositionSizeAtCurrentTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
7767
- getOptionData: (args: readonly [`0x${string}`, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
7754
+ getOptionData: (args: readonly [`0x${string}`, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
7768
7755
  readonly type: "function";
7769
7756
  readonly name: "batchGetRefTick";
7770
7757
  readonly inputs: readonly [{
@@ -8489,7 +8476,7 @@ declare const useLens: () => {
8489
8476
  createdAt: bigint;
8490
8477
  liquidities: readonly bigint[];
8491
8478
  }>;
8492
- getOptionsData: (args: readonly [`0x${string}`, readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
8479
+ getOptionsData: (args: readonly [`0x${string}`, readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
8493
8480
  readonly type: "function";
8494
8481
  readonly name: "batchGetRefTick";
8495
8482
  readonly inputs: readonly [{
@@ -9214,7 +9201,7 @@ declare const useLens: () => {
9214
9201
  createdAt: bigint;
9215
9202
  liquidities: readonly bigint[];
9216
9203
  }[]>;
9217
- getPoolData: (args: readonly [`0x${string}`], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
9204
+ getPoolData: (args: readonly [`0x${string}`], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
9218
9205
  readonly type: "function";
9219
9206
  readonly name: "batchGetRefTick";
9220
9207
  readonly inputs: readonly [{
@@ -9931,7 +9918,7 @@ declare const useLens: () => {
9931
9918
  tickSpacing: number;
9932
9919
  fee: number;
9933
9920
  }>;
9934
- getRefTick: (args: readonly [`0x${string}`, number], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
9921
+ getRefTick: (args: readonly [`0x${string}`, number], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
9935
9922
  readonly type: "function";
9936
9923
  readonly name: "batchGetRefTick";
9937
9924
  readonly inputs: readonly [{
@@ -10637,7 +10624,7 @@ declare const useLens: () => {
10637
10624
  }];
10638
10625
  readonly stateMutability: "view";
10639
10626
  }], "getRefTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<number>;
10640
- getUserOptions: (args: readonly [`0x${string}`, `0x${string}`, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
10627
+ getUserOptions: (args: readonly [`0x${string}`, `0x${string}`, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
10641
10628
  readonly type: "function";
10642
10629
  readonly name: "batchGetRefTick";
10643
10630
  readonly inputs: readonly [{
@@ -11362,7 +11349,7 @@ declare const useLens: () => {
11362
11349
  createdAt: bigint;
11363
11350
  liquidities: readonly bigint[];
11364
11351
  }[], bigint, boolean]>;
11365
- getVaultTVL: (args: readonly [`0x${string}`], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
11352
+ getVaultTVL: (args: readonly [`0x${string}`], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
11366
11353
  readonly type: "function";
11367
11354
  readonly name: "batchGetRefTick";
11368
11355
  readonly inputs: readonly [{
@@ -12779,7 +12766,7 @@ declare const useLens: () => {
12779
12766
  } | undefined;
12780
12767
  uniswapLens: {
12781
12768
  read: {
12782
- batchGetAmount0ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
12769
+ batchGetAmount0ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
12783
12770
  readonly type: "function";
12784
12771
  readonly name: "batchGetAmount0ForLiquidity";
12785
12772
  readonly inputs: readonly [{
@@ -13400,7 +13387,7 @@ declare const useLens: () => {
13400
13387
  }];
13401
13388
  readonly stateMutability: "pure";
13402
13389
  }], "batchGetAmount0ForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
13403
- batchGetAmount0ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
13390
+ batchGetAmount0ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
13404
13391
  readonly type: "function";
13405
13392
  readonly name: "batchGetAmount0ForLiquidity";
13406
13393
  readonly inputs: readonly [{
@@ -14021,7 +14008,7 @@ declare const useLens: () => {
14021
14008
  }];
14022
14009
  readonly stateMutability: "pure";
14023
14010
  }], "batchGetAmount0ForLiquidityTicks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
14024
- batchGetAmount1ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
14011
+ batchGetAmount1ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
14025
14012
  readonly type: "function";
14026
14013
  readonly name: "batchGetAmount0ForLiquidity";
14027
14014
  readonly inputs: readonly [{
@@ -14642,7 +14629,7 @@ declare const useLens: () => {
14642
14629
  }];
14643
14630
  readonly stateMutability: "pure";
14644
14631
  }], "batchGetAmount1ForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
14645
- batchGetAmount1ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
14632
+ batchGetAmount1ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
14646
14633
  readonly type: "function";
14647
14634
  readonly name: "batchGetAmount0ForLiquidity";
14648
14635
  readonly inputs: readonly [{
@@ -15263,7 +15250,7 @@ declare const useLens: () => {
15263
15250
  }];
15264
15251
  readonly stateMutability: "pure";
15265
15252
  }], "batchGetAmount1ForLiquidityTicks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
15266
- batchGetAmountsForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
15253
+ batchGetAmountsForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
15267
15254
  readonly type: "function";
15268
15255
  readonly name: "batchGetAmount0ForLiquidity";
15269
15256
  readonly inputs: readonly [{
@@ -15884,7 +15871,7 @@ declare const useLens: () => {
15884
15871
  }];
15885
15872
  readonly stateMutability: "pure";
15886
15873
  }], "batchGetAmountsForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [readonly bigint[], readonly bigint[]]>;
15887
- batchGetAmountsForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
15874
+ batchGetAmountsForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
15888
15875
  readonly type: "function";
15889
15876
  readonly name: "batchGetAmount0ForLiquidity";
15890
15877
  readonly inputs: readonly [{
@@ -16505,7 +16492,7 @@ declare const useLens: () => {
16505
16492
  }];
16506
16493
  readonly stateMutability: "pure";
16507
16494
  }], "batchGetAmountsForLiquidityTicks", readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [readonly bigint[], readonly bigint[]]>;
16508
- batchGetLiquidityForAmount0: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
16495
+ batchGetLiquidityForAmount0: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
16509
16496
  readonly type: "function";
16510
16497
  readonly name: "batchGetAmount0ForLiquidity";
16511
16498
  readonly inputs: readonly [{
@@ -17126,7 +17113,7 @@ declare const useLens: () => {
17126
17113
  }];
17127
17114
  readonly stateMutability: "pure";
17128
17115
  }], "batchGetLiquidityForAmount0", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
17129
- batchGetLiquidityForAmount0Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
17116
+ batchGetLiquidityForAmount0Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
17130
17117
  readonly type: "function";
17131
17118
  readonly name: "batchGetAmount0ForLiquidity";
17132
17119
  readonly inputs: readonly [{
@@ -17747,7 +17734,7 @@ declare const useLens: () => {
17747
17734
  }];
17748
17735
  readonly stateMutability: "pure";
17749
17736
  }], "batchGetLiquidityForAmount0Ticks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
17750
- batchGetLiquidityForAmount1: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
17737
+ batchGetLiquidityForAmount1: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
17751
17738
  readonly type: "function";
17752
17739
  readonly name: "batchGetAmount0ForLiquidity";
17753
17740
  readonly inputs: readonly [{
@@ -18368,7 +18355,7 @@ declare const useLens: () => {
18368
18355
  }];
18369
18356
  readonly stateMutability: "pure";
18370
18357
  }], "batchGetLiquidityForAmount1", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
18371
- batchGetLiquidityForAmount1Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
18358
+ batchGetLiquidityForAmount1Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
18372
18359
  readonly type: "function";
18373
18360
  readonly name: "batchGetAmount0ForLiquidity";
18374
18361
  readonly inputs: readonly [{
@@ -18989,7 +18976,7 @@ declare const useLens: () => {
18989
18976
  }];
18990
18977
  readonly stateMutability: "pure";
18991
18978
  }], "batchGetLiquidityForAmount1Ticks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
18992
- batchGetLiquidityForAmounts: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
18979
+ batchGetLiquidityForAmounts: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
18993
18980
  readonly type: "function";
18994
18981
  readonly name: "batchGetAmount0ForLiquidity";
18995
18982
  readonly inputs: readonly [{
@@ -19610,7 +19597,7 @@ declare const useLens: () => {
19610
19597
  }];
19611
19598
  readonly stateMutability: "pure";
19612
19599
  }], "batchGetLiquidityForAmounts", readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
19613
- batchGetLiquidityForAmountsTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
19600
+ batchGetLiquidityForAmountsTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
19614
19601
  readonly type: "function";
19615
19602
  readonly name: "batchGetAmount0ForLiquidity";
19616
19603
  readonly inputs: readonly [{
@@ -20231,7 +20218,7 @@ declare const useLens: () => {
20231
20218
  }];
20232
20219
  readonly stateMutability: "pure";
20233
20220
  }], "batchGetLiquidityForAmountsTicks", readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
20234
- batchGetPriceAtTick: (args: readonly [readonly number[]], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
20221
+ batchGetPriceAtTick: (args: readonly [readonly number[]], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
20235
20222
  readonly type: "function";
20236
20223
  readonly name: "batchGetAmount0ForLiquidity";
20237
20224
  readonly inputs: readonly [{
@@ -20852,7 +20839,7 @@ declare const useLens: () => {
20852
20839
  }];
20853
20840
  readonly stateMutability: "pure";
20854
20841
  }], "batchGetPriceAtTick", readonly [readonly number[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
20855
- getAmount0ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
20842
+ getAmount0ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
20856
20843
  readonly type: "function";
20857
20844
  readonly name: "batchGetAmount0ForLiquidity";
20858
20845
  readonly inputs: readonly [{
@@ -21473,7 +21460,7 @@ declare const useLens: () => {
21473
21460
  }];
21474
21461
  readonly stateMutability: "pure";
21475
21462
  }], "getAmount0ForLiquidity", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
21476
- getAmount0ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
21463
+ getAmount0ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
21477
21464
  readonly type: "function";
21478
21465
  readonly name: "batchGetAmount0ForLiquidity";
21479
21466
  readonly inputs: readonly [{
@@ -22094,7 +22081,7 @@ declare const useLens: () => {
22094
22081
  }];
22095
22082
  readonly stateMutability: "pure";
22096
22083
  }], "getAmount0ForLiquidityTicks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
22097
- getAmount1ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
22084
+ getAmount1ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
22098
22085
  readonly type: "function";
22099
22086
  readonly name: "batchGetAmount0ForLiquidity";
22100
22087
  readonly inputs: readonly [{
@@ -22715,7 +22702,7 @@ declare const useLens: () => {
22715
22702
  }];
22716
22703
  readonly stateMutability: "pure";
22717
22704
  }], "getAmount1ForLiquidity", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
22718
- getAmount1ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
22705
+ getAmount1ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
22719
22706
  readonly type: "function";
22720
22707
  readonly name: "batchGetAmount0ForLiquidity";
22721
22708
  readonly inputs: readonly [{
@@ -23336,7 +23323,7 @@ declare const useLens: () => {
23336
23323
  }];
23337
23324
  readonly stateMutability: "pure";
23338
23325
  }], "getAmount1ForLiquidityTicks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
23339
- getAmountsForLiquidity: (args: readonly [bigint, bigint, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
23326
+ getAmountsForLiquidity: (args: readonly [bigint, bigint, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
23340
23327
  readonly type: "function";
23341
23328
  readonly name: "batchGetAmount0ForLiquidity";
23342
23329
  readonly inputs: readonly [{
@@ -23957,7 +23944,7 @@ declare const useLens: () => {
23957
23944
  }];
23958
23945
  readonly stateMutability: "pure";
23959
23946
  }], "getAmountsForLiquidity", readonly [bigint, bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
23960
- getAmountsForLiquidityTicks: (args: readonly [number, number, number, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
23947
+ getAmountsForLiquidityTicks: (args: readonly [number, number, number, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
23961
23948
  readonly type: "function";
23962
23949
  readonly name: "batchGetAmount0ForLiquidity";
23963
23950
  readonly inputs: readonly [{
@@ -24578,7 +24565,7 @@ declare const useLens: () => {
24578
24565
  }];
24579
24566
  readonly stateMutability: "pure";
24580
24567
  }], "getAmountsForLiquidityTicks", readonly [number, number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
24581
- getLiquidityForAmount0: (args: readonly [bigint, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
24568
+ getLiquidityForAmount0: (args: readonly [bigint, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
24582
24569
  readonly type: "function";
24583
24570
  readonly name: "batchGetAmount0ForLiquidity";
24584
24571
  readonly inputs: readonly [{
@@ -25199,7 +25186,7 @@ declare const useLens: () => {
25199
25186
  }];
25200
25187
  readonly stateMutability: "pure";
25201
25188
  }], "getLiquidityForAmount0", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
25202
- getLiquidityForAmount0Ticks: (args: readonly [number, number, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
25189
+ getLiquidityForAmount0Ticks: (args: readonly [number, number, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
25203
25190
  readonly type: "function";
25204
25191
  readonly name: "batchGetAmount0ForLiquidity";
25205
25192
  readonly inputs: readonly [{
@@ -25820,7 +25807,7 @@ declare const useLens: () => {
25820
25807
  }];
25821
25808
  readonly stateMutability: "pure";
25822
25809
  }], "getLiquidityForAmount0Ticks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
25823
- getLiquidityForAmount1: (args: readonly [bigint, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
25810
+ getLiquidityForAmount1: (args: readonly [bigint, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
25824
25811
  readonly type: "function";
25825
25812
  readonly name: "batchGetAmount0ForLiquidity";
25826
25813
  readonly inputs: readonly [{
@@ -26441,7 +26428,7 @@ declare const useLens: () => {
26441
26428
  }];
26442
26429
  readonly stateMutability: "pure";
26443
26430
  }], "getLiquidityForAmount1", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
26444
- getLiquidityForAmount1Ticks: (args: readonly [number, number, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
26431
+ getLiquidityForAmount1Ticks: (args: readonly [number, number, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
26445
26432
  readonly type: "function";
26446
26433
  readonly name: "batchGetAmount0ForLiquidity";
26447
26434
  readonly inputs: readonly [{
@@ -27062,7 +27049,7 @@ declare const useLens: () => {
27062
27049
  }];
27063
27050
  readonly stateMutability: "pure";
27064
27051
  }], "getLiquidityForAmount1Ticks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
27065
- getLiquidityForAmounts: (args: readonly [bigint, bigint, bigint, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
27052
+ getLiquidityForAmounts: (args: readonly [bigint, bigint, bigint, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
27066
27053
  readonly type: "function";
27067
27054
  readonly name: "batchGetAmount0ForLiquidity";
27068
27055
  readonly inputs: readonly [{
@@ -27683,7 +27670,7 @@ declare const useLens: () => {
27683
27670
  }];
27684
27671
  readonly stateMutability: "pure";
27685
27672
  }], "getLiquidityForAmounts", readonly [bigint, bigint, bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
27686
- getLiquidityForAmountsTicks: (args: readonly [number, number, number, bigint, bigint], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
27673
+ getLiquidityForAmountsTicks: (args: readonly [number, number, number, bigint, bigint], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
27687
27674
  readonly type: "function";
27688
27675
  readonly name: "batchGetAmount0ForLiquidity";
27689
27676
  readonly inputs: readonly [{
@@ -28304,7 +28291,7 @@ declare const useLens: () => {
28304
28291
  }];
28305
28292
  readonly stateMutability: "pure";
28306
28293
  }], "getLiquidityForAmountsTicks", readonly [number, number, number, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
28307
- getPriceAtTick: (args: readonly [number], options?: viem116.Prettify<viem116.UnionOmit<viem116.ReadContractParameters<readonly [{
28294
+ getPriceAtTick: (args: readonly [number], options?: viem366.Prettify<viem366.UnionOmit<viem366.ReadContractParameters<readonly [{
28308
28295
  readonly type: "function";
28309
28296
  readonly name: "batchGetAmount0ForLiquidity";
28310
28297
  readonly inputs: readonly [{
@@ -29551,5 +29538,5 @@ declare const useLens: () => {
29551
29538
  } | undefined;
29552
29539
  };
29553
29540
  //#endregion
29554
- export { LiquidityBlockData, OptionData, TimelockMarketProvider, UniswapPoolData, type UsePriceHistoryParams, batchGetAmountsFromLiquidity, useActiveUserOptions, useBurnLiquidity, useClosedUserOptions, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useLens, useLiquidityBlocks, useMarketData, useMaxPositionSize, useMintLiquidity, useMintOption, useOptionPnl, useOptionPremium, usePoolData, usePriceAtTick, usePriceHistory, useTimelockConfig, useVaultData, useVaultTVL };
29541
+ export { LiquidityBlockData, OptionData, TimelockMarketProvider, UniswapPoolData, batchGetAmountsFromLiquidity, useActiveUserOptions, useBurnLiquidity, useClosedUserOptions, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useLens, useLiquidityBlocks, useMarketData, useMaxPositionSize, useMintLiquidity, useMintOption, useOptionPnl, useOptionPremium, usePoolData, usePriceAtTick, usePriceHistory, useTimelockConfig, useVaultData, useVaultTVL };
29555
29542
  //# sourceMappingURL=client.d.cts.map
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./uniswapMathLens-MrB_VfJB.js";
2
- import { Amount, TimelockMarketData, UniswapMathLens } from "./index-B20z73_3.js";
2
+ import { Amount, TimelockMarketData, UniswapMathLens } from "./index-BwLIRtzJ.js";
3
3
  import * as viem0 from "viem";
4
4
  import { Address } from "viem";
5
5
  import React, { ReactNode } from "react";
@@ -2343,20 +2343,7 @@ interface PriceDataPoint {
2343
2343
  type PriceResolution = '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
2344
2344
  //#endregion
2345
2345
  //#region src/hooks/pool/usePriceHistory.d.ts
2346
- interface UsePriceHistoryParams {
2347
- poolAddress?: Address;
2348
- resolution: PriceResolution;
2349
- startTimestamp: number;
2350
- endTimestamp: number;
2351
- enabled?: boolean;
2352
- }
2353
- declare const usePriceHistory: ({
2354
- poolAddress,
2355
- resolution,
2356
- startTimestamp,
2357
- endTimestamp,
2358
- enabled
2359
- }: UsePriceHistoryParams) => _tanstack_react_query0.UseQueryResult<PriceDataPoint[], Error>;
2346
+ declare const usePriceHistory: (pool: Address | undefined, resolution: PriceResolution, startTimestamp: Date, endTimestamp: Date) => _tanstack_react_query0.UseQueryResult<PriceDataPoint[], Error>;
2360
2347
  //#endregion
2361
2348
  //#region src/hooks/vault/useBurnLiquidity.d.ts
2362
2349
  interface BurnPosition {
@@ -29551,5 +29538,5 @@ declare const useLens: () => {
29551
29538
  } | undefined;
29552
29539
  };
29553
29540
  //#endregion
29554
- export { LiquidityBlockData, OptionData, TimelockMarketProvider, UniswapPoolData, type UsePriceHistoryParams, batchGetAmountsFromLiquidity, useActiveUserOptions, useBurnLiquidity, useClosedUserOptions, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useLens, useLiquidityBlocks, useMarketData, useMaxPositionSize, useMintLiquidity, useMintOption, useOptionPnl, useOptionPremium, usePoolData, usePriceAtTick, usePriceHistory, useTimelockConfig, useVaultData, useVaultTVL };
29541
+ export { LiquidityBlockData, OptionData, TimelockMarketProvider, UniswapPoolData, batchGetAmountsFromLiquidity, useActiveUserOptions, useBurnLiquidity, useClosedUserOptions, useCurrentMarket, useCurrentPrice, useCurrentTick, useExerciseOption, useLens, useLiquidityBlocks, useMarketData, useMaxPositionSize, useMintLiquidity, useMintOption, useOptionPnl, useOptionPremium, usePoolData, usePriceAtTick, usePriceHistory, useTimelockConfig, useVaultData, useVaultTVL };
29555
29542
  //# sourceMappingURL=client.d.ts.map
package/dist/client.js CHANGED
@@ -546,30 +546,32 @@ const resolutionToGeckoTerminal = (resolution) => {
546
546
  const getPriceHistory = async (poolAddress, resolution, startTimestamp, endTimestamp) => {
547
547
  const network = "monad-testnet";
548
548
  const { timeframe, aggregate, seconds } = resolutionToGeckoTerminal(resolution);
549
- const timeDiff = endTimestamp - startTimestamp;
550
- const url = `https://api.geckoterminal.com/api/v2/networks/${network}/pools/${poolAddress}/ohlcv/${timeframe}?aggregate=${aggregate}&limit=${Math.min(Math.ceil(timeDiff / seconds), 1e3)}&token=quote&currency=usd&before_timestamp=${endTimestamp}`;
549
+ const startSecs = Math.floor(startTimestamp.getTime() / 1e3);
550
+ const endSecs = Math.floor(endTimestamp.getTime() / 1e3);
551
+ const diffSeconds = endSecs - startSecs;
552
+ const url = `https://api.geckoterminal.com/api/v2/networks/${network}/pools/${poolAddress}/ohlcv/${timeframe}?aggregate=${aggregate}&limit=${Math.min(Math.ceil(diffSeconds / seconds), 1e3)}&token=quote&currency=usd&before_timestamp=${endSecs}`;
551
553
  const res = await fetch(url, { headers: { Accept: "application/json" } });
552
554
  if (!res.ok) throw new Error(`Failed to fetch price history: ${res.statusText}`);
553
555
  return (await res.json()).data.attributes.ohlcv_list.map(({ 0: timestamp, 4: price }) => ({
554
556
  timestamp,
555
557
  price
556
- })).filter((point) => point.timestamp >= startTimestamp && point.timestamp <= endTimestamp).sort((a, b) => a.timestamp - b.timestamp);
558
+ })).filter((point) => point.timestamp >= startSecs && point.timestamp <= endSecs).sort((a, b) => a.timestamp - b.timestamp);
557
559
  };
558
560
 
559
561
  //#endregion
560
562
  //#region src/hooks/pool/usePriceHistory.ts
561
- const usePriceHistory = ({ poolAddress, resolution, startTimestamp, endTimestamp, enabled = true }) => {
563
+ const usePriceHistory = (pool, resolution, startTimestamp, endTimestamp) => {
562
564
  return useQuery({
563
565
  queryKey: [
564
566
  "priceHistory",
565
- poolAddress,
567
+ pool,
566
568
  useChainId(),
567
569
  resolution,
568
570
  startTimestamp,
569
571
  endTimestamp
570
572
  ],
571
- queryFn: () => getPriceHistory(poolAddress, resolution, startTimestamp, endTimestamp),
572
- enabled: enabled && !!poolAddress && startTimestamp < endTimestamp,
573
+ queryFn: () => getPriceHistory(pool, resolution, startTimestamp, endTimestamp),
574
+ enabled: !!pool && startTimestamp < endTimestamp,
573
575
  staleTime: 60 * 1e3,
574
576
  gcTime: 300 * 1e3,
575
577
  retry: 2