Created
June 29, 2023 16:54
-
-
Save numoonchld/ef2c6020242ce124a8170e6d354746fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FC, ReactNode } from 'react'; | |
import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react' | |
import { WalletModalProvider } from "@solana/wallet-adapter-react-ui"; | |
import * as web3 from '@solana/web3.js' | |
import * as walletAdapterWallets from '@solana/wallet-adapter-wallets'; | |
require('@solana/wallet-adapter-react-ui/styles.css'); | |
const WalletContextProvider: FC<{ children: ReactNode }> = ({ children }) => { | |
const endpoint = web3.clusterApiUrl('devnet') | |
const wallets = [new walletAdapterWallets.PhantomWalletAdapter()] | |
return ( | |
<ConnectionProvider endpoint={endpoint}> | |
<WalletProvider wallets={wallets}> | |
<WalletModalProvider> | |
{children} | |
</WalletModalProvider> | |
</WalletProvider> | |
</ConnectionProvider> | |
) | |
} | |
export default WalletContextProvider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment