Commit 3f77ac91 authored by tom's avatar tom

update TestApp setup

parent 4497dc09
import { ChakraProvider } from '@chakra-ui/react'; import { ChakraProvider } from '@chakra-ui/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { createWeb3Modal } from '@web3modal/wagmi/react'; import { createWeb3Modal, defaultWagmiConfig } from '@web3modal/wagmi/react';
import React from 'react'; import React from 'react';
import { configureChains, createConfig, WagmiConfig } from 'wagmi'; import { WagmiConfig } from 'wagmi';
import { mainnet } from 'wagmi/chains'; import { mainnet } from 'wagmi/chains';
import { WalletConnectConnector } from 'wagmi/connectors/walletConnect';
import type { Props as PageProps } from 'nextjs/getServerSideProps'; import type { Props as PageProps } from 'nextjs/getServerSideProps';
...@@ -34,24 +33,17 @@ const defaultAppContext = { ...@@ -34,24 +33,17 @@ const defaultAppContext = {
}; };
// >>> Web3 stuff // >>> Web3 stuff
const { publicClient, chains } = configureChains( const chains = [ mainnet ];
[ mainnet ], const WALLET_CONNECT_PROJECT_ID = 'PROJECT_ID';
[],
);
const wagmiConfig = createConfig({ const wagmiConfig = defaultWagmiConfig({
autoConnect: false, chains,
connectors: [ projectId: WALLET_CONNECT_PROJECT_ID,
new WalletConnectConnector({
options: { projectId: 'xxx' },
}),
],
publicClient,
}); });
createWeb3Modal({ createWeb3Modal({
wagmiConfig, wagmiConfig,
projectId: 'xxx', projectId: WALLET_CONNECT_PROJECT_ID,
chains, chains,
}); });
// <<<< // <<<<
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment