1+
12import '@walletconnect/react-native-compat' ;
3+
24import React , { useEffect } from 'react' ;
35import { Linking } from 'react-native' ;
46import BootSplash from 'react-native-bootsplash' ;
5- import {
6- createAppKit ,
7- defaultWagmiConfig ,
8- AppKit ,
9- } from '@reown/appkit-wagmi -react-native' ;
7+ import { createAppKit , AppKit , solana , bitcoin , AppKitProvider } from '@reown/appkit-react-native' ;
8+ // import {WagmiAdapter} from '@reown/appkit-wagmi-react-native';
9+ import { SolanaAdapter } from '@reown/appkit-solana-react-native' ;
10+ import { BitcoinAdapter } from '@reown/appkit-bitcoin-react-native' ;
11+ import { EthersAdapter } from '@reown/appkit-ethers -react-native' ;
1012import { GestureHandlerRootView } from 'react-native-gesture-handler' ;
1113
1214// import {coinbaseConnector} from '@reown/appkit-coinbase-wagmi-react-native';
13- import { authConnector } from '@reown/appkit-auth-wagmi-react-native' ;
14- import { WagmiProvider } from 'wagmi ' ;
15- import { handleResponse } from '@coinbase/wallet-mobile-sdk ' ;
15+ // import {authConnector} from '@reown/appkit-auth-wagmi-react-native';
16+ // import {handleResponse } from '@coinbase/wallet-mobile-sdk ';
17+ // import {WagmiProvider } from 'wagmi ';
1618import Toast from 'react-native-toast-message' ;
1719import Config from 'react-native-config' ;
1820import Clipboard from '@react-native-clipboard/clipboard' ;
1921import * as Sentry from '@sentry/react-native' ;
2022import { NavigationContainer } from '@react-navigation/native' ;
2123import { QueryClient , QueryClientProvider } from '@tanstack/react-query' ;
2224
23- import { getCustomWallets , getMetadata } from '@/utils/misc' ;
25+ import { getMetadata } from '@/utils/misc' ;
2426import { RootStackNavigator } from '@/navigators/RootStackNavigator' ;
25- import { siweConfig } from '@/utils/SiweUtils' ;
27+ // import {siweConfig} from '@/utils/SiweUtils';
2628import { chains } from '@/utils/WagmiUtils' ;
2729import SettingsStore from '@/stores/SettingsStore' ;
30+ // import { Chain } from 'viem';
2831
2932Sentry . init ( {
3033 enabled : ! __DEV__ && ! ! Config . ENV_SENTRY_DSN ,
@@ -56,41 +59,64 @@ const clipboardClient = {
5659// redirect: metadata?.redirect?.universal || '',
5760// });
5861
59- const _authConnector = authConnector ( {
62+ // const _authConnector = authConnector({
63+ // projectId,
64+ // metadata,
65+ // });
66+
67+ // const wagmiConfig = defaultWagmiConfig({
68+ // chains,
69+ // projectId,
70+ // metadata,
71+ // // extraConnectors: [
72+ // // // _coinbaseConnector,
73+ // // _authConnector],
74+ // });
75+
76+ const ethersAdapter = new EthersAdapter ( {
6077 projectId,
61- metadata,
6278} ) ;
6379
64- const wagmiConfig = defaultWagmiConfig ( {
65- chains,
80+ // const wagmiAdapter = new WagmiAdapter({
81+ // projectId,
82+ // networks: chains as [Chain, ...Chain[]],
83+ // });
84+
85+ const solanaAdapter = new SolanaAdapter ( {
86+ projectId,
87+ } ) ;
88+
89+ const bitcoinAdapter = new BitcoinAdapter ( {
6690 projectId,
67- metadata,
68- extraConnectors : [
69- // _coinbaseConnector,
70- _authConnector ] ,
7191} ) ;
7292
73- const customWallets = getCustomWallets ( ) ;
93+ const adapters = [ ethersAdapter , bitcoinAdapter , solanaAdapter ] ;
94+
95+ const networks = [ ...chains , solana , bitcoin ] ;
96+
97+ // const customWallets = getCustomWallets();
7498
7599// 3. Create modal
76- createAppKit ( {
100+ const appKit = createAppKit ( {
77101 projectId,
78- wagmiConfig,
102+ // wagmiConfig,
103+ adapters,
79104 metadata,
80- siweConfig,
105+ networks,
106+ // siweConfig,
81107 clipboardClient,
82- customWallets,
83- connectorImages : {
84- coinbaseWallet :
85- 'https://play-lh.googleusercontent.com/wrgUujbq5kbn4Wd4tzyhQnxOXkjiGqq39N4zBvCHmxpIiKcZw_Pb065KTWWlnoejsg' ,
86- appKitAuth : 'https://avatars.githubusercontent.com/u/179229932' ,
87- } ,
88- features : {
89- email : true ,
90- socials : [ 'x' , 'discord' , 'apple' ] ,
91- emailShowWallets : true ,
92- swaps : true ,
93- } ,
108+ // customWallets,
109+ // connectorImages: {
110+ // coinbaseWallet:
111+ // 'https://play-lh.googleusercontent.com/wrgUujbq5kbn4Wd4tzyhQnxOXkjiGqq39N4zBvCHmxpIiKcZw_Pb065KTWWlnoejsg',
112+ // appKitAuth: 'https://avatars.githubusercontent.com/u/179229932',
113+ // },
114+ // features: {
115+ // email: true,
116+ // socials: ['x', 'discord', 'apple'],
117+ // emailShowWallets: true,
118+ // swaps: true,
119+ // },
94120} ) ;
95121
96122const queryClient = new QueryClient ( ) ;
@@ -99,7 +125,8 @@ function App(): JSX.Element {
99125 // 4. Handle deeplinks for Coinbase SDK
100126 useEffect ( ( ) => {
101127 const sub = Linking . addEventListener ( 'url' , ( { url} ) => {
102- const handledBySdk = handleResponse ( new URL ( url ) ) ;
128+ // const handledBySdk = handleResponse(new URL(url));
129+ const handledBySdk = false ;
103130 if ( ! handledBySdk ) {
104131 // Handle other deeplinks
105132 if ( url . includes ( 'wc_ev' ) ) {
@@ -129,13 +156,15 @@ function App(): JSX.Element {
129156 return (
130157 < GestureHandlerRootView style = { { flex : 1 } } >
131158 < NavigationContainer >
132- < WagmiProvider config = { wagmiConfig } >
133- < QueryClientProvider client = { queryClient } >
134- < RootStackNavigator />
135- < Toast />
136- < AppKit />
137- </ QueryClientProvider >
138- </ WagmiProvider >
159+ { /* <WagmiProvider config={wagmiAdapter.wagmiConfig}> */ }
160+ < AppKitProvider instance = { appKit } >
161+ < QueryClientProvider client = { queryClient } >
162+ < RootStackNavigator />
163+ < Toast />
164+ < AppKit />
165+ </ QueryClientProvider >
166+ </ AppKitProvider >
167+ { /* </WagmiProvider> */ }
139168 </ NavigationContainer >
140169 </ GestureHandlerRootView >
141170 ) ;
0 commit comments