@reown/appkit-react-native 0.0.0-feat-multichain-20250925192219 → 0.0.0-feat-multichain-20251001210321
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/AppKit.js +105 -14
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/hooks/useAppKit.js.map +1 -1
- package/lib/commonjs/hooks/useAppKitLogs.js +88 -0
- package/lib/commonjs/hooks/useAppKitLogs.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js +2 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js +3 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js +1 -0
- package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js +21 -1
- package/lib/commonjs/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +5 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js +8 -2
- package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/commonjs/utils/SIWXUtil.js +4 -8
- package/lib/commonjs/utils/SIWXUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +3 -2
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +5 -2
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js +5 -3
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +5 -2
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +21 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +1 -0
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js +1 -0
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-network-switch-view/index.js +1 -0
- package/lib/commonjs/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-siwx-sign-view/index.js +1 -0
- package/lib/commonjs/views/w3m-siwx-sign-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js +1 -1
- package/lib/commonjs/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/module/AppKit.js +106 -15
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/hooks/useAppKit.js.map +1 -1
- package/lib/module/hooks/useAppKitLogs.js +83 -0
- package/lib/module/hooks/useAppKitLogs.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js +2 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js +3 -1
- package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-list/index.js +2 -1
- package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js +2 -1
- package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-mobile/index.js +22 -2
- package/lib/module/partials/w3m-connecting-mobile/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/index.js +6 -2
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-web/index.js +9 -3
- package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/module/utils/SIWXUtil.js +5 -9
- package/lib/module/utils/SIWXUtil.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +4 -3
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js +5 -2
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js +5 -3
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +5 -2
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +22 -2
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +2 -1
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js +2 -1
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/views/w3m-network-switch-view/index.js +2 -1
- package/lib/module/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/module/views/w3m-siwx-sign-view/index.js +2 -1
- package/lib/module/views/w3m-siwx-sign-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/index.js +1 -1
- package/lib/module/views/w3m-swap-view/index.js.map +1 -1
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js +1 -1
- package/lib/module/views/w3m-what-is-a-wallet-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +12 -1
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/AppKitContext.d.ts +1 -1
- package/lib/typescript/hooks/useAccount.d.ts +1 -1
- package/lib/typescript/hooks/useAppKit.d.ts +2 -1
- package/lib/typescript/hooks/useAppKit.d.ts.map +1 -1
- package/lib/typescript/hooks/useAppKitEvents.d.ts +69 -17
- package/lib/typescript/hooks/useAppKitEvents.d.ts.map +1 -1
- package/lib/typescript/hooks/useAppKitLogs.d.ts +57 -0
- package/lib/typescript/hooks/useAppKitLogs.d.ts.map +1 -0
- package/lib/typescript/hooks/useAppKitState.d.ts +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts +3 -2
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +1 -1
- package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts +1 -1
- package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-mobile/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-web/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +1 -0
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/SIWXUtil.d.ts +1 -1
- package/lib/typescript/utils/SIWXUtil.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts +1 -1
- package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-external-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-network-switch-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-siwx-sign-view/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/AppKit.ts +122 -14
- package/src/hooks/useAppKit.ts +3 -2
- package/src/hooks/useAppKitLogs.ts +129 -0
- package/src/index.ts +8 -0
- package/src/partials/w3m-account-wallet-features/index.tsx +1 -1
- package/src/partials/w3m-all-wallets-list/components/WalletItem.tsx +11 -3
- package/src/partials/w3m-all-wallets-list/components/WalletList.tsx +3 -2
- package/src/partials/w3m-all-wallets-list/index.tsx +3 -1
- package/src/partials/w3m-all-wallets-search/index.tsx +8 -2
- package/src/partials/w3m-connecting-mobile/index.tsx +24 -2
- package/src/partials/w3m-connecting-qrcode/index.tsx +8 -2
- package/src/partials/w3m-connecting-web/index.tsx +11 -3
- package/src/types.ts +1 -0
- package/src/utils/SIWXUtil.ts +6 -11
- package/src/views/w3m-account-default-view/index.tsx +5 -3
- package/src/views/w3m-all-wallets-view/index.tsx +9 -2
- package/src/views/w3m-connect-view/components/all-wallet-list.tsx +6 -4
- package/src/views/w3m-connect-view/index.tsx +5 -2
- package/src/views/w3m-connecting-external-view/index.tsx +24 -2
- package/src/views/w3m-connecting-social-view/index.tsx +3 -1
- package/src/views/w3m-connecting-view/index.tsx +3 -1
- package/src/views/w3m-network-switch-view/index.tsx +2 -0
- package/src/views/w3m-siwx-sign-view/index.tsx +2 -0
- package/src/views/w3m-swap-view/index.tsx +1 -1
- package/src/views/w3m-what-is-a-wallet-view/index.tsx +1 -1
|
@@ -7,13 +7,21 @@ import { memo } from 'react';
|
|
|
7
7
|
|
|
8
8
|
interface WalletItemProps {
|
|
9
9
|
item: WcWallet;
|
|
10
|
+
displayIndex: number;
|
|
10
11
|
imageHeaders?: Record<string, string>;
|
|
11
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
12
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
12
13
|
style?: StyleProp<ViewStyle>;
|
|
13
14
|
testID?: string;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export function WalletItem({
|
|
17
|
+
export function WalletItem({
|
|
18
|
+
item,
|
|
19
|
+
displayIndex,
|
|
20
|
+
imageHeaders,
|
|
21
|
+
onItemPress,
|
|
22
|
+
style,
|
|
23
|
+
testID
|
|
24
|
+
}: WalletItemProps) {
|
|
17
25
|
const { walletImages } = useSnapshot(AssetController.state);
|
|
18
26
|
const isInstalled = ApiController.state.installed.find(wallet => wallet?.id === item?.id);
|
|
19
27
|
const imageSrc = AssetUtil.getWalletImage(item, walletImages);
|
|
@@ -28,7 +36,7 @@ export function WalletItem({ item, imageHeaders, onItemPress, style, testID }: W
|
|
|
28
36
|
style={style}
|
|
29
37
|
imageHeaders={imageHeaders}
|
|
30
38
|
name={item?.name ?? 'Unknown'}
|
|
31
|
-
onPress={() => onItemPress(item)}
|
|
39
|
+
onPress={() => onItemPress(item, displayIndex)}
|
|
32
40
|
installed={!!isInstalled}
|
|
33
41
|
testID={testID}
|
|
34
42
|
/>
|
|
@@ -18,7 +18,7 @@ const ITEM_HEIGHT_WITH_GAP = ITEM_HEIGHT + Spacing['3xs'];
|
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
20
20
|
data: WcWallet[];
|
|
21
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
21
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
22
22
|
onEndReached?: () => void;
|
|
23
23
|
onEndReachedThreshold?: number;
|
|
24
24
|
isLoading?: boolean;
|
|
@@ -52,7 +52,7 @@ export function WalletList({
|
|
|
52
52
|
data={displayData}
|
|
53
53
|
style={[styles.list, { height: maxHeight }, style]}
|
|
54
54
|
columnWrapperStyle={styles.columnWrapperStyle}
|
|
55
|
-
renderItem={({ item }) => {
|
|
55
|
+
renderItem={({ item, index }) => {
|
|
56
56
|
if (isLoading) {
|
|
57
57
|
return <CardSelectLoader style={styles.itemContainer} />;
|
|
58
58
|
}
|
|
@@ -61,6 +61,7 @@ export function WalletList({
|
|
|
61
61
|
<WalletItem
|
|
62
62
|
item={item}
|
|
63
63
|
imageHeaders={imageHeaders}
|
|
64
|
+
displayIndex={index}
|
|
64
65
|
onItemPress={onItemPress}
|
|
65
66
|
style={styles.itemContainer}
|
|
66
67
|
testID={testIDKey ? `${testIDKey}-${item?.id}` : undefined}
|
|
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { useSnapshot } from 'valtio';
|
|
3
3
|
import {
|
|
4
4
|
ApiController,
|
|
5
|
+
LogController,
|
|
5
6
|
OptionsController,
|
|
6
7
|
SnackController,
|
|
7
8
|
type OptionsControllerState
|
|
@@ -14,7 +15,7 @@ import { Loading } from './components/Loading';
|
|
|
14
15
|
import { WalletList } from './components/WalletList';
|
|
15
16
|
|
|
16
17
|
interface AllWalletsListProps {
|
|
17
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
18
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
18
19
|
headerHeight?: number;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -61,6 +62,7 @@ export function AllWalletsList({ onItemPress }: AllWalletsListProps) {
|
|
|
61
62
|
await ApiController.fetchWallets({ page: 1 });
|
|
62
63
|
setLoading(false);
|
|
63
64
|
} catch (error) {
|
|
65
|
+
LogController.sendError(error, 'AllWalletsList.tsx', 'initialFetch');
|
|
64
66
|
SnackController.showError('Failed to load wallets');
|
|
65
67
|
setLoading(false);
|
|
66
68
|
setLoadingError(true);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
2
|
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ApiController,
|
|
5
|
+
LogController,
|
|
6
|
+
OptionsController,
|
|
7
|
+
SnackController
|
|
8
|
+
} from '@reown/appkit-core-react-native';
|
|
4
9
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
5
10
|
import { useCustomDimensions } from '@reown/appkit-ui-react-native';
|
|
6
11
|
import { Placeholder } from '../w3m-placeholder';
|
|
@@ -10,7 +15,7 @@ import { Loading } from '../w3m-all-wallets-list/components/Loading';
|
|
|
10
15
|
import { WalletList } from '../w3m-all-wallets-list/components/WalletList';
|
|
11
16
|
|
|
12
17
|
export interface AllWalletsSearchProps {
|
|
13
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
18
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
14
19
|
searchQuery?: string;
|
|
15
20
|
}
|
|
16
21
|
|
|
@@ -36,6 +41,7 @@ export function AllWalletsSearch({ searchQuery, onItemPress }: AllWalletsSearchP
|
|
|
36
41
|
await ApiController.searchWallet({ search: searchQuery });
|
|
37
42
|
setLoading(false);
|
|
38
43
|
} catch (error) {
|
|
44
|
+
LogController.sendError(error, 'AllWalletsSearch.tsx', 'searchFetch');
|
|
39
45
|
SnackController.showError('Failed to load wallets');
|
|
40
46
|
setLoading(false);
|
|
41
47
|
setLoadingError(true);
|
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
OptionsController,
|
|
11
11
|
EventsController,
|
|
12
12
|
ConstantsUtil,
|
|
13
|
-
AssetController
|
|
13
|
+
AssetController,
|
|
14
|
+
LogController,
|
|
15
|
+
ConnectionsController
|
|
14
16
|
} from '@reown/appkit-core-react-native';
|
|
15
17
|
import {
|
|
16
18
|
Button,
|
|
@@ -60,6 +62,21 @@ export function ConnectingMobile({ onRetry, onCopyUri, isInstalled }: Props) {
|
|
|
60
62
|
const onStorePress = () => {
|
|
61
63
|
if (storeUrl) {
|
|
62
64
|
CoreHelperUtil.openLink(storeUrl);
|
|
65
|
+
EventsController.sendEvent({
|
|
66
|
+
type: 'track',
|
|
67
|
+
event: 'GET_WALLET',
|
|
68
|
+
properties: {
|
|
69
|
+
name: data?.wallet?.name ?? 'Unknown',
|
|
70
|
+
link: storeUrl,
|
|
71
|
+
linkType: Platform.select({
|
|
72
|
+
ios: 'appstore',
|
|
73
|
+
android: 'playstore',
|
|
74
|
+
default: undefined
|
|
75
|
+
}),
|
|
76
|
+
explorerId: data?.wallet?.id,
|
|
77
|
+
walletRank: data?.wallet?.order
|
|
78
|
+
}
|
|
79
|
+
});
|
|
63
80
|
}
|
|
64
81
|
};
|
|
65
82
|
|
|
@@ -74,17 +91,22 @@ export function ConnectingMobile({ onRetry, onCopyUri, isInstalled }: Props) {
|
|
|
74
91
|
await CoreHelperUtil.openLink(redirect);
|
|
75
92
|
await WcController.state.wcPromise;
|
|
76
93
|
WcController.setConnectedWallet(wcLinking, data?.wallet);
|
|
94
|
+
const address = ConnectionsController.state.activeAddress;
|
|
95
|
+
const caipNetworkId = ConnectionsController.state.activeNetwork?.caipNetworkId;
|
|
77
96
|
EventsController.sendEvent({
|
|
78
97
|
type: 'track',
|
|
79
98
|
event: 'CONNECT_SUCCESS',
|
|
99
|
+
address: CoreHelperUtil.getPlainAddress(address),
|
|
80
100
|
properties: {
|
|
81
101
|
method: 'mobile',
|
|
82
102
|
name: data?.wallet?.name ?? 'Unknown',
|
|
83
|
-
|
|
103
|
+
explorerId: data?.wallet?.id,
|
|
104
|
+
caipNetworkId
|
|
84
105
|
}
|
|
85
106
|
});
|
|
86
107
|
}
|
|
87
108
|
} catch (error: any) {
|
|
109
|
+
LogController.sendError(error, 'ConnectingMobile.tsx', 'onConnect');
|
|
88
110
|
if (error.message.includes(ConstantsUtil.LINKING_ERROR)) {
|
|
89
111
|
setErrorType('not_installed');
|
|
90
112
|
} else {
|
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
WcController,
|
|
5
5
|
EventsController,
|
|
6
6
|
OptionsController,
|
|
7
|
-
SnackController
|
|
7
|
+
SnackController,
|
|
8
|
+
ConnectionsController,
|
|
9
|
+
CoreHelperUtil
|
|
8
10
|
} from '@reown/appkit-core-react-native';
|
|
9
11
|
import {
|
|
10
12
|
FlexView,
|
|
@@ -35,13 +37,17 @@ export function ConnectingQrCode() {
|
|
|
35
37
|
|
|
36
38
|
const onConnect = async () => {
|
|
37
39
|
await WcController.state.wcPromise;
|
|
40
|
+
const address = ConnectionsController.state.activeAddress;
|
|
41
|
+
const caipNetworkId = ConnectionsController.state.activeNetwork?.caipNetworkId;
|
|
38
42
|
|
|
39
43
|
EventsController.sendEvent({
|
|
40
44
|
type: 'track',
|
|
41
45
|
event: 'CONNECT_SUCCESS',
|
|
46
|
+
address: CoreHelperUtil.getPlainAddress(address),
|
|
42
47
|
properties: {
|
|
43
48
|
method: 'qrcode',
|
|
44
|
-
name: 'WalletConnect'
|
|
49
|
+
name: 'WalletConnect',
|
|
50
|
+
caipNetworkId
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
53
|
};
|
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
CoreHelperUtil,
|
|
10
10
|
OptionsController,
|
|
11
11
|
EventsController,
|
|
12
|
-
AssetController
|
|
12
|
+
AssetController,
|
|
13
|
+
LogController,
|
|
14
|
+
ConnectionsController
|
|
13
15
|
} from '@reown/appkit-core-react-native';
|
|
14
16
|
import {
|
|
15
17
|
Button,
|
|
@@ -50,18 +52,24 @@ export function ConnectingWeb({ onCopyUri }: ConnectingWebProps) {
|
|
|
50
52
|
await Linking.openURL(redirect);
|
|
51
53
|
await WcController.state.wcPromise;
|
|
52
54
|
WcController.setConnectedWallet(wcLinking, data?.wallet);
|
|
55
|
+
const address = ConnectionsController.state.activeAddress;
|
|
56
|
+
const caipNetworkId = ConnectionsController.state.activeNetwork?.caipNetworkId;
|
|
53
57
|
|
|
54
58
|
EventsController.sendEvent({
|
|
55
59
|
type: 'track',
|
|
56
60
|
event: 'CONNECT_SUCCESS',
|
|
61
|
+
address: CoreHelperUtil.getPlainAddress(address),
|
|
57
62
|
properties: {
|
|
58
63
|
method: 'web',
|
|
59
64
|
name: data?.wallet?.name ?? 'Unknown',
|
|
60
|
-
|
|
65
|
+
explorerId: data?.wallet?.id,
|
|
66
|
+
caipNetworkId
|
|
61
67
|
}
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
|
-
} catch {
|
|
70
|
+
} catch (error) {
|
|
71
|
+
LogController.sendError(error, 'ConnectingWeb.tsx', 'onConnect');
|
|
72
|
+
}
|
|
65
73
|
}, [data?.wallet, wcUri]);
|
|
66
74
|
|
|
67
75
|
return (
|
package/src/types.ts
CHANGED
|
@@ -129,6 +129,7 @@ export interface AppKitConfig {
|
|
|
129
129
|
/**
|
|
130
130
|
* Optional flag to enable debug mode.
|
|
131
131
|
* When enabled, additional logging and debugging information will be output.
|
|
132
|
+
* Only enabled in development mode.
|
|
132
133
|
*
|
|
133
134
|
* @see {@link https://docs.reown.com/appkit/react-native/core/options#debug | Debug Documentation}
|
|
134
135
|
* @default false
|
package/src/utils/SIWXUtil.ts
CHANGED
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
SnackController,
|
|
14
14
|
CoreHelperUtil,
|
|
15
15
|
ConnectionsController,
|
|
16
|
-
EventsController
|
|
16
|
+
EventsController,
|
|
17
|
+
LogController
|
|
17
18
|
} from '@reown/appkit-core-react-native';
|
|
18
|
-
import { Alert } from 'react-native';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* SIWXUtil holds the methods to interact with the SIWX plugin and must be called internally on AppKit.
|
|
@@ -74,8 +74,7 @@ export const SIWXUtil = {
|
|
|
74
74
|
ModalController.open({ view: 'SIWXSignMessage' });
|
|
75
75
|
}
|
|
76
76
|
} catch (error: unknown) {
|
|
77
|
-
|
|
78
|
-
console.error('SIWXUtil:initializeIfEnabled error', error);
|
|
77
|
+
LogController.sendError(error, 'SIWXUtil.ts', 'initializeIfEnabled');
|
|
79
78
|
|
|
80
79
|
EventsController.sendEvent({
|
|
81
80
|
type: 'track',
|
|
@@ -153,10 +152,7 @@ export const SIWXUtil = {
|
|
|
153
152
|
view: 'SIWXSignMessage'
|
|
154
153
|
});
|
|
155
154
|
}
|
|
156
|
-
|
|
157
|
-
// @ts-ignore
|
|
158
|
-
Alert.alert('Error signing message', error?.message ?? error);
|
|
159
|
-
|
|
155
|
+
SnackController.hide();
|
|
160
156
|
SnackController.showError('Error signing message');
|
|
161
157
|
EventsController.sendEvent({
|
|
162
158
|
type: 'track',
|
|
@@ -293,8 +289,6 @@ export const SIWXUtil = {
|
|
|
293
289
|
universalLink
|
|
294
290
|
);
|
|
295
291
|
|
|
296
|
-
SnackController.showLoading('Authenticating...', true);
|
|
297
|
-
|
|
298
292
|
if (result?.auths?.length) {
|
|
299
293
|
const sessions = result.auths.map<SIWXSession>(cacao => {
|
|
300
294
|
const message = universalProvider.client.formatAuthMessage({
|
|
@@ -320,6 +314,7 @@ export const SIWXUtil = {
|
|
|
320
314
|
});
|
|
321
315
|
|
|
322
316
|
try {
|
|
317
|
+
SnackController.showLoading('Authenticating...', true);
|
|
323
318
|
await siwx.setSessions(sessions);
|
|
324
319
|
|
|
325
320
|
EventsController.sendEvent({
|
|
@@ -349,7 +344,7 @@ export const SIWXUtil = {
|
|
|
349
344
|
},
|
|
350
345
|
getSIWXEventProperties(error?: unknown) {
|
|
351
346
|
return {
|
|
352
|
-
network: ConnectionsController.state.activeNetwork?.caipNetworkId
|
|
347
|
+
network: ConnectionsController.state.activeNetwork?.caipNetworkId,
|
|
353
348
|
isSmartAccount: ConnectionsController.state.accountType === 'smartAccount',
|
|
354
349
|
message: error ? CoreHelperUtil.parseError(error) : undefined
|
|
355
350
|
};
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
OnRampController,
|
|
15
15
|
ConnectionsController,
|
|
16
16
|
AssetController,
|
|
17
|
-
AssetUtil
|
|
17
|
+
AssetUtil,
|
|
18
|
+
LogController
|
|
18
19
|
} from '@reown/appkit-core-react-native';
|
|
19
20
|
// import { ConstantsUtil as CommonConstantsUtil } from '@reown/appkit-common-react-native';
|
|
20
21
|
import {
|
|
@@ -94,6 +95,7 @@ export function AccountDefaultView() {
|
|
|
94
95
|
switchAccountType(namespace, newType, network);
|
|
95
96
|
}
|
|
96
97
|
} catch (error) {
|
|
98
|
+
LogController.sendError(error, 'AccountDefaultView.tsx', 'onSwitchAccountType');
|
|
97
99
|
SnackController.showError('Error switching account type');
|
|
98
100
|
}
|
|
99
101
|
};
|
|
@@ -120,7 +122,7 @@ export function AccountDefaultView() {
|
|
|
120
122
|
type: 'track',
|
|
121
123
|
event: 'OPEN_SWAP',
|
|
122
124
|
properties: {
|
|
123
|
-
network: ConnectionsController.state.activeNetwork?.caipNetworkId
|
|
125
|
+
network: ConnectionsController.state.activeNetwork?.caipNetworkId,
|
|
124
126
|
isSmartAccount: false
|
|
125
127
|
}
|
|
126
128
|
});
|
|
@@ -156,7 +158,7 @@ export function AccountDefaultView() {
|
|
|
156
158
|
};
|
|
157
159
|
|
|
158
160
|
const onSendPress = () => {
|
|
159
|
-
const network = ConnectionsController.state.activeNetwork?.caipNetworkId
|
|
161
|
+
const network = ConnectionsController.state.activeNetwork?.caipNetworkId;
|
|
160
162
|
const isSmartAccount = ConnectionsController.state.accountType === 'smartAccount';
|
|
161
163
|
|
|
162
164
|
EventsController.sendEvent({
|
|
@@ -22,7 +22,7 @@ export function AllWalletsView() {
|
|
|
22
22
|
|
|
23
23
|
const { debouncedCallback: onInputChange } = useDebounceCallback({ callback: setSearchQuery });
|
|
24
24
|
|
|
25
|
-
const onWalletPress = (wallet: WcWallet) => {
|
|
25
|
+
const onWalletPress = (wallet: WcWallet, displayIndex: number) => {
|
|
26
26
|
const isExternal = WcHelpersUtil.isExternalWallet(wallet);
|
|
27
27
|
if (isExternal) {
|
|
28
28
|
RouterController.push('ConnectingExternal', { wallet });
|
|
@@ -33,7 +33,14 @@ export function AllWalletsView() {
|
|
|
33
33
|
EventsController.sendEvent({
|
|
34
34
|
type: 'track',
|
|
35
35
|
event: 'SELECT_WALLET',
|
|
36
|
-
properties: {
|
|
36
|
+
properties: {
|
|
37
|
+
name: wallet.name ?? 'Unknown',
|
|
38
|
+
platform: 'mobile',
|
|
39
|
+
explorerId: wallet.id,
|
|
40
|
+
walletRank: wallet.order,
|
|
41
|
+
displayIndex,
|
|
42
|
+
view: 'AllWallets'
|
|
43
|
+
}
|
|
37
44
|
});
|
|
38
45
|
};
|
|
39
46
|
|
|
@@ -14,7 +14,7 @@ import { UiUtil } from '../../../utils/UiUtil';
|
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
itemStyle: StyleProp<ViewStyle>;
|
|
17
|
-
onWalletPress: (wallet: WcWallet) => void;
|
|
17
|
+
onWalletPress: (wallet: WcWallet, displayIndex: number, isInstalled?: boolean) => void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function AllWalletList({ itemStyle, onWalletPress }: Props) {
|
|
@@ -47,8 +47,10 @@ export function AllWalletList({ itemStyle, onWalletPress }: Props) {
|
|
|
47
47
|
<ListItemLoader style={itemStyle} />
|
|
48
48
|
</>
|
|
49
49
|
) : (
|
|
50
|
-
list.map(wallet => {
|
|
50
|
+
list.map((wallet, index) => {
|
|
51
51
|
const isRecent = recentWallets?.some(recentWallet => recentWallet.id === wallet.id);
|
|
52
|
+
//eslint-disable-next-line valtio/state-snapshot-rule
|
|
53
|
+
const isInstalled = !!installed.find(installedWallet => installedWallet.id === wallet.id);
|
|
52
54
|
|
|
53
55
|
return (
|
|
54
56
|
<ListWallet
|
|
@@ -56,11 +58,11 @@ export function AllWalletList({ itemStyle, onWalletPress }: Props) {
|
|
|
56
58
|
imageSrc={AssetUtil.getWalletImage(wallet, walletImages)}
|
|
57
59
|
imageHeaders={imageHeaders}
|
|
58
60
|
name={wallet?.name ?? 'Unknown'}
|
|
59
|
-
onPress={() => onWalletPress(wallet)}
|
|
61
|
+
onPress={() => onWalletPress(wallet, index, isInstalled)}
|
|
60
62
|
tagLabel={isRecent ? 'Recent' : undefined}
|
|
61
63
|
tagVariant={isRecent ? 'shade' : undefined}
|
|
62
64
|
style={itemStyle}
|
|
63
|
-
installed={
|
|
65
|
+
installed={isInstalled}
|
|
64
66
|
/>
|
|
65
67
|
);
|
|
66
68
|
})
|
|
@@ -33,7 +33,7 @@ export function ConnectView() {
|
|
|
33
33
|
const showLoadingError = !showConnectWalletsButton && prefetchError;
|
|
34
34
|
const showList = !showConnectWalletsButton && !showLoadingError;
|
|
35
35
|
|
|
36
|
-
const onWalletPress = (wallet: WcWallet, isInstalled?: boolean) => {
|
|
36
|
+
const onWalletPress = (wallet: WcWallet, displayIndex: number, isInstalled?: boolean) => {
|
|
37
37
|
const isExternal = WcHelpersUtil.isExternalWallet(wallet);
|
|
38
38
|
if (isExternal) {
|
|
39
39
|
RouterController.push('ConnectingExternal', { wallet });
|
|
@@ -48,7 +48,10 @@ export function ConnectView() {
|
|
|
48
48
|
properties: {
|
|
49
49
|
name: wallet.name ?? 'Unknown',
|
|
50
50
|
platform,
|
|
51
|
-
|
|
51
|
+
explorerId: wallet.id,
|
|
52
|
+
walletRank: wallet.order,
|
|
53
|
+
displayIndex,
|
|
54
|
+
view: 'Connect'
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
};
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
WcController,
|
|
9
9
|
AssetUtil,
|
|
10
10
|
AssetController,
|
|
11
|
-
CoreHelperUtil
|
|
11
|
+
CoreHelperUtil,
|
|
12
|
+
LogController,
|
|
13
|
+
ConnectionsController
|
|
12
14
|
} from '@reown/appkit-core-react-native';
|
|
13
15
|
import {
|
|
14
16
|
Button,
|
|
@@ -41,6 +43,21 @@ export function ConnectingExternalView() {
|
|
|
41
43
|
const onStorePress = () => {
|
|
42
44
|
if (storeUrl) {
|
|
43
45
|
CoreHelperUtil.openLink(storeUrl);
|
|
46
|
+
EventsController.sendEvent({
|
|
47
|
+
type: 'track',
|
|
48
|
+
event: 'GET_WALLET',
|
|
49
|
+
properties: {
|
|
50
|
+
name: RouterController.state.data?.wallet?.name ?? 'Unknown',
|
|
51
|
+
link: storeUrl,
|
|
52
|
+
linkType: Platform.select({
|
|
53
|
+
ios: 'appstore',
|
|
54
|
+
android: 'playstore',
|
|
55
|
+
default: undefined
|
|
56
|
+
}),
|
|
57
|
+
explorerId: RouterController.state.data?.wallet?.id,
|
|
58
|
+
walletRank: RouterController.state.data?.wallet?.order
|
|
59
|
+
}
|
|
60
|
+
});
|
|
44
61
|
}
|
|
45
62
|
};
|
|
46
63
|
|
|
@@ -61,17 +78,22 @@ export function ConnectingExternalView() {
|
|
|
61
78
|
}
|
|
62
79
|
WcController.addRecentWallet(wallet);
|
|
63
80
|
WcController.setPressedWallet(wallet);
|
|
81
|
+
const address = ConnectionsController.state.activeAddress;
|
|
82
|
+
const caipNetworkId = ConnectionsController.state.activeNetwork?.caipNetworkId;
|
|
64
83
|
EventsController.sendEvent({
|
|
65
84
|
type: 'track',
|
|
66
85
|
event: 'CONNECT_SUCCESS',
|
|
86
|
+
address: CoreHelperUtil.getPlainAddress(address),
|
|
67
87
|
properties: {
|
|
68
88
|
name: wallet?.name ?? 'Unknown',
|
|
69
89
|
method: 'mobile',
|
|
70
|
-
|
|
90
|
+
caipNetworkId,
|
|
91
|
+
explorerId: wallet?.id
|
|
71
92
|
}
|
|
72
93
|
});
|
|
73
94
|
}
|
|
74
95
|
} catch (error) {
|
|
96
|
+
LogController.sendError(error, 'ConnectingExternalView.tsx', 'onConnect');
|
|
75
97
|
if (/(Wallet not found)/i.test((error as Error).message)) {
|
|
76
98
|
setErrorType('not_installed');
|
|
77
99
|
} else if (/(rejected)/i.test((error as Error).message)) {
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
CoreHelperUtil,
|
|
6
6
|
EventsController,
|
|
7
7
|
RouterController,
|
|
8
|
-
SnackController
|
|
8
|
+
SnackController,
|
|
9
|
+
LogController
|
|
9
10
|
} from '@reown/appkit-core-react-native';
|
|
10
11
|
import {
|
|
11
12
|
FlexView,
|
|
@@ -48,6 +49,7 @@ export function ConnectingSocialView() {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
} catch (e) {
|
|
52
|
+
LogController.sendError(e, 'ConnectingSocialView.tsx', 'onConnect');
|
|
51
53
|
EventsController.sendEvent({
|
|
52
54
|
type: 'track',
|
|
53
55
|
event: 'SOCIAL_LOGIN_ERROR',
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
SnackController,
|
|
10
10
|
OptionsController,
|
|
11
11
|
ApiController,
|
|
12
|
-
EventsController
|
|
12
|
+
EventsController,
|
|
13
|
+
LogController
|
|
13
14
|
} from '@reown/appkit-core-react-native';
|
|
14
15
|
import { useInternalAppKit } from '../../AppKitContext';
|
|
15
16
|
import { ConnectingQrCode } from '../../partials/w3m-connecting-qrcode';
|
|
@@ -51,6 +52,7 @@ export function ConnectingView() {
|
|
|
51
52
|
WcController.setWcPromise(connectPromise);
|
|
52
53
|
}
|
|
53
54
|
} catch (error) {
|
|
55
|
+
LogController.sendError(error, 'ConnectingView.tsx', 'initializeConnection');
|
|
54
56
|
WcController.setWcError(true);
|
|
55
57
|
WcController.clearUri();
|
|
56
58
|
SnackController.showError('Declined');
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ApiController,
|
|
5
5
|
AssetController,
|
|
6
6
|
AssetUtil,
|
|
7
|
+
LogController,
|
|
7
8
|
RouterController
|
|
8
9
|
} from '@reown/appkit-core-react-native';
|
|
9
10
|
import {
|
|
@@ -35,6 +36,7 @@ export function NetworkSwitchView() {
|
|
|
35
36
|
await switchNetwork(RouterController.state.data.network);
|
|
36
37
|
back();
|
|
37
38
|
} catch (error) {
|
|
39
|
+
LogController.sendError(error, 'NetworkSwitchView.tsx', 'onSwitchNetwork');
|
|
38
40
|
setIsError(true);
|
|
39
41
|
setShowRetry(true);
|
|
40
42
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from '@reown/appkit-ui-react-native';
|
|
12
12
|
import {
|
|
13
13
|
ConnectionsController,
|
|
14
|
+
LogController,
|
|
14
15
|
OptionsController,
|
|
15
16
|
RouterController,
|
|
16
17
|
SnackController
|
|
@@ -37,6 +38,7 @@ export function SIWXSignMessageView() {
|
|
|
37
38
|
try {
|
|
38
39
|
await SIWXUtil.requestSignMessage();
|
|
39
40
|
} catch (error) {
|
|
41
|
+
LogController.sendError(error, 'SIWXSignMessageView.tsx', 'onSign');
|
|
40
42
|
SnackController.showError('Signature declined');
|
|
41
43
|
} finally {
|
|
42
44
|
setIsSigning(false);
|
|
@@ -93,7 +93,7 @@ export function SwapView() {
|
|
|
93
93
|
type: 'track',
|
|
94
94
|
event: 'INITIATE_SWAP',
|
|
95
95
|
properties: {
|
|
96
|
-
network: ConnectionsController.state.activeNetwork?.caipNetworkId
|
|
96
|
+
network: ConnectionsController.state.activeNetwork?.caipNetworkId,
|
|
97
97
|
swapFromToken: SwapController.state.sourceToken?.symbol || '',
|
|
98
98
|
swapToToken: SwapController.state.toToken?.symbol || '',
|
|
99
99
|
swapFromAmount: SwapController.state.sourceTokenAmount || '',
|
|
@@ -8,7 +8,7 @@ export function WhatIsAWalletView() {
|
|
|
8
8
|
|
|
9
9
|
const onGetWalletPress = () => {
|
|
10
10
|
RouterController.push('GetWallet');
|
|
11
|
-
EventsController.sendEvent({ type: 'track', event: '
|
|
11
|
+
EventsController.sendEvent({ type: 'track', event: 'CLICK_GET_WALLET_HELP' });
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
return (
|