Skip to content

Commit

Permalink
docs: fix type errors in custom chain example (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed May 31, 2022
1 parent 2b31d53 commit 1b08172
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions packages/example/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './global.css';
import '@rainbow-me/rainbowkit/styles.css';
import {
Chain,
connectorsForWallets,
darkTheme,
DisclaimerComponent,
Expand All @@ -20,12 +21,32 @@ import { publicProvider } from 'wagmi/providers/public';
const alchemyId = '_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC';
const RAINBOW_TERMS = 'https://rainbow.me/terms-of-use';

const avalancheChain: Chain = {
blockExplorers: {
default: { name: 'SnowTrace', url: 'https://snowtrace.io' },
etherscan: { name: 'SnowTrace', url: 'https://snowtrace.io' },
},
id: 43_114,
name: 'Avalanche',
nativeCurrency: {
decimals: 18,
name: 'Avalanche',
symbol: 'AVAX',
},
network: 'avalanche',
rpcUrls: {
default: 'https://api.avax.network/ext/bc/C/rpc',
},
testnet: false,
};

const { chains, provider, webSocketProvider } = configureChains(
[
chain.mainnet,
chain.polygon,
chain.optimism,
chain.arbitrum,
avalancheChain,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true'
? [chain.goerli, chain.kovan, chain.rinkeby, chain.ropsten]
: []),
Expand Down
5 changes: 4 additions & 1 deletion site/data/docs/custom-chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import { jsonRpcProvider } from 'wagmi/providers/jsonRpc';
const avalancheChain: Chain = {
id: 43_114,
name: 'Avalanche',
network: 'avalanche',
iconUrl: 'https://example.com/icon.svg',
iconBackground: '#fff',
nativeCurrency: {
decimals: 18,
name: 'Avalanche',
Expand All @@ -34,7 +37,7 @@ const avalancheChain: Chain = {
},
blockExplorers: {
default: { name: 'SnowTrace', url: 'https://snowtrace.io' },
snowtrace: { name: 'SnowTrace', url: 'https://snowtrace.io' },
etherscan: { name: 'SnowTrace', url: 'https://snowtrace.io' },
},
testnet: false,
};
Expand Down

2 comments on commit 1b08172

@vercel
Copy link

@vercel vercel bot commented on 1b08172 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1b08172 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.