Created
May 8, 2023 17:38
-
-
Save dicethedev/f0926a88fde1b48efdf977378511db71 to your computer and use it in GitHub Desktop.
CELO Testnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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