소스 검색

feat: add walletconnect (#1392)

guibescos 1 년 전
부모
커밋
cf16fa3211
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17 0
      governance/xc_admin/packages/xc_admin_frontend/pages/_app.tsx

+ 17 - 0
governance/xc_admin/packages/xc_admin_frontend/pages/_app.tsx

@@ -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),
     ],
     []
   )