Skip to content

Commit c3c29bc

Browse files
committed
fix: improve types files
1 parent 76bddd0 commit c3c29bc

File tree

3 files changed

+53
-26
lines changed

3 files changed

+53
-26
lines changed

src/types/core.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import type { Address, PublicClient } from "viem";
2+
3+
/**
4+
* Configuration for V4 contracts.
5+
* Contains addresses for all required Uniswap V4 contracts.
6+
*/
7+
export type V4Contracts = {
8+
/** Address of the pool manager contract */
9+
poolManager: Address;
10+
/** Address of the position descriptor contract */
11+
positionDescriptor: Address;
12+
/** Address of the position manager contract */
13+
positionManager: Address;
14+
/** Address of the quoter contract */
15+
quoter: Address;
16+
/** Address of the state view contract */
17+
stateView: Address;
18+
/** Address of the universal router contract */
19+
universalRouter: Address;
20+
/** Address of the permit2 contract */
21+
permit2: Address;
22+
};
23+
24+
/**
25+
* Configuration for the UniDevKitV4 SDK.
26+
* Required for initializing and managing SDK instances.
27+
*/
28+
export type UniDevKitV4Config = {
29+
/** RPC URL for the chain */
30+
rpcUrl: string;
31+
/** Chain ID */
32+
chainId: number;
33+
/** Contract addresses */
34+
contracts: V4Contracts;
35+
/** Optional native currency configuration */
36+
nativeCurrency?: { name: string; symbol: string; decimals: number };
37+
};
38+
39+
/**
40+
* Internal instance type for UniDevKitV4.
41+
* Represents the state of a single SDK instance.
42+
*/
43+
export type UniDevKitV4Instance = {
44+
/** Viem public client */
45+
client: PublicClient;
46+
/** Chain ID */
47+
chainId: number;
48+
/** Contract addresses */
49+
contracts: V4Contracts;
50+
};

src/types/index.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,2 @@
1-
import type { PublicClient } from "viem";
2-
3-
export type GenericProvider = PublicClient;
4-
5-
export type UniDevKitConfig = {
6-
rpcUrl: string;
7-
chainId: number;
8-
};
9-
10-
export type UniDevKitInstance = {
11-
client: PublicClient;
12-
chainId: number;
13-
contracts: {
14-
poolManager: `0x${string}`;
15-
positionDescriptor: `0x${string}`;
16-
positionManager: `0x${string}`;
17-
quoter: `0x${string}`;
18-
stateView: `0x${string}`;
19-
universalRouter: `0x${string}`;
20-
permit2: `0x${string}`;
21-
};
22-
};
23-
24-
export type UniDevKitContextType = {
25-
instance: UniDevKitInstance;
26-
};
1+
export * from "./core";
2+
export * from "./utils";

src/types/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./getQuote";

0 commit comments

Comments
 (0)