@reown/appkit-react-native 0.0.0-feat-multichain-20250930155416 → 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 +87 -9
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/hooks/useAppKit.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-connecting-mobile/index.js +20 -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 +5 -1
- package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/commonjs/utils/SIWXUtil.js +3 -6
- package/lib/commonjs/utils/SIWXUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +2 -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 +20 -1
- package/lib/commonjs/views/w3m-connecting-external-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 +87 -9
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/hooks/useAppKit.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-connecting-mobile/index.js +21 -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 +6 -2
- package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
- package/lib/module/utils/SIWXUtil.js +3 -6
- package/lib/module/utils/SIWXUtil.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +2 -2
- 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 +21 -2
- package/lib/module/views/w3m-connecting-external-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/useAppKitState.d.ts +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/utils/SIWXUtil.d.ts +1 -1
- package/lib/typescript/utils/SIWXUtil.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/package.json +4 -4
- package/src/AppKit.ts +102 -9
- package/src/hooks/useAppKit.ts +3 -2
- 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 +1 -1
- package/src/partials/w3m-all-wallets-search/index.tsx +1 -1
- package/src/partials/w3m-connecting-mobile/index.tsx +22 -2
- package/src/partials/w3m-connecting-qrcode/index.tsx +8 -2
- package/src/partials/w3m-connecting-web/index.tsx +7 -2
- package/src/utils/SIWXUtil.ts +3 -8
- package/src/views/w3m-account-default-view/index.tsx +2 -2
- 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 +22 -2
- package/src/views/w3m-swap-view/index.tsx +1 -1
- package/src/views/w3m-what-is-a-wallet-view/index.tsx +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ChainNamespace } from '@reown/appkit-common-react-native';
|
|
1
2
|
import type { AppKit } from '../AppKit';
|
|
2
3
|
interface UseAppKitReturn {
|
|
3
4
|
open: AppKit['open'];
|
|
4
5
|
close: AppKit['close'];
|
|
5
|
-
disconnect: (namespace?:
|
|
6
|
+
disconnect: (namespace?: ChainNamespace) => void;
|
|
6
7
|
switchNetwork: AppKit['switchNetwork'];
|
|
7
8
|
}
|
|
8
9
|
export declare const useAppKit: () => UseAppKitReturn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppKit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAppKit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAppKit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAppKit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,SAAS,QAAO,eA2B5B,CAAC"}
|
|
@@ -13,6 +13,39 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
13
13
|
readonly properties: {
|
|
14
14
|
readonly connected: boolean;
|
|
15
15
|
};
|
|
16
|
+
} | {
|
|
17
|
+
readonly type: "track";
|
|
18
|
+
readonly event: "INITIALIZE";
|
|
19
|
+
readonly properties: {
|
|
20
|
+
readonly showWallets?: boolean | undefined;
|
|
21
|
+
readonly themeMode?: import("@reown/appkit-common-react-native").ThemeMode | undefined;
|
|
22
|
+
readonly themeVariables?: {
|
|
23
|
+
readonly accent?: string | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
readonly networks: readonly `${string}:${string}`[];
|
|
26
|
+
readonly defaultNetwork?: `${string}:${string}` | undefined;
|
|
27
|
+
readonly metadata?: {
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly description: string;
|
|
30
|
+
readonly url: string;
|
|
31
|
+
readonly icons: readonly string[];
|
|
32
|
+
readonly redirect?: {
|
|
33
|
+
readonly native?: string | undefined;
|
|
34
|
+
readonly universal?: string | undefined;
|
|
35
|
+
readonly linkMode?: boolean | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
readonly enableAnalytics?: boolean | undefined;
|
|
39
|
+
readonly features?: {
|
|
40
|
+
readonly swaps?: boolean | undefined;
|
|
41
|
+
readonly onramp?: boolean | undefined;
|
|
42
|
+
readonly showWallets?: boolean | undefined;
|
|
43
|
+
readonly socials?: false | readonly import("@reown/appkit-common-react-native").SocialProvider[] | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
readonly adapters?: readonly string[] | undefined;
|
|
46
|
+
readonly extraConnectors?: readonly string[] | undefined;
|
|
47
|
+
readonly siwx?: boolean | undefined;
|
|
48
|
+
};
|
|
16
49
|
} | {
|
|
17
50
|
readonly type: "track";
|
|
18
51
|
readonly event: "MODAL_CLOSE";
|
|
@@ -29,7 +62,7 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
29
62
|
readonly type: "track";
|
|
30
63
|
readonly event: "SWITCH_NETWORK";
|
|
31
64
|
readonly properties: {
|
|
32
|
-
readonly network: string
|
|
65
|
+
readonly network: `${string}:${string}`;
|
|
33
66
|
};
|
|
34
67
|
} | {
|
|
35
68
|
readonly type: "track";
|
|
@@ -37,15 +70,21 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
37
70
|
readonly properties: {
|
|
38
71
|
readonly name: string;
|
|
39
72
|
readonly platform?: import("@reown/appkit-common-react-native").Platform | undefined;
|
|
40
|
-
readonly
|
|
73
|
+
readonly explorerId?: string | undefined;
|
|
74
|
+
readonly walletRank?: number | undefined;
|
|
75
|
+
readonly displayIndex?: number | undefined;
|
|
76
|
+
readonly view?: "AllWallets" | "Connect" | undefined;
|
|
41
77
|
};
|
|
42
78
|
} | {
|
|
43
79
|
readonly type: "track";
|
|
44
80
|
readonly event: "CONNECT_SUCCESS";
|
|
81
|
+
readonly address?: string | undefined;
|
|
45
82
|
readonly properties: {
|
|
46
83
|
readonly name: string;
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
84
|
+
readonly caipNetworkId?: `${string}:${string}` | undefined;
|
|
85
|
+
readonly method?: import("@reown/appkit-common-react-native").Platform | undefined;
|
|
86
|
+
readonly explorerId?: string | undefined;
|
|
87
|
+
readonly reconnect?: boolean | undefined;
|
|
49
88
|
};
|
|
50
89
|
} | {
|
|
51
90
|
readonly type: "track";
|
|
@@ -56,6 +95,9 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
56
95
|
} | {
|
|
57
96
|
readonly type: "track";
|
|
58
97
|
readonly event: "DISCONNECT_SUCCESS";
|
|
98
|
+
readonly properties: {
|
|
99
|
+
readonly namespace?: import("@reown/appkit-common-react-native").ChainNamespace | undefined;
|
|
100
|
+
};
|
|
59
101
|
} | {
|
|
60
102
|
readonly type: "track";
|
|
61
103
|
readonly event: "DISCONNECT_ERROR";
|
|
@@ -67,7 +109,17 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
67
109
|
readonly event: "CLICK_NETWORK_HELP";
|
|
68
110
|
} | {
|
|
69
111
|
readonly type: "track";
|
|
70
|
-
readonly event: "
|
|
112
|
+
readonly event: "CLICK_GET_WALLET_HELP";
|
|
113
|
+
} | {
|
|
114
|
+
readonly type: "track";
|
|
115
|
+
readonly event: "GET_WALLET";
|
|
116
|
+
readonly properties: {
|
|
117
|
+
readonly name: string;
|
|
118
|
+
readonly explorerId?: string | undefined;
|
|
119
|
+
readonly link?: string | undefined;
|
|
120
|
+
readonly linkType?: "appstore" | "playstore" | undefined;
|
|
121
|
+
readonly walletRank?: number | undefined;
|
|
122
|
+
};
|
|
71
123
|
} | {
|
|
72
124
|
readonly type: "track";
|
|
73
125
|
readonly event: "EMAIL_LOGIN_SELECTED";
|
|
@@ -91,28 +143,28 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
91
143
|
readonly address?: string | undefined;
|
|
92
144
|
readonly event: "CLICK_SIGN_SIWX_MESSAGE";
|
|
93
145
|
readonly properties: {
|
|
94
|
-
readonly network
|
|
146
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
95
147
|
readonly isSmartAccount: boolean;
|
|
96
148
|
};
|
|
97
149
|
} | {
|
|
98
150
|
readonly type: "track";
|
|
99
151
|
readonly event: "CLICK_CANCEL_SIWX";
|
|
100
152
|
readonly properties: {
|
|
101
|
-
readonly network
|
|
153
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
102
154
|
readonly isSmartAccount: boolean;
|
|
103
155
|
};
|
|
104
156
|
} | {
|
|
105
157
|
readonly type: "track";
|
|
106
158
|
readonly event: "SIWX_AUTH_SUCCESS";
|
|
107
159
|
readonly properties: {
|
|
108
|
-
readonly network
|
|
160
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
109
161
|
readonly isSmartAccount: boolean;
|
|
110
162
|
};
|
|
111
163
|
} | {
|
|
112
164
|
readonly type: "track";
|
|
113
165
|
readonly event: "SIWX_AUTH_ERROR";
|
|
114
166
|
readonly properties: {
|
|
115
|
-
readonly network
|
|
167
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
116
168
|
readonly isSmartAccount: boolean;
|
|
117
169
|
readonly message?: string | undefined;
|
|
118
170
|
};
|
|
@@ -145,21 +197,21 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
145
197
|
readonly event: "OPEN_SEND";
|
|
146
198
|
readonly properties: {
|
|
147
199
|
readonly isSmartAccount: boolean;
|
|
148
|
-
readonly network
|
|
200
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
149
201
|
};
|
|
150
202
|
} | {
|
|
151
203
|
readonly type: "track";
|
|
152
204
|
readonly event: "OPEN_SWAP";
|
|
153
205
|
readonly properties: {
|
|
154
206
|
readonly isSmartAccount: boolean;
|
|
155
|
-
readonly network
|
|
207
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
156
208
|
};
|
|
157
209
|
} | {
|
|
158
210
|
readonly type: "track";
|
|
159
211
|
readonly event: "INITIATE_SWAP";
|
|
160
212
|
readonly properties: {
|
|
161
213
|
readonly isSmartAccount: boolean;
|
|
162
|
-
readonly network
|
|
214
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
163
215
|
readonly swapFromToken: string;
|
|
164
216
|
readonly swapToToken: string;
|
|
165
217
|
readonly swapFromAmount: string;
|
|
@@ -170,7 +222,7 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
170
222
|
readonly event: "SWAP_SUCCESS";
|
|
171
223
|
readonly properties: {
|
|
172
224
|
readonly isSmartAccount: boolean;
|
|
173
|
-
readonly network
|
|
225
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
174
226
|
readonly swapFromToken: string;
|
|
175
227
|
readonly swapToToken: string;
|
|
176
228
|
readonly swapFromAmount: string;
|
|
@@ -181,7 +233,7 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
181
233
|
readonly event: "SWAP_ERROR";
|
|
182
234
|
readonly properties: {
|
|
183
235
|
readonly isSmartAccount: boolean;
|
|
184
|
-
readonly network
|
|
236
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
185
237
|
readonly swapFromToken: string;
|
|
186
238
|
readonly swapToToken: string;
|
|
187
239
|
readonly swapFromAmount: string;
|
|
@@ -193,7 +245,7 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
193
245
|
readonly event: "SEND_INITIATED";
|
|
194
246
|
readonly properties: {
|
|
195
247
|
readonly isSmartAccount: boolean;
|
|
196
|
-
readonly network
|
|
248
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
197
249
|
readonly token: string;
|
|
198
250
|
readonly amount: number;
|
|
199
251
|
};
|
|
@@ -202,7 +254,7 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
202
254
|
readonly event: "SEND_SUCCESS";
|
|
203
255
|
readonly properties: {
|
|
204
256
|
readonly isSmartAccount: boolean;
|
|
205
|
-
readonly network
|
|
257
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
206
258
|
readonly token: string;
|
|
207
259
|
readonly amount: number;
|
|
208
260
|
};
|
|
@@ -211,7 +263,7 @@ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerSt
|
|
|
211
263
|
readonly event: "SEND_ERROR";
|
|
212
264
|
readonly properties: {
|
|
213
265
|
readonly isSmartAccount: boolean;
|
|
214
|
-
readonly network
|
|
266
|
+
readonly network?: `${string}:${string}` | undefined;
|
|
215
267
|
readonly token: string;
|
|
216
268
|
readonly amount: number;
|
|
217
269
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppKitEvents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAppKitEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAGnE,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI
|
|
1
|
+
{"version":3,"file":"useAppKitEvents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAppKitEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAGnE,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAenF;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI,QAWpD"}
|
|
@@ -28,7 +28,7 @@ export declare function useAppKitState(): {
|
|
|
28
28
|
readonly url: string;
|
|
29
29
|
};
|
|
30
30
|
} | undefined;
|
|
31
|
-
readonly chainNamespace: "eip155" | "solana" | "
|
|
31
|
+
readonly chainNamespace: "eip155" | "solana" | "bip122";
|
|
32
32
|
readonly caipNetworkId: `${string}:${string}`;
|
|
33
33
|
readonly testnet?: boolean | undefined;
|
|
34
34
|
readonly deprecatedCaipNetworkId?: `${string}:${string}` | undefined;
|
|
@@ -3,12 +3,13 @@ import type { WcWallet } from '@reown/appkit-common-react-native';
|
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
interface WalletItemProps {
|
|
5
5
|
item: WcWallet;
|
|
6
|
+
displayIndex: number;
|
|
6
7
|
imageHeaders?: Record<string, string>;
|
|
7
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
8
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
8
9
|
style?: StyleProp<ViewStyle>;
|
|
9
10
|
testID?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare function WalletItem({ item, imageHeaders, onItemPress, style, testID }: WalletItemProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function WalletItem({ item, displayIndex, imageHeaders, onItemPress, style, testID }: WalletItemProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare const MemoizedWalletItem: import("react").MemoExoticComponent<typeof WalletItem>;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=WalletItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletItem.d.ts","sourceRoot":"","sources":["../../../../../src/partials/w3m-all-wallets-list/components/WalletItem.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,UAAU,eAAe;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"WalletItem.d.ts","sourceRoot":"","sources":["../../../../../src/partials/w3m-all-wallets-list/components/WalletItem.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,UAAU,eAAe;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,MAAM,EACP,EAAE,eAAe,2CAoBjB;AAED,eAAO,MAAM,kBAAkB,wDAE7B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type StyleProp, type ViewStyle } from 'react-native';
|
|
|
2
2
|
import type { WcWallet } from '@reown/appkit-common-react-native';
|
|
3
3
|
interface Props {
|
|
4
4
|
data: WcWallet[];
|
|
5
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
5
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
6
6
|
onEndReached?: () => void;
|
|
7
7
|
onEndReachedThreshold?: number;
|
|
8
8
|
isLoading?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletList.d.ts","sourceRoot":"","sources":["../../../../../src/partials/w3m-all-wallets-list/components/WalletList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAQlE,UAAU,KAAK;IACb,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"WalletList.d.ts","sourceRoot":"","sources":["../../../../../src/partials/w3m-all-wallets-list/components/WalletList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAQlE,UAAU,KAAK;IACb,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,SAAiB,EACjB,YAAiB,EACjB,SAAS,EACT,KAAK,EACN,EAAE,KAAK,2CA8CP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
2
2
|
interface AllWalletsListProps {
|
|
3
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
3
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
4
4
|
headerHeight?: number;
|
|
5
5
|
}
|
|
6
6
|
export declare function AllWalletsList({ onItemPress }: AllWalletsListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-all-wallets-list/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAOlE,UAAU,mBAAmB;IAC3B,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-all-wallets-list/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAOlE,UAAU,mBAAmB;IAC3B,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,EAAE,mBAAmB,2CAqGlE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
2
2
|
export interface AllWalletsSearchProps {
|
|
3
|
-
onItemPress: (wallet: WcWallet) => void;
|
|
3
|
+
onItemPress: (wallet: WcWallet, displayIndex: number) => void;
|
|
4
4
|
searchQuery?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function AllWalletsSearch({ searchQuery, onItemPress }: AllWalletsSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-all-wallets-search/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAQlE,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-all-wallets-search/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAQlE,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,qBAAqB,2CAkEnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-mobile/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-mobile/index.tsx"],"names":[],"mappings":"AA8BA,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,2CAgJ1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-qrcode/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-qrcode/index.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,gBAAgB,4CA+D/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-web/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-web/index.tsx"],"names":[],"mappings":"AA2BA,UAAU,kBAAkB;IAC1B,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE,kBAAkB,2CAuF9D"}
|
|
@@ -25,7 +25,7 @@ export declare const SIWXUtil: {
|
|
|
25
25
|
universalLink?: string | undefined;
|
|
26
26
|
}): Promise<import("@walletconnect/types").SessionTypes.Struct | undefined>;
|
|
27
27
|
getSIWXEventProperties(error?: unknown): {
|
|
28
|
-
network: string;
|
|
28
|
+
network: `${string}:${string}` | undefined;
|
|
29
29
|
isSmartAccount: boolean;
|
|
30
30
|
message: string | undefined;
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SIWXUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SIWXUtil.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"SIWXUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/SIWXUtil.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAElE,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;AAa3C;;GAEG;AAEH,eAAO,MAAM,QAAQ;;;sBAUH,MAAM,QAAQ,IAAI,CAAC;;;;;oCAqIG,MAAM,QAAQ,IAAI,CAAC;;uBAsChC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,aAAa,CAAA;KAAE;;;2BAwCvD,iBAAiB;gBAC5B,aAAa,EAAE;iBACd,MAAM,EAAE;;;mCAkGY,OAAO;;;;;;CAcvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-all-wallets-view/index.tsx"],"names":[],"mappings":"AAiBA,wBAAgB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-all-wallets-view/index.tsx"],"names":[],"mappings":"AAiBA,wBAAgB,cAAc,4CAyF7B"}
|
|
@@ -2,7 +2,7 @@ import { type StyleProp, type ViewStyle } from 'react-native';
|
|
|
2
2
|
import { type WcWallet } from '@reown/appkit-common-react-native';
|
|
3
3
|
interface Props {
|
|
4
4
|
itemStyle: StyleProp<ViewStyle>;
|
|
5
|
-
onWalletPress: (wallet: WcWallet) => void;
|
|
5
|
+
onWalletPress: (wallet: WcWallet, displayIndex: number, isInstalled?: boolean) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare function AllWalletList({ itemStyle, onWalletPress }: Props): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[] | null;
|
|
8
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-wallet-list.d.ts","sourceRoot":"","sources":["../../../../../src/views/w3m-connect-view/components/all-wallet-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAIlE,UAAU,KAAK;IACb,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"all-wallet-list.d.ts","sourceRoot":"","sources":["../../../../../src/views/w3m-connect-view/components/all-wallet-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAIlE,UAAU,KAAK;IACb,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACxF;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,KAAK,8FAkDhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-connect-view/index.tsx"],"names":[],"mappings":"AAyBA,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-connect-view/index.tsx"],"names":[],"mappings":"AAyBA,wBAAgB,WAAW,4CAgF1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-connecting-external-view/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-connecting-external-view/index.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,sBAAsB,4CAiIrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-react-native",
|
|
3
|
-
"version": "0.0.0-feat-multichain-
|
|
3
|
+
"version": "0.0.0-feat-multichain-20251001210321",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"provenance": true
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@reown/appkit-common-react-native": "0.0.0-feat-multichain-
|
|
43
|
-
"@reown/appkit-core-react-native": "0.0.0-feat-multichain-
|
|
44
|
-
"@reown/appkit-ui-react-native": "0.0.0-feat-multichain-
|
|
42
|
+
"@reown/appkit-common-react-native": "0.0.0-feat-multichain-20251001210321",
|
|
43
|
+
"@reown/appkit-core-react-native": "0.0.0-feat-multichain-20251001210321",
|
|
44
|
+
"@reown/appkit-ui-react-native": "0.0.0-feat-multichain-20251001210321",
|
|
45
45
|
"@walletconnect/universal-provider": "2.21.10",
|
|
46
46
|
"valtio": "2.1.8"
|
|
47
47
|
},
|
package/src/AppKit.ts
CHANGED
|
@@ -46,6 +46,13 @@ import { RouterUtil } from './utils/RouterUtil';
|
|
|
46
46
|
import { type AppKitConfig } from './types';
|
|
47
47
|
import { SIWXUtil } from './utils/SIWXUtil';
|
|
48
48
|
|
|
49
|
+
const APPKIT_INSTANCE_KEY = Symbol.for('__REOWN_APPKIT_INSTANCE__');
|
|
50
|
+
|
|
51
|
+
// Type helper to access the symbol-keyed property on globalThis
|
|
52
|
+
interface GlobalWithAppKit {
|
|
53
|
+
[key: symbol]: AppKit | undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
export class AppKit {
|
|
50
57
|
private projectId: string;
|
|
51
58
|
private adapters: BlockchainAdapter[];
|
|
@@ -180,7 +187,7 @@ export class AppKit {
|
|
|
180
187
|
* @param namespace - The namespace to disconnect from.
|
|
181
188
|
* @param isInternal - Whether the disconnect is internal (i.e. from the AppKit) or external (i.e. from wallet side).
|
|
182
189
|
*/
|
|
183
|
-
async disconnect(namespace?:
|
|
190
|
+
async disconnect(namespace?: ChainNamespace, isInternal?: boolean): Promise<void> {
|
|
184
191
|
try {
|
|
185
192
|
const activeNamespace = namespace ?? ConnectionsController.state.activeNamespace;
|
|
186
193
|
|
|
@@ -220,7 +227,10 @@ export class AppKit {
|
|
|
220
227
|
|
|
221
228
|
EventsController.sendEvent({
|
|
222
229
|
type: 'track',
|
|
223
|
-
event: 'DISCONNECT_SUCCESS'
|
|
230
|
+
event: 'DISCONNECT_SUCCESS',
|
|
231
|
+
properties: {
|
|
232
|
+
namespace: activeNamespace
|
|
233
|
+
}
|
|
224
234
|
});
|
|
225
235
|
} catch (error) {
|
|
226
236
|
LogController.sendError(error, 'AppKit.ts', 'disconnect');
|
|
@@ -270,7 +280,7 @@ export class AppKit {
|
|
|
270
280
|
type: 'track',
|
|
271
281
|
event: 'SWITCH_NETWORK',
|
|
272
282
|
properties: {
|
|
273
|
-
network: network.
|
|
283
|
+
network: network.caipNetworkId
|
|
274
284
|
}
|
|
275
285
|
});
|
|
276
286
|
|
|
@@ -385,6 +395,10 @@ export class AppKit {
|
|
|
385
395
|
*/
|
|
386
396
|
private async initConnectors() {
|
|
387
397
|
ModalController.setLoading(true);
|
|
398
|
+
|
|
399
|
+
//Always init the walletconnect connector
|
|
400
|
+
await this.createWalletConnectConnector();
|
|
401
|
+
|
|
388
402
|
const connectedConnectors = await StorageUtil.getConnectedConnectors();
|
|
389
403
|
if (connectedConnectors.length > 0) {
|
|
390
404
|
for (const connected of connectedConnectors) {
|
|
@@ -401,10 +415,22 @@ export class AppKit {
|
|
|
401
415
|
await StorageUtil.removeConnectedConnectors(connected.type);
|
|
402
416
|
}
|
|
403
417
|
}
|
|
418
|
+
|
|
419
|
+
const address = ConnectionsController.state.activeAddress;
|
|
420
|
+
const walletInfo = ConnectionsController.state.walletInfo;
|
|
421
|
+
if (address) {
|
|
422
|
+
EventsController.sendEvent({
|
|
423
|
+
type: 'track',
|
|
424
|
+
event: 'CONNECT_SUCCESS',
|
|
425
|
+
address: CoreHelperUtil.getPlainAddress(address),
|
|
426
|
+
properties: {
|
|
427
|
+
name: walletInfo?.name ?? 'Unknown',
|
|
428
|
+
reconnect: true
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
404
432
|
}
|
|
405
433
|
|
|
406
|
-
//Always init the walletconnect connector
|
|
407
|
-
await this.createWalletConnectConnector();
|
|
408
434
|
ModalController.setLoading(false);
|
|
409
435
|
}
|
|
410
436
|
|
|
@@ -607,6 +633,13 @@ export class AppKit {
|
|
|
607
633
|
|
|
608
634
|
const namespace = adapter.getSupportedNamespace();
|
|
609
635
|
const chain = `${namespace}:${chainId}` as CaipNetworkId;
|
|
636
|
+
|
|
637
|
+
const activeNetwork = ConnectionsController.getActiveNetworkId(namespace);
|
|
638
|
+
if (activeNetwork === chain) {
|
|
639
|
+
// No need to update the active network
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
|
|
610
643
|
ConnectionsController.setActiveNetwork(namespace, chain);
|
|
611
644
|
|
|
612
645
|
const connection = ConnectionsController.state.connections.get(namespace);
|
|
@@ -628,7 +661,13 @@ export class AppKit {
|
|
|
628
661
|
TransactionsController.fetchTransactions(address, true);
|
|
629
662
|
}
|
|
630
663
|
|
|
631
|
-
|
|
664
|
+
const closeModal = RouterController.state.view === 'UnsupportedChain';
|
|
665
|
+
|
|
666
|
+
SIWXUtil.initializeIfEnabled({
|
|
667
|
+
onDisconnect: this.disconnect,
|
|
668
|
+
caipAddress: address,
|
|
669
|
+
closeModal
|
|
670
|
+
});
|
|
632
671
|
});
|
|
633
672
|
|
|
634
673
|
adapter.on('disconnect', () => {
|
|
@@ -644,6 +683,7 @@ export class AppKit {
|
|
|
644
683
|
|
|
645
684
|
private async initControllers(options: AppKitConfig) {
|
|
646
685
|
await this.initStorageAndValues(options);
|
|
686
|
+
let defaultNetwork;
|
|
647
687
|
|
|
648
688
|
OptionsController.setProjectId(options.projectId);
|
|
649
689
|
OptionsController.setMetadata(options.metadata);
|
|
@@ -667,8 +707,8 @@ export class AppKit {
|
|
|
667
707
|
OptionsController.setRequestedNetworks(this.networks);
|
|
668
708
|
|
|
669
709
|
if (options.defaultNetwork) {
|
|
670
|
-
|
|
671
|
-
OptionsController.setDefaultNetwork(
|
|
710
|
+
defaultNetwork = NetworkUtil.formatNetwork(options.defaultNetwork, this.projectId);
|
|
711
|
+
OptionsController.setDefaultNetwork(defaultNetwork);
|
|
672
712
|
}
|
|
673
713
|
|
|
674
714
|
ThemeController.setDefaultThemeMode(options.themeMode);
|
|
@@ -694,6 +734,24 @@ export class AppKit {
|
|
|
694
734
|
) {
|
|
695
735
|
OptionsController.setIsOnRampEnabled(true);
|
|
696
736
|
}
|
|
737
|
+
|
|
738
|
+
EventsController.sendEvent({
|
|
739
|
+
type: 'track',
|
|
740
|
+
event: 'INITIALIZE',
|
|
741
|
+
properties: {
|
|
742
|
+
showWallets: options.features?.showWallets,
|
|
743
|
+
themeMode: options.themeMode,
|
|
744
|
+
themeVariables: options.themeVariables,
|
|
745
|
+
networks: this.networks.map(network => network.caipNetworkId).filter(Boolean),
|
|
746
|
+
defaultNetwork: defaultNetwork?.caipNetworkId,
|
|
747
|
+
metadata: options.metadata,
|
|
748
|
+
enableAnalytics: options.enableAnalytics,
|
|
749
|
+
features: options.features,
|
|
750
|
+
adapters: this.adapters.map(adapter => adapter?.constructor?.name).filter(Boolean),
|
|
751
|
+
extraConnectors: this.extraConnectors.map(connector => connector?.type).filter(Boolean),
|
|
752
|
+
siwx: !!options.siwx
|
|
753
|
+
}
|
|
754
|
+
});
|
|
697
755
|
}
|
|
698
756
|
|
|
699
757
|
private async initActiveNamespace() {
|
|
@@ -793,6 +851,41 @@ export class AppKit {
|
|
|
793
851
|
};
|
|
794
852
|
}
|
|
795
853
|
|
|
854
|
+
/**
|
|
855
|
+
* Creates or returns the existing AppKit singleton instance.
|
|
856
|
+
*
|
|
857
|
+
* @warning This function implements a singleton pattern. If an instance already exists,
|
|
858
|
+
* it will be returned and the provided config parameter will be IGNORED. If you need to
|
|
859
|
+
* change configuration, you must reload your application or clear the singleton manually.
|
|
860
|
+
*
|
|
861
|
+
* @param config - AppKit configuration options
|
|
862
|
+
* @returns The AppKit singleton instance
|
|
863
|
+
* @throws Error if configuration validation fails
|
|
864
|
+
*/
|
|
796
865
|
export function createAppKit(config: AppKitConfig): AppKit {
|
|
797
|
-
|
|
866
|
+
try {
|
|
867
|
+
const globalWithAppKit = globalThis as GlobalWithAppKit;
|
|
868
|
+
|
|
869
|
+
if (!globalWithAppKit[APPKIT_INSTANCE_KEY]) {
|
|
870
|
+
if (config.debug && __DEV__) {
|
|
871
|
+
// using console.log to avoid possible issues with LogController not being initialized
|
|
872
|
+
//eslint-disable-next-line no-console
|
|
873
|
+
console.log('AppKit: Creating new instance - AppKit.ts:createAppKit');
|
|
874
|
+
}
|
|
875
|
+
globalWithAppKit[APPKIT_INSTANCE_KEY] = new AppKit(config);
|
|
876
|
+
} else if (config.debug && __DEV__) {
|
|
877
|
+
//eslint-disable-next-line no-console
|
|
878
|
+
console.log('AppKit: Reusing existing instance - AppKit.ts:createAppKit');
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
return globalWithAppKit[APPKIT_INSTANCE_KEY]!;
|
|
882
|
+
} catch (error) {
|
|
883
|
+
if (__DEV__) {
|
|
884
|
+
// using console.error to avoid possible issues with LogController not being initialized
|
|
885
|
+
//eslint-disable-next-line no-console
|
|
886
|
+
console.error('AppKit: Failed to create instance - AppKit.ts:createAppKit', error);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
throw error;
|
|
890
|
+
}
|
|
798
891
|
}
|
package/src/hooks/useAppKit.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'react';
|
|
2
|
+
import type { ChainNamespace } from '@reown/appkit-common-react-native';
|
|
2
3
|
|
|
3
4
|
import type { AppKit } from '../AppKit';
|
|
4
5
|
import { AppKitContext } from '../AppKitContext';
|
|
@@ -6,7 +7,7 @@ import { AppKitContext } from '../AppKitContext';
|
|
|
6
7
|
interface UseAppKitReturn {
|
|
7
8
|
open: AppKit['open'];
|
|
8
9
|
close: AppKit['close'];
|
|
9
|
-
disconnect: (namespace?:
|
|
10
|
+
disconnect: (namespace?: ChainNamespace) => void;
|
|
10
11
|
switchNetwork: AppKit['switchNetwork'];
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -30,7 +31,7 @@ export const useAppKit = (): UseAppKitReturn => {
|
|
|
30
31
|
return {
|
|
31
32
|
open: context.appKit.open.bind(context.appKit),
|
|
32
33
|
close: context.appKit.close.bind(context.appKit),
|
|
33
|
-
disconnect: (namespace?:
|
|
34
|
+
disconnect: (namespace?: ChainNamespace) =>
|
|
34
35
|
context.appKit!.disconnect.bind(context.appKit!)(namespace),
|
|
35
36
|
switchNetwork: context.appKit.switchNetwork.bind(context.appKit)
|
|
36
37
|
};
|
|
@@ -21,7 +21,7 @@ export function AccountWalletFeatures() {
|
|
|
21
21
|
const { features, isOnRampEnabled } = useSnapshot(OptionsController.state);
|
|
22
22
|
const { activeNetwork, balances, activeNamespace } = useSnapshot(ConnectionsController.state);
|
|
23
23
|
const balance = CoreHelperUtil.calculateAndFormatBalance(balances as BalanceType[]);
|
|
24
|
-
const network = ConnectionsController.state.activeNetwork?.caipNetworkId
|
|
24
|
+
const network = ConnectionsController.state.activeNetwork?.caipNetworkId;
|
|
25
25
|
const isSmartAccount = ConnectionsController.state.accountType === 'smartAccount';
|
|
26
26
|
const showSend =
|
|
27
27
|
activeNamespace && ConstantsUtil.SEND_SUPPORTED_NAMESPACES.includes(activeNamespace);
|