@reown/appkit-core-react-native 2.0.0-alpha.5 → 2.0.0-alpha.6

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.
Files changed (69) hide show
  1. package/lib/commonjs/controllers/ConnectionsController.js +3 -3
  2. package/lib/commonjs/controllers/ConnectionsController.js.map +1 -1
  3. package/lib/commonjs/controllers/OptionsController.js +6 -3
  4. package/lib/commonjs/controllers/OptionsController.js.map +1 -1
  5. package/lib/commonjs/controllers/SendController.js +15 -1
  6. package/lib/commonjs/controllers/SendController.js.map +1 -1
  7. package/lib/commonjs/features/reown-authentication/ReownAuthentication.js +264 -0
  8. package/lib/commonjs/features/reown-authentication/ReownAuthentication.js.map +1 -0
  9. package/lib/commonjs/features/reown-authentication/ReownAuthenticationMessenger.js +48 -0
  10. package/lib/commonjs/features/reown-authentication/ReownAuthenticationMessenger.js.map +1 -0
  11. package/lib/commonjs/features/reown-authentication/index.js +28 -0
  12. package/lib/commonjs/features/reown-authentication/index.js.map +1 -0
  13. package/lib/commonjs/index.js +14 -0
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/utils/CoreHelperUtil.js +13 -2
  16. package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
  17. package/lib/commonjs/utils/FetchUtil.js.map +1 -1
  18. package/lib/commonjs/utils/StorageUtil.js +27 -27
  19. package/lib/commonjs/utils/StorageUtil.js.map +1 -1
  20. package/lib/module/controllers/ConnectionsController.js +4 -4
  21. package/lib/module/controllers/ConnectionsController.js.map +1 -1
  22. package/lib/module/controllers/OptionsController.js +6 -3
  23. package/lib/module/controllers/OptionsController.js.map +1 -1
  24. package/lib/module/controllers/SendController.js +15 -1
  25. package/lib/module/controllers/SendController.js.map +1 -1
  26. package/lib/module/features/reown-authentication/ReownAuthentication.js +260 -0
  27. package/lib/module/features/reown-authentication/ReownAuthentication.js.map +1 -0
  28. package/lib/module/features/reown-authentication/ReownAuthenticationMessenger.js +43 -0
  29. package/lib/module/features/reown-authentication/ReownAuthenticationMessenger.js.map +1 -0
  30. package/lib/module/features/reown-authentication/index.js +5 -0
  31. package/lib/module/features/reown-authentication/index.js.map +1 -0
  32. package/lib/module/index.js +4 -0
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/utils/CoreHelperUtil.js +13 -2
  35. package/lib/module/utils/CoreHelperUtil.js.map +1 -1
  36. package/lib/module/utils/FetchUtil.js.map +1 -1
  37. package/lib/module/utils/StorageUtil.js +28 -28
  38. package/lib/module/utils/StorageUtil.js.map +1 -1
  39. package/lib/typescript/controllers/ConnectionsController.d.ts.map +1 -1
  40. package/lib/typescript/controllers/OptionsController.d.ts +3 -3
  41. package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
  42. package/lib/typescript/controllers/RouterController.d.ts +1 -1
  43. package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
  44. package/lib/typescript/controllers/SendController.d.ts.map +1 -1
  45. package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts +174 -0
  46. package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts.map +1 -0
  47. package/lib/typescript/features/reown-authentication/ReownAuthenticationMessenger.d.ts +16 -0
  48. package/lib/typescript/features/reown-authentication/ReownAuthenticationMessenger.d.ts.map +1 -0
  49. package/lib/typescript/features/reown-authentication/index.d.ts +3 -0
  50. package/lib/typescript/features/reown-authentication/index.d.ts.map +1 -0
  51. package/lib/typescript/index.d.ts +2 -0
  52. package/lib/typescript/index.d.ts.map +1 -1
  53. package/lib/typescript/utils/CoreHelperUtil.d.ts +2 -1
  54. package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
  55. package/lib/typescript/utils/FetchUtil.d.ts +1 -1
  56. package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
  57. package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
  58. package/package.json +3 -3
  59. package/src/controllers/ConnectionsController.ts +13 -3
  60. package/src/controllers/OptionsController.ts +11 -6
  61. package/src/controllers/RouterController.ts +3 -3
  62. package/src/controllers/SendController.ts +22 -2
  63. package/src/features/reown-authentication/ReownAuthentication.ts +470 -0
  64. package/src/features/reown-authentication/ReownAuthenticationMessenger.ts +80 -0
  65. package/src/features/reown-authentication/index.ts +2 -0
  66. package/src/index.ts +4 -0
  67. package/src/utils/CoreHelperUtil.ts +20 -2
  68. package/src/utils/FetchUtil.ts +1 -1
  69. package/src/utils/StorageUtil.ts +37 -53
@@ -0,0 +1,80 @@
1
+ import type { SIWXMessage, CaipNetworkId } from '@reown/appkit-common-react-native';
2
+ import { ConnectionsController } from '../../controllers/ConnectionsController';
3
+ import { OptionsController } from '../../controllers/OptionsController';
4
+ import { CoreHelperUtil } from '../../utils/CoreHelperUtil';
5
+
6
+ export class ReownAuthenticationMessenger {
7
+ public resources?: SIWXMessage['resources'];
8
+
9
+ protected getNonce: (params: SIWXMessage.Input) => Promise<SIWXMessage['nonce']>;
10
+
11
+ constructor(params: ReownAuthenticationMessenger.ConstructorParams) {
12
+ this.getNonce = params.getNonce;
13
+ }
14
+
15
+ async createMessage(input: SIWXMessage.Input): Promise<SIWXMessage> {
16
+ const metadata = OptionsController.state.metadata;
17
+ const domain = CoreHelperUtil.getBundleId();
18
+ const params = {
19
+ accountAddress: input.accountAddress,
20
+ chainId: input.chainId,
21
+ version: '1',
22
+ domain: domain ?? 'Unknown Domain',
23
+ uri: metadata?.redirect?.universal ?? metadata?.redirect?.native ?? 'Unknown URI',
24
+ resources: this.resources,
25
+ nonce: await this.getNonce(input),
26
+ issuedAt: this.stringifyDate(new Date()),
27
+ statement: undefined,
28
+ expirationTime: undefined,
29
+ notBefore: undefined
30
+ };
31
+
32
+ const methods = {
33
+ toString: () => this.stringify(params)
34
+ } satisfies SIWXMessage.Methods;
35
+
36
+ return Object.assign(params, methods);
37
+ }
38
+
39
+ private stringify(params: SIWXMessage.Data): string {
40
+ const networkName = this.getNetworkName(params.chainId);
41
+
42
+ return [
43
+ `${params.domain} wants you to sign in with your ${networkName} account:`,
44
+ params.accountAddress,
45
+ params.statement ? `\n${params.statement}\n` : '',
46
+ `URI: ${params.uri}`,
47
+ `Version: ${params.version}`,
48
+ `Chain ID: ${params.chainId}`,
49
+ `Nonce: ${params.nonce}`,
50
+ params.issuedAt && `Issued At: ${params.issuedAt}`,
51
+ params.expirationTime && `Expiration Time: ${params.expirationTime}`,
52
+ params.notBefore && `Not Before: ${params.notBefore}`,
53
+ params.requestId && `Request ID: ${params.requestId}`,
54
+ params.resources?.length &&
55
+ params.resources.reduce((acc, resource) => `${acc}\n- ${resource}`, 'Resources:')
56
+ ]
57
+ .filter(line => typeof line === 'string')
58
+ .join('\n')
59
+ .trim();
60
+ }
61
+
62
+ private getNetworkName(chainId: CaipNetworkId): string | undefined {
63
+ const requestedNetworks = ConnectionsController.state.networks;
64
+
65
+ return (
66
+ requestedNetworks.find(network => network.caipNetworkId === chainId)?.name ||
67
+ 'Unknown Network'
68
+ );
69
+ }
70
+
71
+ private stringifyDate(date: Date): string {
72
+ return date.toISOString();
73
+ }
74
+ }
75
+
76
+ export namespace ReownAuthenticationMessenger {
77
+ export interface ConstructorParams {
78
+ getNonce: (params: SIWXMessage.Input) => Promise<SIWXMessage['nonce']>;
79
+ }
80
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ReownAuthentication';
2
+ export * from './ReownAuthenticationMessenger';
package/src/index.ts CHANGED
@@ -55,4 +55,8 @@ export { StorageUtil } from './utils/StorageUtil';
55
55
  export { EventUtil } from './utils/EventUtil';
56
56
  export { WalletUtil } from './utils/WalletUtil';
57
57
 
58
+ // -- Features ----------------------------------------------------------------
59
+ export { ReownAuthentication } from './features/reown-authentication/ReownAuthentication';
60
+ export { ReownAuthenticationMessenger } from './features/reown-authentication/ReownAuthenticationMessenger';
61
+
58
62
  // Types are now exported from @reown/appkit-common-react-native
@@ -53,6 +53,20 @@ export const CoreHelperUtil = {
53
53
  return Date.now() - lastRetry >= ConstantsUtil.ONE_SEC_MS;
54
54
  },
55
55
 
56
+ isCaipAddress(address?: unknown): address is CaipAddress {
57
+ if (typeof address !== 'string') {
58
+ return false;
59
+ }
60
+
61
+ const sections = address.split(':');
62
+ const namespace = sections[0];
63
+
64
+ return (
65
+ sections.filter(Boolean).length === 3 &&
66
+ (namespace as string) in CommonConstants.CHAIN_NAME_MAP
67
+ );
68
+ },
69
+
56
70
  getPairingExpiry() {
57
71
  return Date.now() + ConstantsUtil.FOUR_MINUTES_MS;
58
72
  },
@@ -61,8 +75,12 @@ export const CoreHelperUtil = {
61
75
  return caipAddress?.split(':')[1];
62
76
  },
63
77
 
64
- getPlainAddress(caipAddress: CaipAddress | undefined) {
65
- return caipAddress?.split(':')[2];
78
+ getPlainAddress(address: CaipAddress | string | undefined) {
79
+ if (this.isCaipAddress(address)) {
80
+ return address?.split(':')[2];
81
+ }
82
+
83
+ return address;
66
84
  },
67
85
 
68
86
  async wait(milliseconds: number) {
@@ -87,7 +87,7 @@ export class FetchUtil {
87
87
  }
88
88
  }
89
89
 
90
- private createUrl({ path, params }: RequestArguments) {
90
+ public createUrl({ path, params }: RequestArguments) {
91
91
  let fullUrl: string;
92
92
 
93
93
  const isAbsoluteUrl = path.startsWith('http://') || path.startsWith('https://');
@@ -10,7 +10,7 @@ import {
10
10
  type ConnectorType,
11
11
  type ChainNamespace,
12
12
  type WalletDeepLink,
13
- ConstantsUtil
13
+ SafeStorageKeys
14
14
  } from '@reown/appkit-common-react-native';
15
15
  import { OptionsController } from '../controllers/OptionsController';
16
16
 
@@ -18,7 +18,7 @@ import { OptionsController } from '../controllers/OptionsController';
18
18
  export const StorageUtil = {
19
19
  setWalletConnectDeepLink({ href, name }: WalletDeepLink) {
20
20
  try {
21
- OptionsController.getStorage().setItem(ConstantsUtil.STORAGE_KEYS.WC_DEEPLINK, {
21
+ OptionsController.getStorage().setItem(SafeStorageKeys.WC_DEEPLINK, {
22
22
  href,
23
23
  name
24
24
  });
@@ -30,7 +30,7 @@ export const StorageUtil = {
30
30
  async getWalletConnectDeepLink() {
31
31
  try {
32
32
  const deepLink = await OptionsController.getStorage().getItem<WalletDeepLink>(
33
- ConstantsUtil.STORAGE_KEYS.WC_DEEPLINK
33
+ SafeStorageKeys.WC_DEEPLINK
34
34
  );
35
35
  if (deepLink) {
36
36
  return deepLink;
@@ -44,7 +44,7 @@ export const StorageUtil = {
44
44
 
45
45
  async removeWalletConnectDeepLink() {
46
46
  try {
47
- await OptionsController.getStorage().removeItem(ConstantsUtil.STORAGE_KEYS.WC_DEEPLINK);
47
+ await OptionsController.getStorage().removeItem(SafeStorageKeys.WC_DEEPLINK);
48
48
  } catch {
49
49
  console.info('Unable to remove WalletConnect deep link');
50
50
  }
@@ -63,10 +63,7 @@ export const StorageUtil = {
63
63
  if (recentWallets.length > 2) {
64
64
  recentWallets.pop();
65
65
  }
66
- OptionsController.getStorage().setItem(
67
- ConstantsUtil.STORAGE_KEYS.RECENT_WALLET,
68
- recentWallets
69
- );
66
+ OptionsController.getStorage().setItem(SafeStorageKeys.RECENT_WALLET, recentWallets);
70
67
 
71
68
  return recentWallets;
72
69
  } catch {
@@ -78,10 +75,7 @@ export const StorageUtil = {
78
75
 
79
76
  async setRecentWallets(wallets: WcWallet[]) {
80
77
  try {
81
- await OptionsController.getStorage().setItem(
82
- ConstantsUtil.STORAGE_KEYS.RECENT_WALLET,
83
- wallets
84
- );
78
+ await OptionsController.getStorage().setItem(SafeStorageKeys.RECENT_WALLET, wallets);
85
79
  } catch {
86
80
  console.info('Unable to set recent wallets');
87
81
  }
@@ -89,9 +83,7 @@ export const StorageUtil = {
89
83
 
90
84
  async getRecentWallets(): Promise<WcWallet[]> {
91
85
  try {
92
- const recent = await OptionsController.getStorage().getItem(
93
- ConstantsUtil.STORAGE_KEYS.RECENT_WALLET
94
- );
86
+ const recent = await OptionsController.getStorage().getItem(SafeStorageKeys.RECENT_WALLET);
95
87
 
96
88
  return recent ?? [];
97
89
  } catch {
@@ -114,7 +106,7 @@ export const StorageUtil = {
114
106
  if (!currentConnectors.some(c => c.type === type)) {
115
107
  const updatedConnectors = [...currentConnectors, { type, namespaces }];
116
108
  await OptionsController.getStorage().setItem(
117
- ConstantsUtil.STORAGE_KEYS.CONNECTED_CONNECTORS,
109
+ SafeStorageKeys.CONNECTED_CONNECTORS,
118
110
  updatedConnectors
119
111
  );
120
112
  }
@@ -127,7 +119,7 @@ export const StorageUtil = {
127
119
  try {
128
120
  const connectors = await OptionsController.getStorage().getItem<
129
121
  { type: ConnectorType; namespaces: string[] }[]
130
- >(ConstantsUtil.STORAGE_KEYS.CONNECTED_CONNECTORS);
122
+ >(SafeStorageKeys.CONNECTED_CONNECTORS);
131
123
 
132
124
  return connectors ?? [];
133
125
  } catch (err) {
@@ -142,7 +134,7 @@ export const StorageUtil = {
142
134
  const currentConnectors = await StorageUtil.getConnectedConnectors();
143
135
  const updatedConnectors = currentConnectors.filter(c => c.type !== type);
144
136
  await OptionsController.getStorage().setItem(
145
- ConstantsUtil.STORAGE_KEYS.CONNECTED_CONNECTORS,
137
+ SafeStorageKeys.CONNECTED_CONNECTORS,
146
138
  updatedConnectors
147
139
  );
148
140
  } catch {
@@ -153,7 +145,7 @@ export const StorageUtil = {
153
145
  async setOnRampPreferredCountry(country: OnRampCountry) {
154
146
  try {
155
147
  await OptionsController.getStorage().setItem(
156
- ConstantsUtil.STORAGE_KEYS.ONRAMP_PREFERRED_COUNTRY,
148
+ SafeStorageKeys.ONRAMP_PREFERRED_COUNTRY,
157
149
  country
158
150
  );
159
151
  } catch {
@@ -164,7 +156,7 @@ export const StorageUtil = {
164
156
  async getOnRampPreferredCountry() {
165
157
  try {
166
158
  const country = await OptionsController.getStorage().getItem<OnRampCountry>(
167
- ConstantsUtil.STORAGE_KEYS.ONRAMP_PREFERRED_COUNTRY
159
+ SafeStorageKeys.ONRAMP_PREFERRED_COUNTRY
168
160
  );
169
161
 
170
162
  return country ?? undefined;
@@ -178,7 +170,7 @@ export const StorageUtil = {
178
170
  async setOnRampPreferredFiatCurrency(currency: OnRampFiatCurrency) {
179
171
  try {
180
172
  await OptionsController.getStorage().setItem(
181
- ConstantsUtil.STORAGE_KEYS.ONRAMP_PREFERRED_FIAT_CURRENCY,
173
+ SafeStorageKeys.ONRAMP_PREFERRED_FIAT_CURRENCY,
182
174
  currency
183
175
  );
184
176
  } catch {
@@ -189,7 +181,7 @@ export const StorageUtil = {
189
181
  async getOnRampPreferredFiatCurrency() {
190
182
  try {
191
183
  const currency = await OptionsController.getStorage().getItem<OnRampFiatCurrency>(
192
- ConstantsUtil.STORAGE_KEYS.ONRAMP_PREFERRED_FIAT_CURRENCY
184
+ SafeStorageKeys.ONRAMP_PREFERRED_FIAT_CURRENCY
193
185
  );
194
186
 
195
187
  return currency ?? undefined;
@@ -202,10 +194,7 @@ export const StorageUtil = {
202
194
 
203
195
  async setOnRampCountries(countries: OnRampCountry[]) {
204
196
  try {
205
- await OptionsController.getStorage().setItem(
206
- ConstantsUtil.STORAGE_KEYS.ONRAMP_COUNTRIES,
207
- countries
208
- );
197
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_COUNTRIES, countries);
209
198
  } catch {
210
199
  console.info('Unable to set OnRamp Countries');
211
200
  }
@@ -214,7 +203,7 @@ export const StorageUtil = {
214
203
  async getOnRampCountries() {
215
204
  try {
216
205
  const countries = await OptionsController.getStorage().getItem<OnRampCountry[]>(
217
- ConstantsUtil.STORAGE_KEYS.ONRAMP_COUNTRIES
206
+ SafeStorageKeys.ONRAMP_COUNTRIES
218
207
  );
219
208
 
220
209
  return countries ?? [];
@@ -229,10 +218,10 @@ export const StorageUtil = {
229
218
  try {
230
219
  const timestamp = Date.now();
231
220
 
232
- await OptionsController.getStorage().setItem(
233
- ConstantsUtil.STORAGE_KEYS.ONRAMP_COUNTRIES_DEFAULTS,
234
- { data: countriesDefaults, timestamp }
235
- );
221
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_COUNTRIES_DEFAULTS, {
222
+ data: countriesDefaults,
223
+ timestamp
224
+ });
236
225
  } catch {
237
226
  console.info('Unable to set OnRamp Countries Defaults');
238
227
  }
@@ -241,7 +230,7 @@ export const StorageUtil = {
241
230
  async getOnRampCountriesDefaults() {
242
231
  try {
243
232
  const result = await OptionsController.getStorage().getItem(
244
- ConstantsUtil.STORAGE_KEYS.ONRAMP_COUNTRIES_DEFAULTS
233
+ SafeStorageKeys.ONRAMP_COUNTRIES_DEFAULTS
245
234
  );
246
235
 
247
236
  if (!result) {
@@ -267,10 +256,10 @@ export const StorageUtil = {
267
256
  try {
268
257
  const timestamp = Date.now();
269
258
 
270
- await OptionsController.getStorage().setItem(
271
- ConstantsUtil.STORAGE_KEYS.ONRAMP_SERVICE_PROVIDERS,
272
- { data: serviceProviders, timestamp }
273
- );
259
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_SERVICE_PROVIDERS, {
260
+ data: serviceProviders,
261
+ timestamp
262
+ });
274
263
  } catch {
275
264
  console.info('Unable to set OnRamp Service Providers');
276
265
  }
@@ -279,7 +268,7 @@ export const StorageUtil = {
279
268
  async getOnRampServiceProviders() {
280
269
  try {
281
270
  const result = await OptionsController.getStorage().getItem(
282
- ConstantsUtil.STORAGE_KEYS.ONRAMP_SERVICE_PROVIDERS
271
+ SafeStorageKeys.ONRAMP_SERVICE_PROVIDERS
283
272
  );
284
273
 
285
274
  if (!result) {
@@ -306,7 +295,7 @@ export const StorageUtil = {
306
295
  try {
307
296
  const timestamp = Date.now();
308
297
 
309
- await OptionsController.getStorage().setItem(ConstantsUtil.STORAGE_KEYS.ONRAMP_FIAT_LIMITS, {
298
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_FIAT_LIMITS, {
310
299
  data: fiatLimits,
311
300
  timestamp
312
301
  });
@@ -318,7 +307,7 @@ export const StorageUtil = {
318
307
  async getOnRampFiatLimits() {
319
308
  try {
320
309
  const result = await OptionsController.getStorage().getItem(
321
- ConstantsUtil.STORAGE_KEYS.ONRAMP_FIAT_LIMITS
310
+ SafeStorageKeys.ONRAMP_FIAT_LIMITS
322
311
  );
323
312
 
324
313
  if (!result) {
@@ -344,10 +333,10 @@ export const StorageUtil = {
344
333
  try {
345
334
  const timestamp = Date.now();
346
335
 
347
- await OptionsController.getStorage().setItem(
348
- ConstantsUtil.STORAGE_KEYS.ONRAMP_FIAT_CURRENCIES,
349
- { data: fiatCurrencies, timestamp }
350
- );
336
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_FIAT_CURRENCIES, {
337
+ data: fiatCurrencies,
338
+ timestamp
339
+ });
351
340
  } catch {
352
341
  console.info('Unable to set OnRamp Fiat Currencies');
353
342
  }
@@ -356,7 +345,7 @@ export const StorageUtil = {
356
345
  async getOnRampFiatCurrencies() {
357
346
  try {
358
347
  const result = await OptionsController.getStorage().getItem(
359
- ConstantsUtil.STORAGE_KEYS.ONRAMP_FIAT_CURRENCIES
348
+ SafeStorageKeys.ONRAMP_FIAT_CURRENCIES
360
349
  );
361
350
 
362
351
  if (!result) {
@@ -381,17 +370,12 @@ export const StorageUtil = {
381
370
  async setActiveNamespace(namespace?: ChainNamespace) {
382
371
  try {
383
372
  if (!namespace) {
384
- await OptionsController.getStorage().removeItem(
385
- ConstantsUtil.STORAGE_KEYS.ACTIVE_NAMESPACE
386
- );
373
+ await OptionsController.getStorage().removeItem(SafeStorageKeys.ACTIVE_NAMESPACE);
387
374
 
388
375
  return;
389
376
  }
390
377
 
391
- await OptionsController.getStorage().setItem(
392
- ConstantsUtil.STORAGE_KEYS.ACTIVE_NAMESPACE,
393
- namespace
394
- );
378
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ACTIVE_NAMESPACE, namespace);
395
379
  } catch {
396
380
  console.info('Unable to set Active Namespace');
397
381
  }
@@ -400,7 +384,7 @@ export const StorageUtil = {
400
384
  async getActiveNamespace() {
401
385
  try {
402
386
  const namespace = (await OptionsController.getStorage().getItem(
403
- ConstantsUtil.STORAGE_KEYS.ACTIVE_NAMESPACE
387
+ SafeStorageKeys.ACTIVE_NAMESPACE
404
388
  )) as ChainNamespace;
405
389
 
406
390
  return namespace ?? undefined;
@@ -414,7 +398,7 @@ export const StorageUtil = {
414
398
 
415
399
  async removeActiveNamespace() {
416
400
  try {
417
- await OptionsController.getStorage().removeItem(ConstantsUtil.STORAGE_KEYS.ACTIVE_NAMESPACE);
401
+ await OptionsController.getStorage().removeItem(SafeStorageKeys.ACTIVE_NAMESPACE);
418
402
  } catch {
419
403
  console.info('Unable to remove Active Namespace');
420
404
  }