Hello Moralis community. Please solve this problem fast! I am receiving an error I can not resolve myself. My coding experience is limited. Attached is an image of the code compiled in Visual Studio Code that does look very similar to the youtube tutorial but I notice that the βconst { provider, webSocketProvider } = configureChains(β has the error as the colour of provider & webSocketProvider appear as a blue color not yellow.
Hi @4-Art
As per the latest wagmi sdk version createClient has been replace with createConfig.
Here is an example code on how to update wagmi code as per the latest wagmi version. Please try similar to this.
Check the wagmi docs for more details
import "@/styles/globals.css";
import { createConfig, configureChains, mainnet } from "wagmi";
import { publicProvider } from "wagmi/providers/public";
import { InjectedConnector } from "wagmi/connectors/injected";
import { WalletConnectConnector } from "wagmi/connectors/walletConnect";
const { chains, publicClient } = configureChains([mainnet], [publicProvider()]);
import { WagmiConfig } from "wagmi";
const config = createConfig({
connectors: [
new InjectedConnector({ chains }),
new WalletConnectConnector({
chains,
options: {
projectId: "...",
},
}),
],
publicClient,
});
export default function App({ Component, pageProps }) {
return (
<>
<WagmiConfig config={config}>
<Component {...pageProps} />
</WagmiConfig>
</>
);
}
Thank you for this speedy help. I will start another thread in regards to the next issue I run into.
1 Like