From ca551ef35fbcdb3b0c5a0fb1d07cb891d20ad1a3 Mon Sep 17 00:00:00 2001 From: KillariDev Date: Fri, 29 Dec 2023 11:56:30 +0200 Subject: [PATCH 1/3] add keydonix nodes, remove infura --- src/constants/networks.ts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/constants/networks.ts b/src/constants/networks.ts index d7cbb103fbc..e5e1bdb3f96 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -1,9 +1,5 @@ import { ChainId } from '@uniswap/sdk-core' -const INFURA_KEY = process.env.REACT_APP_INFURA_KEY -if (typeof INFURA_KEY === 'undefined') { - throw new Error(`REACT_APP_INFURA_KEY must be a defined environment variable`) -} const QUICKNODE_MAINNET_RPC_URL = process.env.REACT_APP_QUICKNODE_MAINNET_RPC_URL if (typeof QUICKNODE_MAINNET_RPC_URL === 'undefined') { throw new Error(`REACT_APP_QUICKNODE_MAINNET_RPC_URL must be a defined environment variable`) @@ -127,33 +123,29 @@ export const FALLBACK_URLS = { */ export const RPC_URLS = { [ChainId.MAINNET]: [ - `https://mainnet.infura.io/v3/${INFURA_KEY}`, + `https://ethereum.keydonix.com/v1/mainnet`, QUICKNODE_MAINNET_RPC_URL, ...FALLBACK_URLS[ChainId.MAINNET], ], - [ChainId.GOERLI]: [`https://goerli.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.GOERLI]], - [ChainId.SEPOLIA]: [`https://sepolia.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.SEPOLIA]], - [ChainId.OPTIMISM]: [`https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.OPTIMISM]], + [ChainId.GOERLI]: [`https://ethereum.keydonix.com/v1/goerli`, ...FALLBACK_URLS[ChainId.GOERLI]], + [ChainId.SEPOLIA]: [...FALLBACK_URLS[ChainId.SEPOLIA]], + [ChainId.OPTIMISM]: [...FALLBACK_URLS[ChainId.OPTIMISM]], [ChainId.OPTIMISM_GOERLI]: [ - `https://optimism-goerli.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.OPTIMISM_GOERLI], ], [ChainId.ARBITRUM_ONE]: [ - `https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.ARBITRUM_ONE], ], [ChainId.ARBITRUM_GOERLI]: [ - `https://arbitrum-goerli.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.ARBITRUM_GOERLI], ], - [ChainId.POLYGON]: [`https://polygon-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.POLYGON]], + [ChainId.POLYGON]: [...FALLBACK_URLS[ChainId.POLYGON]], [ChainId.POLYGON_MUMBAI]: [ - `https://polygon-mumbai.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.POLYGON_MUMBAI], ], [ChainId.CELO]: FALLBACK_URLS[ChainId.CELO], [ChainId.CELO_ALFAJORES]: FALLBACK_URLS[ChainId.CELO_ALFAJORES], [ChainId.BNB]: [QUICKNODE_BNB_RPC_URL, ...FALLBACK_URLS[ChainId.BNB]], - [ChainId.AVALANCHE]: [`https://avalanche-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.AVALANCHE]], - [ChainId.BASE]: [`https://base-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.BASE]], + [ChainId.AVALANCHE]: [...FALLBACK_URLS[ChainId.AVALANCHE]], + [ChainId.BASE]: [...FALLBACK_URLS[ChainId.BASE]], } From 3b32506bbc8e02908a72983447de56c5dedf0c0f Mon Sep 17 00:00:00 2001 From: KillariDev Date: Fri, 29 Dec 2023 12:07:48 +0200 Subject: [PATCH 2/3] remove cryptoapi and quicknode --- src/constants/networks.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/constants/networks.ts b/src/constants/networks.ts index e5e1bdb3f96..c8db52f4ce2 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -1,14 +1,5 @@ import { ChainId } from '@uniswap/sdk-core' -const QUICKNODE_MAINNET_RPC_URL = process.env.REACT_APP_QUICKNODE_MAINNET_RPC_URL -if (typeof QUICKNODE_MAINNET_RPC_URL === 'undefined') { - throw new Error(`REACT_APP_QUICKNODE_MAINNET_RPC_URL must be a defined environment variable`) -} -const QUICKNODE_BNB_RPC_URL = process.env.REACT_APP_BNB_RPC_URL -if (typeof QUICKNODE_BNB_RPC_URL === 'undefined') { - throw new Error(`REACT_APP_BNB_RPC_URL must be a defined environment variable`) -} - /** * Fallback JSON-RPC endpoints. * These are used if the integrator does not provide an endpoint, or if the endpoint does not work. @@ -22,7 +13,6 @@ if (typeof QUICKNODE_BNB_RPC_URL === 'undefined') { export const FALLBACK_URLS = { [ChainId.MAINNET]: [ // "Safe" URLs - 'https://api.mycryptoapi.com/eth', 'https://cloudflare-eth.com', // "Fallback" URLs 'https://rpc.ankr.com/eth', @@ -124,7 +114,6 @@ export const FALLBACK_URLS = { export const RPC_URLS = { [ChainId.MAINNET]: [ `https://ethereum.keydonix.com/v1/mainnet`, - QUICKNODE_MAINNET_RPC_URL, ...FALLBACK_URLS[ChainId.MAINNET], ], [ChainId.GOERLI]: [`https://ethereum.keydonix.com/v1/goerli`, ...FALLBACK_URLS[ChainId.GOERLI]], @@ -145,7 +134,7 @@ export const RPC_URLS = { ], [ChainId.CELO]: FALLBACK_URLS[ChainId.CELO], [ChainId.CELO_ALFAJORES]: FALLBACK_URLS[ChainId.CELO_ALFAJORES], - [ChainId.BNB]: [QUICKNODE_BNB_RPC_URL, ...FALLBACK_URLS[ChainId.BNB]], + [ChainId.BNB]: [...FALLBACK_URLS[ChainId.BNB]], [ChainId.AVALANCHE]: [...FALLBACK_URLS[ChainId.AVALANCHE]], [ChainId.BASE]: [...FALLBACK_URLS[ChainId.BASE]], } From d3e9f5c3d46d9bf49398428065ec3596995190d8 Mon Sep 17 00:00:00 2001 From: KillariDev Date: Tue, 2 Jan 2024 10:49:07 +0200 Subject: [PATCH 3/3] fix lints --- src/constants/networks.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/constants/networks.ts b/src/constants/networks.ts index c8db52f4ce2..1b74095dcf2 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -112,26 +112,15 @@ export const FALLBACK_URLS = { * These are the URLs used by the interface when there is not another available source of chain data. */ export const RPC_URLS = { - [ChainId.MAINNET]: [ - `https://ethereum.keydonix.com/v1/mainnet`, - ...FALLBACK_URLS[ChainId.MAINNET], - ], + [ChainId.MAINNET]: [`https://ethereum.keydonix.com/v1/mainnet`, ...FALLBACK_URLS[ChainId.MAINNET]], [ChainId.GOERLI]: [`https://ethereum.keydonix.com/v1/goerli`, ...FALLBACK_URLS[ChainId.GOERLI]], [ChainId.SEPOLIA]: [...FALLBACK_URLS[ChainId.SEPOLIA]], [ChainId.OPTIMISM]: [...FALLBACK_URLS[ChainId.OPTIMISM]], - [ChainId.OPTIMISM_GOERLI]: [ - ...FALLBACK_URLS[ChainId.OPTIMISM_GOERLI], - ], - [ChainId.ARBITRUM_ONE]: [ - ...FALLBACK_URLS[ChainId.ARBITRUM_ONE], - ], - [ChainId.ARBITRUM_GOERLI]: [ - ...FALLBACK_URLS[ChainId.ARBITRUM_GOERLI], - ], + [ChainId.OPTIMISM_GOERLI]: [...FALLBACK_URLS[ChainId.OPTIMISM_GOERLI]], + [ChainId.ARBITRUM_ONE]: [...FALLBACK_URLS[ChainId.ARBITRUM_ONE]], + [ChainId.ARBITRUM_GOERLI]: [...FALLBACK_URLS[ChainId.ARBITRUM_GOERLI]], [ChainId.POLYGON]: [...FALLBACK_URLS[ChainId.POLYGON]], - [ChainId.POLYGON_MUMBAI]: [ - ...FALLBACK_URLS[ChainId.POLYGON_MUMBAI], - ], + [ChainId.POLYGON_MUMBAI]: [...FALLBACK_URLS[ChainId.POLYGON_MUMBAI]], [ChainId.CELO]: FALLBACK_URLS[ChainId.CELO], [ChainId.CELO_ALFAJORES]: FALLBACK_URLS[ChainId.CELO_ALFAJORES], [ChainId.BNB]: [...FALLBACK_URLS[ChainId.BNB]],