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
Copy file name to clipboardExpand all lines: README.md
+48-17Lines changed: 48 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,13 @@ npm install uniswap-dev-kit
19
19
20
20
## Quick Start
21
21
22
-
### 1. Configure and create an SDK instance
22
+
### 1. Configure and create SDK instances
23
23
24
24
```ts
25
25
import { createInstance } from"uniswap-dev-kit";
26
26
27
-
const config = {
27
+
// Create instance for Ethereum mainnet
28
+
createInstance({
28
29
chainId: 1,
29
30
rpcUrl: "https://eth.llamarpc.com",
30
31
contracts: {
@@ -36,9 +37,29 @@ const config = {
36
37
universalRouter: "0x...",
37
38
permit2: "0x..."
38
39
}
39
-
};
40
+
});
40
41
41
-
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
+
});
50
+
```
51
+
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