From d7ca90c2deb57db1ca5b4d2f5755c939c64509db Mon Sep 17 00:00:00 2001 From: Alissa Crane Date: Thu, 15 Aug 2024 08:56:54 -0700 Subject: [PATCH 1/2] add base to wagmi config and update onchainkit chain --- src/components/OnchainProviders.tsx | 4 ++-- src/wagmi.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/OnchainProviders.tsx b/src/components/OnchainProviders.tsx index e479d3e..0192794 100644 --- a/src/components/OnchainProviders.tsx +++ b/src/components/OnchainProviders.tsx @@ -3,7 +3,7 @@ import { OnchainKitProvider } from '@coinbase/onchainkit'; import { RainbowKitProvider } from '@rainbow-me/rainbowkit'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { ReactNode } from 'react'; -import { baseSepolia } from 'viem/chains'; +import { base } from 'viem/chains'; import { WagmiProvider } from 'wagmi'; import { NEXT_PUBLIC_CDP_API_KEY } from '../config'; import { useWamigConfig } from '../wagmi'; @@ -20,7 +20,7 @@ function OnchainProviders({ children }: Props) { {children} diff --git a/src/wagmi.ts b/src/wagmi.ts index efc6c5a..d4c5fad 100644 --- a/src/wagmi.ts +++ b/src/wagmi.ts @@ -7,7 +7,7 @@ import { } from '@rainbow-me/rainbowkit/wallets'; import { useMemo } from 'react'; import { http, createConfig } from 'wagmi'; -import { baseSepolia } from 'wagmi/chains'; +import { base, baseSepolia } from 'wagmi/chains'; import { NEXT_PUBLIC_WC_PROJECT_ID } from './config'; export function useWamigConfig() { @@ -37,12 +37,13 @@ export function useWamigConfig() { ); const wagmiConfig = createConfig({ - chains: [baseSepolia], + chains: [base, baseSepolia], // turn off injected provider discovery multiInjectedProviderDiscovery: false, connectors, ssr: true, transports: { + [base.id]: http(), [baseSepolia.id]: http(), }, }); From 390230be33c841e5265150b6dbfdc0946259697d Mon Sep 17 00:00:00 2001 From: Alissa Crane Date: Thu, 15 Aug 2024 20:39:46 -0700 Subject: [PATCH 2/2] fix formatting --- src/components/OnchainProviders.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/OnchainProviders.tsx b/src/components/OnchainProviders.tsx index 0192794..faff83d 100644 --- a/src/components/OnchainProviders.tsx +++ b/src/components/OnchainProviders.tsx @@ -18,10 +18,7 @@ function OnchainProviders({ children }: Props) { return ( - + {children}