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

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 (116) hide show
  1. package/lib/commonjs/controllers/ApiController.js +19 -8
  2. package/lib/commonjs/controllers/ApiController.js.map +1 -1
  3. package/lib/commonjs/controllers/BlockchainApiController.js +31 -28
  4. package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
  5. package/lib/commonjs/controllers/ConnectionsController.js +10 -0
  6. package/lib/commonjs/controllers/ConnectionsController.js.map +1 -1
  7. package/lib/commonjs/controllers/EnsController.js +2 -0
  8. package/lib/commonjs/controllers/EnsController.js.map +1 -1
  9. package/lib/commonjs/controllers/EventsController.js +51 -1
  10. package/lib/commonjs/controllers/EventsController.js.map +1 -1
  11. package/lib/commonjs/controllers/LogController.js +188 -0
  12. package/lib/commonjs/controllers/LogController.js.map +1 -0
  13. package/lib/commonjs/controllers/OnRampController.js +14 -0
  14. package/lib/commonjs/controllers/OnRampController.js.map +1 -1
  15. package/lib/commonjs/controllers/SendController.js +4 -2
  16. package/lib/commonjs/controllers/SendController.js.map +1 -1
  17. package/lib/commonjs/controllers/SwapController.js +10 -2
  18. package/lib/commonjs/controllers/SwapController.js.map +1 -1
  19. package/lib/commonjs/controllers/TransactionsController.js +2 -0
  20. package/lib/commonjs/controllers/TransactionsController.js.map +1 -1
  21. package/lib/commonjs/features/reown-authentication/ReownAuthentication.js +14 -6
  22. package/lib/commonjs/features/reown-authentication/ReownAuthentication.js.map +1 -1
  23. package/lib/commonjs/index.js +14 -0
  24. package/lib/commonjs/index.js.map +1 -1
  25. package/lib/commonjs/utils/ApiUtil.js +1 -1
  26. package/lib/commonjs/utils/ApiUtil.js.map +1 -1
  27. package/lib/commonjs/utils/ConstantsUtil.js +0 -1
  28. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  29. package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
  30. package/lib/commonjs/utils/FetchUtil.js +7 -2
  31. package/lib/commonjs/utils/FetchUtil.js.map +1 -1
  32. package/lib/commonjs/utils/LogUtils.js +131 -0
  33. package/lib/commonjs/utils/LogUtils.js.map +1 -0
  34. package/lib/commonjs/utils/StorageUtil.js +48 -49
  35. package/lib/commonjs/utils/StorageUtil.js.map +1 -1
  36. package/lib/module/controllers/ApiController.js +19 -8
  37. package/lib/module/controllers/ApiController.js.map +1 -1
  38. package/lib/module/controllers/BlockchainApiController.js +31 -28
  39. package/lib/module/controllers/BlockchainApiController.js.map +1 -1
  40. package/lib/module/controllers/ConnectionsController.js +10 -0
  41. package/lib/module/controllers/ConnectionsController.js.map +1 -1
  42. package/lib/module/controllers/EnsController.js +2 -0
  43. package/lib/module/controllers/EnsController.js.map +1 -1
  44. package/lib/module/controllers/EventsController.js +51 -1
  45. package/lib/module/controllers/EventsController.js.map +1 -1
  46. package/lib/module/controllers/LogController.js +185 -0
  47. package/lib/module/controllers/LogController.js.map +1 -0
  48. package/lib/module/controllers/OnRampController.js +14 -0
  49. package/lib/module/controllers/OnRampController.js.map +1 -1
  50. package/lib/module/controllers/SendController.js +4 -2
  51. package/lib/module/controllers/SendController.js.map +1 -1
  52. package/lib/module/controllers/SwapController.js +10 -2
  53. package/lib/module/controllers/SwapController.js.map +1 -1
  54. package/lib/module/controllers/TransactionsController.js +2 -0
  55. package/lib/module/controllers/TransactionsController.js.map +1 -1
  56. package/lib/module/features/reown-authentication/ReownAuthentication.js +14 -6
  57. package/lib/module/features/reown-authentication/ReownAuthentication.js.map +1 -1
  58. package/lib/module/index.js +2 -0
  59. package/lib/module/index.js.map +1 -1
  60. package/lib/module/utils/ApiUtil.js +1 -1
  61. package/lib/module/utils/ApiUtil.js.map +1 -1
  62. package/lib/module/utils/ConstantsUtil.js +0 -1
  63. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  64. package/lib/module/utils/CoreHelperUtil.js.map +1 -1
  65. package/lib/module/utils/FetchUtil.js +8 -2
  66. package/lib/module/utils/FetchUtil.js.map +1 -1
  67. package/lib/module/utils/LogUtils.js +121 -0
  68. package/lib/module/utils/LogUtils.js.map +1 -0
  69. package/lib/module/utils/StorageUtil.js +48 -49
  70. package/lib/module/utils/StorageUtil.js.map +1 -1
  71. package/lib/typescript/controllers/ApiController.d.ts +6 -4
  72. package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
  73. package/lib/typescript/controllers/BlockchainApiController.d.ts.map +1 -1
  74. package/lib/typescript/controllers/ConnectionsController.d.ts +1 -0
  75. package/lib/typescript/controllers/ConnectionsController.d.ts.map +1 -1
  76. package/lib/typescript/controllers/EnsController.d.ts.map +1 -1
  77. package/lib/typescript/controllers/EventsController.d.ts +13 -1
  78. package/lib/typescript/controllers/EventsController.d.ts.map +1 -1
  79. package/lib/typescript/controllers/LogController.d.ts +65 -0
  80. package/lib/typescript/controllers/LogController.d.ts.map +1 -0
  81. package/lib/typescript/controllers/OnRampController.d.ts.map +1 -1
  82. package/lib/typescript/controllers/SendController.d.ts.map +1 -1
  83. package/lib/typescript/controllers/SwapController.d.ts.map +1 -1
  84. package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -1
  85. package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts.map +1 -1
  86. package/lib/typescript/index.d.ts +2 -0
  87. package/lib/typescript/index.d.ts.map +1 -1
  88. package/lib/typescript/utils/ApiUtil.d.ts +1 -1
  89. package/lib/typescript/utils/ConstantsUtil.d.ts +0 -1
  90. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  91. package/lib/typescript/utils/CoreHelperUtil.d.ts +1 -1
  92. package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
  93. package/lib/typescript/utils/FetchUtil.d.ts +1 -1
  94. package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
  95. package/lib/typescript/utils/LogUtils.d.ts +15 -0
  96. package/lib/typescript/utils/LogUtils.d.ts.map +1 -0
  97. package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
  98. package/package.json +2 -2
  99. package/src/controllers/ApiController.ts +28 -8
  100. package/src/controllers/BlockchainApiController.ts +39 -29
  101. package/src/controllers/ConnectionsController.ts +14 -0
  102. package/src/controllers/EnsController.ts +2 -0
  103. package/src/controllers/EventsController.ts +73 -2
  104. package/src/controllers/LogController.ts +250 -0
  105. package/src/controllers/OnRampController.ts +12 -0
  106. package/src/controllers/SendController.ts +7 -2
  107. package/src/controllers/SwapController.ts +10 -2
  108. package/src/controllers/TransactionsController.ts +2 -0
  109. package/src/features/reown-authentication/ReownAuthentication.ts +11 -6
  110. package/src/index.ts +8 -0
  111. package/src/utils/ApiUtil.ts +1 -1
  112. package/src/utils/ConstantsUtil.ts +0 -1
  113. package/src/utils/CoreHelperUtil.ts +1 -1
  114. package/src/utils/FetchUtil.ts +11 -2
  115. package/src/utils/LogUtils.ts +179 -0
  116. package/src/utils/StorageUtil.ts +48 -49
@@ -1,4 +1,5 @@
1
1
  import type { RequestCache } from '@reown/appkit-common-react-native';
2
+ import { LogController } from '../controllers/LogController';
2
3
 
3
4
  // -- Types ----------------------------------------------------------------------
4
5
  interface Options {
@@ -71,9 +72,13 @@ export class FetchUtil {
71
72
  return this.processResponse<T>(response);
72
73
  }
73
74
 
74
- public async fetchImage(path: string, headers?: Record<string, string>) {
75
+ public async fetchImage(
76
+ path: string,
77
+ headers?: Record<string, string>,
78
+ params?: Record<string, string>
79
+ ) {
75
80
  try {
76
- const url = this.createUrl({ path }).toString();
81
+ const url = this.createUrl({ path, params }).toString();
77
82
  const response = await fetch(url, { headers });
78
83
  const blob = await response.blob();
79
84
  const reader = new FileReader();
@@ -130,14 +135,18 @@ export class FetchUtil {
130
135
  if (response.headers.get('content-type')?.includes('application/json')) {
131
136
  try {
132
137
  const errorData = await response.json();
138
+ LogController.sendError(JSON.stringify(errorData), 'FetchUtil.ts', 'processResponse');
133
139
 
134
140
  return Promise.reject(errorData);
135
141
  } catch (jsonError) {
142
+ LogController.sendError(jsonError, 'FetchUtil.ts', 'processResponse');
143
+
136
144
  return Promise.reject(`Code: ${response.status} - ${response.statusText}`);
137
145
  }
138
146
  }
139
147
 
140
148
  const errorText = await response.text();
149
+ LogController.sendError(errorText, 'FetchUtil.ts', 'processResponse');
141
150
 
142
151
  return Promise.reject(`Code: ${response.status} - ${response.statusText} - ${errorText}`);
143
152
  }
@@ -0,0 +1,179 @@
1
+ // -- Constants ----------------------------------------- //
2
+ const SENSITIVE_KEYS = [
3
+ 'password',
4
+ 'pass',
5
+ 'pwd',
6
+ 'secret',
7
+ 'token',
8
+ 'key',
9
+ 'auth',
10
+ 'authorization',
11
+ 'bearer',
12
+ 'credential',
13
+ 'api_key',
14
+ 'apikey',
15
+ 'access_token',
16
+ 'refresh_token',
17
+ 'private_key',
18
+ 'privatekey',
19
+ 'mnemonic',
20
+ 'seed',
21
+ 'phrase',
22
+ 'wallet',
23
+ 'address',
24
+ 'email',
25
+ 'phone',
26
+ 'ssn',
27
+ 'social',
28
+ 'credit',
29
+ 'card',
30
+ 'cvv',
31
+ 'connection_string',
32
+ 'connection',
33
+ 'user_token'
34
+ ];
35
+
36
+ const MAX_STRING_LENGTH = 480; // Maximum length for any string value (account for potential replacements)
37
+ const MAX_STACK_LINES = 10; // Maximum lines in stack trace
38
+
39
+ // -- Data Sanitization Functions ---------------------- //
40
+ export const sanitizeString = (value: string): string => {
41
+ if (typeof value !== 'string') {
42
+ value = String(value);
43
+ }
44
+
45
+ if (value.length > MAX_STRING_LENGTH) {
46
+ return value.substring(0, MAX_STRING_LENGTH) + '... [truncated]';
47
+ }
48
+
49
+ return value;
50
+ };
51
+
52
+ export const sanitizeStackTrace = (stack: string): string => {
53
+ if (typeof stack !== 'string') {
54
+ stack = String(stack);
55
+ }
56
+
57
+ const lines = stack.split('\n');
58
+ const sanitizedLines = lines.slice(0, MAX_STACK_LINES).map(line => {
59
+ // Remove file paths that might contain sensitive info
60
+ return line.replace(/\/[^\s]*\//g, '/[path]/');
61
+ });
62
+
63
+ if (lines.length > MAX_STACK_LINES) {
64
+ sanitizedLines.push('... [stack trace truncated]');
65
+ }
66
+
67
+ return sanitizedLines.join('\n');
68
+ };
69
+
70
+ export const sanitizeUrl = (url: string): string => {
71
+ try {
72
+ const urlObj = new URL(url);
73
+ // Remove query parameters that might contain sensitive data
74
+ urlObj.search = '';
75
+ // Keep only the origin and pathname
76
+
77
+ return urlObj.origin + urlObj.pathname;
78
+ } catch {
79
+ // If URL parsing fails, just return sanitized string
80
+
81
+ return sanitizeString(url);
82
+ }
83
+ };
84
+
85
+ const isSensitiveKey = (key: string): boolean => {
86
+ const lowerKey = key.toLowerCase();
87
+
88
+ return SENSITIVE_KEYS.some(sensitiveKey => lowerKey.includes(sensitiveKey));
89
+ };
90
+
91
+ export const sanitizeValue = (value: unknown, visited = new WeakSet()): unknown => {
92
+ if (value === null || value === undefined) {
93
+ return value;
94
+ }
95
+
96
+ if (typeof value === 'string') {
97
+ // Check if it looks like a URL
98
+ if (value.startsWith('http://') || value.startsWith('https://')) {
99
+ return sanitizeUrl(value);
100
+ }
101
+
102
+ return sanitizeString(value);
103
+ }
104
+
105
+ if (typeof value === 'number' || typeof value === 'boolean') {
106
+ return value;
107
+ }
108
+
109
+ if (Array.isArray(value)) {
110
+ // Prevent circular references in arrays
111
+ if (visited.has(value)) {
112
+ return '[Circular Reference]';
113
+ }
114
+
115
+ visited.add(value);
116
+ const result = value.slice(0, 10).map(item => sanitizeValue(item, visited));
117
+ visited.delete(value);
118
+
119
+ return result;
120
+ }
121
+
122
+ if (typeof value === 'object') {
123
+ return sanitizeObject(value as Record<string, unknown>, visited);
124
+ }
125
+
126
+ // For other types, convert to string and sanitize
127
+ return sanitizeString(String(value));
128
+ };
129
+
130
+ export const sanitizeObject = (
131
+ obj: Record<string, unknown>,
132
+ visited = new WeakSet()
133
+ ): Record<string, unknown> => {
134
+ // Prevent circular references
135
+ if (visited.has(obj)) {
136
+ return { '[Circular Reference]': true };
137
+ }
138
+
139
+ visited.add(obj);
140
+
141
+ const sanitized: Record<string, unknown> = {};
142
+ const keys = Object.keys(obj).slice(0, 20); // Limit number of keys
143
+
144
+ for (const key of keys) {
145
+ if (isSensitiveKey(key)) {
146
+ sanitized[key] = '[REDACTED]';
147
+ } else {
148
+ sanitized[key] = sanitizeValue(obj[key], visited);
149
+ }
150
+ }
151
+
152
+ if (Object.keys(obj).length > 20) {
153
+ sanitized['...'] = '[additional properties truncated]';
154
+ }
155
+
156
+ visited.delete(obj);
157
+
158
+ return sanitized;
159
+ };
160
+
161
+ export const sanitizeData = (
162
+ data?: Record<string, unknown>
163
+ ): Record<string, unknown> | undefined => {
164
+ if (!data) {
165
+ return undefined;
166
+ }
167
+
168
+ return sanitizeObject(data);
169
+ };
170
+
171
+ // -- Utility Functions --------------------------------- //
172
+ export const LogUtils = {
173
+ sanitizeString,
174
+ sanitizeStackTrace,
175
+ sanitizeUrl,
176
+ sanitizeValue,
177
+ sanitizeObject,
178
+ sanitizeData
179
+ };
@@ -13,6 +13,7 @@ import {
13
13
  SafeStorageKeys
14
14
  } from '@reown/appkit-common-react-native';
15
15
  import { OptionsController } from '../controllers/OptionsController';
16
+ import { LogController } from '../controllers/LogController';
16
17
 
17
18
  // -- Utility -----------------------------------------------------------------
18
19
  export const StorageUtil = {
@@ -22,8 +23,8 @@ export const StorageUtil = {
22
23
  href,
23
24
  name
24
25
  });
25
- } catch {
26
- console.info('Unable to set WalletConnect deep link');
26
+ } catch (error) {
27
+ LogController.sendError(error, 'StorageUtil.ts', 'setWalletConnectDeepLink');
27
28
  }
28
29
  },
29
30
 
@@ -35,8 +36,8 @@ export const StorageUtil = {
35
36
  if (deepLink) {
36
37
  return deepLink;
37
38
  }
38
- } catch {
39
- console.info('Unable to get WalletConnect deep link');
39
+ } catch (error) {
40
+ LogController.sendError(error, 'StorageUtil.ts', 'getWalletConnectDeepLink');
40
41
  }
41
42
 
42
43
  return undefined;
@@ -45,8 +46,8 @@ export const StorageUtil = {
45
46
  async removeWalletConnectDeepLink() {
46
47
  try {
47
48
  await OptionsController.getStorage().removeItem(SafeStorageKeys.WC_DEEPLINK);
48
- } catch {
49
- console.info('Unable to remove WalletConnect deep link');
49
+ } catch (error) {
50
+ LogController.sendError(error, 'StorageUtil.ts', 'removeWalletConnectDeepLink');
50
51
  }
51
52
  },
52
53
 
@@ -66,8 +67,8 @@ export const StorageUtil = {
66
67
  OptionsController.getStorage().setItem(SafeStorageKeys.RECENT_WALLET, recentWallets);
67
68
 
68
69
  return recentWallets;
69
- } catch {
70
- console.info('Unable to set recent wallet');
70
+ } catch (error) {
71
+ LogController.sendError(error, 'StorageUtil.ts', 'addRecentWallet');
71
72
 
72
73
  return undefined;
73
74
  }
@@ -76,8 +77,8 @@ export const StorageUtil = {
76
77
  async setRecentWallets(wallets: WcWallet[]) {
77
78
  try {
78
79
  await OptionsController.getStorage().setItem(SafeStorageKeys.RECENT_WALLET, wallets);
79
- } catch {
80
- console.info('Unable to set recent wallets');
80
+ } catch (error) {
81
+ LogController.sendError(error, 'StorageUtil.ts', 'setRecentWallets');
81
82
  }
82
83
  },
83
84
 
@@ -86,8 +87,8 @@ export const StorageUtil = {
86
87
  const recent = await OptionsController.getStorage().getItem(SafeStorageKeys.RECENT_WALLET);
87
88
 
88
89
  return recent ?? [];
89
- } catch {
90
- console.info('Unable to get recent wallets');
90
+ } catch (error) {
91
+ LogController.sendError(error, 'StorageUtil.ts', 'getRecentWallets');
91
92
  }
92
93
 
93
94
  return [];
@@ -110,8 +111,8 @@ export const StorageUtil = {
110
111
  updatedConnectors
111
112
  );
112
113
  }
113
- } catch {
114
- console.info('Unable to set Connected Connector');
114
+ } catch (error) {
115
+ LogController.sendError(error, 'StorageUtil.ts', 'setConnectedConnectors');
115
116
  }
116
117
  },
117
118
 
@@ -123,7 +124,7 @@ export const StorageUtil = {
123
124
 
124
125
  return connectors ?? [];
125
126
  } catch (err) {
126
- console.info('Unable to get Connected Connector');
127
+ LogController.sendError(err, 'StorageUtil.ts', 'getConnectedConnectors');
127
128
  }
128
129
 
129
130
  return [];
@@ -137,8 +138,8 @@ export const StorageUtil = {
137
138
  SafeStorageKeys.CONNECTED_CONNECTORS,
138
139
  updatedConnectors
139
140
  );
140
- } catch {
141
- console.info('Unable to remove Connected Connector');
141
+ } catch (error) {
142
+ LogController.sendError(error, 'StorageUtil.ts', 'removeConnectedConnectors');
142
143
  }
143
144
  },
144
145
 
@@ -148,8 +149,8 @@ export const StorageUtil = {
148
149
  SafeStorageKeys.ONRAMP_PREFERRED_COUNTRY,
149
150
  country
150
151
  );
151
- } catch {
152
- console.info('Unable to set OnRamp Preferred Country');
152
+ } catch (error) {
153
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampPreferredCountry');
153
154
  }
154
155
  },
155
156
 
@@ -173,8 +174,8 @@ export const StorageUtil = {
173
174
  SafeStorageKeys.ONRAMP_PREFERRED_FIAT_CURRENCY,
174
175
  currency
175
176
  );
176
- } catch {
177
- console.info('Unable to set OnRamp Preferred Fiat Currency');
177
+ } catch (error) {
178
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampPreferredFiatCurrency');
178
179
  }
179
180
  },
180
181
 
@@ -185,8 +186,8 @@ export const StorageUtil = {
185
186
  );
186
187
 
187
188
  return currency ?? undefined;
188
- } catch {
189
- console.info('Unable to get OnRamp Preferred Fiat Currency');
189
+ } catch (error) {
190
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampPreferredFiatCurrency');
190
191
  }
191
192
 
192
193
  return undefined;
@@ -195,8 +196,8 @@ export const StorageUtil = {
195
196
  async setOnRampCountries(countries: OnRampCountry[]) {
196
197
  try {
197
198
  await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_COUNTRIES, countries);
198
- } catch {
199
- console.info('Unable to set OnRamp Countries');
199
+ } catch (error) {
200
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampCountries');
200
201
  }
201
202
  },
202
203
 
@@ -207,8 +208,8 @@ export const StorageUtil = {
207
208
  );
208
209
 
209
210
  return countries ?? [];
210
- } catch {
211
- console.info('Unable to get OnRamp Countries');
211
+ } catch (error) {
212
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampCountries');
212
213
  }
213
214
 
214
215
  return [];
@@ -222,8 +223,8 @@ export const StorageUtil = {
222
223
  data: countriesDefaults,
223
224
  timestamp
224
225
  });
225
- } catch {
226
- console.info('Unable to set OnRamp Countries Defaults');
226
+ } catch (error) {
227
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampCountriesDefaults');
227
228
  }
228
229
  },
229
230
 
@@ -245,8 +246,8 @@ export const StorageUtil = {
245
246
  }
246
247
 
247
248
  return (data as OnRampCountryDefaults[]) ?? [];
248
- } catch {
249
- console.info('Unable to get OnRamp Countries Defaults');
249
+ } catch (error) {
250
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampCountriesDefaults');
250
251
  }
251
252
 
252
253
  return [];
@@ -260,8 +261,8 @@ export const StorageUtil = {
260
261
  data: serviceProviders,
261
262
  timestamp
262
263
  });
263
- } catch {
264
- console.info('Unable to set OnRamp Service Providers');
264
+ } catch (error) {
265
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampServiceProviders');
265
266
  }
266
267
  },
267
268
 
@@ -284,8 +285,7 @@ export const StorageUtil = {
284
285
 
285
286
  return (data as OnRampServiceProvider[]) ?? [];
286
287
  } catch (err) {
287
- console.error(err);
288
- console.info('Unable to get OnRamp Service Providers');
288
+ LogController.sendError(err, 'StorageUtil.ts', 'getOnRampServiceProviders');
289
289
  }
290
290
 
291
291
  return [];
@@ -299,8 +299,8 @@ export const StorageUtil = {
299
299
  data: fiatLimits,
300
300
  timestamp
301
301
  });
302
- } catch {
303
- console.info('Unable to set OnRamp Fiat Limits');
302
+ } catch (error) {
303
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampFiatLimits');
304
304
  }
305
305
  },
306
306
 
@@ -322,8 +322,8 @@ export const StorageUtil = {
322
322
  }
323
323
 
324
324
  return (data as OnRampFiatLimit[]) ?? [];
325
- } catch {
326
- console.info('Unable to get OnRamp Fiat Limits');
325
+ } catch (error) {
326
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampFiatLimits');
327
327
  }
328
328
 
329
329
  return [];
@@ -337,8 +337,8 @@ export const StorageUtil = {
337
337
  data: fiatCurrencies,
338
338
  timestamp
339
339
  });
340
- } catch {
341
- console.info('Unable to set OnRamp Fiat Currencies');
340
+ } catch (error) {
341
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampFiatCurrencies');
342
342
  }
343
343
  },
344
344
 
@@ -360,8 +360,8 @@ export const StorageUtil = {
360
360
  }
361
361
 
362
362
  return (data as OnRampFiatCurrency[]) ?? [];
363
- } catch {
364
- console.info('Unable to get OnRamp Fiat Currencies');
363
+ } catch (error) {
364
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampFiatCurrencies');
365
365
  }
366
366
 
367
367
  return [];
@@ -376,8 +376,8 @@ export const StorageUtil = {
376
376
  }
377
377
 
378
378
  await OptionsController.getStorage().setItem(SafeStorageKeys.ACTIVE_NAMESPACE, namespace);
379
- } catch {
380
- console.info('Unable to set Active Namespace');
379
+ } catch (error) {
380
+ LogController.sendError(error, 'StorageUtil.ts', 'setActiveNamespace');
381
381
  }
382
382
  },
383
383
 
@@ -389,8 +389,7 @@ export const StorageUtil = {
389
389
 
390
390
  return namespace ?? undefined;
391
391
  } catch (err) {
392
- console.error(err);
393
- console.info('Unable to get Active Namespace');
392
+ LogController.sendError(err, 'StorageUtil.ts', 'getActiveNamespace');
394
393
  }
395
394
 
396
395
  return undefined;
@@ -399,8 +398,8 @@ export const StorageUtil = {
399
398
  async removeActiveNamespace() {
400
399
  try {
401
400
  await OptionsController.getStorage().removeItem(SafeStorageKeys.ACTIVE_NAMESPACE);
402
- } catch {
403
- console.info('Unable to remove Active Namespace');
401
+ } catch (error) {
402
+ LogController.sendError(error, 'StorageUtil.ts', 'removeActiveNamespace');
404
403
  }
405
404
  }
406
405
  };