-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_app.tsx
78 lines (71 loc) · 2.51 KB
/
_app.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { DeflyWalletConnect } from '@blockshake/defly-connect'
import { DaffiWalletConnect } from '@daffiwallet/connect'
import { Inter } from '@next/font/google'
import { PeraWalletConnect } from '@perawallet/connect'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { WalletProvider, useInitializeProviders, PROVIDER_ID } from '@txnlab/use-wallet'
import { WalletConnectModalSign } from '@walletconnect/modal-sign-html'
import algosdk from 'algosdk'
import Toaster from 'components/Toaster'
import { NODE_NETWORK, NODE_PORT, NODE_TOKEN, NODE_URL } from 'constants/env'
import type { AppProps } from 'next/app'
import 'styles/globals.css'
const inter = Inter({ subsets: ['latin'] })
const queryClient = new QueryClient()
export default function App({ Component, pageProps, router }: AppProps) {
const walletProviders = useInitializeProviders({
providers: [
{ id: PROVIDER_ID.DEFLY, clientStatic: DeflyWalletConnect },
{ id: PROVIDER_ID.PERA, clientStatic: PeraWalletConnect },
{ id: PROVIDER_ID.DAFFI, clientStatic: DaffiWalletConnect },
{ id: PROVIDER_ID.EXODUS },
{
id: PROVIDER_ID.WALLETCONNECT,
clientStatic: WalletConnectModalSign,
clientOptions: {
projectId: process.env.NEXT_PUBLIC_WC2_PROJECT_ID || '',
relayUrl: process.env.NEXT_PUBLIC_WC2_RELAY_URL,
metadata: {
name: 'next-use-wallet',
description: 'Next.js @txnlab/use-wallet example',
url: 'https://next-use-wallet.vercel.app/',
icons: ['https://next-use-wallet.vercel.app/nfd.svg']
},
modalOptions: {
explorerRecommendedWalletIds: [
// Fireblocks desktop wallet
'5864e2ced7c293ed18ac35e0db085c09ed567d67346ccb6f58a0327a75137489',
// D'Cent Wallet
'a1f506a38f39b672b369bd13b68abbbd81f83a0489e6625f2bf12aa0389c22ae'
]
}
}
}
],
nodeConfig: {
network: NODE_NETWORK,
nodeServer: NODE_URL,
nodePort: NODE_PORT,
nodeToken: NODE_TOKEN
},
algosdkStatic: algosdk,
debug: true
})
return (
<>
<style jsx global>
{`
:root {
--sans-font: ${inter.style.fontFamily};
}
`}
</style>
<Toaster />
<WalletProvider value={walletProviders}>
<QueryClientProvider client={queryClient}>
<Component {...pageProps} />
</QueryClientProvider>
</WalletProvider>
</>
)
}