Skip to content

Commit

Permalink
feat: add sepolia network support on web3 package
Browse files Browse the repository at this point in the history
  • Loading branch information
diegonzs-roll committed Aug 20, 2024
1 parent dd2ade1 commit 752db17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-planes-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roll-network/web3': patch
---

Added Sepolia network support
2 changes: 2 additions & 0 deletions packages/web3/src/connectors/connectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export const CHAIN_ID_GOERLI = 5
export const CHAIN_ID_MUMBAI = 80001
export const CHAIN_ID_HARDHAT = 31337
export const CHAIN_ID_FORM_TESTNET = 132902
export const CHAIN_ID_SEPOLIA = 11155111

export const SUPPORTED_CHAIN_IDS = [
CHAIN_ID_MAIN_NET,
CHAIN_ID_POLYGON,
CHAIN_ID_GOERLI,
CHAIN_ID_SEPOLIA,
CHAIN_ID_MUMBAI,
CHAIN_ID_HARDHAT,
CHAIN_ID_FORM_TESTNET,
Expand Down
2 changes: 2 additions & 0 deletions packages/web3/src/providers/web3ProviderWagmi/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import {
CHAIN_ID_MAIN_NET,
CHAIN_ID_MUMBAI,
CHAIN_ID_POLYGON,
CHAIN_ID_SEPOLIA,
} from '../../connectors'
import { formTestnet } from './chains'

const MAP_CHAINS: Record<number, Chain> = {
[CHAIN_ID_MAIN_NET]: mainnet,
[CHAIN_ID_POLYGON]: polygon,
[CHAIN_ID_GOERLI]: goerli,
[CHAIN_ID_SEPOLIA]: polygon,
[CHAIN_ID_HARDHAT]: hardhat,
[CHAIN_ID_MUMBAI]: polygonMumbai,
[CHAIN_ID_FORM_TESTNET]: formTestnet,
Expand Down
5 changes: 5 additions & 0 deletions packages/web3/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
CHAIN_ID_MAIN_NET,
CHAIN_ID_MUMBAI,
CHAIN_ID_POLYGON,
CHAIN_ID_SEPOLIA,
} from '../connectors'

export function shortenAddress(address: string, digits: number = 4) {
Expand Down Expand Up @@ -34,6 +35,10 @@ const ETHERSCAN_DATA: Record<number, { domain: string; prefix?: string }> = {
[CHAIN_ID_MAIN_NET]: {
domain: 'etherscan.io',
},
[CHAIN_ID_SEPOLIA]: {
domain: 'etherscan.io',
prefix: 'sepolia.',
},
[CHAIN_ID_GOERLI]: {
domain: 'etherscan.io',
prefix: 'goerli.',
Expand Down

0 comments on commit 752db17

Please sign in to comment.