From 410b2688971298402362fbbf36007007f80516d0 Mon Sep 17 00:00:00 2001 From: Ram Bhaskar Date: Thu, 30 Nov 2023 11:32:12 -0500 Subject: [PATCH] =?UTF-8?q?feat(opt-base-sepolia):=20adding=20support=20fo?= =?UTF-8?q?r=20sepolia=20networks=20on=20opt=20an=E2=80=A6=20(#394)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(opt-base-sepolia): adding support for sepolia networks on opt and base * add changelog --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- docs-md/README.md | 4 ++-- src/types/types.ts | 4 +++- src/util/const.ts | 12 +++++++++++- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5745bb..cc55ca3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ ### Major Changes +## 3.1.0 + +### Major Changes + +- Added support for Optimism Sepolia and Base Sepolia via the `Network.OPT_SEPOLIA` and `Network.BASE_SEPOLIA` enums. + ### Minor Changes ## 3.0.0 diff --git a/README.md b/README.md index 6450a3d7..3d46ee59 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ The SDK currently supports the following chains: - **Ethereum**: Mainnet, Goerli, Sepolia - **Polygon**: Mainnet, Mumbai -- **Optimism**: Mainnet, Goerli, Kovan +- **Optimism**: Mainnet, Goerli, Kovan, Sepolia - **Arbitrum**: Mainnet, Goerli, Rinkeby, Sepolia - **Astar**: Mainnet - **PolygonZKEVM**: Mainnet, Testnet -- **Base**: Mainnet, Goerli +- **Base**: Mainnet, Goerli, Sepolia You can find per-method documentation of the Alchemy SDK endpoints at the [Alchemy Docs linked in the sidebar](https://docs.alchemy.com/reference/alchemy-sdk-quickstart). diff --git a/docs-md/README.md b/docs-md/README.md index c5ebfb3e..76e989a2 100644 --- a/docs-md/README.md +++ b/docs-md/README.md @@ -16,11 +16,11 @@ The SDK currently supports the following chains: - **Ethereum**: Mainnet, Goerli, Sepolia - **Polygon**: Mainnet, Mumbai -- **Optimism**: Mainnet, Goerli, Kovan +- **Optimism**: Mainnet, Goerli, Kovan, Sepolia - **Arbitrum**: Mainnet, Goerli, Rinkeby, Sepolia - **Astar**: Mainnet - **PolygonZKEVM**: Mainnet, Testnet -- **Base**: Mainnet, Goerli +- **Base**: Mainnet, Goerli, Sepolia You can find per-method documentation of the Alchemy SDK endpoints at the [Alchemy Docs linked in the sidebar](https://docs.alchemy.com/reference/alchemy-sdk-quickstart). diff --git a/src/types/types.ts b/src/types/types.ts index bea9b7b5..15b612c9 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -84,6 +84,7 @@ export enum Network { ETH_SEPOLIA = 'eth-sepolia', OPT_MAINNET = 'opt-mainnet', OPT_GOERLI = 'opt-goerli', + OPT_SEPOLIA = 'opt-sepolia', ARB_MAINNET = 'arb-mainnet', ARB_GOERLI = 'arb-goerli', ARB_SEPOLIA = 'arb-sepolia', @@ -93,7 +94,8 @@ export enum Network { POLYGONZKEVM_MAINNET = 'polygonzkevm-mainnet', POLYGONZKEVM_TESTNET = 'polygonzkevm-testnet', BASE_MAINNET = 'base-mainnet', - BASE_GOERLI = 'base-goerli' + BASE_GOERLI = 'base-goerli', + BASE_SEPOLIA = 'base-sepolia' } /** Token Types for the `getTokenBalances()` endpoint. */ diff --git a/src/util/const.ts b/src/util/const.ts index 8478df96..4fb4d52c 100644 --- a/src/util/const.ts +++ b/src/util/const.ts @@ -45,6 +45,7 @@ export const EthersNetwork = { [Network.ETH_SEPOLIA]: 'sepolia', [Network.OPT_MAINNET]: 'optimism', [Network.OPT_GOERLI]: 'optimism-goerli', + [Network.OPT_SEPOLIA]: 'optimism-sepolia', [Network.ARB_MAINNET]: 'arbitrum', [Network.ARB_GOERLI]: 'arbitrum-goerli', [Network.ARB_SEPOLIA]: 'arbitrum-sepolia', @@ -54,7 +55,8 @@ export const EthersNetwork = { [Network.POLYGONZKEVM_MAINNET]: 'polygonzkevm-mainnet', [Network.POLYGONZKEVM_TESTNET]: 'polygonzkevm-testnet', [Network.BASE_MAINNET]: 'base-mainnet', - [Network.BASE_GOERLI]: 'base-goerli' + [Network.BASE_GOERLI]: 'base-goerli', + [Network.BASE_SEPOLIA]: 'base-sepolia' }; /** @@ -79,6 +81,10 @@ export const CustomNetworks: { [key: string]: NetworkFromEthers } = { chainId: 11155111, name: 'sepolia' }, + 'optimism-sepolia': { + chainId: 11155420, + name: 'optimism-sepolia' + }, 'polygonzkevm-mainnet': { chainId: 1101, name: 'polygonzkevm-mainnet' @@ -94,6 +100,10 @@ export const CustomNetworks: { [key: string]: NetworkFromEthers } = { 'base-goerli': { chainId: 84531, name: 'base-goerli' + }, + 'base-sepolia': { + chainId: 84532, + name: 'base-sepolia' } };