-
Notifications
You must be signed in to change notification settings - Fork 74
/
index.tsx
62 lines (57 loc) · 1.29 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from "react";
import Header from "./Header";
import {
MetaMask,
OkxWallet,
TokenPocket,
WagmiWeb3ConfigProvider,
WalletConnect,
Hardhat,
Mainnet,
} from "@ant-design/web3-wagmi";
import { QueryClient } from "@tanstack/react-query";
import { createConfig, http } from "wagmi";
import { mainnet, hardhat } from "wagmi/chains";
import { walletConnect } from "wagmi/connectors";
const queryClient = new QueryClient();
const config = createConfig({
chains: [mainnet, hardhat],
transports: {
[mainnet.id]: http(),
[hardhat.id]: http("http://127.0.0.1:8545/"),
},
connectors: [
walletConnect({
showQrModal: false,
projectId: "c07c0051c2055890eade3556618e38a6",
}),
],
});
interface WtfLayoutProps {
children: React.ReactNode;
}
const WtfLayout: React.FC<WtfLayoutProps> = ({ children }) => {
return (
<WagmiWeb3ConfigProvider
eip6963={{
autoAddInjectedWallets: true,
}}
chains={[Mainnet, Hardhat]}
ens
wallets={[
MetaMask(),
WalletConnect(),
TokenPocket({
group: "Popular",
}),
OkxWallet(),
]}
config={config}
queryClient={queryClient}
>
<Header />
{children}
</WagmiWeb3ConfigProvider>
);
};
export default WtfLayout;