diff --git a/README.md b/README.md index 68f0962b..9fa97fde 100644 --- a/README.md +++ b/README.md @@ -135,8 +135,8 @@ The settings are described in more detailed in the Sequence Kit documentation. logoUrl: 'https://logo-dark-mode.svg', projectName: 'my app', showEmailInput: true, - miniAuthOptions: ['google', 'facebook', 'twitch', 'apple'], - authOptions: ['metamask', 'wallet-connect'], + socialAuthOptions: ['google', 'facebook', 'twitch', 'apple'], + walletAuthOptions: ['metamask', 'wallet-connect'], }; // limits the digital assets displayed on the assets summary screen displayedAssets: [ diff --git a/examples/react/package.json b/examples/react/package.json index 4cfc1966..c87342e6 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -4,7 +4,7 @@ "private": true, "homepage": "kit", "dependencies": { - "0xsequence": "^1.4.4", + "0xsequence": "^1.4.5", "@0xsequence/design-system": "^1.0.20", "@0xsequence/kit": "workspace:*", "@0xsequence/kit-checkout": "workspace:*", diff --git a/examples/react/src/components/Homepage.tsx b/examples/react/src/components/Homepage.tsx index 4899cf19..fc6ccf2c 100644 --- a/examples/react/src/components/Homepage.tsx +++ b/examples/react/src/components/Homepage.tsx @@ -3,7 +3,7 @@ import qs from 'query-string' import { useOpenConnectModal, signEthAuthProof, validateEthProof, useTheme as useKitTheme } from '@0xsequence/kit' import { useOpenWalletModal } from '@0xsequence/kit-wallet' import { useCheckoutModal } from '@0xsequence/kit-checkout' -import { useDisconnect, useAccount, useWalletClient, usePublicClient } from 'wagmi' +import { useDisconnect, useAccount, useWalletClient, usePublicClient, useSwitchNetwork, useChainId } from 'wagmi' import { Box, Button, @@ -30,6 +30,9 @@ function Homepage() { const { triggerCheckout } = useCheckoutModal() const { disconnect } = useDisconnect() const { data: walletClient } = useWalletClient() + const { switchNetwork } = useSwitchNetwork() + const chainId = useChainId() + const publicClient = usePublicClient() // append ?debug=true to url to enable debug mode @@ -168,6 +171,14 @@ function Homepage() { ) } + const onSwitchNetwork = () => { + if (chainId === 1) { + switchNetwork(137) + } else { + switchNetwork(1) + } + } + return ( {isDebugMode && ( @@ -205,6 +216,13 @@ function Homepage() { onClick={generateEthAuthProof} /> )} + {isDebugMode && ( + + )}