You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error occurs trying to add Base chain from wagmi chains
import "@/styles/globals.css";
import "react-toastify/dist/ReactToastify.css";
import type { AppProps } from "next/app";
import { WagmiConfig, createConfig, mainnet, configureChains } from "wagmi";
import {
ConnectKitProvider,
ConnectKitButton,
getDefaultConfig,
} from "connectkit";
import Head from "next/head";
import { useEffect, useState } from "react";
import Navbar from "./components/Navbar";
import AppContext from "@/context/AppContext";
import { ToastContainer } from "react-toastify";
import {
polygon,
optimism,
arbitrum,
bsc,
avalanche,
celo,
fantom,
} from "wagmi/chains";
import { alchemyProvider } from "wagmi/providers/alchemy";
import { publicProvider } from "wagmi/providers/public";
import UserContext from "@/context/UserContext";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { defineChain } from "viem";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
// Choose which chains you'd like to show
//const chains = [mainnet, polygon, optimism, arbitrum]
const alchemyId = "";
// Add your custom chains to the list of wagmi configured chains
const { publicClient, chains } = configureChains(
[mainnet, polygon, optimism, arbitrum, bsc, avalanche, celo, fantom],
[alchemyProvider({ apiKey: alchemyId }), publicProvider()]
);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Error occurs trying to add Base chain from wagmi chains
import "@/styles/globals.css";
import "react-toastify/dist/ReactToastify.css";
import type { AppProps } from "next/app";
import { WagmiConfig, createConfig, mainnet, configureChains } from "wagmi";
import {
ConnectKitProvider,
ConnectKitButton,
getDefaultConfig,
} from "connectkit";
import Head from "next/head";
import { useEffect, useState } from "react";
import Navbar from "./components/Navbar";
import AppContext from "@/context/AppContext";
import { ToastContainer } from "react-toastify";
import {
polygon,
optimism,
arbitrum,
bsc,
avalanche,
celo,
fantom,
} from "wagmi/chains";
import { alchemyProvider } from "wagmi/providers/alchemy";
import { publicProvider } from "wagmi/providers/public";
import UserContext from "@/context/UserContext";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { defineChain } from "viem";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
// Choose which chains you'd like to show
//const chains = [mainnet, polygon, optimism, arbitrum]
const alchemyId = "";
// Add your custom chains to the list of wagmi configured chains
const { publicClient, chains } = configureChains(
[mainnet, polygon, optimism, arbitrum, bsc, avalanche, celo, fantom],
[alchemyProvider({ apiKey: alchemyId }), publicProvider()]
);
const config = createConfig(
getDefaultConfig({
// Required API Keys
alchemyId,
walletConnectProjectId: "",
);
export default function App({ Component, pageProps }: AppProps) {
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
const queryClient = new QueryClient();
}
Beta Was this translation helpful? Give feedback.
All reactions