import { getNetwork } from '@example-react/chains'; import { currentWallet, getWalletConfig, walletConfigs, } from '@example-react/wallets'; import { BalancePlugin } from '@web3-wallet/plugin-balance'; import { EnsPlugin } from '@web3-wallet/plugin-ens'; import Image from 'next/image'; import { useEffect } from 'react'; import { Accounts } from './Accounts'; import { Box } from './Box'; import { Card } from './Card'; import { Chain } from './Chain'; import { ConnectWithSelect } from './ConnectWithSelect'; import { NoSSR } from './NoSSR'; import { Status } from './Status'; import { WalletSelect } from './WalletSelect'; const { useName, getPluginApi, connect, autoConnect, disconnect, useIsConnecting, useIsConnected, useAccounts, useChainId, switchCurrentWallet, } = currentWallet; export const CurrentWalletCard = () => { const walletName = useName(); const isConnecting = useIsConnecting(); const isConnected = useIsConnected(); const chainId = useChainId(); const accounts = useAccounts(); const { useBalances } = getPluginApi(BalancePlugin.name); const { useEnsNames } = getPluginApi(EnsPlugin.name); const ensNames = useEnsNames([getNetwork(chainId)]); const balances = useBalances(); useEffect(() => { autoConnect(); }, [walletName]); return ( Wallet Logo {walletName} ); };