Skip to content

Commit

Permalink
fix: updated wagmi config and OnchainKitProvider chain (#27)
Browse files Browse the repository at this point in the history
Co-authored-by: Alissa Crane <alissa.crane@coinbase.com>
  • Loading branch information
abcrane123 and alissacrane-cb authored Aug 17, 2024
1 parent 7cd7cb1 commit 80c414c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/components/OnchainProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -18,10 +18,7 @@ function OnchainProviders({ children }: Props) {
return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<OnchainKitProvider
apiKey={NEXT_PUBLIC_CDP_API_KEY}
chain={baseSepolia}
>
<OnchainKitProvider apiKey={NEXT_PUBLIC_CDP_API_KEY} chain={base}>
<RainbowKitProvider modalSize="compact">
{children}
</RainbowKitProvider>
Expand Down
5 changes: 3 additions & 2 deletions src/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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(),
},
});
Expand Down

0 comments on commit 80c414c

Please sign in to comment.