From 381b77aaed6cd43e021a8a04f926c8d29e85b6f8 Mon Sep 17 00:00:00 2001 From: "Anton@habdevs" Date: Tue, 5 Sep 2023 14:10:03 +0500 Subject: [PATCH] =?UTF-8?q?upd:=20deconstructed=20alchemy=20=C3=A2=C2=84?= =?UTF-8?q?=C3=A2=C2=84#190?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/_app.tsx | 73 ++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index 4a39289..3488f80 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,47 +1,52 @@ -import type { AppProps } from 'next/app' -import Head from 'next/head' -import { RainbowKitProvider, getDefaultWallets } from '@rainbow-me/rainbowkit' -import { configureChains, createClient, WagmiConfig } from 'wagmi' -import { polygon } from 'wagmi/chains' -import { ApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client' -import { Layout } from 'components' -import { WalletContextProvider } from 'contexts/WalltetContext' -import { XmtpContextProvider } from 'contexts/XmtpContext' -import 'i18n/index' -import '@rainbow-me/rainbowkit/styles.css' -import 'styles/globals.css' -import XmtpProvider from '../contexts/XmtpProvider' +import type { AppProps } from 'next/app'; +import Head from 'next/head'; +import { RainbowKitProvider, getDefaultWallets } from '@rainbow-me/rainbowkit'; +import { configureChains, createClient, WagmiConfig } from 'wagmi'; +import { polygon } from 'wagmi/chains'; +import { ApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client'; +import { Layout } from 'components'; +import { WalletContextProvider } from 'contexts/WalltetContext'; +import { XmtpContextProvider } from 'contexts/XmtpContext'; +import 'i18n/index'; +import '@rainbow-me/rainbowkit/styles.css'; +import 'styles/globals.css'; +import XmtpProvider from '../contexts/XmtpProvider'; // TODO: don't forget to bring back alchemy instead of publicProvider. @habdevs #190 -// import {alchemyProvider} from 'wagmi/providers/alchemy'; -import { GameStateContextProvider } from 'contexts/GameStateContext' -import { publicProvider } from 'wagmi/providers/public' +import { alchemyProvider } from 'wagmi/providers/alchemy'; +import { publicProvider } from 'wagmi/providers/public'; +import { GameStateContextProvider } from 'contexts/GameStateContext'; -const { chains, provider, webSocketProvider } = configureChains([polygon], - [publicProvider()], - // [alchemyProvider({apiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY!})] -) +const { chains, provider, webSocketProvider } = configureChains( + [polygon], + // [publicProvider()], + [alchemyProvider({ apiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY! }), publicProvider()], +); const { connectors } = getDefaultWallets({ appName: 'GameJutsu App', chains, projectId: 'efa8ae30b8b72991a9630a636d6d0411', -}) +}); const wagmiClient = createClient({ - autoConnect: true, connectors, provider, webSocketProvider, -}) + autoConnect: true, + connectors, + provider, + webSocketProvider, +}); -const cache = new InMemoryCache() +const cache = new InMemoryCache(); const client = new ApolloClient({ uri: 'https://api.thegraph.com/subgraphs/name/chainhackers/gamejutsu-subgraph', cache, -}) +}); -const version = 'v1.2.38' +const version = 'v1.2.38'; -function MyApp ({ Component, pageProps }: AppProps) { - const props = { ...pageProps, version } - return ( +function MyApp({ Component, pageProps }: AppProps) { + const props = { ...pageProps, version }; + return ( + @@ -50,10 +55,7 @@ function MyApp ({ Component, pageProps }: AppProps) { - + @@ -63,7 +65,8 @@ function MyApp ({ Component, pageProps }: AppProps) { - ) + + ); } -export default MyApp +export default MyApp;