import { WalletAdapterNetwork } from "@solana/wallet-adapter-base" ; import { ConnectionProvider , WalletProvider , } from "@solana/wallet-adapter-react" ; import { WalletModalProvider } from "@solana/wallet-adapter-react-ui" ; import { getLedgerWallet , getPhantomWallet , getSlopeWallet , getSolflareWallet , getSolletWallet , getSolletExtensionWallet , getTorusWallet , } from "@solana/wallet-adapter-wallets" ; import { clusterApiUrl } from "@solana/web3.js" ; import { FC , useMemo } from "react" ; const WalletConnectionProvider = ( { children } ) => { const network = process . env . NEXT_PUBLIC_SOLANA_NETWORK as WalletAdapterNetwork ; const endpoint = useMemo ( ( ) => clusterApiUrl ( network ) , [ network ] ) ; const wallets = useMemo ( ( ) => [ getPhantomWallet ( ) , getSlopeWallet ( ) , getSolflareWallet ( ) , getTorusWallet ( { options : { clientId : "CLIENT_ID" , } , } ) , getLedgerWallet ( ) , getSolletWallet ( { network } ) , getSolletExtensionWallet ( { network } ) , ] , [ network ] ) ; return ( < ConnectionProvider endpoint = { endpoint } > < WalletProvider wallets = { wallets } autoConnect > < WalletModalProvider > { children } < /WalletModalProvider> < /WalletProvider> < /ConnectionProvider>); } ; export default WalletConnectionProvider ;