Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
at main 38 lines 962 B view raw
1import { 2 BASE_RPC_URL, 3 CHAIN, 4 IS_MAINNET, 5 WALLETCONNECT_PROJECT_ID 6} from "@hey/data/constants"; 7import { familyAccountsConnector } from "family"; 8import type { ReactNode } from "react"; 9import { http } from "viem"; 10import { base } from "viem/chains"; 11import { createConfig, WagmiProvider } from "wagmi"; 12import { injected, walletConnect } from "wagmi/connectors"; 13import getRpc from "@/helpers/getRpc"; 14 15const connectors = [ 16 familyAccountsConnector(), 17 walletConnect({ projectId: WALLETCONNECT_PROJECT_ID }), 18 injected() 19]; 20 21const config = createConfig({ 22 chains: [CHAIN, base], 23 connectors, 24 transports: { 25 [CHAIN.id]: getRpc({ mainnet: IS_MAINNET }), 26 [base.id]: http(BASE_RPC_URL, { batch: { batchSize: 30 } }) 27 } 28}); 29 30interface Web3ProviderProps { 31 children: ReactNode; 32} 33 34const Web3Provider = ({ children }: Web3ProviderProps) => { 35 return <WagmiProvider config={config}>{children}</WagmiProvider>; 36}; 37 38export default Web3Provider;