From d72e459c6fa9d541739438ecc7da78168419c037 Mon Sep 17 00:00:00 2001 From: Babak Date: Sun, 14 May 2023 19:36:21 +1000 Subject: [PATCH] Add support for SEPOLIA network (#117) * Add support for SEPOLIA network * Create mighty-forks-talk.md --------- Co-authored-by: Babak Rafat Co-authored-by: Kris Kaczor --- .changeset/mighty-forks-talk.md | 5 +++++ packages/eth-sdk/README.md | 2 +- .../src/abi-management/etherscan/explorerEndpoints.ts | 4 ++++ packages/eth-sdk/src/abi-management/getRpcProvider.ts | 1 + packages/eth-sdk/src/abi-management/networks.ts | 2 ++ 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/mighty-forks-talk.md diff --git a/.changeset/mighty-forks-talk.md b/.changeset/mighty-forks-talk.md new file mode 100644 index 0000000..fcb8267 --- /dev/null +++ b/.changeset/mighty-forks-talk.md @@ -0,0 +1,5 @@ +--- +"@dethcrypto/eth-sdk": patch +--- + +Add support for SEPOLIA network diff --git a/packages/eth-sdk/README.md b/packages/eth-sdk/README.md index ab7e8d3..e7664c0 100644 --- a/packages/eth-sdk/README.md +++ b/packages/eth-sdk/README.md @@ -167,7 +167,7 @@ Predefined network identifiers are: "bscTestnet" "heco" "hecoTestnet" "opera" "ftmTestnet" "optimism" "optimismKovan" "polygon" "polygonMumbai" -"arbitrumOne" "arbitrumTestnet" +"arbitrumOne" "arbitrumTestnet" "sepolia" ``` You can use other networks, but you will need to configure Etherscan URLs for them in [`etherscanURLs`](#etherscanurls) diff --git a/packages/eth-sdk/src/abi-management/etherscan/explorerEndpoints.ts b/packages/eth-sdk/src/abi-management/etherscan/explorerEndpoints.ts index 4684edd..1de9f4b 100644 --- a/packages/eth-sdk/src/abi-management/etherscan/explorerEndpoints.ts +++ b/packages/eth-sdk/src/abi-management/etherscan/explorerEndpoints.ts @@ -31,6 +31,10 @@ export const predefinedExplorerEndpoints: PredefinedExplorerEndpoints = { url: 'https://api-goerli.etherscan.io/api', apiKey: ETHERSCAN_KEY, }, + sepolia: { + url: 'https://api-sepolia.etherscan.io/api', + apiKey: ETHERSCAN_KEY, + }, kovan: { url: 'https://api-kovan.etherscan.io/api', apiKey: ETHERSCAN_KEY, diff --git a/packages/eth-sdk/src/abi-management/getRpcProvider.ts b/packages/eth-sdk/src/abi-management/getRpcProvider.ts index 5622486..daccd07 100644 --- a/packages/eth-sdk/src/abi-management/getRpcProvider.ts +++ b/packages/eth-sdk/src/abi-management/getRpcProvider.ts @@ -11,6 +11,7 @@ const rpcProviders: RpcURLs = { rinkeby: `https://rinkeby.infura.io/v3/${INFURA_PROJECT_URL}`, ropsten: `https://ropsten.infura.io/v3/${INFURA_PROJECT_URL}`, goerli: `https://goerli.infura.io/v3/${INFURA_PROJECT_URL}`, + sepolia: `https://sepolia.infura.io/v3/${INFURA_PROJECT_URL}`, } export function getRpcProvider(config: EthSdkConfig, network: NetworkSymbol): RpcProvider | null { diff --git a/packages/eth-sdk/src/abi-management/networks.ts b/packages/eth-sdk/src/abi-management/networks.ts index 77e2e05..4bce2c8 100644 --- a/packages/eth-sdk/src/abi-management/networks.ts +++ b/packages/eth-sdk/src/abi-management/networks.ts @@ -8,6 +8,7 @@ export enum NetworkID { RINKEBY = 4, GOERLI = 5, KOVAN = 42, + SEPOLIA = 11155111, // Binance Smart Chain BSC = 56, BSC_TESTNET = 97, @@ -36,6 +37,7 @@ export const networkIDtoSymbol = { [NetworkID.ROPSTEN]: 'ropsten', [NetworkID.RINKEBY]: 'rinkeby', [NetworkID.GOERLI]: 'goerli', + [NetworkID.SEPOLIA]: 'sepolia', [NetworkID.KOVAN]: 'kovan', [NetworkID.BSC]: 'bsc', [NetworkID.BSC_TESTNET]: 'bscTestnet',