feat: add walletconnect (#1392)

This commit is contained in:
guibescos 2024-03-27 11:15:56 +00:00 committed by GitHub
parent 6d3b5234f6
commit cf16fa3211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 0 deletions

View File

@ -13,6 +13,8 @@ import {
SolletExtensionWalletAdapter,
SolletWalletAdapter,
TorusWalletAdapter,
WalletConnectWalletAdapter,
WalletConnectWalletAdapterConfig,
} from '@solana/wallet-adapter-wallets'
import { clusterApiUrl } from '@solana/web3.js'
import { DefaultSeo } from 'next-seo'
@ -24,6 +26,20 @@ import { ClusterProvider } from '../contexts/ClusterContext'
import SEO from '../next-seo.config'
import '../styles/globals.css'
const walletConnectConfig: WalletConnectWalletAdapterConfig = {
network: WalletAdapterNetwork.Mainnet,
options: {
relayUrl: 'wss://relay.walletconnect.com',
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID,
metadata: {
name: 'Pyth Proposals',
description: 'Vote on Pyth Improvement Proposals',
url: 'https://proposals.pyth.network/',
icons: ['https://pyth.network/token.svg'],
},
},
}
function MyApp({ Component, pageProps }: AppProps) {
// Can be set to 'devnet', 'testnet', or 'mainnet-beta'
// const network = WalletAdapterNetwork.Devnet
@ -44,6 +60,7 @@ function MyApp({ Component, pageProps }: AppProps) {
new LedgerWalletAdapter(),
new SolletWalletAdapter(),
new SolletExtensionWalletAdapter(),
new WalletConnectWalletAdapter(walletConnectConfig),
],
[]
)