project-cpu-mcp 0.8.0 → 0.8.1
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.
|
@@ -3,7 +3,7 @@ export declare const V4Planner: typeof import("@uniswap/v4-sdk").V4Planner;
|
|
|
3
3
|
export declare const V4Action: typeof import("@uniswap/v4-sdk").Actions;
|
|
4
4
|
export declare const RoutePlanner: typeof import("@uniswap/universal-router-sdk").RoutePlanner;
|
|
5
5
|
export declare const RouterCommand: typeof import("@uniswap/universal-router-sdk").CommandType;
|
|
6
|
-
/** Universal Router address for `chainId`. Throws if
|
|
6
|
+
/** Universal Router address for `chainId`. Throws if no supported router version is deployed there. */
|
|
7
7
|
export declare function universalRouterAddress(chainId: number): Address;
|
|
8
8
|
/** Uniswap v4 Quoter address for `chainId`. Throws if v4 is not deployed there. */
|
|
9
9
|
export declare function v4QuoterAddress(chainId: number): Address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap.utils.d.ts","sourceRoot":"","sources":["../../src/services/uniswap.utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAUpC,eAAO,MAAM,SAAS,4CAAkB,CAAC;AACzC,eAAO,MAAM,QAAQ,0CAAgB,CAAC;AACtC,eAAO,MAAM,YAAY,6DAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,4DAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"uniswap.utils.d.ts","sourceRoot":"","sources":["../../src/services/uniswap.utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAUpC,eAAO,MAAM,SAAS,4CAAkB,CAAC;AACzC,eAAO,MAAM,QAAQ,0CAAgB,CAAC;AACtC,eAAO,MAAM,YAAY,6DAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,4DAAoB,CAAC;AAW/C,uGAAuG;AACvG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAS/D;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOxD"}
|
|
@@ -11,14 +11,22 @@ export const RoutePlanner = urSdk.RoutePlanner;
|
|
|
11
11
|
export const RouterCommand = urSdk.CommandType;
|
|
12
12
|
const { UNIVERSAL_ROUTER_ADDRESS, UniversalRouterVersion } = urSdk;
|
|
13
13
|
const { CHAIN_TO_ADDRESSES_MAP } = coreSdk;
|
|
14
|
-
|
|
14
|
+
// No single router version is deployed on every supported chain: some have nothing below 2.1.1,
|
|
15
|
+
// while 2.2.0 is missing on most. Ordered 2.0 first so chains that have it keep the version this
|
|
16
|
+
// client has always sent, with 2.1.1 as the fallback for the rest — both take the same v4 command
|
|
17
|
+
// encoding, so only the address differs.
|
|
18
|
+
const ROUTER_VERSIONS = [UniversalRouterVersion.V2_0, UniversalRouterVersion.V2_1_1];
|
|
19
|
+
/** Universal Router address for `chainId`. Throws if no supported router version is deployed there. */
|
|
15
20
|
export function universalRouterAddress(chainId) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
for (const version of ROUTER_VERSIONS) {
|
|
22
|
+
try {
|
|
23
|
+
return UNIVERSAL_ROUTER_ADDRESS(version, chainId);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
21
28
|
}
|
|
29
|
+
throw new Error(`Uniswap Universal Router is not available for chainId ${chainId}.`);
|
|
22
30
|
}
|
|
23
31
|
/** Uniswap v4 Quoter address for `chainId`. Throws if v4 is not deployed there. */
|
|
24
32
|
export function v4QuoterAddress(chainId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap.utils.js","sourceRoot":"","sources":["../../src/services/uniswap.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CA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