From 1a168a2ba15523f056c1b1bd0704d269edf19e8c Mon Sep 17 00:00:00 2001 From: Lochie Axon Date: Mon, 5 Feb 2024 16:25:11 +1100 Subject: [PATCH 1/6] fix: unsupported chains not correctly being identified --- .../testbench/src/components/Web3Provider.tsx | 11 +++++-- examples/testbench/src/pages/chains.tsx | 33 +++++++++---------- examples/testbench/src/pages/index.tsx | 22 ++----------- .../src/components/BalanceButton/index.tsx | 4 ++- .../src/components/Common/Chain/index.tsx | 11 ++++++- .../components/Common/ChainSelect/index.tsx | 14 ++------ .../src/components/ConnectButton/index.tsx | 17 +++++----- .../connectkit/src/components/ConnectKit.tsx | 8 ++--- .../src/components/ConnectModal/demo.tsx | 8 ++--- .../src/components/ConnectModal/index.tsx | 7 ++-- .../Pages/MobileConnectors/index.tsx | 1 - .../components/Pages/SwitchNetworks/index.tsx | 31 +++++++++-------- .../src/components/contexts/web3/index.tsx | 11 ++++--- .../src/hooks/useChainIsSupported.ts | 7 ++++ packages/connectkit/src/hooks/useModal.ts | 2 +- packages/connectkit/src/index.ts | 1 + 16 files changed, 92 insertions(+), 96 deletions(-) create mode 100644 packages/connectkit/src/hooks/useChainIsSupported.ts diff --git a/examples/testbench/src/components/Web3Provider.tsx b/examples/testbench/src/components/Web3Provider.tsx index 4b9fa145..2e79c569 100644 --- a/examples/testbench/src/components/Web3Provider.tsx +++ b/examples/testbench/src/components/Web3Provider.tsx @@ -7,6 +7,7 @@ import { WagmiProvider, createConfig } from 'wagmi'; import { defineChain, type Chain, http } from 'viem'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { mainnet } from 'viem/chains'; const avalanche: Chain = defineChain({ id: 43_114, @@ -27,10 +28,16 @@ const avalanche: Chain = defineChain({ }); const ckConfig = getDefaultConfig({ - chains: [avalanche], + /* + chains: [ + mainnet, + //avalanche + ], transports: { - [avalanche.id]: http(avalanche.rpcUrls.default.http[0]), + [mainnet.id]: http(mainnet.rpcUrls.default.http[0]), + //[avalanche.id]: http(avalanche.rpcUrls.default.http[0]), }, + */ appName: 'ConnectKit testbench', appIcon: '/app.png', walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!, diff --git a/examples/testbench/src/pages/chains.tsx b/examples/testbench/src/pages/chains.tsx index 824e10db..c16f766f 100644 --- a/examples/testbench/src/pages/chains.tsx +++ b/examples/testbench/src/pages/chains.tsx @@ -25,8 +25,8 @@ const Home: NextPage = () => { return () => clearInterval(interval); }, []); - const { chain } = useAccount(); const chains = useChains(); + const { chain } = useAccount(); if (!mounted) return null; @@ -36,12 +36,7 @@ const Home: NextPage = () => {

Chains

Connected to

- x.id !== chain?.id) - )} - /> +

Configured/Supported Chains

{chains.map((chain) => ( @@ -93,17 +88,19 @@ const Home: NextPage = () => { gap: 8, }} > - {allChains.map((chain) => ( -
- - - {chain.name} {chain.id} - -
- ))} + {allChains + .sort((a, b) => a.id - b.id) + .map((chain) => ( +
+ + + {chain.name} {chain.id} + +
+ ))}
diff --git a/examples/testbench/src/pages/index.tsx b/examples/testbench/src/pages/index.tsx index e373894f..c09e589f 100644 --- a/examples/testbench/src/pages/index.tsx +++ b/examples/testbench/src/pages/index.tsx @@ -20,7 +20,6 @@ import { useSendTransaction, useSignMessage, useSignTypedData, - useSimulateContract, useConnect, useDisconnect, } from 'wagmi'; @@ -103,12 +102,7 @@ const AccountInfo = () => { Chain Supported - - {!chain || - Boolean(chain && !chains.some((x) => x.id !== chain?.id)) - ? 'No' - : 'Yes'} - + {chains.some((x) => x.id === chain?.id) ? 'Yes' : 'No'} Address @@ -318,12 +312,7 @@ const Home: NextPage = () => {

Chains

- x.id !== chain?.id) - )} - /> + @@ -364,12 +353,7 @@ const Home: NextPage = () => { }} > {chain?.name} - x.id !== chain?.id) - )} - /> + {ensName ?? address}
diff --git a/packages/connectkit/src/components/BalanceButton/index.tsx b/packages/connectkit/src/components/BalanceButton/index.tsx index d556bd89..d07533ca 100644 --- a/packages/connectkit/src/components/BalanceButton/index.tsx +++ b/packages/connectkit/src/components/BalanceButton/index.tsx @@ -14,6 +14,7 @@ import { chainConfigs } from '../../constants/chainConfigs'; import ThemedButton from '../Common/ThemedButton'; import { nFormatter } from '../../utils'; import { useChains } from '../../hooks/useChains'; +import { useChainIsSupported } from '../../hooks/useChainIsSupported'; const Container = styled(motion.div)` display: flex; @@ -52,6 +53,7 @@ export const Balance: React.FC = ({ hideIcon, hideSymbol }) => { const { address, chain } = useAccount(); const chains = useChains(); + const unsupported = useChainIsSupported(chain?.id); const queryClient = useQueryClient(); const { data: blockNumber } = useBlockNumber({ watch: true }); @@ -112,7 +114,7 @@ export const Balance: React.FC = ({ hideIcon, hideSymbol }) => { - ) : Boolean(chain && !chains.some((x) => x.id !== chain?.id)) ? ( + ) : unsupported ? ( {!hideIcon && } ??? diff --git a/packages/connectkit/src/components/Common/Chain/index.tsx b/packages/connectkit/src/components/Common/Chain/index.tsx index 963f1091..c69b92e2 100644 --- a/packages/connectkit/src/components/Common/Chain/index.tsx +++ b/packages/connectkit/src/components/Common/Chain/index.tsx @@ -10,6 +10,7 @@ import { AnimatePresence } from 'framer-motion'; import { chainConfigs } from '../../../constants/chainConfigs'; import Chains from '../../../assets/chains'; import useIsMounted from '../../../hooks/useIsMounted'; +import { useChainIsSupported } from '../../../hooks/useChainIsSupported'; const Spinner = ( = ({ id, unsupported, radius = '50%', size = 24 }) => { +}> = ({ + id, + unsupported: controlledUnsupported, + radius = '50%', + size = 24, +}) => { + const isChainSupported = useChainIsSupported(id); + const unsupported = controlledUnsupported ?? !isChainSupported; + const chain = chainConfigs.find((c) => c.id === id); const isMounted = useIsMounted(); if (!isMounted) diff --git a/packages/connectkit/src/components/Common/ChainSelect/index.tsx b/packages/connectkit/src/components/Common/ChainSelect/index.tsx index 9097f9c5..65b72d98 100644 --- a/packages/connectkit/src/components/Common/ChainSelect/index.tsx +++ b/packages/connectkit/src/components/Common/ChainSelect/index.tsx @@ -172,20 +172,10 @@ const ChainSelector: React.FC = () => { > {disabled ? ( - x.id !== chain?.id) - )} - /> + ) : ( - x.id !== chain?.id) - )} - /> + )} {!disabled && } diff --git a/packages/connectkit/src/components/ConnectButton/index.tsx b/packages/connectkit/src/components/ConnectButton/index.tsx index 97f3e6a0..8ca0ccf5 100644 --- a/packages/connectkit/src/components/ConnectButton/index.tsx +++ b/packages/connectkit/src/components/ConnectButton/index.tsx @@ -21,7 +21,7 @@ import { AuthIcon } from '../../assets/icons'; import { useSIWE } from '../../siwe'; import useLocales from '../../hooks/useLocales'; import { Chain } from 'viem'; -import { useChains } from '../../hooks/useChains'; +import { useChainIsSupported } from '../../hooks/useChainIsSupported'; const contentVariants: Variants = { initial: { @@ -124,7 +124,8 @@ const ConnectButtonRenderer: React.FC = ({ const { open, setOpen } = useModal(); const { address, isConnected, chain } = useAccount(); - const chains = useChains(); + const isChainSupported = useChainIsSupported(chain?.id); + const { data: ensName } = useEnsName({ chainId: 1, address: address, @@ -148,7 +149,7 @@ const ConnectButtonRenderer: React.FC = ({ show, hide, chain: chain, - unsupported: Boolean(chain && !chains.some((x) => x.id !== chain?.id)), + unsupported: !isChainSupported, isConnected: !!address, isConnecting: open, // Using `open` to determine if connecting as wagmi isConnecting only is set to true when an active connector is awaiting connection address: address, @@ -175,7 +176,8 @@ function ConnectKitButtonInner({ const { isSignedIn } = useSIWE(); const { address, chain } = useAccount(); - const chains = useChains(); + const isChainSupported = useChainIsSupported(chain?.id); + const { data: ensName } = useEnsName({ chainId: 1, address: address, @@ -214,7 +216,7 @@ function ConnectKitButtonInner({ )} - {Boolean(chain && !chains.some((x) => x.id !== chain?.id)) && ( + {!isChainSupported && ( x.id !== chain?.id)); + const shouldShowBalance = showBalance && chainIsSupported; const willShowBalance = address && shouldShowBalance; return ( diff --git a/packages/connectkit/src/components/ConnectKit.tsx b/packages/connectkit/src/components/ConnectKit.tsx index 20a09f6b..26a864d9 100644 --- a/packages/connectkit/src/components/ConnectKit.tsx +++ b/packages/connectkit/src/components/ConnectKit.tsx @@ -29,6 +29,7 @@ import { isFamily } from '../utils/wallets'; import { useConnector } from '../hooks/useConnectors'; import { WagmiContext, useAccount } from 'wagmi'; import { Web3ContextProvider } from './contexts/web3'; +import { useChainIsSupported } from '../hooks/useChainIsSupported'; export const routes = { ONBOARDING: 'onboarding', @@ -202,11 +203,10 @@ export const ConnectKitProvider = ({ // Check if chain is supported, elsewise redirect to switches page const { chain } = useAccount(); + const isChainSupported = useChainIsSupported(chain?.id); + useEffect(() => { - if ( - opts.enforceSupportedChains && - Boolean(chain && !chains.some((x) => x.id !== chain?.id)) - ) { + if (opts.enforceSupportedChains && !isChainSupported) { setOpen(true); setRoute(routes.SWITCHNETWORKS); } diff --git a/packages/connectkit/src/components/ConnectModal/demo.tsx b/packages/connectkit/src/components/ConnectModal/demo.tsx index c8615ec8..c978b4d3 100644 --- a/packages/connectkit/src/components/ConnectModal/demo.tsx +++ b/packages/connectkit/src/components/ConnectModal/demo.tsx @@ -20,8 +20,8 @@ import { ConnectKitThemeProvider } from '../ConnectKitThemeProvider/ConnectKitTh import styled from './../../styles/styled'; import { keyframes } from 'styled-components'; -import { useChains } from '../../hooks/useChains'; import { Web3ContextProvider } from '../contexts/web3'; +import { useChainIsSupported } from '../../hooks/useChainIsSupported'; const dist = 8; const shake = keyframes` @@ -99,13 +99,13 @@ const ConnectModal: React.FC<{ onClose, }) => { const context = useContext(); + const { isConnected, chain } = useAccount(); - const chains = useChains(); + const chainIsSupported = useChainIsSupported(chain?.id); //if chain is unsupported we enforce a "switch chain" prompt const closeable = !( - context.options?.enforceSupportedChains && - Boolean(chain && !chains.some((x) => x.id !== chain?.id)) + context.options?.enforceSupportedChains && !chainIsSupported ); const showBackButton = diff --git a/packages/connectkit/src/components/ConnectModal/index.tsx b/packages/connectkit/src/components/ConnectModal/index.tsx index 0b42ee60..1ce8e7d2 100644 --- a/packages/connectkit/src/components/ConnectModal/index.tsx +++ b/packages/connectkit/src/components/ConnectModal/index.tsx @@ -16,7 +16,7 @@ import SignInWithEthereum from '../Pages/SignInWithEthereum'; import { getAppIcon, getAppName } from '../../defaultConfig'; import { ConnectKitThemeProvider } from '../ConnectKitThemeProvider/ConnectKitThemeProvider'; -import { useChains } from '../../hooks/useChains'; +import { useChainIsSupported } from '../../hooks/useChainIsSupported'; const customThemeDefault: object = {}; @@ -33,12 +33,11 @@ const ConnectModal: React.FC<{ }) => { const context = useContext(); const { isConnected, chain } = useAccount(); - const chains = useChains(); + const chainIsSupported = useChainIsSupported(chain?.id); //if chain is unsupported we enforce a "switch chain" prompt const closeable = !( - context.options?.enforceSupportedChains && - Boolean(chain && !chains.some((x) => x.id !== chain?.id)) + context.options?.enforceSupportedChains && !chainIsSupported ); const showBackButton = diff --git a/packages/connectkit/src/components/Pages/MobileConnectors/index.tsx b/packages/connectkit/src/components/Pages/MobileConnectors/index.tsx index 8bc3e91f..f0fe264f 100644 --- a/packages/connectkit/src/components/Pages/MobileConnectors/index.tsx +++ b/packages/connectkit/src/components/Pages/MobileConnectors/index.tsx @@ -21,7 +21,6 @@ import { WalletConfigProps, walletConfigs, } from '../../../wallets/walletConfigs'; -import wallet from '../../../assets/wallet'; const MoreIcon = ( { const { reset } = useConnect(); const { disconnect } = useDisconnect(); const { connector, chain } = useAccount(); - const chains = useChains(); + const isChainSupported = useChainIsSupported(chain?.id); const locales = useLocales({}); @@ -32,7 +32,7 @@ const SwitchNetworks: React.FC = () => { return ( - {Boolean(chain && !chains.some((x) => x.id !== chain?.id)) && ( + {!isChainSupported && ( {locales.warnings_chainUnsupported}{' '} {locales.warnings_chainUnsupportedResolve} @@ -43,19 +43,18 @@ const SwitchNetworks: React.FC = () => {
- {Boolean(chain && !chains.some((x) => x.id !== chain?.id)) && - !isSafeConnector(connector?.id) && ( -
- - -
- )} + {!isChainSupported && !isSafeConnector(connector?.id) && ( +
+ + +
+ )} ); diff --git a/packages/connectkit/src/components/contexts/web3/index.tsx b/packages/connectkit/src/components/contexts/web3/index.tsx index 607202fe..cec792a1 100644 --- a/packages/connectkit/src/components/contexts/web3/index.tsx +++ b/packages/connectkit/src/components/contexts/web3/index.tsx @@ -11,8 +11,8 @@ import { useChains } from '../../../hooks/useChains'; import { useWalletConnectUri } from '../../../hooks/connectors/useWalletConnectUri'; import { useCoinbaseWalletUri } from '../../../hooks/connectors/useCoinbaseWalletUri'; import { isCoinbaseWalletConnector } from '../../../utils'; -import { useContext } from '../../ConnectKit'; import useIsMobile from '../../../hooks/useIsMobile'; +import { useChainIsSupported } from '../../../hooks/useChainIsSupported'; type Web3Context = { connect: { @@ -22,9 +22,8 @@ type Web3Context = { chains: Chain[]; }; account?: { - chain: Chain & { - unsupported?: boolean; - }; + chain: Chain; + chainIsSupported: boolean; address: Address; }; }; @@ -56,6 +55,7 @@ export const Web3ContextProvider = ({ }); const { address: currentAddress, chain } = useAccount(); + const chainIsSupported = useChainIsSupported(chain?.id); const chains = useChains(); const value = { @@ -70,7 +70,8 @@ export const Web3ContextProvider = ({ }, account: currentAddress ? { - chain: Boolean(chain && !chains.some((x) => x.id !== chain?.id)), + chain, + chainIsSupported, address: currentAddress, } : undefined, diff --git a/packages/connectkit/src/hooks/useChainIsSupported.ts b/packages/connectkit/src/hooks/useChainIsSupported.ts new file mode 100644 index 00000000..5aacdd84 --- /dev/null +++ b/packages/connectkit/src/hooks/useChainIsSupported.ts @@ -0,0 +1,7 @@ +import { useConfig } from 'wagmi'; + +export function useChainIsSupported(chainId?: number): boolean | null { + if (!chainId) return false; + const { chains } = useConfig(); + return chains.some((x) => x.id === chainId); +} diff --git a/packages/connectkit/src/hooks/useModal.ts b/packages/connectkit/src/hooks/useModal.ts index 3297858b..2fd2447a 100644 --- a/packages/connectkit/src/hooks/useModal.ts +++ b/packages/connectkit/src/hooks/useModal.ts @@ -6,7 +6,7 @@ import { useConnectCallbackProps, } from './useConnectCallback'; -type ModalRoutes = typeof routes[keyof typeof routes]; +type ModalRoutes = (typeof routes)[keyof typeof routes]; const safeRoutes: { connected: ModalRoutes[]; diff --git a/packages/connectkit/src/index.ts b/packages/connectkit/src/index.ts index bdd3daa1..e83f46f7 100644 --- a/packages/connectkit/src/index.ts +++ b/packages/connectkit/src/index.ts @@ -21,6 +21,7 @@ export { default as ChainIcon } from './components/Common/Chain'; // Hooks export { default as useIsMounted } from './hooks/useIsMounted'; // Useful for apps that use SSR export { useChains } from './hooks/useChains'; +export { useChainIsSupported } from './hooks/useChainIsSupported'; // TODO: Make this private export { default as ConnectKitModalDemo } from './components/ConnectModal/demo'; From 75602497156ffb8c3446b9eaacc3816951a267a3 Mon Sep 17 00:00:00 2001 From: Lochie Axon Date: Mon, 5 Feb 2024 17:00:40 +1100 Subject: [PATCH 2/6] closeable modal --- packages/connectkit/src/components/ConnectKit.tsx | 6 +++--- packages/connectkit/src/components/ConnectModal/demo.tsx | 4 +++- packages/connectkit/src/components/ConnectModal/index.tsx | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/connectkit/src/components/ConnectKit.tsx b/packages/connectkit/src/components/ConnectKit.tsx index 26a864d9..60cb4000 100644 --- a/packages/connectkit/src/components/ConnectKit.tsx +++ b/packages/connectkit/src/components/ConnectKit.tsx @@ -202,15 +202,15 @@ export const ConnectKitProvider = ({ useEffect(() => setErrorMessage(null), [route, open]); // Check if chain is supported, elsewise redirect to switches page - const { chain } = useAccount(); + const { chain, isConnected } = useAccount(); const isChainSupported = useChainIsSupported(chain?.id); useEffect(() => { - if (opts.enforceSupportedChains && !isChainSupported) { + if (isConnected && opts.enforceSupportedChains && !isChainSupported) { setOpen(true); setRoute(routes.SWITCHNETWORKS); } - }, [chain, route, open]); + }, [isConnected, isChainSupported, chain, route, open]); // Autoconnect to Family wallet if available useEffect(() => { diff --git a/packages/connectkit/src/components/ConnectModal/demo.tsx b/packages/connectkit/src/components/ConnectModal/demo.tsx index c978b4d3..066248fc 100644 --- a/packages/connectkit/src/components/ConnectModal/demo.tsx +++ b/packages/connectkit/src/components/ConnectModal/demo.tsx @@ -105,7 +105,9 @@ const ConnectModal: React.FC<{ //if chain is unsupported we enforce a "switch chain" prompt const closeable = !( - context.options?.enforceSupportedChains && !chainIsSupported + context.options?.enforceSupportedChains && + isConnected && + !chainIsSupported ); const showBackButton = diff --git a/packages/connectkit/src/components/ConnectModal/index.tsx b/packages/connectkit/src/components/ConnectModal/index.tsx index 1ce8e7d2..3acffad2 100644 --- a/packages/connectkit/src/components/ConnectModal/index.tsx +++ b/packages/connectkit/src/components/ConnectModal/index.tsx @@ -37,7 +37,9 @@ const ConnectModal: React.FC<{ //if chain is unsupported we enforce a "switch chain" prompt const closeable = !( - context.options?.enforceSupportedChains && !chainIsSupported + context.options?.enforceSupportedChains && + isConnected && + !chainIsSupported ); const showBackButton = From 417362218c97d14fa34db8a34e225ea47d6ed872 Mon Sep 17 00:00:00 2001 From: Lochie Axon Date: Mon, 5 Feb 2024 23:51:59 +1100 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8b14106..f8707e2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 1.7.1 + +This update fixes a bug where the chain was incorrectly detected as unsupported when only one chain is configured. + +## Fixed + +- Chain being incorrectly detected as unsupported when only one chain is configured. + # 1.7.0 This update moves peer dependencies wagmi and viem up to their latest versions. From 147f03498f1086a9454a25caace3531840389e2d Mon Sep 17 00:00:00 2001 From: Lochie Axon Date: Mon, 5 Feb 2024 23:53:30 +1100 Subject: [PATCH 4/6] bump version --- packages/connectkit/package.json | 2 +- packages/connectkit/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/connectkit/package.json b/packages/connectkit/package.json index c5e230a8..2047e271 100644 --- a/packages/connectkit/package.json +++ b/packages/connectkit/package.json @@ -1,6 +1,6 @@ { "name": "connectkit", - "version": "1.7.0", + "version": "1.7.1", "author": "Family", "homepage": "https://docs.family.co/connectkit", "license": "BSD-2-Clause license", diff --git a/packages/connectkit/src/index.ts b/packages/connectkit/src/index.ts index e83f46f7..9168023f 100644 --- a/packages/connectkit/src/index.ts +++ b/packages/connectkit/src/index.ts @@ -1,4 +1,4 @@ -export const CONNECTKIT_VERSION = '1.7.0'; +export const CONNECTKIT_VERSION = '1.7.1; export * as Types from './types'; export { default as getDefaultConfig } from './defaultConfig'; From 84c7fbd0708504c37d74247c0ea970a5b46acda5 Mon Sep 17 00:00:00 2001 From: Lochie Axon Date: Mon, 5 Feb 2024 23:53:44 +1100 Subject: [PATCH 5/6] update examples --- examples/nextjs-app/config.ts | 2 -- examples/nextjs-siwe/src/pages/_app.tsx | 1 - packages/cra-template/template.json | 2 +- packages/cra-template/template/src/index.tsx | 4 ---- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/examples/nextjs-app/config.ts b/examples/nextjs-app/config.ts index ead600ee..d99f93c0 100644 --- a/examples/nextjs-app/config.ts +++ b/examples/nextjs-app/config.ts @@ -5,8 +5,6 @@ import { mainnet, polygon, optimism, arbitrum } from 'wagmi/chains'; export const config = createConfig( getDefaultConfig({ appName: 'ConnectKit Next.js demo', - //infuraId: process.env.NEXT_PUBLIC_INFURA_ID, - //alchemyId: process.env.NEXT_PUBLIC_ALCHEMY_ID, chains: [mainnet, polygon, optimism, arbitrum], walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!, }) diff --git a/examples/nextjs-siwe/src/pages/_app.tsx b/examples/nextjs-siwe/src/pages/_app.tsx index a5ac0b16..e1b6c76a 100644 --- a/examples/nextjs-siwe/src/pages/_app.tsx +++ b/examples/nextjs-siwe/src/pages/_app.tsx @@ -6,7 +6,6 @@ import { WagmiProvider, createConfig } from 'wagmi'; const config = createConfig( getDefaultConfig({ - alchemyId: process.env.NEXT_PUBLIC_ALCHEMY_ID, walletConnectProjectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!, appName: 'My ConnectKit App', }) diff --git a/packages/cra-template/template.json b/packages/cra-template/template.json index 172e0efb..1a3c337c 100644 --- a/packages/cra-template/template.json +++ b/packages/cra-template/template.json @@ -8,7 +8,7 @@ "@types/node": "^16.7.13", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", - "connectkit": "^1.7.0", + "connectkit": "^1.7.1", "typescript": "^5.0.4", "viem": "^2.0.6", "wagmi": "^2.2.1", diff --git a/packages/cra-template/template/src/index.tsx b/packages/cra-template/template/src/index.tsx index 3423506d..61495204 100644 --- a/packages/cra-template/template/src/index.tsx +++ b/packages/cra-template/template/src/index.tsx @@ -4,15 +4,11 @@ import App from './App'; import reportWebVitals from './reportWebVitals'; import { WagmiProvider, createConfig } from 'wagmi'; -import { mainnet, polygon } from 'wagmi/chains'; import { ConnectKitProvider, getDefaultConfig } from 'connectkit'; const config = createConfig( getDefaultConfig({ appName: 'My App Name', - //infuraId: process.env.REACT_APP_INFURA_ID, - //alchemyId: process.env.REACT_APP_ALCHEMY_ID, - chains: [mainnet, polygon], walletConnectProjectId: process.env.REACT_APP_WALLETCONNECT_PROJECT_ID!, }) ); From dfe41cc333b2d0815100ace155065c7f56414669 Mon Sep 17 00:00:00 2001 From: Lochie Axon Date: Tue, 6 Feb 2024 00:08:17 +1100 Subject: [PATCH 6/6] missing syntax --- packages/connectkit/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/connectkit/src/index.ts b/packages/connectkit/src/index.ts index 9168023f..ab0b4985 100644 --- a/packages/connectkit/src/index.ts +++ b/packages/connectkit/src/index.ts @@ -1,4 +1,4 @@ -export const CONNECTKIT_VERSION = '1.7.1; +export const CONNECTKIT_VERSION = '1.7.1'; export * as Types from './types'; export { default as getDefaultConfig } from './defaultConfig';