@reown/appkit-core-react-native 2.0.0 → 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 (282) hide show
  1. package/lib/commonjs/controllers/ApiController.js +148 -82
  2. package/lib/commonjs/controllers/ApiController.js.map +1 -1
  3. package/lib/commonjs/controllers/AssetController.js +0 -4
  4. package/lib/commonjs/controllers/AssetController.js.map +1 -1
  5. package/lib/commonjs/controllers/BlockchainApiController.js +127 -134
  6. package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
  7. package/lib/commonjs/controllers/ConnectionsController.js +280 -60
  8. package/lib/commonjs/controllers/ConnectionsController.js.map +1 -1
  9. package/lib/commonjs/controllers/EnsController.js +6 -4
  10. package/lib/commonjs/controllers/EnsController.js.map +1 -1
  11. package/lib/commonjs/controllers/EventsController.js +55 -5
  12. package/lib/commonjs/controllers/EventsController.js.map +1 -1
  13. package/lib/commonjs/controllers/LogController.js +188 -0
  14. package/lib/commonjs/controllers/LogController.js.map +1 -0
  15. package/lib/commonjs/controllers/ModalController.js +9 -7
  16. package/lib/commonjs/controllers/ModalController.js.map +1 -1
  17. package/lib/commonjs/controllers/OnRampController.js +134 -53
  18. package/lib/commonjs/controllers/OnRampController.js.map +1 -1
  19. package/lib/commonjs/controllers/OptionsController.js +20 -7
  20. package/lib/commonjs/controllers/OptionsController.js.map +1 -1
  21. package/lib/commonjs/controllers/PublicStateController.js.map +1 -1
  22. package/lib/commonjs/controllers/RouterController.js +7 -22
  23. package/lib/commonjs/controllers/RouterController.js.map +1 -1
  24. package/lib/commonjs/controllers/SendController.js +115 -99
  25. package/lib/commonjs/controllers/SendController.js.map +1 -1
  26. package/lib/commonjs/controllers/SnackController.js +29 -5
  27. package/lib/commonjs/controllers/SnackController.js.map +1 -1
  28. package/lib/commonjs/controllers/SwapController.js +119 -119
  29. package/lib/commonjs/controllers/SwapController.js.map +1 -1
  30. package/lib/commonjs/controllers/ThemeController.js +5 -0
  31. package/lib/commonjs/controllers/ThemeController.js.map +1 -1
  32. package/lib/commonjs/controllers/TransactionsController.js +25 -19
  33. package/lib/commonjs/controllers/TransactionsController.js.map +1 -1
  34. package/lib/commonjs/controllers/WcController.js +73 -0
  35. package/lib/commonjs/controllers/WcController.js.map +1 -0
  36. package/lib/commonjs/features/reown-authentication/ReownAuthentication.js +272 -0
  37. package/lib/commonjs/features/reown-authentication/ReownAuthentication.js.map +1 -0
  38. package/lib/commonjs/features/reown-authentication/ReownAuthenticationMessenger.js +48 -0
  39. package/lib/commonjs/features/reown-authentication/ReownAuthenticationMessenger.js.map +1 -0
  40. package/lib/commonjs/features/reown-authentication/index.js +28 -0
  41. package/lib/commonjs/features/reown-authentication/index.js.map +1 -0
  42. package/lib/commonjs/index.js +30 -37
  43. package/lib/commonjs/index.js.map +1 -1
  44. package/lib/commonjs/package.json +1 -0
  45. package/lib/commonjs/utils/ApiUtil.js +1 -1
  46. package/lib/commonjs/utils/ApiUtil.js.map +1 -1
  47. package/lib/commonjs/utils/AssetUtil.js +8 -17
  48. package/lib/commonjs/utils/AssetUtil.js.map +1 -1
  49. package/lib/commonjs/utils/ConstantsUtil.js +14 -431
  50. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  51. package/lib/commonjs/utils/CoreHelperUtil.js +33 -10
  52. package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
  53. package/lib/commonjs/utils/EventUtil.js.map +1 -1
  54. package/lib/commonjs/utils/FetchUtil.js +41 -12
  55. package/lib/commonjs/utils/FetchUtil.js.map +1 -1
  56. package/lib/commonjs/utils/LogUtils.js +131 -0
  57. package/lib/commonjs/utils/LogUtils.js.map +1 -0
  58. package/lib/commonjs/utils/StorageUtil.js +119 -172
  59. package/lib/commonjs/utils/StorageUtil.js.map +1 -1
  60. package/lib/commonjs/utils/SwapApiUtil.js +2 -17
  61. package/lib/commonjs/utils/SwapApiUtil.js.map +1 -1
  62. package/lib/commonjs/utils/SwapCalculationUtil.js.map +1 -1
  63. package/lib/commonjs/utils/WalletUtil.js +23 -0
  64. package/lib/commonjs/utils/WalletUtil.js.map +1 -0
  65. package/lib/module/controllers/ApiController.js +150 -82
  66. package/lib/module/controllers/ApiController.js.map +1 -1
  67. package/lib/module/controllers/AssetController.js +2 -4
  68. package/lib/module/controllers/AssetController.js.map +1 -1
  69. package/lib/module/controllers/BlockchainApiController.js +128 -133
  70. package/lib/module/controllers/BlockchainApiController.js.map +1 -1
  71. package/lib/module/controllers/ConnectionsController.js +282 -60
  72. package/lib/module/controllers/ConnectionsController.js.map +1 -1
  73. package/lib/module/controllers/EnsController.js +6 -2
  74. package/lib/module/controllers/EnsController.js.map +1 -1
  75. package/lib/module/controllers/EventsController.js +54 -2
  76. package/lib/module/controllers/EventsController.js.map +1 -1
  77. package/lib/module/controllers/LogController.js +185 -0
  78. package/lib/module/controllers/LogController.js.map +1 -0
  79. package/lib/module/controllers/ModalController.js +11 -7
  80. package/lib/module/controllers/ModalController.js.map +1 -1
  81. package/lib/module/controllers/OnRampController.js +135 -52
  82. package/lib/module/controllers/OnRampController.js.map +1 -1
  83. package/lib/module/controllers/OptionsController.js +22 -7
  84. package/lib/module/controllers/OptionsController.js.map +1 -1
  85. package/lib/module/controllers/PublicStateController.js +2 -0
  86. package/lib/module/controllers/PublicStateController.js.map +1 -1
  87. package/lib/module/controllers/RouterController.js +9 -22
  88. package/lib/module/controllers/RouterController.js.map +1 -1
  89. package/lib/module/controllers/SendController.js +114 -96
  90. package/lib/module/controllers/SendController.js.map +1 -1
  91. package/lib/module/controllers/SnackController.js +31 -5
  92. package/lib/module/controllers/SnackController.js.map +1 -1
  93. package/lib/module/controllers/SwapController.js +121 -119
  94. package/lib/module/controllers/SwapController.js.map +1 -1
  95. package/lib/module/controllers/ThemeController.js +7 -0
  96. package/lib/module/controllers/ThemeController.js.map +1 -1
  97. package/lib/module/controllers/TransactionsController.js +25 -17
  98. package/lib/module/controllers/TransactionsController.js.map +1 -1
  99. package/lib/module/controllers/WcController.js +70 -0
  100. package/lib/module/controllers/WcController.js.map +1 -0
  101. package/lib/module/features/reown-authentication/ReownAuthentication.js +268 -0
  102. package/lib/module/features/reown-authentication/ReownAuthentication.js.map +1 -0
  103. package/lib/module/features/reown-authentication/ReownAuthenticationMessenger.js +43 -0
  104. package/lib/module/features/reown-authentication/ReownAuthenticationMessenger.js.map +1 -0
  105. package/lib/module/features/reown-authentication/index.js +5 -0
  106. package/lib/module/features/reown-authentication/index.js.map +1 -0
  107. package/lib/module/index.js +12 -7
  108. package/lib/module/index.js.map +1 -1
  109. package/lib/module/utils/ApiUtil.js +3 -1
  110. package/lib/module/utils/ApiUtil.js.map +1 -1
  111. package/lib/module/utils/AssetUtil.js +10 -17
  112. package/lib/module/utils/AssetUtil.js.map +1 -1
  113. package/lib/module/utils/ConstantsUtil.js +16 -431
  114. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  115. package/lib/module/utils/CoreHelperUtil.js +35 -8
  116. package/lib/module/utils/CoreHelperUtil.js.map +1 -1
  117. package/lib/module/utils/EventUtil.js +2 -0
  118. package/lib/module/utils/EventUtil.js.map +1 -1
  119. package/lib/module/utils/FetchUtil.js +44 -12
  120. package/lib/module/utils/FetchUtil.js.map +1 -1
  121. package/lib/module/utils/LogUtils.js +121 -0
  122. package/lib/module/utils/LogUtils.js.map +1 -0
  123. package/lib/module/utils/StorageUtil.js +122 -172
  124. package/lib/module/utils/StorageUtil.js.map +1 -1
  125. package/lib/module/utils/SwapApiUtil.js +4 -17
  126. package/lib/module/utils/SwapApiUtil.js.map +1 -1
  127. package/lib/module/utils/SwapCalculationUtil.js +3 -0
  128. package/lib/module/utils/SwapCalculationUtil.js.map +1 -1
  129. package/lib/module/utils/WalletUtil.js +19 -0
  130. package/lib/module/utils/WalletUtil.js.map +1 -0
  131. package/lib/typescript/controllers/ApiController.d.ts +8 -7
  132. package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
  133. package/lib/typescript/controllers/AssetController.d.ts +0 -2
  134. package/lib/typescript/controllers/AssetController.d.ts.map +1 -1
  135. package/lib/typescript/controllers/BlockchainApiController.d.ts +21 -13
  136. package/lib/typescript/controllers/BlockchainApiController.d.ts.map +1 -1
  137. package/lib/typescript/controllers/ConnectionsController.d.ts +22 -18
  138. package/lib/typescript/controllers/ConnectionsController.d.ts.map +1 -1
  139. package/lib/typescript/controllers/EnsController.d.ts +1 -1
  140. package/lib/typescript/controllers/EnsController.d.ts.map +1 -1
  141. package/lib/typescript/controllers/EventsController.d.ts +13 -1
  142. package/lib/typescript/controllers/EventsController.d.ts.map +1 -1
  143. package/lib/typescript/controllers/LogController.d.ts +65 -0
  144. package/lib/typescript/controllers/LogController.d.ts.map +1 -0
  145. package/lib/typescript/controllers/ModalController.d.ts +1 -1
  146. package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
  147. package/lib/typescript/controllers/OnRampController.d.ts +4 -3
  148. package/lib/typescript/controllers/OnRampController.d.ts.map +1 -1
  149. package/lib/typescript/controllers/OptionsController.d.ts +8 -6
  150. package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
  151. package/lib/typescript/controllers/RouterController.d.ts +6 -21
  152. package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
  153. package/lib/typescript/controllers/SendController.d.ts +5 -7
  154. package/lib/typescript/controllers/SendController.d.ts.map +1 -1
  155. package/lib/typescript/controllers/SnackController.d.ts +3 -3
  156. package/lib/typescript/controllers/SnackController.d.ts.map +1 -1
  157. package/lib/typescript/controllers/SwapController.d.ts +11 -11
  158. package/lib/typescript/controllers/SwapController.d.ts.map +1 -1
  159. package/lib/typescript/controllers/ThemeController.d.ts +2 -0
  160. package/lib/typescript/controllers/ThemeController.d.ts.map +1 -1
  161. package/lib/typescript/controllers/TransactionsController.d.ts +3 -3
  162. package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -1
  163. package/lib/typescript/controllers/WcController.d.ts +27 -0
  164. package/lib/typescript/controllers/WcController.d.ts.map +1 -0
  165. package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts +174 -0
  166. package/lib/typescript/features/reown-authentication/ReownAuthentication.d.ts.map +1 -0
  167. package/lib/typescript/features/reown-authentication/ReownAuthenticationMessenger.d.ts +16 -0
  168. package/lib/typescript/features/reown-authentication/ReownAuthenticationMessenger.d.ts.map +1 -0
  169. package/lib/typescript/features/reown-authentication/index.d.ts +3 -0
  170. package/lib/typescript/features/reown-authentication/index.d.ts.map +1 -0
  171. package/lib/typescript/index.d.ts +6 -8
  172. package/lib/typescript/index.d.ts.map +1 -1
  173. package/lib/typescript/utils/ApiUtil.d.ts +1 -1
  174. package/lib/typescript/utils/AssetUtil.d.ts +3 -4
  175. package/lib/typescript/utils/AssetUtil.d.ts.map +1 -1
  176. package/lib/typescript/utils/ConstantsUtil.d.ts +7 -416
  177. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  178. package/lib/typescript/utils/CoreHelperUtil.d.ts +8 -6
  179. package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
  180. package/lib/typescript/utils/EventUtil.d.ts +1 -1
  181. package/lib/typescript/utils/EventUtil.d.ts.map +1 -1
  182. package/lib/typescript/utils/FetchUtil.d.ts +3 -3
  183. package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
  184. package/lib/typescript/utils/LogUtils.d.ts +15 -0
  185. package/lib/typescript/utils/LogUtils.d.ts.map +1 -0
  186. package/lib/typescript/utils/StorageUtil.d.ts +8 -19
  187. package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
  188. package/lib/typescript/utils/SwapApiUtil.d.ts +3 -4
  189. package/lib/typescript/utils/SwapApiUtil.d.ts.map +1 -1
  190. package/lib/typescript/utils/SwapCalculationUtil.d.ts +1 -1
  191. package/lib/typescript/utils/SwapCalculationUtil.d.ts.map +1 -1
  192. package/lib/typescript/utils/WalletUtil.d.ts +5 -0
  193. package/lib/typescript/utils/WalletUtil.d.ts.map +1 -0
  194. package/package.json +12 -25
  195. package/src/controllers/ApiController.ts +158 -80
  196. package/src/controllers/AssetController.ts +0 -6
  197. package/src/controllers/BlockchainApiController.ts +109 -144
  198. package/src/controllers/ConnectionsController.ts +372 -88
  199. package/src/controllers/EnsController.ts +5 -3
  200. package/src/controllers/EventsController.ts +74 -3
  201. package/src/controllers/LogController.ts +250 -0
  202. package/src/controllers/ModalController.ts +11 -9
  203. package/src/controllers/OnRampController.ts +195 -82
  204. package/src/controllers/OptionsController.ts +40 -13
  205. package/src/controllers/RouterController.ts +20 -58
  206. package/src/controllers/SendController.ts +148 -112
  207. package/src/controllers/SnackController.ts +31 -5
  208. package/src/controllers/SwapController.ts +140 -148
  209. package/src/controllers/ThemeController.ts +7 -0
  210. package/src/controllers/TransactionsController.ts +26 -18
  211. package/src/controllers/WcController.ts +93 -0
  212. package/src/features/reown-authentication/ReownAuthentication.ts +475 -0
  213. package/src/features/reown-authentication/ReownAuthenticationMessenger.ts +80 -0
  214. package/src/features/reown-authentication/index.ts +2 -0
  215. package/src/index.ts +15 -22
  216. package/src/utils/ApiUtil.ts +1 -1
  217. package/src/utils/AssetUtil.ts +9 -20
  218. package/src/utils/ConstantsUtil.ts +16 -435
  219. package/src/utils/CoreHelperUtil.ts +62 -11
  220. package/src/utils/EventUtil.ts +1 -1
  221. package/src/utils/FetchUtil.ts +50 -14
  222. package/src/utils/LogUtils.ts +179 -0
  223. package/src/utils/StorageUtil.ts +171 -199
  224. package/src/utils/SwapApiUtil.ts +18 -37
  225. package/src/utils/SwapCalculationUtil.ts +1 -2
  226. package/src/utils/WalletUtil.ts +14 -0
  227. package/lib/commonjs/controllers/AccountController.js +0 -93
  228. package/lib/commonjs/controllers/AccountController.js.map +0 -1
  229. package/lib/commonjs/controllers/ConnectionController.js +0 -132
  230. package/lib/commonjs/controllers/ConnectionController.js.map +0 -1
  231. package/lib/commonjs/controllers/ConnectorController.js +0 -50
  232. package/lib/commonjs/controllers/ConnectorController.js.map +0 -1
  233. package/lib/commonjs/controllers/NetworkController.js +0 -90
  234. package/lib/commonjs/controllers/NetworkController.js.map +0 -1
  235. package/lib/commonjs/controllers/WebviewController.js +0 -52
  236. package/lib/commonjs/controllers/WebviewController.js.map +0 -1
  237. package/lib/commonjs/utils/NetworkUtil.js +0 -46
  238. package/lib/commonjs/utils/NetworkUtil.js.map +0 -1
  239. package/lib/commonjs/utils/RouterUtil.js +0 -25
  240. package/lib/commonjs/utils/RouterUtil.js.map +0 -1
  241. package/lib/commonjs/utils/TypeUtil.js +0 -6
  242. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  243. package/lib/module/controllers/AccountController.js +0 -88
  244. package/lib/module/controllers/AccountController.js.map +0 -1
  245. package/lib/module/controllers/ConnectionController.js +0 -127
  246. package/lib/module/controllers/ConnectionController.js.map +0 -1
  247. package/lib/module/controllers/ConnectorController.js +0 -45
  248. package/lib/module/controllers/ConnectorController.js.map +0 -1
  249. package/lib/module/controllers/NetworkController.js +0 -85
  250. package/lib/module/controllers/NetworkController.js.map +0 -1
  251. package/lib/module/controllers/WebviewController.js +0 -47
  252. package/lib/module/controllers/WebviewController.js.map +0 -1
  253. package/lib/module/utils/NetworkUtil.js +0 -40
  254. package/lib/module/utils/NetworkUtil.js.map +0 -1
  255. package/lib/module/utils/RouterUtil.js +0 -19
  256. package/lib/module/utils/RouterUtil.js.map +0 -1
  257. package/lib/module/utils/TypeUtil.js +0 -2
  258. package/lib/module/utils/TypeUtil.js.map +0 -1
  259. package/lib/typescript/controllers/AccountController.d.ts +0 -33
  260. package/lib/typescript/controllers/AccountController.d.ts.map +0 -1
  261. package/lib/typescript/controllers/ConnectionController.d.ts +0 -68
  262. package/lib/typescript/controllers/ConnectionController.d.ts.map +0 -1
  263. package/lib/typescript/controllers/ConnectorController.d.ts +0 -18
  264. package/lib/typescript/controllers/ConnectorController.d.ts.map +0 -1
  265. package/lib/typescript/controllers/NetworkController.d.ts +0 -34
  266. package/lib/typescript/controllers/NetworkController.d.ts.map +0 -1
  267. package/lib/typescript/controllers/WebviewController.d.ts +0 -21
  268. package/lib/typescript/controllers/WebviewController.d.ts.map +0 -1
  269. package/lib/typescript/utils/NetworkUtil.d.ts +0 -8
  270. package/lib/typescript/utils/NetworkUtil.d.ts.map +0 -1
  271. package/lib/typescript/utils/RouterUtil.d.ts +0 -5
  272. package/lib/typescript/utils/RouterUtil.d.ts.map +0 -1
  273. package/lib/typescript/utils/TypeUtil.d.ts +0 -817
  274. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  275. package/src/controllers/AccountController.ts +0 -128
  276. package/src/controllers/ConnectionController.ts +0 -208
  277. package/src/controllers/ConnectorController.ts +0 -64
  278. package/src/controllers/NetworkController.ts +0 -120
  279. package/src/controllers/WebviewController.ts +0 -63
  280. package/src/utils/NetworkUtil.ts +0 -33
  281. package/src/utils/RouterUtil.ts +0 -21
  282. package/src/utils/TypeUtil.ts +0 -995
@@ -1,53 +1,43 @@
1
1
  /* eslint-disable no-console */
2
- import AsyncStorage from '@react-native-async-storage/async-storage';
3
- import type {
4
- OnRampCountry,
5
- OnRampFiatCurrency,
6
- OnRampFiatLimit,
7
- OnRampServiceProvider,
8
- WcWallet
9
- } from './TypeUtil';
10
2
  import {
3
+ type OnRampCountry,
4
+ type OnRampFiatCurrency,
5
+ type OnRampFiatLimit,
6
+ type OnRampServiceProvider,
7
+ type OnRampCountryDefaults,
8
+ type WcWallet,
11
9
  DateUtil,
12
- type SocialProvider,
13
- type New_ConnectorType,
14
10
  type ConnectorType,
15
- type ChainNamespace
11
+ type ChainNamespace,
12
+ type WalletDeepLink,
13
+ SafeStorageKeys
16
14
  } from '@reown/appkit-common-react-native';
17
-
18
- // -- Helpers -----------------------------------------------------------------
19
- const WC_DEEPLINK = 'WALLETCONNECT_DEEPLINK_CHOICE';
20
- const RECENT_WALLET = '@w3m/recent';
21
- const CONNECTED_WALLET_IMAGE_URL = '@w3m/connected_wallet_image_url';
22
- const CONNECTED_CONNECTOR = '@w3m/connected_connector';
23
- const CONNECTED_CONNECTORS = '@appkit/connected_connectors';
24
- const CONNECTED_SOCIAL = '@appkit/connected_social';
25
- const ONRAMP_PREFERRED_COUNTRY = '@appkit/onramp_preferred_country';
26
- const ONRAMP_COUNTRIES = '@appkit/onramp_countries';
27
- const ONRAMP_SERVICE_PROVIDERS = '@appkit/onramp_service_providers';
28
- const ONRAMP_FIAT_LIMITS = '@appkit/onramp_fiat_limits';
29
- const ONRAMP_FIAT_CURRENCIES = '@appkit/onramp_fiat_currencies';
30
- const ONRAMP_PREFERRED_FIAT_CURRENCY = '@appkit/onramp_preferred_fiat_currency';
31
- const ACTIVE_NAMESPACE = '@appkit/active_namespace';
15
+ import { OptionsController } from '../controllers/OptionsController';
16
+ import { LogController } from '../controllers/LogController';
32
17
 
33
18
  // -- Utility -----------------------------------------------------------------
34
19
  export const StorageUtil = {
35
- setWalletConnectDeepLink({ href, name }: { href: string; name: string }) {
20
+ setWalletConnectDeepLink({ href, name }: WalletDeepLink) {
36
21
  try {
37
- AsyncStorage.setItem(WC_DEEPLINK, JSON.stringify({ href, name }));
38
- } catch {
39
- console.info('Unable to set WalletConnect deep link');
22
+ OptionsController.getStorage().setItem(SafeStorageKeys.WC_DEEPLINK, {
23
+ href,
24
+ name
25
+ });
26
+ } catch (error) {
27
+ LogController.sendError(error, 'StorageUtil.ts', 'setWalletConnectDeepLink');
40
28
  }
41
29
  },
42
30
 
43
31
  async getWalletConnectDeepLink() {
44
32
  try {
45
- const deepLink = await AsyncStorage.getItem(WC_DEEPLINK);
33
+ const deepLink = await OptionsController.getStorage().getItem<WalletDeepLink>(
34
+ SafeStorageKeys.WC_DEEPLINK
35
+ );
46
36
  if (deepLink) {
47
- return JSON.parse(deepLink);
37
+ return deepLink;
48
38
  }
49
- } catch {
50
- console.info('Unable to get WalletConnect deep link');
39
+ } catch (error) {
40
+ LogController.sendError(error, 'StorageUtil.ts', 'getWalletConnectDeepLink');
51
41
  }
52
42
 
53
43
  return undefined;
@@ -55,9 +45,9 @@ export const StorageUtil = {
55
45
 
56
46
  async removeWalletConnectDeepLink() {
57
47
  try {
58
- await AsyncStorage.removeItem(WC_DEEPLINK);
59
- } catch {
60
- console.info('Unable to delete WalletConnect deep link');
48
+ await OptionsController.getStorage().removeItem(SafeStorageKeys.WC_DEEPLINK);
49
+ } catch (error) {
50
+ LogController.sendError(error, 'StorageUtil.ts', 'removeWalletConnectDeepLink');
61
51
  }
62
52
  },
63
53
 
@@ -74,11 +64,11 @@ export const StorageUtil = {
74
64
  if (recentWallets.length > 2) {
75
65
  recentWallets.pop();
76
66
  }
77
- AsyncStorage.setItem(RECENT_WALLET, JSON.stringify(recentWallets));
67
+ OptionsController.getStorage().setItem(SafeStorageKeys.RECENT_WALLET, recentWallets);
78
68
 
79
69
  return recentWallets;
80
- } catch {
81
- console.info('Unable to set recent wallet');
70
+ } catch (error) {
71
+ LogController.sendError(error, 'StorageUtil.ts', 'addRecentWallet');
82
72
 
83
73
  return undefined;
84
74
  }
@@ -86,58 +76,29 @@ export const StorageUtil = {
86
76
 
87
77
  async setRecentWallets(wallets: WcWallet[]) {
88
78
  try {
89
- await AsyncStorage.setItem(RECENT_WALLET, JSON.stringify(wallets));
90
- } catch {
91
- console.info('Unable to set recent wallets');
79
+ await OptionsController.getStorage().setItem(SafeStorageKeys.RECENT_WALLET, wallets);
80
+ } catch (error) {
81
+ LogController.sendError(error, 'StorageUtil.ts', 'setRecentWallets');
92
82
  }
93
83
  },
94
84
 
95
85
  async getRecentWallets(): Promise<WcWallet[]> {
96
86
  try {
97
- const recent = await AsyncStorage.getItem(RECENT_WALLET);
87
+ const recent = await OptionsController.getStorage().getItem(SafeStorageKeys.RECENT_WALLET);
98
88
 
99
- return recent ? JSON.parse(recent) : [];
100
- } catch {
101
- console.info('Unable to get recent wallets');
89
+ return recent ?? [];
90
+ } catch (error) {
91
+ LogController.sendError(error, 'StorageUtil.ts', 'getRecentWallets');
102
92
  }
103
93
 
104
94
  return [];
105
95
  },
106
96
 
107
- //TODO: remove this
108
- async setConnectedConnector(connectorType: ConnectorType) {
109
- try {
110
- await AsyncStorage.setItem(CONNECTED_CONNECTOR, JSON.stringify(connectorType));
111
- } catch {
112
- console.info('Unable to set Connected Connector');
113
- }
114
- },
115
-
116
- async getConnectedConnector(): Promise<ConnectorType | undefined> {
117
- try {
118
- const connector = (await AsyncStorage.getItem(CONNECTED_CONNECTOR)) as ConnectorType;
119
-
120
- return connector ? JSON.parse(connector) : undefined;
121
- } catch {
122
- console.info('Unable to get Connected Connector');
123
- }
124
-
125
- return undefined;
126
- },
127
-
128
- async removeConnectedConnector() {
129
- try {
130
- await AsyncStorage.removeItem(CONNECTED_CONNECTOR);
131
- } catch {
132
- console.info('Unable to remove Connected Connector');
133
- }
134
- },
135
-
136
97
  async setConnectedConnectors({
137
98
  type,
138
99
  namespaces
139
100
  }: {
140
- type: New_ConnectorType;
101
+ type: ConnectorType;
141
102
  namespaces: string[];
142
103
  }) {
143
104
  try {
@@ -145,144 +106,148 @@ export const StorageUtil = {
145
106
  // Only add if it doesn't exist already
146
107
  if (!currentConnectors.some(c => c.type === type)) {
147
108
  const updatedConnectors = [...currentConnectors, { type, namespaces }];
148
- await AsyncStorage.setItem(CONNECTED_CONNECTORS, JSON.stringify(updatedConnectors));
109
+ await OptionsController.getStorage().setItem(
110
+ SafeStorageKeys.CONNECTED_CONNECTORS,
111
+ updatedConnectors
112
+ );
149
113
  }
150
- } catch {
151
- console.info('Unable to set Connected Connector');
114
+ } catch (error) {
115
+ LogController.sendError(error, 'StorageUtil.ts', 'setConnectedConnectors');
152
116
  }
153
117
  },
154
118
 
155
- async getConnectedConnectors(): Promise<{ type: New_ConnectorType; namespaces: string[] }[]> {
119
+ async getConnectedConnectors(): Promise<{ type: ConnectorType; namespaces: string[] }[]> {
156
120
  try {
157
- const connectors = await AsyncStorage.getItem(CONNECTED_CONNECTORS);
121
+ const connectors = await OptionsController.getStorage().getItem<
122
+ { type: ConnectorType; namespaces: string[] }[]
123
+ >(SafeStorageKeys.CONNECTED_CONNECTORS);
158
124
 
159
- return connectors ? JSON.parse(connectors) : [];
160
- } catch {
161
- console.info('Unable to get Connected Connector');
125
+ return connectors ?? [];
126
+ } catch (err) {
127
+ LogController.sendError(err, 'StorageUtil.ts', 'getConnectedConnectors');
162
128
  }
163
129
 
164
130
  return [];
165
131
  },
166
132
 
167
- async removeConnectedConnectors(type: New_ConnectorType) {
133
+ async removeConnectedConnectors(type: ConnectorType) {
168
134
  try {
169
135
  const currentConnectors = await StorageUtil.getConnectedConnectors();
170
136
  const updatedConnectors = currentConnectors.filter(c => c.type !== type);
171
- await AsyncStorage.setItem(CONNECTED_CONNECTORS, JSON.stringify(updatedConnectors));
172
- } catch {
173
- console.info('Unable to remove Connected Connector');
137
+ await OptionsController.getStorage().setItem(
138
+ SafeStorageKeys.CONNECTED_CONNECTORS,
139
+ updatedConnectors
140
+ );
141
+ } catch (error) {
142
+ LogController.sendError(error, 'StorageUtil.ts', 'removeConnectedConnectors');
174
143
  }
175
144
  },
176
145
 
177
- async setConnectedWalletImageUrl(url: string) {
146
+ async setOnRampPreferredCountry(country: OnRampCountry) {
178
147
  try {
179
- await AsyncStorage.setItem(CONNECTED_WALLET_IMAGE_URL, url);
180
- } catch {
181
- console.info('Unable to set Connected Wallet Image URL');
148
+ await OptionsController.getStorage().setItem(
149
+ SafeStorageKeys.ONRAMP_PREFERRED_COUNTRY,
150
+ country
151
+ );
152
+ } catch (error) {
153
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampPreferredCountry');
182
154
  }
183
155
  },
184
156
 
185
- async getConnectedWalletImageUrl() {
157
+ async getOnRampPreferredCountry() {
186
158
  try {
187
- return await AsyncStorage.getItem(CONNECTED_WALLET_IMAGE_URL);
159
+ const country = await OptionsController.getStorage().getItem<OnRampCountry>(
160
+ SafeStorageKeys.ONRAMP_PREFERRED_COUNTRY
161
+ );
162
+
163
+ return country ?? undefined;
188
164
  } catch {
189
- console.info('Unable to get Connected Wallet Image URL');
165
+ console.info('Unable to get OnRamp Preferred Country');
190
166
  }
191
167
 
192
168
  return undefined;
193
169
  },
194
170
 
195
- async removeConnectedWalletImageUrl() {
196
- try {
197
- await AsyncStorage.removeItem(CONNECTED_WALLET_IMAGE_URL);
198
- } catch {
199
- console.info('Unable to remove Connected Wallet Image URL');
200
- }
201
- },
202
-
203
- async setConnectedSocialProvider(provider: SocialProvider) {
171
+ async setOnRampPreferredFiatCurrency(currency: OnRampFiatCurrency) {
204
172
  try {
205
- await AsyncStorage.setItem(CONNECTED_SOCIAL, JSON.stringify(provider));
206
- } catch {
207
- console.info('Unable to set Connected Social Provider');
173
+ await OptionsController.getStorage().setItem(
174
+ SafeStorageKeys.ONRAMP_PREFERRED_FIAT_CURRENCY,
175
+ currency
176
+ );
177
+ } catch (error) {
178
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampPreferredFiatCurrency');
208
179
  }
209
180
  },
210
181
 
211
- async getConnectedSocialProvider() {
182
+ async getOnRampPreferredFiatCurrency() {
212
183
  try {
213
- const provider = (await AsyncStorage.getItem(CONNECTED_SOCIAL)) as SocialProvider;
184
+ const currency = await OptionsController.getStorage().getItem<OnRampFiatCurrency>(
185
+ SafeStorageKeys.ONRAMP_PREFERRED_FIAT_CURRENCY
186
+ );
214
187
 
215
- return provider ? JSON.parse(provider) : undefined;
216
- } catch {
217
- console.info('Unable to get Connected Social Provider');
188
+ return currency ?? undefined;
189
+ } catch (error) {
190
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampPreferredFiatCurrency');
218
191
  }
219
192
 
220
193
  return undefined;
221
194
  },
222
195
 
223
- async removeConnectedSocialProvider() {
224
- try {
225
- await AsyncStorage.removeItem(CONNECTED_SOCIAL);
226
- } catch {
227
- console.info('Unable to remove Connected Social Provider');
228
- }
229
- },
230
-
231
- async setOnRampPreferredCountry(country: OnRampCountry) {
196
+ async setOnRampCountries(countries: OnRampCountry[]) {
232
197
  try {
233
- await AsyncStorage.setItem(ONRAMP_PREFERRED_COUNTRY, JSON.stringify(country));
234
- } catch {
235
- console.info('Unable to set OnRamp Preferred Country');
198
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_COUNTRIES, countries);
199
+ } catch (error) {
200
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampCountries');
236
201
  }
237
202
  },
238
203
 
239
- async getOnRampPreferredCountry() {
204
+ async getOnRampCountries() {
240
205
  try {
241
- const country = await AsyncStorage.getItem(ONRAMP_PREFERRED_COUNTRY);
206
+ const countries = await OptionsController.getStorage().getItem<OnRampCountry[]>(
207
+ SafeStorageKeys.ONRAMP_COUNTRIES
208
+ );
242
209
 
243
- return country ? (JSON.parse(country) as OnRampCountry) : undefined;
244
- } catch {
245
- console.info('Unable to get OnRamp Preferred Country');
210
+ return countries ?? [];
211
+ } catch (error) {
212
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampCountries');
246
213
  }
247
214
 
248
- return undefined;
215
+ return [];
249
216
  },
250
217
 
251
- async setOnRampPreferredFiatCurrency(currency: OnRampFiatCurrency) {
218
+ async setOnRampCountriesDefaults(countriesDefaults: OnRampCountryDefaults[]) {
252
219
  try {
253
- await AsyncStorage.setItem(ONRAMP_PREFERRED_FIAT_CURRENCY, JSON.stringify(currency));
254
- } catch {
255
- console.info('Unable to set OnRamp Preferred Fiat Currency');
220
+ const timestamp = Date.now();
221
+
222
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_COUNTRIES_DEFAULTS, {
223
+ data: countriesDefaults,
224
+ timestamp
225
+ });
226
+ } catch (error) {
227
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampCountriesDefaults');
256
228
  }
257
229
  },
258
230
 
259
- async getOnRampPreferredFiatCurrency() {
231
+ async getOnRampCountriesDefaults() {
260
232
  try {
261
- const currency = await AsyncStorage.getItem(ONRAMP_PREFERRED_FIAT_CURRENCY);
233
+ const result = await OptionsController.getStorage().getItem(
234
+ SafeStorageKeys.ONRAMP_COUNTRIES_DEFAULTS
235
+ );
262
236
 
263
- return currency ? (JSON.parse(currency) as OnRampFiatCurrency) : undefined;
264
- } catch {
265
- console.info('Unable to get OnRamp Preferred Fiat Currency');
266
- }
237
+ if (!result) {
238
+ return [];
239
+ }
267
240
 
268
- return undefined;
269
- },
241
+ const { data, timestamp } = result;
270
242
 
271
- async setOnRampCountries(countries: OnRampCountry[]) {
272
- try {
273
- await AsyncStorage.setItem(ONRAMP_COUNTRIES, JSON.stringify(countries));
274
- } catch {
275
- console.info('Unable to set OnRamp Countries');
276
- }
277
- },
278
-
279
- async getOnRampCountries() {
280
- try {
281
- const countries = await AsyncStorage.getItem(ONRAMP_COUNTRIES);
243
+ // Cache for 1 week
244
+ if (timestamp && DateUtil.isMoreThanOneWeekAgo(timestamp)) {
245
+ return [];
246
+ }
282
247
 
283
- return countries ? (JSON.parse(countries) as OnRampCountry[]) : [];
284
- } catch {
285
- console.info('Unable to get OnRamp Countries');
248
+ return (data as OnRampCountryDefaults[]) ?? [];
249
+ } catch (error) {
250
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampCountriesDefaults');
286
251
  }
287
252
 
288
253
  return [];
@@ -292,34 +257,35 @@ export const StorageUtil = {
292
257
  try {
293
258
  const timestamp = Date.now();
294
259
 
295
- await AsyncStorage.setItem(
296
- ONRAMP_SERVICE_PROVIDERS,
297
- JSON.stringify({ data: serviceProviders, timestamp })
298
- );
299
- } catch {
300
- console.info('Unable to set OnRamp Service Providers');
260
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_SERVICE_PROVIDERS, {
261
+ data: serviceProviders,
262
+ timestamp
263
+ });
264
+ } catch (error) {
265
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampServiceProviders');
301
266
  }
302
267
  },
303
268
 
304
269
  async getOnRampServiceProviders() {
305
270
  try {
306
- const result = await AsyncStorage.getItem(ONRAMP_SERVICE_PROVIDERS);
271
+ const result = await OptionsController.getStorage().getItem(
272
+ SafeStorageKeys.ONRAMP_SERVICE_PROVIDERS
273
+ );
307
274
 
308
275
  if (!result) {
309
276
  return [];
310
277
  }
311
278
 
312
- const { data, timestamp } = JSON.parse(result);
279
+ const { data, timestamp } = result;
313
280
 
314
281
  // Cache for 1 week
315
282
  if (timestamp && DateUtil.isMoreThanOneWeekAgo(timestamp)) {
316
283
  return [];
317
284
  }
318
285
 
319
- return data ? (data as OnRampServiceProvider[]) : [];
286
+ return (data as OnRampServiceProvider[]) ?? [];
320
287
  } catch (err) {
321
- console.error(err);
322
- console.info('Unable to get OnRamp Service Providers');
288
+ LogController.sendError(err, 'StorageUtil.ts', 'getOnRampServiceProviders');
323
289
  }
324
290
 
325
291
  return [];
@@ -329,33 +295,35 @@ export const StorageUtil = {
329
295
  try {
330
296
  const timestamp = Date.now();
331
297
 
332
- await AsyncStorage.setItem(
333
- ONRAMP_FIAT_LIMITS,
334
- JSON.stringify({ data: fiatLimits, timestamp })
335
- );
336
- } catch {
337
- console.info('Unable to set OnRamp Fiat Limits');
298
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_FIAT_LIMITS, {
299
+ data: fiatLimits,
300
+ timestamp
301
+ });
302
+ } catch (error) {
303
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampFiatLimits');
338
304
  }
339
305
  },
340
306
 
341
307
  async getOnRampFiatLimits() {
342
308
  try {
343
- const result = await AsyncStorage.getItem(ONRAMP_FIAT_LIMITS);
309
+ const result = await OptionsController.getStorage().getItem(
310
+ SafeStorageKeys.ONRAMP_FIAT_LIMITS
311
+ );
344
312
 
345
313
  if (!result) {
346
314
  return [];
347
315
  }
348
316
 
349
- const { data, timestamp } = JSON.parse(result);
317
+ const { data, timestamp } = result;
350
318
 
351
319
  // Cache for 1 week
352
320
  if (timestamp && DateUtil.isMoreThanOneWeekAgo(timestamp)) {
353
321
  return [];
354
322
  }
355
323
 
356
- return data ? (data as OnRampFiatLimit[]) : [];
357
- } catch {
358
- console.info('Unable to get OnRamp Fiat Limits');
324
+ return (data as OnRampFiatLimit[]) ?? [];
325
+ } catch (error) {
326
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampFiatLimits');
359
327
  }
360
328
 
361
329
  return [];
@@ -365,33 +333,35 @@ export const StorageUtil = {
365
333
  try {
366
334
  const timestamp = Date.now();
367
335
 
368
- await AsyncStorage.setItem(
369
- ONRAMP_FIAT_CURRENCIES,
370
- JSON.stringify({ data: fiatCurrencies, timestamp })
371
- );
372
- } catch {
373
- console.info('Unable to set OnRamp Fiat Currencies');
336
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ONRAMP_FIAT_CURRENCIES, {
337
+ data: fiatCurrencies,
338
+ timestamp
339
+ });
340
+ } catch (error) {
341
+ LogController.sendError(error, 'StorageUtil.ts', 'setOnRampFiatCurrencies');
374
342
  }
375
343
  },
376
344
 
377
345
  async getOnRampFiatCurrencies() {
378
346
  try {
379
- const result = await AsyncStorage.getItem(ONRAMP_FIAT_CURRENCIES);
347
+ const result = await OptionsController.getStorage().getItem(
348
+ SafeStorageKeys.ONRAMP_FIAT_CURRENCIES
349
+ );
380
350
 
381
351
  if (!result) {
382
352
  return [];
383
353
  }
384
354
 
385
- const { data, timestamp } = JSON.parse(result);
355
+ const { data, timestamp } = result;
386
356
 
387
357
  // Cache for 1 week
388
358
  if (timestamp && DateUtil.isMoreThanOneWeekAgo(timestamp)) {
389
359
  return [];
390
360
  }
391
361
 
392
- return data ? (data as OnRampFiatCurrency[]) : [];
393
- } catch {
394
- console.info('Unable to get OnRamp Fiat Currencies');
362
+ return (data as OnRampFiatCurrency[]) ?? [];
363
+ } catch (error) {
364
+ LogController.sendError(error, 'StorageUtil.ts', 'getOnRampFiatCurrencies');
395
365
  }
396
366
 
397
367
  return [];
@@ -400,24 +370,26 @@ export const StorageUtil = {
400
370
  async setActiveNamespace(namespace?: ChainNamespace) {
401
371
  try {
402
372
  if (!namespace) {
403
- await AsyncStorage.removeItem(ACTIVE_NAMESPACE);
373
+ await OptionsController.getStorage().removeItem(SafeStorageKeys.ACTIVE_NAMESPACE);
404
374
 
405
375
  return;
406
376
  }
407
377
 
408
- await AsyncStorage.setItem(ACTIVE_NAMESPACE, namespace);
409
- } catch {
410
- console.info('Unable to set Active Namespace');
378
+ await OptionsController.getStorage().setItem(SafeStorageKeys.ACTIVE_NAMESPACE, namespace);
379
+ } catch (error) {
380
+ LogController.sendError(error, 'StorageUtil.ts', 'setActiveNamespace');
411
381
  }
412
382
  },
413
383
 
414
384
  async getActiveNamespace() {
415
385
  try {
416
- const namespace = (await AsyncStorage.getItem(ACTIVE_NAMESPACE)) as ChainNamespace;
386
+ const namespace = (await OptionsController.getStorage().getItem(
387
+ SafeStorageKeys.ACTIVE_NAMESPACE
388
+ )) as ChainNamespace;
417
389
 
418
390
  return namespace ?? undefined;
419
391
  } catch (err) {
420
- console.info('Unable to get Active Namespace');
392
+ LogController.sendError(err, 'StorageUtil.ts', 'getActiveNamespace');
421
393
  }
422
394
 
423
395
  return undefined;
@@ -425,9 +397,9 @@ export const StorageUtil = {
425
397
 
426
398
  async removeActiveNamespace() {
427
399
  try {
428
- await AsyncStorage.removeItem(ACTIVE_NAMESPACE);
429
- } catch {
430
- console.info('Unable to remove Active Namespace');
400
+ await OptionsController.getStorage().removeItem(SafeStorageKeys.ACTIVE_NAMESPACE);
401
+ } catch (error) {
402
+ LogController.sendError(error, 'StorageUtil.ts', 'removeActiveNamespace');
431
403
  }
432
404
  }
433
405
  };
@@ -1,13 +1,12 @@
1
- import { BlockchainApiController } from '../controllers/BlockchainApiController';
2
- import { OptionsController } from '../controllers/OptionsController';
3
1
  import type {
4
- BlockchainApiBalanceResponse,
2
+ Balance,
3
+ CaipNetworkId,
5
4
  BlockchainApiSwapAllowanceRequest,
6
5
  SwapTokenWithBalance
7
- } from './TypeUtil';
8
- import { AccountController } from '../controllers/AccountController';
6
+ } from '@reown/appkit-common-react-native';
7
+ import { BlockchainApiController } from '../controllers/BlockchainApiController';
8
+ import { OptionsController } from '../controllers/OptionsController';
9
9
  import { ConnectionsController } from '../controllers/ConnectionsController';
10
- import type { CaipNetworkId } from '@reown/appkit-common-react-native';
11
10
  import { ConstantsUtil } from './ConstantsUtil';
12
11
 
13
12
  export const SwapApiUtil = {
@@ -64,43 +63,25 @@ export const SwapApiUtil = {
64
63
  return false;
65
64
  },
66
65
 
67
- async getMyTokensWithBalance(forceUpdate?: string) {
68
- const { activeAddress, activeNetwork: network } = ConnectionsController.state;
69
- const address = activeAddress?.split(':')[2];
70
-
71
- if (!address) {
72
- return [];
73
- }
74
-
75
- const response = await BlockchainApiController.getBalance(
76
- address,
77
- network?.caipNetworkId,
78
- forceUpdate
79
- );
80
- const balances = response?.balances.filter(balance => balance.quantity.decimals !== '0');
81
-
82
- AccountController.setTokenBalance(balances);
83
-
84
- return this.mapBalancesToSwapTokens(balances);
85
- },
86
-
87
- mapBalancesToSwapTokens(balances?: BlockchainApiBalanceResponse['balances']) {
66
+ mapBalancesToSwapTokens(balances?: Balance[]) {
88
67
  const { activeNamespace, activeCaipNetworkId } = ConnectionsController.state;
89
68
  const address = activeNamespace
90
69
  ? ConstantsUtil.NATIVE_TOKEN_ADDRESS[activeNamespace]
91
70
  : undefined;
92
71
 
93
72
  return (
94
- balances?.map(
95
- token =>
96
- ({
97
- ...token,
98
- address: token?.address ?? `${token?.chainId ?? activeCaipNetworkId}:${address}`,
99
- decimals: parseInt(token.quantity.decimals, 10),
100
- logoUri: token.iconUrl,
101
- eip2612: false
102
- }) as SwapTokenWithBalance
103
- ) || []
73
+ balances
74
+ ?.filter(balance => balance?.quantity?.numeric)
75
+ .map(
76
+ token =>
77
+ ({
78
+ ...token,
79
+ address: token?.address ?? `${token?.chainId ?? activeCaipNetworkId}:${address}`,
80
+ decimals: parseInt(token.quantity?.decimals ?? '0', 10),
81
+ logoUri: token.iconUrl,
82
+ eip2612: false
83
+ }) as SwapTokenWithBalance
84
+ ) || []
104
85
  );
105
86
  },
106
87
 
@@ -1,7 +1,6 @@
1
1
  // -- Types --------------------------------------------- //
2
2
 
3
- import { NumberUtil } from '@reown/appkit-common-react-native';
4
- import type { SwapTokenWithBalance } from './TypeUtil';
3
+ import { NumberUtil, type SwapTokenWithBalance } from '@reown/appkit-common-react-native';
5
4
 
6
5
  // -- Util ---------------------------------------- //
7
6
  export const SwapCalculationUtil = {