timelock-sdk 0.0.52 → 0.0.54
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.cjs +38 -16
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +59 -59
- package/dist/client.d.ts +59 -59
- package/dist/client.js +39 -17
- package/dist/client.js.map +1 -1
- package/dist/{index-D_lnxPOC.d.ts → index-BPKijlT_.d.cts} +2 -2
- package/dist/{index-HQTA4ETi.d.cts → index-Dt4gerGl.d.ts} +2 -2
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./uniswapMathLens-DCuaXAGZ.js";
|
|
2
|
-
import { D as TimelockMarketData, O as UniswapMathLens, d as Amount } from "./index-
|
|
3
|
-
import * as
|
|
2
|
+
import { D as TimelockMarketData, O as UniswapMathLens, d as Amount } from "./index-Dt4gerGl.js";
|
|
3
|
+
import * as viem367 from "viem";
|
|
4
4
|
import { Address } from "viem";
|
|
5
5
|
import React, { ReactNode } from "react";
|
|
6
6
|
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
@@ -181,7 +181,7 @@ declare const useTimelockConfig: () => TimelockMarketContextValue;
|
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region src/hooks/market/useUserOptions.d.ts
|
|
183
183
|
type OptionData = ReturnType<typeof useUserOptions>['data'][0];
|
|
184
|
-
declare const useUserOptions: (user?:
|
|
184
|
+
declare const useUserOptions: (user?: Address, active?: boolean) => {
|
|
185
185
|
error: Error;
|
|
186
186
|
isError: true;
|
|
187
187
|
isPending: false;
|
|
@@ -884,7 +884,7 @@ declare const useUserOptions: (user?: string, active?: boolean) => {
|
|
|
884
884
|
} | null;
|
|
885
885
|
}[];
|
|
886
886
|
};
|
|
887
|
-
declare const useActiveUserOptions: (user?:
|
|
887
|
+
declare const useActiveUserOptions: (user?: Address) => {
|
|
888
888
|
error: Error;
|
|
889
889
|
isError: true;
|
|
890
890
|
isPending: false;
|
|
@@ -1587,7 +1587,7 @@ declare const useActiveUserOptions: (user?: string) => {
|
|
|
1587
1587
|
} | null;
|
|
1588
1588
|
}[];
|
|
1589
1589
|
};
|
|
1590
|
-
declare const useClosedUserOptions: (user?:
|
|
1590
|
+
declare const useClosedUserOptions: (user?: Address) => {
|
|
1591
1591
|
error: Error;
|
|
1592
1592
|
isError: true;
|
|
1593
1593
|
isPending: false;
|
|
@@ -2421,7 +2421,7 @@ declare const useBurnLiquidity: (vaultAddr?: Address) => {
|
|
|
2421
2421
|
//#region src/hooks/vault/useLiquidityBlocks.d.ts
|
|
2422
2422
|
type LiquidityBlockData = ReturnType<typeof useLiquidityBlocks>['data'][0];
|
|
2423
2423
|
declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
2424
|
-
error:
|
|
2424
|
+
error: viem367.ReadContractErrorType;
|
|
2425
2425
|
isError: true;
|
|
2426
2426
|
isPending: false;
|
|
2427
2427
|
isLoading: false;
|
|
@@ -2433,7 +2433,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2433
2433
|
dataUpdatedAt: number;
|
|
2434
2434
|
errorUpdatedAt: number;
|
|
2435
2435
|
failureCount: number;
|
|
2436
|
-
failureReason:
|
|
2436
|
+
failureReason: viem367.ReadContractErrorType | null;
|
|
2437
2437
|
errorUpdateCount: number;
|
|
2438
2438
|
isFetched: boolean;
|
|
2439
2439
|
isFetchedAfterMount: boolean;
|
|
@@ -2453,7 +2453,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2453
2453
|
totalAmount1: bigint;
|
|
2454
2454
|
borrowedAmount0: bigint;
|
|
2455
2455
|
borrowedAmount1: bigint;
|
|
2456
|
-
}[],
|
|
2456
|
+
}[], viem367.ReadContractErrorType>>;
|
|
2457
2457
|
fetchStatus: _tanstack_query_core0.FetchStatus;
|
|
2458
2458
|
promise: Promise<readonly {
|
|
2459
2459
|
tickLower: number;
|
|
@@ -2491,7 +2491,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2491
2491
|
dataUpdatedAt: number;
|
|
2492
2492
|
errorUpdatedAt: number;
|
|
2493
2493
|
failureCount: number;
|
|
2494
|
-
failureReason:
|
|
2494
|
+
failureReason: viem367.ReadContractErrorType | null;
|
|
2495
2495
|
errorUpdateCount: number;
|
|
2496
2496
|
isFetched: boolean;
|
|
2497
2497
|
isFetchedAfterMount: boolean;
|
|
@@ -2511,7 +2511,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2511
2511
|
totalAmount1: bigint;
|
|
2512
2512
|
borrowedAmount0: bigint;
|
|
2513
2513
|
borrowedAmount1: bigint;
|
|
2514
|
-
}[],
|
|
2514
|
+
}[], viem367.ReadContractErrorType>>;
|
|
2515
2515
|
fetchStatus: _tanstack_query_core0.FetchStatus;
|
|
2516
2516
|
promise: Promise<readonly {
|
|
2517
2517
|
tickLower: number;
|
|
@@ -2537,7 +2537,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2537
2537
|
borrowedAmount1: bigint;
|
|
2538
2538
|
}[];
|
|
2539
2539
|
} | {
|
|
2540
|
-
error:
|
|
2540
|
+
error: viem367.ReadContractErrorType;
|
|
2541
2541
|
isError: true;
|
|
2542
2542
|
isPending: false;
|
|
2543
2543
|
isLoading: false;
|
|
@@ -2549,7 +2549,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2549
2549
|
dataUpdatedAt: number;
|
|
2550
2550
|
errorUpdatedAt: number;
|
|
2551
2551
|
failureCount: number;
|
|
2552
|
-
failureReason:
|
|
2552
|
+
failureReason: viem367.ReadContractErrorType | null;
|
|
2553
2553
|
errorUpdateCount: number;
|
|
2554
2554
|
isFetched: boolean;
|
|
2555
2555
|
isFetchedAfterMount: boolean;
|
|
@@ -2569,7 +2569,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2569
2569
|
totalAmount1: bigint;
|
|
2570
2570
|
borrowedAmount0: bigint;
|
|
2571
2571
|
borrowedAmount1: bigint;
|
|
2572
|
-
}[],
|
|
2572
|
+
}[], viem367.ReadContractErrorType>>;
|
|
2573
2573
|
fetchStatus: _tanstack_query_core0.FetchStatus;
|
|
2574
2574
|
promise: Promise<readonly {
|
|
2575
2575
|
tickLower: number;
|
|
@@ -2607,7 +2607,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2607
2607
|
dataUpdatedAt: number;
|
|
2608
2608
|
errorUpdatedAt: number;
|
|
2609
2609
|
failureCount: number;
|
|
2610
|
-
failureReason:
|
|
2610
|
+
failureReason: viem367.ReadContractErrorType | null;
|
|
2611
2611
|
errorUpdateCount: number;
|
|
2612
2612
|
isFetched: boolean;
|
|
2613
2613
|
isFetchedAfterMount: boolean;
|
|
@@ -2627,7 +2627,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2627
2627
|
totalAmount1: bigint;
|
|
2628
2628
|
borrowedAmount0: bigint;
|
|
2629
2629
|
borrowedAmount1: bigint;
|
|
2630
|
-
}[],
|
|
2630
|
+
}[], viem367.ReadContractErrorType>>;
|
|
2631
2631
|
fetchStatus: _tanstack_query_core0.FetchStatus;
|
|
2632
2632
|
promise: Promise<readonly {
|
|
2633
2633
|
tickLower: number;
|
|
@@ -2664,7 +2664,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2664
2664
|
dataUpdatedAt: number;
|
|
2665
2665
|
errorUpdatedAt: number;
|
|
2666
2666
|
failureCount: number;
|
|
2667
|
-
failureReason:
|
|
2667
|
+
failureReason: viem367.ReadContractErrorType | null;
|
|
2668
2668
|
errorUpdateCount: number;
|
|
2669
2669
|
isFetched: boolean;
|
|
2670
2670
|
isFetchedAfterMount: boolean;
|
|
@@ -2685,7 +2685,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2685
2685
|
totalAmount1: bigint;
|
|
2686
2686
|
borrowedAmount0: bigint;
|
|
2687
2687
|
borrowedAmount1: bigint;
|
|
2688
|
-
}[],
|
|
2688
|
+
}[], viem367.ReadContractErrorType>>;
|
|
2689
2689
|
fetchStatus: _tanstack_query_core0.FetchStatus;
|
|
2690
2690
|
promise: Promise<readonly {
|
|
2691
2691
|
tickLower: number;
|
|
@@ -2723,7 +2723,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2723
2723
|
dataUpdatedAt: number;
|
|
2724
2724
|
errorUpdatedAt: number;
|
|
2725
2725
|
failureCount: number;
|
|
2726
|
-
failureReason:
|
|
2726
|
+
failureReason: viem367.ReadContractErrorType | null;
|
|
2727
2727
|
errorUpdateCount: number;
|
|
2728
2728
|
isFetched: boolean;
|
|
2729
2729
|
isFetchedAfterMount: boolean;
|
|
@@ -2743,7 +2743,7 @@ declare const useLiquidityBlocks: (vaultAddr?: Address) => {
|
|
|
2743
2743
|
totalAmount1: bigint;
|
|
2744
2744
|
borrowedAmount0: bigint;
|
|
2745
2745
|
borrowedAmount1: bigint;
|
|
2746
|
-
}[],
|
|
2746
|
+
}[], viem367.ReadContractErrorType>>;
|
|
2747
2747
|
fetchStatus: _tanstack_query_core0.FetchStatus;
|
|
2748
2748
|
promise: Promise<readonly {
|
|
2749
2749
|
tickLower: number;
|
|
@@ -2816,14 +2816,14 @@ declare const useVaultTVL: (vaultAddr?: Address) => {
|
|
|
2816
2816
|
borrowedAmount0: Amount;
|
|
2817
2817
|
borrowedAmount1: Amount;
|
|
2818
2818
|
blocksCount: bigint;
|
|
2819
|
-
refetch: (options?: _tanstack_query_core0.RefetchOptions) => Promise<_tanstack_query_core0.QueryObserverResult<readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint],
|
|
2819
|
+
refetch: (options?: _tanstack_query_core0.RefetchOptions) => Promise<_tanstack_query_core0.QueryObserverResult<readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint], viem367.ReadContractErrorType>>;
|
|
2820
2820
|
};
|
|
2821
2821
|
//#endregion
|
|
2822
2822
|
//#region src/hooks/useLens.d.ts
|
|
2823
2823
|
declare const useLens: () => {
|
|
2824
2824
|
timelockLens: {
|
|
2825
2825
|
read: {
|
|
2826
|
-
batchGetRefTick: (args: readonly [`0x${string}`, readonly number[]], options?:
|
|
2826
|
+
batchGetRefTick: (args: readonly [`0x${string}`, readonly number[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
2827
2827
|
readonly type: "function";
|
|
2828
2828
|
readonly name: "batchGetRefTick";
|
|
2829
2829
|
readonly inputs: readonly [{
|
|
@@ -3497,7 +3497,7 @@ declare const useLens: () => {
|
|
|
3497
3497
|
}];
|
|
3498
3498
|
readonly stateMutability: "view";
|
|
3499
3499
|
}], "batchGetRefTick", readonly [`0x${string}`, readonly number[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly number[]>;
|
|
3500
|
-
getAllBlocks: (args: readonly [`0x${string}`], options?:
|
|
3500
|
+
getAllBlocks: (args: readonly [`0x${string}`], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
3501
3501
|
readonly type: "function";
|
|
3502
3502
|
readonly name: "batchGetRefTick";
|
|
3503
3503
|
readonly inputs: readonly [{
|
|
@@ -4181,7 +4181,7 @@ declare const useLens: () => {
|
|
|
4181
4181
|
borrowedAmount0: bigint;
|
|
4182
4182
|
borrowedAmount1: bigint;
|
|
4183
4183
|
}[]>;
|
|
4184
|
-
getExpiredOptions: (args: readonly [`0x${string}`, bigint, bigint], options?:
|
|
4184
|
+
getExpiredOptions: (args: readonly [`0x${string}`, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
4185
4185
|
readonly type: "function";
|
|
4186
4186
|
readonly name: "batchGetRefTick";
|
|
4187
4187
|
readonly inputs: readonly [{
|
|
@@ -4872,7 +4872,7 @@ declare const useLens: () => {
|
|
|
4872
4872
|
expiresAt: bigint;
|
|
4873
4873
|
liquidities: readonly bigint[];
|
|
4874
4874
|
}[], bigint, boolean]>;
|
|
4875
|
-
getLiquidityAtTick: (args: readonly [`0x${string}`, number], options?:
|
|
4875
|
+
getLiquidityAtTick: (args: readonly [`0x${string}`, number], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
4876
4876
|
readonly type: "function";
|
|
4877
4877
|
readonly name: "batchGetRefTick";
|
|
4878
4878
|
readonly inputs: readonly [{
|
|
@@ -5546,7 +5546,7 @@ declare const useLens: () => {
|
|
|
5546
5546
|
}];
|
|
5547
5547
|
readonly stateMutability: "view";
|
|
5548
5548
|
}], "getLiquidityAtTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
|
|
5549
|
-
getMarketData: (args: readonly [`0x${string}`], options?:
|
|
5549
|
+
getMarketData: (args: readonly [`0x${string}`], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
5550
5550
|
readonly type: "function";
|
|
5551
5551
|
readonly name: "batchGetRefTick";
|
|
5552
5552
|
readonly inputs: readonly [{
|
|
@@ -6233,7 +6233,7 @@ declare const useLens: () => {
|
|
|
6233
6233
|
payoutAssetName: string;
|
|
6234
6234
|
optionsCount: bigint;
|
|
6235
6235
|
}>;
|
|
6236
|
-
getMaxPositionSize: (args: readonly [`0x${string}`, number, number], options?:
|
|
6236
|
+
getMaxPositionSize: (args: readonly [`0x${string}`, number, number], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
6237
6237
|
readonly type: "function";
|
|
6238
6238
|
readonly name: "batchGetRefTick";
|
|
6239
6239
|
readonly inputs: readonly [{
|
|
@@ -6907,7 +6907,7 @@ declare const useLens: () => {
|
|
|
6907
6907
|
}];
|
|
6908
6908
|
readonly stateMutability: "view";
|
|
6909
6909
|
}], "getMaxPositionSize", readonly [`0x${string}`, number, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
|
|
6910
|
-
getMaxPositionSizeAtCurrentTick: (args: readonly [`0x${string}`, number], options?:
|
|
6910
|
+
getMaxPositionSizeAtCurrentTick: (args: readonly [`0x${string}`, number], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
6911
6911
|
readonly type: "function";
|
|
6912
6912
|
readonly name: "batchGetRefTick";
|
|
6913
6913
|
readonly inputs: readonly [{
|
|
@@ -7581,7 +7581,7 @@ declare const useLens: () => {
|
|
|
7581
7581
|
}];
|
|
7582
7582
|
readonly stateMutability: "view";
|
|
7583
7583
|
}], "getMaxPositionSizeAtCurrentTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
|
|
7584
|
-
getOptionData: (args: readonly [`0x${string}`, bigint], options?:
|
|
7584
|
+
getOptionData: (args: readonly [`0x${string}`, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
7585
7585
|
readonly type: "function";
|
|
7586
7586
|
readonly name: "batchGetRefTick";
|
|
7587
7587
|
readonly inputs: readonly [{
|
|
@@ -8272,7 +8272,7 @@ declare const useLens: () => {
|
|
|
8272
8272
|
expiresAt: bigint;
|
|
8273
8273
|
liquidities: readonly bigint[];
|
|
8274
8274
|
}>;
|
|
8275
|
-
getOptionsData: (args: readonly [`0x${string}`, readonly bigint[]], options?:
|
|
8275
|
+
getOptionsData: (args: readonly [`0x${string}`, readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
8276
8276
|
readonly type: "function";
|
|
8277
8277
|
readonly name: "batchGetRefTick";
|
|
8278
8278
|
readonly inputs: readonly [{
|
|
@@ -8963,7 +8963,7 @@ declare const useLens: () => {
|
|
|
8963
8963
|
expiresAt: bigint;
|
|
8964
8964
|
liquidities: readonly bigint[];
|
|
8965
8965
|
}[]>;
|
|
8966
|
-
getPoolData: (args: readonly [`0x${string}`], options?:
|
|
8966
|
+
getPoolData: (args: readonly [`0x${string}`], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
8967
8967
|
readonly type: "function";
|
|
8968
8968
|
readonly name: "batchGetRefTick";
|
|
8969
8969
|
readonly inputs: readonly [{
|
|
@@ -9648,7 +9648,7 @@ declare const useLens: () => {
|
|
|
9648
9648
|
tickSpacing: number;
|
|
9649
9649
|
fee: number;
|
|
9650
9650
|
}>;
|
|
9651
|
-
getRefTick: (args: readonly [`0x${string}`, number], options?:
|
|
9651
|
+
getRefTick: (args: readonly [`0x${string}`, number], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
9652
9652
|
readonly type: "function";
|
|
9653
9653
|
readonly name: "batchGetRefTick";
|
|
9654
9654
|
readonly inputs: readonly [{
|
|
@@ -10322,7 +10322,7 @@ declare const useLens: () => {
|
|
|
10322
10322
|
}];
|
|
10323
10323
|
readonly stateMutability: "view";
|
|
10324
10324
|
}], "getRefTick", readonly [`0x${string}`, number]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<number>;
|
|
10325
|
-
getUserOptions: (args: readonly [`0x${string}`, `0x${string}`, bigint, bigint], options?:
|
|
10325
|
+
getUserOptions: (args: readonly [`0x${string}`, `0x${string}`, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
10326
10326
|
readonly type: "function";
|
|
10327
10327
|
readonly name: "batchGetRefTick";
|
|
10328
10328
|
readonly inputs: readonly [{
|
|
@@ -11013,7 +11013,7 @@ declare const useLens: () => {
|
|
|
11013
11013
|
expiresAt: bigint;
|
|
11014
11014
|
liquidities: readonly bigint[];
|
|
11015
11015
|
}[], bigint, boolean]>;
|
|
11016
|
-
getVaultTVL: (args: readonly [`0x${string}`], options?:
|
|
11016
|
+
getVaultTVL: (args: readonly [`0x${string}`], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
11017
11017
|
readonly type: "function";
|
|
11018
11018
|
readonly name: "batchGetRefTick";
|
|
11019
11019
|
readonly inputs: readonly [{
|
|
@@ -12366,7 +12366,7 @@ declare const useLens: () => {
|
|
|
12366
12366
|
} | undefined;
|
|
12367
12367
|
uniswapLens: {
|
|
12368
12368
|
read: {
|
|
12369
|
-
batchGetAmount0ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?:
|
|
12369
|
+
batchGetAmount0ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
12370
12370
|
readonly type: "function";
|
|
12371
12371
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
12372
12372
|
readonly inputs: readonly [{
|
|
@@ -12987,7 +12987,7 @@ declare const useLens: () => {
|
|
|
12987
12987
|
}];
|
|
12988
12988
|
readonly stateMutability: "pure";
|
|
12989
12989
|
}], "batchGetAmount0ForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
12990
|
-
batchGetAmount0ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?:
|
|
12990
|
+
batchGetAmount0ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
12991
12991
|
readonly type: "function";
|
|
12992
12992
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
12993
12993
|
readonly inputs: readonly [{
|
|
@@ -13608,7 +13608,7 @@ declare const useLens: () => {
|
|
|
13608
13608
|
}];
|
|
13609
13609
|
readonly stateMutability: "pure";
|
|
13610
13610
|
}], "batchGetAmount0ForLiquidityTicks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
13611
|
-
batchGetAmount1ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?:
|
|
13611
|
+
batchGetAmount1ForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
13612
13612
|
readonly type: "function";
|
|
13613
13613
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
13614
13614
|
readonly inputs: readonly [{
|
|
@@ -14229,7 +14229,7 @@ declare const useLens: () => {
|
|
|
14229
14229
|
}];
|
|
14230
14230
|
readonly stateMutability: "pure";
|
|
14231
14231
|
}], "batchGetAmount1ForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
14232
|
-
batchGetAmount1ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?:
|
|
14232
|
+
batchGetAmount1ForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
14233
14233
|
readonly type: "function";
|
|
14234
14234
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
14235
14235
|
readonly inputs: readonly [{
|
|
@@ -14850,7 +14850,7 @@ declare const useLens: () => {
|
|
|
14850
14850
|
}];
|
|
14851
14851
|
readonly stateMutability: "pure";
|
|
14852
14852
|
}], "batchGetAmount1ForLiquidityTicks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
14853
|
-
batchGetAmountsForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?:
|
|
14853
|
+
batchGetAmountsForLiquidity: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
14854
14854
|
readonly type: "function";
|
|
14855
14855
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
14856
14856
|
readonly inputs: readonly [{
|
|
@@ -15471,7 +15471,7 @@ declare const useLens: () => {
|
|
|
15471
15471
|
}];
|
|
15472
15472
|
readonly stateMutability: "pure";
|
|
15473
15473
|
}], "batchGetAmountsForLiquidity", readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [readonly bigint[], readonly bigint[]]>;
|
|
15474
|
-
batchGetAmountsForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]], options?:
|
|
15474
|
+
batchGetAmountsForLiquidityTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
15475
15475
|
readonly type: "function";
|
|
15476
15476
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
15477
15477
|
readonly inputs: readonly [{
|
|
@@ -16092,7 +16092,7 @@ declare const useLens: () => {
|
|
|
16092
16092
|
}];
|
|
16093
16093
|
readonly stateMutability: "pure";
|
|
16094
16094
|
}], "batchGetAmountsForLiquidityTicks", readonly [readonly number[], readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [readonly bigint[], readonly bigint[]]>;
|
|
16095
|
-
batchGetLiquidityForAmount0: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?:
|
|
16095
|
+
batchGetLiquidityForAmount0: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
16096
16096
|
readonly type: "function";
|
|
16097
16097
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
16098
16098
|
readonly inputs: readonly [{
|
|
@@ -16713,7 +16713,7 @@ declare const useLens: () => {
|
|
|
16713
16713
|
}];
|
|
16714
16714
|
readonly stateMutability: "pure";
|
|
16715
16715
|
}], "batchGetLiquidityForAmount0", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
16716
|
-
batchGetLiquidityForAmount0Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?:
|
|
16716
|
+
batchGetLiquidityForAmount0Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
16717
16717
|
readonly type: "function";
|
|
16718
16718
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
16719
16719
|
readonly inputs: readonly [{
|
|
@@ -17334,7 +17334,7 @@ declare const useLens: () => {
|
|
|
17334
17334
|
}];
|
|
17335
17335
|
readonly stateMutability: "pure";
|
|
17336
17336
|
}], "batchGetLiquidityForAmount0Ticks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
17337
|
-
batchGetLiquidityForAmount1: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?:
|
|
17337
|
+
batchGetLiquidityForAmount1: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
17338
17338
|
readonly type: "function";
|
|
17339
17339
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
17340
17340
|
readonly inputs: readonly [{
|
|
@@ -17955,7 +17955,7 @@ declare const useLens: () => {
|
|
|
17955
17955
|
}];
|
|
17956
17956
|
readonly stateMutability: "pure";
|
|
17957
17957
|
}], "batchGetLiquidityForAmount1", readonly [readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
17958
|
-
batchGetLiquidityForAmount1Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?:
|
|
17958
|
+
batchGetLiquidityForAmount1Ticks: (args: readonly [readonly number[], readonly number[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
17959
17959
|
readonly type: "function";
|
|
17960
17960
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
17961
17961
|
readonly inputs: readonly [{
|
|
@@ -18576,7 +18576,7 @@ declare const useLens: () => {
|
|
|
18576
18576
|
}];
|
|
18577
18577
|
readonly stateMutability: "pure";
|
|
18578
18578
|
}], "batchGetLiquidityForAmount1Ticks", readonly [readonly number[], readonly number[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
18579
|
-
batchGetLiquidityForAmounts: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?:
|
|
18579
|
+
batchGetLiquidityForAmounts: (args: readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
18580
18580
|
readonly type: "function";
|
|
18581
18581
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
18582
18582
|
readonly inputs: readonly [{
|
|
@@ -19197,7 +19197,7 @@ declare const useLens: () => {
|
|
|
19197
19197
|
}];
|
|
19198
19198
|
readonly stateMutability: "pure";
|
|
19199
19199
|
}], "batchGetLiquidityForAmounts", readonly [readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
19200
|
-
batchGetLiquidityForAmountsTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]], options?:
|
|
19200
|
+
batchGetLiquidityForAmountsTicks: (args: readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
19201
19201
|
readonly type: "function";
|
|
19202
19202
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
19203
19203
|
readonly inputs: readonly [{
|
|
@@ -19818,7 +19818,7 @@ declare const useLens: () => {
|
|
|
19818
19818
|
}];
|
|
19819
19819
|
readonly stateMutability: "pure";
|
|
19820
19820
|
}], "batchGetLiquidityForAmountsTicks", readonly [readonly number[], readonly number[], readonly number[], readonly bigint[], readonly bigint[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
19821
|
-
batchGetPriceAtTick: (args: readonly [readonly number[]], options?:
|
|
19821
|
+
batchGetPriceAtTick: (args: readonly [readonly number[]], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
19822
19822
|
readonly type: "function";
|
|
19823
19823
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
19824
19824
|
readonly inputs: readonly [{
|
|
@@ -20439,7 +20439,7 @@ declare const useLens: () => {
|
|
|
20439
20439
|
}];
|
|
20440
20440
|
readonly stateMutability: "pure";
|
|
20441
20441
|
}], "batchGetPriceAtTick", readonly [readonly number[]]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly bigint[]>;
|
|
20442
|
-
getAmount0ForLiquidity: (args: readonly [bigint, bigint, bigint], options?:
|
|
20442
|
+
getAmount0ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
20443
20443
|
readonly type: "function";
|
|
20444
20444
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
20445
20445
|
readonly inputs: readonly [{
|
|
@@ -21060,7 +21060,7 @@ declare const useLens: () => {
|
|
|
21060
21060
|
}];
|
|
21061
21061
|
readonly stateMutability: "pure";
|
|
21062
21062
|
}], "getAmount0ForLiquidity", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
21063
|
-
getAmount0ForLiquidityTicks: (args: readonly [number, number, bigint], options?:
|
|
21063
|
+
getAmount0ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
21064
21064
|
readonly type: "function";
|
|
21065
21065
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
21066
21066
|
readonly inputs: readonly [{
|
|
@@ -21681,7 +21681,7 @@ declare const useLens: () => {
|
|
|
21681
21681
|
}];
|
|
21682
21682
|
readonly stateMutability: "pure";
|
|
21683
21683
|
}], "getAmount0ForLiquidityTicks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
21684
|
-
getAmount1ForLiquidity: (args: readonly [bigint, bigint, bigint], options?:
|
|
21684
|
+
getAmount1ForLiquidity: (args: readonly [bigint, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
21685
21685
|
readonly type: "function";
|
|
21686
21686
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
21687
21687
|
readonly inputs: readonly [{
|
|
@@ -22302,7 +22302,7 @@ declare const useLens: () => {
|
|
|
22302
22302
|
}];
|
|
22303
22303
|
readonly stateMutability: "pure";
|
|
22304
22304
|
}], "getAmount1ForLiquidity", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
22305
|
-
getAmount1ForLiquidityTicks: (args: readonly [number, number, bigint], options?:
|
|
22305
|
+
getAmount1ForLiquidityTicks: (args: readonly [number, number, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
22306
22306
|
readonly type: "function";
|
|
22307
22307
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
22308
22308
|
readonly inputs: readonly [{
|
|
@@ -22923,7 +22923,7 @@ declare const useLens: () => {
|
|
|
22923
22923
|
}];
|
|
22924
22924
|
readonly stateMutability: "pure";
|
|
22925
22925
|
}], "getAmount1ForLiquidityTicks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
22926
|
-
getAmountsForLiquidity: (args: readonly [bigint, bigint, bigint, bigint], options?:
|
|
22926
|
+
getAmountsForLiquidity: (args: readonly [bigint, bigint, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
22927
22927
|
readonly type: "function";
|
|
22928
22928
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
22929
22929
|
readonly inputs: readonly [{
|
|
@@ -23544,7 +23544,7 @@ declare const useLens: () => {
|
|
|
23544
23544
|
}];
|
|
23545
23545
|
readonly stateMutability: "pure";
|
|
23546
23546
|
}], "getAmountsForLiquidity", readonly [bigint, bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
|
|
23547
|
-
getAmountsForLiquidityTicks: (args: readonly [number, number, number, bigint], options?:
|
|
23547
|
+
getAmountsForLiquidityTicks: (args: readonly [number, number, number, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
23548
23548
|
readonly type: "function";
|
|
23549
23549
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
23550
23550
|
readonly inputs: readonly [{
|
|
@@ -24165,7 +24165,7 @@ declare const useLens: () => {
|
|
|
24165
24165
|
}];
|
|
24166
24166
|
readonly stateMutability: "pure";
|
|
24167
24167
|
}], "getAmountsForLiquidityTicks", readonly [number, number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<readonly [bigint, bigint]>;
|
|
24168
|
-
getLiquidityForAmount0: (args: readonly [bigint, bigint, bigint], options?:
|
|
24168
|
+
getLiquidityForAmount0: (args: readonly [bigint, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
24169
24169
|
readonly type: "function";
|
|
24170
24170
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
24171
24171
|
readonly inputs: readonly [{
|
|
@@ -24786,7 +24786,7 @@ declare const useLens: () => {
|
|
|
24786
24786
|
}];
|
|
24787
24787
|
readonly stateMutability: "pure";
|
|
24788
24788
|
}], "getLiquidityForAmount0", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
24789
|
-
getLiquidityForAmount0Ticks: (args: readonly [number, number, bigint], options?:
|
|
24789
|
+
getLiquidityForAmount0Ticks: (args: readonly [number, number, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
24790
24790
|
readonly type: "function";
|
|
24791
24791
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
24792
24792
|
readonly inputs: readonly [{
|
|
@@ -25407,7 +25407,7 @@ declare const useLens: () => {
|
|
|
25407
25407
|
}];
|
|
25408
25408
|
readonly stateMutability: "pure";
|
|
25409
25409
|
}], "getLiquidityForAmount0Ticks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
25410
|
-
getLiquidityForAmount1: (args: readonly [bigint, bigint, bigint], options?:
|
|
25410
|
+
getLiquidityForAmount1: (args: readonly [bigint, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
25411
25411
|
readonly type: "function";
|
|
25412
25412
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
25413
25413
|
readonly inputs: readonly [{
|
|
@@ -26028,7 +26028,7 @@ declare const useLens: () => {
|
|
|
26028
26028
|
}];
|
|
26029
26029
|
readonly stateMutability: "pure";
|
|
26030
26030
|
}], "getLiquidityForAmount1", readonly [bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
26031
|
-
getLiquidityForAmount1Ticks: (args: readonly [number, number, bigint], options?:
|
|
26031
|
+
getLiquidityForAmount1Ticks: (args: readonly [number, number, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
26032
26032
|
readonly type: "function";
|
|
26033
26033
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
26034
26034
|
readonly inputs: readonly [{
|
|
@@ -26649,7 +26649,7 @@ declare const useLens: () => {
|
|
|
26649
26649
|
}];
|
|
26650
26650
|
readonly stateMutability: "pure";
|
|
26651
26651
|
}], "getLiquidityForAmount1Ticks", readonly [number, number, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
26652
|
-
getLiquidityForAmounts: (args: readonly [bigint, bigint, bigint, bigint, bigint], options?:
|
|
26652
|
+
getLiquidityForAmounts: (args: readonly [bigint, bigint, bigint, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
26653
26653
|
readonly type: "function";
|
|
26654
26654
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
26655
26655
|
readonly inputs: readonly [{
|
|
@@ -27270,7 +27270,7 @@ declare const useLens: () => {
|
|
|
27270
27270
|
}];
|
|
27271
27271
|
readonly stateMutability: "pure";
|
|
27272
27272
|
}], "getLiquidityForAmounts", readonly [bigint, bigint, bigint, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
27273
|
-
getLiquidityForAmountsTicks: (args: readonly [number, number, number, bigint, bigint], options?:
|
|
27273
|
+
getLiquidityForAmountsTicks: (args: readonly [number, number, number, bigint, bigint], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
27274
27274
|
readonly type: "function";
|
|
27275
27275
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
27276
27276
|
readonly inputs: readonly [{
|
|
@@ -27891,7 +27891,7 @@ declare const useLens: () => {
|
|
|
27891
27891
|
}];
|
|
27892
27892
|
readonly stateMutability: "pure";
|
|
27893
27893
|
}], "getLiquidityForAmountsTicks", readonly [number, number, number, bigint, bigint]>, "address" | "abi" | "args" | "functionName">> | undefined) => Promise<bigint>;
|
|
27894
|
-
getPriceAtTick: (args: readonly [number], options?:
|
|
27894
|
+
getPriceAtTick: (args: readonly [number], options?: viem367.Prettify<viem367.UnionOmit<viem367.ReadContractParameters<readonly [{
|
|
27895
27895
|
readonly type: "function";
|
|
27896
27896
|
readonly name: "batchGetAmount0ForLiquidity";
|
|
27897
27897
|
readonly inputs: readonly [{
|
package/dist/client.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useAccount, useChainId, useClient, useReadContract, useWaitForTransacti
|
|
|
10
10
|
import { GraphQLClient, RequestOptions } from "graphql-request";
|
|
11
11
|
import gql from "graphql-tag";
|
|
12
12
|
import { waitForTransactionReceipt } from "viem/actions";
|
|
13
|
-
import { useQuery } from "@tanstack/react-query";
|
|
13
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
14
14
|
|
|
15
15
|
//#region src/generated/graphql.ts
|
|
16
16
|
const GetActiveUserOptionsDocument = gql`
|
|
@@ -179,10 +179,21 @@ const useTimelockConfig = () => {
|
|
|
179
179
|
return context;
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/hooks/useLens.ts
|
|
184
|
+
const useLens = () => {
|
|
185
|
+
const client = useClient();
|
|
186
|
+
return useMemo(() => ({
|
|
187
|
+
timelockLens: client ? getTimelockLens(client) : void 0,
|
|
188
|
+
uniswapLens: client ? getUniswapMathLens(client) : void 0
|
|
189
|
+
}), [client]);
|
|
190
|
+
};
|
|
191
|
+
|
|
182
192
|
//#endregion
|
|
183
193
|
//#region src/hooks/market/useMarketData.ts
|
|
184
194
|
const useMarketData = (marketAddr) => {
|
|
185
195
|
const { graphqlClient } = useTimelockConfig();
|
|
196
|
+
const { timelockLens } = useLens();
|
|
186
197
|
const { data } = useQuery({
|
|
187
198
|
queryKey: ["marketData", marketAddr || "--"],
|
|
188
199
|
queryFn: async () => {
|
|
@@ -199,17 +210,18 @@ const useMarketData = (marketAddr) => {
|
|
|
199
210
|
},
|
|
200
211
|
enabled: !!marketAddr && !!graphqlClient
|
|
201
212
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
})
|
|
213
|
+
const { data: fallback } = useQuery({
|
|
214
|
+
queryKey: ["marketData", marketAddr || "--"],
|
|
215
|
+
queryFn: async () => {
|
|
216
|
+
if (!marketAddr || !timelockLens) return void 0;
|
|
217
|
+
return {
|
|
218
|
+
...await timelockLens.read.getMarketData([marketAddr]),
|
|
219
|
+
tradersCount: void 0
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
enabled: !!marketAddr && !!timelockLens
|
|
223
|
+
});
|
|
224
|
+
return data || fallback || {};
|
|
213
225
|
};
|
|
214
226
|
|
|
215
227
|
//#endregion
|
|
@@ -234,11 +246,17 @@ const useExerciseOption = (marketAddr) => {
|
|
|
234
246
|
const { vault, pool } = useMarketData(marketAddr);
|
|
235
247
|
const { fee } = usePoolData(pool);
|
|
236
248
|
const { timelockLens } = useLens();
|
|
249
|
+
const queryClient = useQueryClient();
|
|
237
250
|
const client = useClient();
|
|
251
|
+
const { address } = useAccount();
|
|
238
252
|
const { writeContractAsync, data: hash, isPending, error } = useWriteContract();
|
|
239
253
|
const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
|
|
240
254
|
const exerciseOption = async (option, liquidities) => {
|
|
241
|
-
if (!client || !
|
|
255
|
+
if (!client || !address) throw new Error("Wallet not connected");
|
|
256
|
+
if (!marketAddr) throw new Error("Market address not available");
|
|
257
|
+
if (!timelockLens) throw new Error("Timelock lens not available");
|
|
258
|
+
if (!vault) throw new Error("Vault not available");
|
|
259
|
+
if (!fee) throw new Error("Pool data not available");
|
|
242
260
|
const refTick = await timelockLens.read.getRefTick([vault, option.startTick]);
|
|
243
261
|
const hash$1 = await writeContractAsync({
|
|
244
262
|
address: marketAddr,
|
|
@@ -254,6 +272,7 @@ const useExerciseOption = (marketAddr) => {
|
|
|
254
272
|
]
|
|
255
273
|
});
|
|
256
274
|
await waitForTransactionReceipt(client, { hash: hash$1 });
|
|
275
|
+
await queryClient.invalidateQueries({ queryKey: ["userOptions", address.toLowerCase()] });
|
|
257
276
|
return hash$1;
|
|
258
277
|
};
|
|
259
278
|
return {
|
|
@@ -336,6 +355,7 @@ const useMintOption = (marketAddr) => {
|
|
|
336
355
|
const { exact: currentTick } = useCurrentTick(pool);
|
|
337
356
|
const client = useClient();
|
|
338
357
|
const { address } = useAccount();
|
|
358
|
+
const queryClient = useQueryClient();
|
|
339
359
|
const { writeContractAsync, data: hash, isPending, error } = useWriteContract();
|
|
340
360
|
const { isLoading: isConfirming, isSuccess } = useWaitForTransactionReceipt({ hash });
|
|
341
361
|
const askForApproval = async (premiumAmount) => {
|
|
@@ -349,7 +369,7 @@ const useMintOption = (marketAddr) => {
|
|
|
349
369
|
}) });
|
|
350
370
|
};
|
|
351
371
|
const mintOption = async (optionType, amount, duration, strikeTick) => {
|
|
352
|
-
if (!client) throw new Error("Wallet not connected");
|
|
372
|
+
if (!client || !address) throw new Error("Wallet not connected");
|
|
353
373
|
if (!marketAddr) throw new Error("Market address not available");
|
|
354
374
|
if (!timelockLens) throw new Error("Timelock lens not available");
|
|
355
375
|
if (!vault) throw new Error("Vault not available");
|
|
@@ -378,6 +398,7 @@ const useMintOption = (marketAddr) => {
|
|
|
378
398
|
]
|
|
379
399
|
});
|
|
380
400
|
await waitForTransactionReceipt(client, { hash: hash$1 });
|
|
401
|
+
await queryClient.invalidateQueries({ queryKey: ["userOptions", address.toLowerCase()] });
|
|
381
402
|
return hash$1;
|
|
382
403
|
};
|
|
383
404
|
return {
|
|
@@ -474,15 +495,16 @@ const useOptionPremium = (marketAddr, optionType, optionAmount, duration, strike
|
|
|
474
495
|
//#region src/hooks/market/useUserOptions.ts
|
|
475
496
|
const useUserOptions = (user, active = false) => {
|
|
476
497
|
const { graphqlClient } = useTimelockConfig();
|
|
498
|
+
user = user === null || user === void 0 ? void 0 : user.toLowerCase();
|
|
477
499
|
const { data,...rest } = useQuery({
|
|
478
500
|
queryKey: [
|
|
479
|
-
"
|
|
501
|
+
"userOptions",
|
|
480
502
|
user || "--",
|
|
481
503
|
active
|
|
482
504
|
],
|
|
483
505
|
queryFn: async () => {
|
|
484
|
-
if (!graphqlClient) return [];
|
|
485
|
-
return (active ? await graphqlClient.GetActiveUserOptions({ user
|
|
506
|
+
if (!graphqlClient || !user) return [];
|
|
507
|
+
return (active ? await graphqlClient.GetActiveUserOptions({ user }) : await graphqlClient.GetClosedUserOptions({ user })).UserOption.map((option) => ({
|
|
486
508
|
...option,
|
|
487
509
|
optionId: BigInt(option.optionId),
|
|
488
510
|
marketAddr: option.marketAddr,
|