|
1 | | -import type { Chain } from 'wagmi/chains' |
| 1 | +import { getDefaultConfig } from 'connectkit' |
| 2 | +import { defineChain } from 'viem' |
| 3 | +import { createConfig, http } from 'wagmi' |
| 4 | +import { type Chain, mainnet } from 'wagmi/chains' |
2 | 5 |
|
3 | | -export const statusNetworkTestnet: Chain = { |
4 | | - id: Number(1660990954), |
| 6 | +import { clientEnv } from './env.client.mjs' |
| 7 | + |
| 8 | +import type { |
| 9 | + CreateConfigParameters, |
| 10 | + CreateConnectorFn, |
| 11 | + Transport, |
| 12 | +} from 'wagmi' |
| 13 | + |
| 14 | +export const testnet = defineChain({ |
| 15 | + id: 1660990954, |
5 | 16 | name: 'Status Network Testnet', |
6 | | - nativeCurrency: { |
7 | | - decimals: 18, |
8 | | - name: 'Ether', |
9 | | - symbol: 'ETH', |
10 | | - }, |
| 17 | + testnet: true, |
| 18 | + sourceId: 1660990954, |
| 19 | + nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, |
11 | 20 | rpcUrls: { |
12 | 21 | default: { |
13 | 22 | http: ['https://public.sepolia.rpc.status.network'], |
14 | 23 | }, |
15 | | - public: { |
16 | | - http: ['https://public.sepolia.rpc.status.network'], |
17 | | - }, |
18 | 24 | }, |
19 | 25 | blockExplorers: { |
20 | 26 | default: { |
21 | 27 | name: 'Status Explorer', |
22 | 28 | url: 'https://sepoliascan.status.network', |
23 | 29 | }, |
24 | 30 | }, |
25 | | -} |
| 31 | +}) |
| 32 | + |
| 33 | +export const getDefaultWagmiConfig = () => |
| 34 | + getDefaultConfig({ |
| 35 | + chains: [mainnet, testnet], |
| 36 | + transports: { |
| 37 | + [mainnet.id]: http(mainnet.rpcUrls.default.http[0]), |
| 38 | + [testnet.id]: http(testnet.rpcUrls.default.http[0]), |
| 39 | + }, |
| 40 | + walletConnectProjectId: |
| 41 | + clientEnv.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID as string, |
| 42 | + appName: 'Status Hub', |
| 43 | + appDescription: 'Status Network DeFi Dashboard', |
| 44 | + appUrl: 'https://status.app', |
| 45 | + appIcon: 'https://status.app/icon.png', |
| 46 | + }) as CreateConfigParameters< |
| 47 | + readonly [Chain, ...Chain[]], |
| 48 | + Record<number, Transport>, |
| 49 | + readonly CreateConnectorFn[] |
| 50 | + > |
| 51 | + |
| 52 | +export const wagmiConfig = createConfig(getDefaultWagmiConfig()) |
0 commit comments