Skip to content

Instantly share code, notes, and snippets.

@dicethedev
Created May 8, 2023 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dicethedev/f0926a88fde1b48efdf977378511db71 to your computer and use it in GitHub Desktop.
Save dicethedev/f0926a88fde1b48efdf977378511db71 to your computer and use it in GitHub Desktop.
CELO Testnet
import '../styles/globals.css'
import Head from 'next/head'
import type { AppProps } from 'next/app'
import { WagmiConfig, createClient, configureChains, Chain, chain } from "wagmi";
import { getDefaultWallets, RainbowKitProvider, darkTheme} from "@rainbow-me/rainbowkit";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
import '@rainbow-me/rainbowkit/styles.css';
function MyApp({ Component, pageProps }: AppProps) {
const celoChain: Chain = {
id: 44787,
name: 'Celo Testnet',
network: 'avalanche',
nativeCurrency: {
decimals: 18,
name: 'Celo Alfajores Testnet',
symbol: 'CELO',
},
rpcUrls: {
default: 'https://alfajores-forno.celo-testnet.org',
},
blockExplorers: {
default: { name: 'CeloExplorer', url: 'https://docs.celo.org/' },
snowtrace: { name: "SnowTrace", url: "https://snowtrace.io" },
},
testnet: false,
}
const {provider, chains } = configureChains(
[celoChain],
[jsonRpcProvider({ rpc: chain => ({ http: chain.rpcUrls.default }) })]
)
const { connectors } = getDefaultWallets({
appName: "BlessingDAO",
chains
});
const wagmiClient = createClient({
autoConnect: true,
connectors,
provider
});
return (
<>
<Head>
<title>BlessingDAO</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/Favicon.svg" />
</Head>
<WagmiConfig client={wagmiClient}>
<RainbowKitProvider chains={chains} theme={darkTheme()}>
<Component {...pageProps} />
</RainbowKitProvider>
</WagmiConfig>
</>
)
}
export default MyApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment