• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

clippingkk / web / #1189

25 Dec 2025 09:10AM UTC coverage: 0.525% (-0.001%) from 0.526%
#1189

push

web-flow
Merge 56b5874ac into 6ac9a5cd9

30 of 447 branches covered (6.71%)

Branch coverage included in aggregate %.

0 of 153 new or added lines in 13 files covered. (0.0%)

3 existing lines in 2 files now uncovered.

147 of 33267 relevant lines covered (0.44%)

8.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/utils/chains.ts
NEW
1
/* METAMASK DISABLED - Package removed to prevent hydration errors
×
2
import type { AddEthereumChainParameter } from '@web3-react/types'
×
3

×
4
const ETH: AddEthereumChainParameter['nativeCurrency'] = {
×
5
  name: 'Ether',
×
6
  symbol: 'ETH',
×
7
  decimals: 18,
×
8
}
×
9

×
10
const MATIC: AddEthereumChainParameter['nativeCurrency'] = {
×
11
  name: 'Matic',
×
12
  symbol: 'MATIC',
×
13
  decimals: 18,
×
14
}
×
15

×
16
interface BasicChainInformation {
×
17
  urls: string[]
×
18
  name: string
×
19
}
×
20

×
21
interface ExtendedChainInformation extends BasicChainInformation {
×
22
  nativeCurrency: AddEthereumChainParameter['nativeCurrency']
×
23
  blockExplorerUrls: AddEthereumChainParameter['blockExplorerUrls']
×
24
}
×
25

×
26
function isExtendedChainInformation(
×
27
  chainInformation: BasicChainInformation | ExtendedChainInformation
×
28
): chainInformation is ExtendedChainInformation {
×
29
  return !!(chainInformation as ExtendedChainInformation).nativeCurrency
×
30
}
×
31

×
32
export function getAddChainParameters(
×
33
  chainId: number
×
34
): AddEthereumChainParameter | number {
×
35
  const chainInformation = CHAINS[chainId]
×
36
  if (isExtendedChainInformation(chainInformation)) {
×
37
    return {
×
38
      chainId,
×
39
      chainName: chainInformation.name,
×
40
      nativeCurrency: chainInformation.nativeCurrency,
×
41
      rpcUrls: chainInformation.urls,
×
42
      blockExplorerUrls: chainInformation.blockExplorerUrls,
×
43
    }
×
44
  }
×
45
  return chainId
×
46
}
×
47

×
48
export const CHAINS: {
×
49
  [chainId: number]: BasicChainInformation | ExtendedChainInformation
×
50
} = {
×
51
  1: {
×
52
    urls: [
×
53
      process.env.NEXT_PUBLIC_INFURA_KEY
×
54
        ? `https://mainnet.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_KEY}`
×
55
        : undefined,
×
56
      process.env.alchemyKey
×
57
        ? `https://eth-mainnet.alchemyapi.io/v2/${process.env.alchemyKey}`
×
58
        : undefined,
×
59
      'https://cloudflare-eth.com',
×
60
    ].filter((url) => url !== undefined) as string[],
×
61
    name: 'Mainnet',
×
62
  },
×
NEW
63
  // ... rest of chains
×
64
}
×
65

×
66
export const URLS: { [chainId: number]: string[] } = Object.keys(
×
67
  CHAINS
×
68
).reduce<{ [chainId: number]: string[] }>((accumulator, chainId) => {
×
69
  const validURLs: string[] = CHAINS[Number(chainId)].urls
×
70

×
71
  if (validURLs.length) {
×
72
    accumulator[Number(chainId)] = validURLs
×
73
  }
×
74

×
75
  return accumulator
×
76
}, {})
×
NEW
77
*/
×
NEW
78

×
NEW
79
// Stub exports to prevent import errors
×
NEW
80
export function getAddChainParameters(_chainId: number): number {
×
NEW
81
  return _chainId
×
NEW
82
}
×
NEW
83

×
NEW
84
export const CHAINS: Record<number, { urls: string[]; name: string }> = {}
×
NEW
85

×
NEW
86
export const URLS: Record<number, string[]> = {}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc