Skip to content

feat: add sepolia network support on web3 package #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading