From 1eede935c97b657bf92557c9582b2e46e5e03dc8 Mon Sep 17 00:00:00 2001 From: xrsv Date: Mon, 25 Nov 2024 09:00:16 -0800 Subject: [PATCH] feat(universal-router-sdk): support unichain mainnet on universal-router-sdk (#206) --- .github/workflows/monorepo-integrity.yml | 4 +- sdks/universal-router-sdk/package.json | 10 +-- .../src/utils/constants.ts | 13 +++ yarn.lock | 86 +++---------------- 4 files changed, 34 insertions(+), 79 deletions(-) diff --git a/.github/workflows/monorepo-integrity.yml b/.github/workflows/monorepo-integrity.yml index 0a45ebeda..1467a8e1f 100644 --- a/.github/workflows/monorepo-integrity.yml +++ b/.github/workflows/monorepo-integrity.yml @@ -43,8 +43,8 @@ jobs: run: yarn g:check:deps:mismatch # This check will be disabled while a major version change of sdk-core is underway -# - name: 👬🏽 Check for duplicate dependencies in lock file -# run: yarn dedupe --check + - name: 👬🏽 Check for duplicate dependencies in lock file + run: yarn dedupe --check - name: 🧑‍⚖️ Check for yarn constraints.pro run: yarn constraints diff --git a/sdks/universal-router-sdk/package.json b/sdks/universal-router-sdk/package.json index f5973175f..b9370540a 100644 --- a/sdks/universal-router-sdk/package.json +++ b/sdks/universal-router-sdk/package.json @@ -31,14 +31,14 @@ "dependencies": { "@openzeppelin/contracts": "4.7.0", "@uniswap/permit2-sdk": "^1.3.0", - "@uniswap/router-sdk": "^1.14.3", - "@uniswap/sdk-core": "^5.8.2", + "@uniswap/router-sdk": "^1.15.0", + "@uniswap/sdk-core": "^6.0.0", "@uniswap/universal-router": "2.0.0-beta.2", "@uniswap/v2-core": "^1.0.1", - "@uniswap/v2-sdk": "^4.6.0", + "@uniswap/v2-sdk": "^4.7.0", "@uniswap/v3-core": "1.0.0", - "@uniswap/v3-sdk": "^3.18.1", - "@uniswap/v4-sdk": "^1.10.3", + "@uniswap/v3-sdk": "^3.19.0", + "@uniswap/v4-sdk": "^1.12.0", "bignumber.js": "^9.0.2", "ethers": "^5.7.0" }, diff --git a/sdks/universal-router-sdk/src/utils/constants.ts b/sdks/universal-router-sdk/src/utils/constants.ts index 71c842661..0513e9848 100644 --- a/sdks/universal-router-sdk/src/utils/constants.ts +++ b/sdks/universal-router-sdk/src/utils/constants.ts @@ -294,6 +294,19 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { }, }, }, + [130]: { + weth: '0x4200000000000000000000000000000000000006', + routerConfigs: { + [UniversalRouterVersion.V1_2]: { + address: '0x4D73A4411CA1c660035e4AECC8270E5DdDEC8C17', + creationBlock: 23678, + }, + [UniversalRouterVersion.V2_0]: { + address: '0x4D73A4411CA1c660035e4AECC8270E5DdDEC8C17', + creationBlock: 23678, + }, + }, + }, } export const UNIVERSAL_ROUTER_ADDRESS = (version: UniversalRouterVersion, chainId: number): string => { diff --git a/yarn.lock b/yarn.lock index 0a816e1bf..8a7d6211e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4509,17 +4509,17 @@ __metadata: languageName: unknown linkType: soft -"@uniswap/router-sdk@npm:^1.14.3": - version: 1.14.3 - resolution: "@uniswap/router-sdk@npm:1.14.3" +"@uniswap/router-sdk@npm:^1.15.0": + version: 1.15.0 + resolution: "@uniswap/router-sdk@npm:1.15.0" dependencies: "@ethersproject/abi": ^5.5.0 - "@uniswap/sdk-core": ^5.8.0 + "@uniswap/sdk-core": ^6.0.0 "@uniswap/swap-router-contracts": ^1.3.0 - "@uniswap/v2-sdk": ^4.6.0 - "@uniswap/v3-sdk": ^3.17.0 - "@uniswap/v4-sdk": ^1.10.3 - checksum: ba7e0800d493c0d5f71c050bb21b475f762e56f81de13be96f29bb792351ef9846929271d8befdab93eae0e2800d64516f93d86eecb0ae894da708f806a1010d + "@uniswap/v2-sdk": ^4.7.0 + "@uniswap/v3-sdk": ^3.19.0 + "@uniswap/v4-sdk": ^1.12.0 + checksum: f41fcec2c06775071e1139426bddb569ab88a314d20d6e7d10a56f6994325b39bdf00105a0b35a7d114a07c17e7ab59360cef5ce4632fba53000f13543ff8284 languageName: node linkType: hard @@ -4539,7 +4539,7 @@ __metadata: languageName: unknown linkType: soft -"@uniswap/sdk-core@npm:^5.0.0, @uniswap/sdk-core@npm:^5.3.0, @uniswap/sdk-core@npm:^5.3.1, @uniswap/sdk-core@npm:^5.8.0, @uniswap/sdk-core@npm:^5.8.1, @uniswap/sdk-core@npm:^5.8.2": +"@uniswap/sdk-core@npm:^5.0.0": version: 5.9.0 resolution: "@uniswap/sdk-core@npm:5.9.0" dependencies: @@ -4647,14 +4647,14 @@ __metadata: "@types/node": ^18.7.16 "@types/node-fetch": ^2.6.2 "@uniswap/permit2-sdk": ^1.3.0 - "@uniswap/router-sdk": ^1.14.3 - "@uniswap/sdk-core": ^5.8.2 + "@uniswap/router-sdk": ^1.15.0 + "@uniswap/sdk-core": ^6.0.0 "@uniswap/universal-router": 2.0.0-beta.2 "@uniswap/v2-core": ^1.0.1 - "@uniswap/v2-sdk": ^4.6.0 + "@uniswap/v2-sdk": ^4.7.0 "@uniswap/v3-core": 1.0.0 - "@uniswap/v3-sdk": ^3.18.1 - "@uniswap/v4-sdk": ^1.10.3 + "@uniswap/v3-sdk": ^3.19.0 + "@uniswap/v4-sdk": ^1.12.0 bignumber.js: ^9.0.2 chai: ^4.3.6 dotenv: ^16.0.3 @@ -4688,19 +4688,6 @@ __metadata: languageName: node linkType: hard -"@uniswap/v2-sdk@npm:^4.6.0": - version: 4.6.0 - resolution: "@uniswap/v2-sdk@npm:4.6.0" - dependencies: - "@ethersproject/address": ^5.0.2 - "@ethersproject/solidity": ^5.0.9 - "@uniswap/sdk-core": ^5.8.0 - tiny-invariant: ^1.1.0 - tiny-warning: ^1.0.3 - checksum: 7ec46ca0780892adaadbab546b05d628cb2aaaef7198f3f92021e10e3adbbf42566ae0f6d7ae1c55afa01f894164b4b8f450cc91f718059a19f5a333115a5f68 - languageName: node - linkType: hard - "@uniswap/v2-sdk@npm:^4.7.0": version: 4.7.0 resolution: "@uniswap/v2-sdk@npm:4.7.0" @@ -4758,22 +4745,6 @@ __metadata: languageName: node linkType: hard -"@uniswap/v3-sdk@npm:3.12.0": - version: 3.12.0 - resolution: "@uniswap/v3-sdk@npm:3.12.0" - dependencies: - "@ethersproject/abi": ^5.5.0 - "@ethersproject/solidity": ^5.0.9 - "@uniswap/sdk-core": ^5.3.0 - "@uniswap/swap-router-contracts": ^1.3.0 - "@uniswap/v3-periphery": ^1.1.1 - "@uniswap/v3-staker": 1.0.0 - tiny-invariant: ^1.1.0 - tiny-warning: ^1.0.3 - checksum: d8d507a8ed302c983217575bcead36700c4ee823db98ea9281cf8f9e5dfb9a5c49da111199f28f65f43ccb4c4dc2996d8a120128076b622b560fe780f8bb8db5 - languageName: node - linkType: hard - "@uniswap/v3-sdk@npm:3.19.0, @uniswap/v3-sdk@npm:^3.19.0": version: 3.19.0 resolution: "@uniswap/v3-sdk@npm:3.19.0" @@ -4790,22 +4761,6 @@ __metadata: languageName: node linkType: hard -"@uniswap/v3-sdk@npm:^3.17.0, @uniswap/v3-sdk@npm:^3.18.1": - version: 3.18.1 - resolution: "@uniswap/v3-sdk@npm:3.18.1" - dependencies: - "@ethersproject/abi": ^5.5.0 - "@ethersproject/solidity": ^5.0.9 - "@uniswap/sdk-core": ^5.8.1 - "@uniswap/swap-router-contracts": ^1.3.0 - "@uniswap/v3-periphery": ^1.1.1 - "@uniswap/v3-staker": 1.0.0 - tiny-invariant: ^1.1.0 - tiny-warning: ^1.0.3 - checksum: ab86fb564f3970b9ea8361781e026d539a1b7216d4d248280b619cac7ea9ab859431be38b464582ca1312f37f5ed05a1dc685af63eba4adf4e0148be473cbf21 - languageName: node - linkType: hard - "@uniswap/v3-sdk@workspace:sdks/v3-sdk": version: 0.0.0-use.local resolution: "@uniswap/v3-sdk@workspace:sdks/v3-sdk" @@ -4836,19 +4791,6 @@ __metadata: languageName: node linkType: hard -"@uniswap/v4-sdk@npm:^1.10.3": - version: 1.10.3 - resolution: "@uniswap/v4-sdk@npm:1.10.3" - dependencies: - "@ethersproject/solidity": ^5.0.9 - "@uniswap/sdk-core": ^5.3.1 - "@uniswap/v3-sdk": 3.12.0 - tiny-invariant: ^1.1.0 - tiny-warning: ^1.0.3 - checksum: ca0565f4e87c2b306dc642ca13b7e2605a994cf5e9cb661503a60a3cc8dd86727f73328ebd529f9a42cedf6751dde91735b4ff7e3468deef37fa254d47e3ee9b - languageName: node - linkType: hard - "@uniswap/v4-sdk@npm:^1.12.0": version: 1.12.0 resolution: "@uniswap/v4-sdk@npm:1.12.0"