From 2c93e1dfbc1550c3e45daa0e69032b5fe84db2b5 Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Fri, 21 Mar 2025 15:28:46 +0000 Subject: [PATCH 1/2] chore: upgrade CC to support Optimism chains --- package-lock.json | 55 ++++++++++++++++++++-------------- package.json | 4 +-- src/lib/constants/chainInfo.ts | 19 ++++++++++++ src/lib/constants/chains.ts | 3 ++ 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec7830b84..3f160c817 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/client": "^3.8.1", "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/react-kit": "^0.37.0", + "@bosonprotocol/react-kit": "^0.38.0", "@davatar/react": "^1.10.4", "@ethersproject/address": "^5.6.1", "@ethersproject/units": "^5.7.0", @@ -38,7 +38,7 @@ "@uniswap/permit2-sdk": "^1.2.0", "@uniswap/redux-multicall": "^1.1.8", "@uniswap/router-sdk": "^1.6.0", - "@uniswap/sdk-core": "^4.0.6", + "@uniswap/sdk-core": "^4.2.1", "@uniswap/smart-order-router": "^3.15.14", "@uniswap/token-lists": "^1.0.0-beta.33", "@uniswap/uniswapx-sdk": "^1.4.0", @@ -3423,9 +3423,9 @@ } }, "node_modules/@bosonprotocol/common": { - "version": "1.30.3", - "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.30.3.tgz", - "integrity": "sha512-R/AvlXYPTLafzUB/ywSxnoeL61L0yNjVZldeWSnh6bxYX906cTsb3IB/QkuyjXUTzVrRGqShqbgKOeDIJtemVg==", + "version": "1.30.4", + "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.30.4.tgz", + "integrity": "sha512-7Qpxuy+8JEqvx+6GX4ozSD3YzmwUVMoF4rj2ULyfxxZA2SJOlqUMOoJh23gkQ/IutBw+yMCrRKezEmM6gZUYQg==", "dependencies": { "@bosonprotocol/metadata": "^1.16.3", "@ethersproject/abi": "^5.5.0", @@ -3436,11 +3436,11 @@ } }, "node_modules/@bosonprotocol/core-sdk": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.43.0.tgz", - "integrity": "sha512-9mCMi92nsKKDHPvaZ493pUCElVRVN4p3iAaE2OtfE2L0j9qLWN9iyGiQkYqabZAUOh8bq4AwkCQX3rzDb+Wpbg==", + "version": "1.43.1", + "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.43.1.tgz", + "integrity": "sha512-QptwUrJ2wLBJfSz0zGQZgeOqg6qlSr42tf5s/i1/VwIxZJMByw6+ZzMTbFRpGeh4bWQo6qKRU1Xv3PUFy673lQ==", "dependencies": { - "@bosonprotocol/common": "^1.30.3", + "@bosonprotocol/common": "^1.30.4", "@ethersproject/abi": "^5.5.0", "@ethersproject/address": "^5.5.0", "@ethersproject/bignumber": "^5.5.0", @@ -3456,11 +3456,11 @@ } }, "node_modules/@bosonprotocol/ethers-sdk": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.15.4.tgz", - "integrity": "sha512-10NQIpCcOv3s5HbT7U1cni2ugbFcVQ7eAG5V93gZIabRHFnFQxtEYLdiYMfAv5cvKctxUqIPj7FaPal4uoYy7A==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.15.5.tgz", + "integrity": "sha512-92L4mv4XHrrriFWyIA9ek//7+oEdkY05b4phbO7Tm7jbtod14BE0a+vpdw21x0C34sIyGirrpKae6Rx1nrk5TA==", "dependencies": { - "@bosonprotocol/common": "^1.30.3" + "@bosonprotocol/common": "^1.30.4" }, "peerDependencies": { "ethers": "^5.5.0" @@ -3493,13 +3493,13 @@ "integrity": "sha512-f2W2SQAvY5IKD6L9JwaiNye7gGRIIPd/HOB0i+otWLzMPBlwQtbN4JeWSuKeJvuaqu8tyMy7CHzN8EkhrJDB+A==" }, "node_modules/@bosonprotocol/react-kit": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.37.0.tgz", - "integrity": "sha512-NfsqpZAIucCScGSd2e6Q+zGMgAb6hzWmHUv9pgFiPlYBqI8WGcxdmaWr6qeTv7APHZCYoyH1Xso0hg2iJpB35A==", + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.38.0.tgz", + "integrity": "sha512-LBKO6snL27Rp+XvaOoHPBZQblfGBmKVSs9hyIR69xlLKS+f0tFmrD46G4KItIHiHKTNoLst6Owf4ne6gtLlZig==", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.43.0", - "@bosonprotocol/ethers-sdk": "^1.15.4", + "@bosonprotocol/core-sdk": "^1.43.1", + "@bosonprotocol/ethers-sdk": "^1.15.5", "@bosonprotocol/ipfs-storage": "^1.12.0", "@bosonprotocol/roblox-sdk": "^1.0.0-alpha.16", "@davatar/react": "1.11.1", @@ -3526,7 +3526,7 @@ "cids": "^1.1.9", "dayjs": "1.11.7", "eth-revert-reason": "^1.0.3", - "formik": "2.2.9", + "formik": "^2.4.6", "graphql-request": "5.2.0", "i": "^0.3.7", "jotai": "^1.13.1", @@ -16059,7 +16059,9 @@ } }, "node_modules/@uniswap/sdk-core": { - "version": "4.0.7", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@uniswap/sdk-core/-/sdk-core-4.2.1.tgz", + "integrity": "sha512-hr7vwYrXScg+V8/rRc2UL/Ixc/p0P7yqe4D/OxzUdMRYr8RZd+8z5Iu9+WembjZT/DCdbTjde6lsph4Og0n1BQ==", "license": "MIT", "dependencies": { "@ethersproject/address": "^5.0.2", @@ -24812,22 +24814,24 @@ } }, "node_modules/formik": { - "version": "2.2.9", + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.6.tgz", + "integrity": "sha512-A+2EI7U7aG296q2TLGvNapDNTZp1khVt5Vk0Q/fyfSROss0V/V6+txt2aJnwEos44IxTCW/LYAi/zgWzlevj+g==", "funding": [ { "type": "individual", "url": "https://opencollective.com/formik" } ], - "license": "Apache-2.0", "dependencies": { + "@types/hoist-non-react-statics": "^3.3.1", "deepmerge": "^2.1.1", "hoist-non-react-statics": "^3.3.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "react-fast-compare": "^2.0.1", "tiny-warning": "^1.0.2", - "tslib": "^1.10.0" + "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" @@ -24840,6 +24844,11 @@ "node": ">=0.10.0" } }, + "node_modules/formik/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, "node_modules/forwarded": { "version": "0.2.0", "license": "MIT", diff --git a/package.json b/package.json index 11339944b..8de4642a8 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dependencies": { "@apollo/client": "^3.8.1", "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/react-kit": "^0.37.0", + "@bosonprotocol/react-kit": "^0.38.0", "@davatar/react": "^1.10.4", "@ethersproject/address": "^5.6.1", "@ethersproject/units": "^5.7.0", @@ -74,7 +74,7 @@ "@uniswap/permit2-sdk": "^1.2.0", "@uniswap/redux-multicall": "^1.1.8", "@uniswap/router-sdk": "^1.6.0", - "@uniswap/sdk-core": "^4.0.6", + "@uniswap/sdk-core": "^4.2.1", "@uniswap/smart-order-router": "^3.15.14", "@uniswap/token-lists": "^1.0.0-beta.33", "@uniswap/uniswapx-sdk": "^1.4.0", diff --git a/src/lib/constants/chainInfo.ts b/src/lib/constants/chainInfo.ts index edd0328d2..451d10484 100644 --- a/src/lib/constants/chainInfo.ts +++ b/src/lib/constants/chainInfo.ts @@ -150,6 +150,25 @@ const CHAIN_INFO: ChainInfoMap = { decimals: 18 } }, + [ChainId.OPTIMISM_SEPOLIA]: { + networkType: NetworkType.L2, + blockWaitMsBeforeWarning: ms(`25m`), + defaultListUrl: OPTIMISM_LIST, + bridge: "https://testnets.superbridge.app/optimism-sepolia", + docs: "https://docs.optimism.io", + explorer: "https://sepolia-optimistic.etherscan.io/", + infoLink: "https://info.uniswap.org/#/optimism-sepolia/", + label: "Optimism Sepolia", + logoUrl: optimismLogoUrl, + statusPage: "https://optimism.io/status", + helpCenterUrl: + "https://help.uniswap.org/en/collections/3137778-uniswap-on-optimistic-ethereum-oξ", + nativeCurrency: { + name: "Ether", + symbol: "OpETH", + decimals: 18 + } + }, [ChainId.ARBITRUM_ONE]: { networkType: NetworkType.L2, blockWaitMsBeforeWarning: ms(`10m`), diff --git a/src/lib/constants/chains.ts b/src/lib/constants/chains.ts index db3840233..a45d15faf 100644 --- a/src/lib/constants/chains.ts +++ b/src/lib/constants/chains.ts @@ -29,6 +29,7 @@ export const CHAIN_IDS_TO_NAMES = { [ChainId.ARBITRUM_GOERLI]: "arbitrum_goerli", [ChainId.OPTIMISM]: "optimism", [ChainId.OPTIMISM_GOERLI]: "optimism_goerli", + [ChainId.OPTIMISM_SEPOLIA]: "optimism_sepolia", [ChainId.BNB]: "bnb", [ChainId.AVALANCHE]: "avalanche", [ChainId.BASE]: "base", @@ -50,6 +51,7 @@ export const CHAIN_IDS_TO_FRIENDLY_NAMES = { [ChainId.ARBITRUM_GOERLI]: "Arbitrum Goerli", [ChainId.OPTIMISM]: "Optimism", [ChainId.OPTIMISM_GOERLI]: "Optimism Goerli", + [ChainId.OPTIMISM_SEPOLIA]: "OP-Sepolia", [ChainId.BNB]: "Bnb", [ChainId.AVALANCHE]: "Avalanche", [ChainId.BASE]: "Base", @@ -80,6 +82,7 @@ export function isSupportedChain( if (featureFlags && chainId && chainId in featureFlags) { return featureFlags[chainId]; } + // TODO: add Optimism chains return ( !!chainId && ACTUALLY_SUPPORTED_CHAINS.indexOf(chainId) !== -1 && From 4815cf053df51b2ae4cc36d8712dd02baab5f5cd Mon Sep 17 00:00:00 2001 From: Ludovic Levalleux Date: Fri, 21 Mar 2025 16:23:45 +0000 Subject: [PATCH 2/2] upgrade cc deps --- package-lock.json | 83 +++++++++++++++++++++++---- package.json | 2 +- src/lib/constants/chains.ts | 13 +++-- src/lib/constants/providers.ts | 10 ---- src/lib/utils/hooks/useSwitchChain.ts | 9 ++- 5 files changed, 87 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f160c817..ef03aec25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/client": "^3.8.1", "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/react-kit": "^0.38.0", + "@bosonprotocol/react-kit": "^0.39.0-alpha.2", "@davatar/react": "^1.10.4", "@ethersproject/address": "^5.6.1", "@ethersproject/units": "^5.7.0", @@ -3426,6 +3426,7 @@ "version": "1.30.4", "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.30.4.tgz", "integrity": "sha512-7Qpxuy+8JEqvx+6GX4ozSD3YzmwUVMoF4rj2ULyfxxZA2SJOlqUMOoJh23gkQ/IutBw+yMCrRKezEmM6gZUYQg==", + "peer": true, "dependencies": { "@bosonprotocol/metadata": "^1.16.3", "@ethersproject/abi": "^5.5.0", @@ -3439,6 +3440,7 @@ "version": "1.43.1", "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.43.1.tgz", "integrity": "sha512-QptwUrJ2wLBJfSz0zGQZgeOqg6qlSr42tf5s/i1/VwIxZJMByw6+ZzMTbFRpGeh4bWQo6qKRU1Xv3PUFy673lQ==", + "peer": true, "dependencies": { "@bosonprotocol/common": "^1.30.4", "@ethersproject/abi": "^5.5.0", @@ -3456,16 +3458,29 @@ } }, "node_modules/@bosonprotocol/ethers-sdk": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.15.5.tgz", - "integrity": "sha512-92L4mv4XHrrriFWyIA9ek//7+oEdkY05b4phbO7Tm7jbtod14BE0a+vpdw21x0C34sIyGirrpKae6Rx1nrk5TA==", + "version": "1.15.6-alpha.0", + "resolved": "https://registry.npmjs.org/@bosonprotocol/ethers-sdk/-/ethers-sdk-1.15.6-alpha.0.tgz", + "integrity": "sha512-Om99Ys1WylRuKXvj8kyhQ7fmm/BgWLZJmnBqH7gdrl4UoCAbZUfxRplgskmmBXS2loFXM5kbKVrqJOdqpGMTvg==", "dependencies": { - "@bosonprotocol/common": "^1.30.4" + "@bosonprotocol/common": "^1.30.5-alpha.0" }, "peerDependencies": { "ethers": "^5.5.0" } }, + "node_modules/@bosonprotocol/ethers-sdk/node_modules/@bosonprotocol/common": { + "version": "1.30.5-alpha.0", + "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.30.5-alpha.0.tgz", + "integrity": "sha512-hUVs2nKyfOnkz5UB6Na7O/65BzaZgvLk0w9wGP9comD2zAX9/oa2pAkP+53wbOg8aFi90GDNez+2mIUF4upyCA==", + "dependencies": { + "@bosonprotocol/metadata": "^1.16.3", + "@ethersproject/abi": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/units": "^5.5.0" + } + }, "node_modules/@bosonprotocol/ipfs-storage": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/@bosonprotocol/ipfs-storage/-/ipfs-storage-1.12.0.tgz", @@ -3493,13 +3508,13 @@ "integrity": "sha512-f2W2SQAvY5IKD6L9JwaiNye7gGRIIPd/HOB0i+otWLzMPBlwQtbN4JeWSuKeJvuaqu8tyMy7CHzN8EkhrJDB+A==" }, "node_modules/@bosonprotocol/react-kit": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.38.0.tgz", - "integrity": "sha512-LBKO6snL27Rp+XvaOoHPBZQblfGBmKVSs9hyIR69xlLKS+f0tFmrD46G4KItIHiHKTNoLst6Owf4ne6gtLlZig==", + "version": "0.39.0-alpha.2", + "resolved": "https://registry.npmjs.org/@bosonprotocol/react-kit/-/react-kit-0.39.0-alpha.2.tgz", + "integrity": "sha512-8//Y1R9j8REK6/DJN+8DOeu95+KcZ0EY3C0B1OlnAMi31NJo4xtNndT303C8cF0NQpjBoyd8paW6/yR4dHCbkg==", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.43.1", - "@bosonprotocol/ethers-sdk": "^1.15.5", + "@bosonprotocol/core-sdk": "^1.43.2-alpha.0", + "@bosonprotocol/ethers-sdk": "^1.15.6-alpha.0", "@bosonprotocol/ipfs-storage": "^1.12.0", "@bosonprotocol/roblox-sdk": "^1.0.0-alpha.16", "@davatar/react": "1.11.1", @@ -3510,7 +3525,7 @@ "@svgr/webpack": "^8.1.0", "@tippyjs/react": "4.2.6", "@uniswap/redux-multicall": "^1.1.8", - "@uniswap/sdk-core": "^4.0.7", + "@uniswap/sdk-core": "^4.2.1", "@uniswap/token-lists": "^1.0.0-beta.33", "@uniswap/v2-sdk": "^3.3.0", "@uniswap/v3-periphery": "^1.4.4", @@ -3578,6 +3593,52 @@ "yup": "^1.5.0" } }, + "node_modules/@bosonprotocol/react-kit/node_modules/@bosonprotocol/common": { + "version": "1.30.5-alpha.0", + "resolved": "https://registry.npmjs.org/@bosonprotocol/common/-/common-1.30.5-alpha.0.tgz", + "integrity": "sha512-hUVs2nKyfOnkz5UB6Na7O/65BzaZgvLk0w9wGP9comD2zAX9/oa2pAkP+53wbOg8aFi90GDNez+2mIUF4upyCA==", + "dependencies": { + "@bosonprotocol/metadata": "^1.16.3", + "@ethersproject/abi": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/units": "^5.5.0" + } + }, + "node_modules/@bosonprotocol/react-kit/node_modules/@bosonprotocol/core-sdk": { + "version": "1.43.2-alpha.0", + "resolved": "https://registry.npmjs.org/@bosonprotocol/core-sdk/-/core-sdk-1.43.2-alpha.0.tgz", + "integrity": "sha512-OHTR5EWdOCJy9Y3KAitR72hnR8SaaKc6JealXGyJqfriIUVXok/tjWCUP954UiIFsR2usSp6kGH586rO/LyitA==", + "dependencies": { + "@bosonprotocol/common": "^1.30.5-alpha.0", + "@ethersproject/abi": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/units": "^5.5.0", + "cross-fetch": "^3.1.5", + "graphql": "^16.5.0", + "graphql-request": "^4.3.0", + "mustache": "^4.2.0", + "opensea-js": "^7.1.13", + "schema-to-yup": "^1.11.11" + } + }, + "node_modules/@bosonprotocol/react-kit/node_modules/@bosonprotocol/core-sdk/node_modules/graphql-request": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-4.3.0.tgz", + "integrity": "sha512-2v6hQViJvSsifK606AliqiNiijb1uwWp6Re7o0RTyH+uRTv/u7Uqm2g4Fjq/LgZIzARB38RZEvVBFOQOVdlBow==", + "dependencies": { + "cross-fetch": "^3.1.5", + "extract-files": "^9.0.0", + "form-data": "^3.0.0" + }, + "peerDependencies": { + "graphql": "14 - 16" + } + }, "node_modules/@bosonprotocol/react-kit/node_modules/@ethersproject/units": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.0.tgz", diff --git a/package.json b/package.json index 8de4642a8..0b636df0e 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dependencies": { "@apollo/client": "^3.8.1", "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/react-kit": "^0.38.0", + "@bosonprotocol/react-kit": "^0.39.0-alpha.2", "@davatar/react": "^1.10.4", "@ethersproject/address": "^5.6.1", "@ethersproject/units": "^5.7.0", diff --git a/src/lib/constants/chains.ts b/src/lib/constants/chains.ts index a45d15faf..c2cb6f4a9 100644 --- a/src/lib/constants/chains.ts +++ b/src/lib/constants/chains.ts @@ -1,7 +1,4 @@ -import { - ChainId, - SUPPORTED_CHAINS as _SUPPORTED_CHAINS -} from "@uniswap/sdk-core"; +import { ChainId } from "@uniswap/sdk-core"; import { envChainIds } from "lib/config"; export const LocalChainId = 31337; @@ -27,6 +24,7 @@ export const CHAIN_IDS_TO_NAMES = { [ChainId.CELO_ALFAJORES]: "celo_alfajores", [ChainId.ARBITRUM_ONE]: "arbitrum", [ChainId.ARBITRUM_GOERLI]: "arbitrum_goerli", + [ChainId.ARBITRUM_SEPOLIA]: "arbitrum_sepolia", [ChainId.OPTIMISM]: "optimism", [ChainId.OPTIMISM_GOERLI]: "optimism_goerli", [ChainId.OPTIMISM_SEPOLIA]: "optimism_sepolia", @@ -62,9 +60,14 @@ export const CHAIN_IDS_TO_FRIENDLY_NAMES = { const SUPPORTED_CHAINS = [ LocalChainId, + ChainId.MAINNET, + ChainId.POLYGON, + ChainId.OPTIMISM, + ChainId.BASE, + ChainId.SEPOLIA, ChainId_POLYGON_AMOY, ChainId_BASE_SEPOLIA, - ..._SUPPORTED_CHAINS + ChainId.OPTIMISM_SEPOLIA ] as const; export declare type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number]; diff --git a/src/lib/constants/providers.ts b/src/lib/constants/providers.ts index 07a0684c9..7888c1ac8 100644 --- a/src/lib/constants/providers.ts +++ b/src/lib/constants/providers.ts @@ -72,20 +72,10 @@ export const RPC_PROVIDERS: { [key: number]: StaticJsonRpcProvider; } = { [ChainId.MAINNET]: new AppJsonRpcProvider(ChainId.MAINNET), - [ChainId.GOERLI]: new AppJsonRpcProvider(ChainId.GOERLI), [ChainId.SEPOLIA]: new AppJsonRpcProvider(ChainId.SEPOLIA), [ChainId.OPTIMISM]: new AppJsonRpcProvider(ChainId.OPTIMISM), - [ChainId.OPTIMISM_GOERLI]: new AppJsonRpcProvider(ChainId.OPTIMISM_GOERLI), - [ChainId.ARBITRUM_ONE]: new AppJsonRpcProvider(ChainId.ARBITRUM_ONE), - [ChainId.ARBITRUM_GOERLI]: new AppJsonRpcProvider(ChainId.ARBITRUM_GOERLI), [ChainId.POLYGON]: new AppJsonRpcProvider(ChainId.POLYGON), - [ChainId.POLYGON_MUMBAI]: new AppJsonRpcProvider(ChainId.POLYGON_MUMBAI), [ChainId_POLYGON_AMOY]: new AppJsonRpcProvider(ChainId_POLYGON_AMOY), - [ChainId.CELO]: new AppJsonRpcProvider(ChainId.CELO), - [ChainId.CELO_ALFAJORES]: new AppJsonRpcProvider(ChainId.CELO_ALFAJORES), - [ChainId.BNB]: new AppJsonRpcProvider(ChainId.BNB), - [ChainId.AVALANCHE]: new AppJsonRpcProvider(ChainId.AVALANCHE), [ChainId.BASE]: new AppJsonRpcProvider(ChainId.BASE), - [ChainId.BASE_GOERLI]: new AppJsonRpcProvider(ChainId.BASE_GOERLI), [ChainId_BASE_SEPOLIA]: new AppJsonRpcProvider(ChainId_BASE_SEPOLIA) }; diff --git a/src/lib/utils/hooks/useSwitchChain.ts b/src/lib/utils/hooks/useSwitchChain.ts index 4a1e4b9f7..188c8ceb1 100644 --- a/src/lib/utils/hooks/useSwitchChain.ts +++ b/src/lib/utils/hooks/useSwitchChain.ts @@ -12,7 +12,11 @@ import { walletConnectV2Connection } from "../../connection"; import { getChainInfo } from "../../constants/chainInfo"; -import { isSupportedChain, SupportedChainsType } from "../../constants/chains"; +import { + ChainId_POLYGON_AMOY, + isSupportedChain, + SupportedChainsType +} from "../../constants/chains"; import { useChainId } from "./connection/connection"; const RPC_URLS = CONFIG.rpcUrls; const localChainId = 31337; @@ -22,9 +26,8 @@ const localRpcUrl = getEnvConfigs("local").find( function getRpcUrl(chainId: SupportedChainsType): string { switch (chainId) { case ChainId.MAINNET: - case ChainId.GOERLI: case ChainId.SEPOLIA: - case 80002: + case ChainId_POLYGON_AMOY: return RPC_URLS[chainId][0]; case localChainId: { if (localRpcUrl) {