You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modern TypeScript library for integrating Uniswap V4 into your dapp.
7
+
> Modern TypeScript SDK for integrating Uniswap V4 into your dapp.
8
+
> **Early version:** API may change rapidly.
8
9
9
-
## Installation
10
+
---
11
+
12
+
## Install
10
13
11
14
```bash
12
15
pnpm install uniswap-dev-kit
16
+
# or
17
+
npm install uniswap-dev-kit
13
18
```
14
19
15
20
## Quick Start
16
21
17
-
### 1. Configure and create an SDK instance
22
+
### 1. Configure and create SDK instances
18
23
19
24
```ts
20
-
import { createInstance } from'uniswap-dev-kit';
25
+
import { createInstance } from"uniswap-dev-kit";
21
26
22
-
const config = {
27
+
// Create instance for Ethereum mainnet
28
+
createInstance({
23
29
chainId: 1,
24
-
rpcUrl: 'https://eth.llamarpc.com',
30
+
rpcUrl: "https://eth.llamarpc.com",
25
31
contracts: {
26
-
poolManager: '0x...',
27
-
positionDescriptor: '0x...',
28
-
positionManager: '0x...',
29
-
quoter: '0x...',
30
-
stateView: '0x...',
31
-
universalRouter: '0x...',
32
-
permit2: '0x...'
32
+
poolManager: "0x...",
33
+
positionDescriptor: "0x...",
34
+
positionManager: "0x...",
35
+
quoter: "0x...",
36
+
stateView: "0x...",
37
+
universalRouter: "0x...",
38
+
permit2: "0x..."
33
39
}
34
-
};
40
+
});
35
41
36
-
createInstance(config);
42
+
// Create instance for another chain (e.g., Base)
43
+
createInstance({
44
+
chainId: 8453,
45
+
rpcUrl: "https://mainnet.base.org",
46
+
contracts: {
47
+
// Base Uniswap V4 contract addresses...
48
+
}
49
+
});
37
50
```
38
51
39
-
### 2. Use the getQuote function (vanilla JS/TS)
52
+
The SDK automatically manages multiple instances based on chainId. When using hooks or utilities, just specify the chainId to use the corresponding instance:
0 commit comments