wallet-stack 1.0.0-alpha.121

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 (1288) hide show
  1. package/README.md +86 -0
  2. package/app.plugin.js +1 -0
  3. package/locales/base/translation.json +2998 -0
  4. package/locales/de/translation.json +2998 -0
  5. package/locales/en-US/translation.json +2998 -0
  6. package/locales/es-419/translation.json +2998 -0
  7. package/locales/fr-FR/translation.json +2998 -0
  8. package/locales/index.ts +163 -0
  9. package/locales/it-IT/translation.json +2998 -0
  10. package/locales/pl-PL/translation.json +3004 -0
  11. package/locales/pt-BR/translation.json +2998 -0
  12. package/locales/ru-RU/translation.json +3004 -0
  13. package/locales/th-TH/translation.json +2995 -0
  14. package/locales/tr-TR/translation.json +2998 -0
  15. package/locales/uk-UA/translation.json +3004 -0
  16. package/locales/vi-VN/translation.json +2995 -0
  17. package/locales/zh-CN/translation.json +2995 -0
  18. package/metro-config.js +40 -0
  19. package/package.json +227 -0
  20. package/plugin/build/consts.d.ts +2 -0
  21. package/plugin/build/consts.js +6 -0
  22. package/plugin/build/index.d.ts +8 -0
  23. package/plugin/build/index.js +21 -0
  24. package/plugin/build/withAndroidUserAgent.d.ts +8 -0
  25. package/plugin/build/withAndroidUserAgent.js +86 -0
  26. package/plugin/build/withAndroidWindowSoftInputModeAdjustNothing.d.ts +6 -0
  27. package/plugin/build/withAndroidWindowSoftInputModeAdjustNothing.js +16 -0
  28. package/plugin/build/withIosAppDelegateResetKeychain.d.ts +2 -0
  29. package/plugin/build/withIosAppDelegateResetKeychain.js +77 -0
  30. package/plugin/build/withIosUserAgent.d.ts +8 -0
  31. package/plugin/build/withIosUserAgent.js +56 -0
  32. package/plugin/tsconfig.json +13 -0
  33. package/src/RevokePhoneNumber.tsx +117 -0
  34. package/src/abis/IWalletJumpstart.ts +472 -0
  35. package/src/account/AccountErrorScreen.test.tsx +47 -0
  36. package/src/account/AccountErrorScreen.tsx +72 -0
  37. package/src/account/AccountKeyEducation.test.tsx +20 -0
  38. package/src/account/AccountKeyEducation.tsx +83 -0
  39. package/src/account/AccountSetupFailureScreen.test.tsx +59 -0
  40. package/src/account/AccountSetupFailureScreen.tsx +42 -0
  41. package/src/account/Education.test.tsx +48 -0
  42. package/src/account/Education.tsx +235 -0
  43. package/src/account/GoldEducation.test.tsx +35 -0
  44. package/src/account/GoldEducation.tsx +82 -0
  45. package/src/account/LegalSubmenu.test.tsx +84 -0
  46. package/src/account/LegalSubmenu.tsx +74 -0
  47. package/src/account/LicenseDisclaimer.txt +15310 -0
  48. package/src/account/Licenses.test.tsx +17 -0
  49. package/src/account/Licenses.tsx +43 -0
  50. package/src/account/PreferencesSubmenu.test.tsx +66 -0
  51. package/src/account/PreferencesSubmenu.tsx +87 -0
  52. package/src/account/PrivateKey.test.tsx +241 -0
  53. package/src/account/PrivateKey.tsx +169 -0
  54. package/src/account/Profile.test.tsx +77 -0
  55. package/src/account/Profile.tsx +153 -0
  56. package/src/account/ProfileSubmenu.test.tsx +105 -0
  57. package/src/account/ProfileSubmenu.tsx +89 -0
  58. package/src/account/SecuritySubmenu.test.tsx +305 -0
  59. package/src/account/SecuritySubmenu.tsx +435 -0
  60. package/src/account/ShakeForSupport.test.tsx +23 -0
  61. package/src/account/ShakeForSupport.tsx +112 -0
  62. package/src/account/StoreWipeRecoveryScreen.test.tsx +39 -0
  63. package/src/account/StoreWipeRecoveryScreen.tsx +50 -0
  64. package/src/account/Support.test.tsx +67 -0
  65. package/src/account/Support.tsx +69 -0
  66. package/src/account/SupportContact.test.tsx +95 -0
  67. package/src/account/SupportContact.tsx +265 -0
  68. package/src/account/__snapshots__/AccountKeyEducation.test.tsx.snap +579 -0
  69. package/src/account/__snapshots__/Education.test.tsx.snap +286 -0
  70. package/src/account/__snapshots__/GoldEducation.test.tsx.snap +579 -0
  71. package/src/account/__snapshots__/Licenses.test.tsx.snap +33 -0
  72. package/src/account/__snapshots__/ShakeForSupport.test.tsx.snap +3 -0
  73. package/src/account/actions.ts +270 -0
  74. package/src/account/reducer.test.ts +28 -0
  75. package/src/account/reducer.ts +296 -0
  76. package/src/account/saga.test.ts +209 -0
  77. package/src/account/saga.ts +249 -0
  78. package/src/account/selectors.test.ts +18 -0
  79. package/src/account/selectors.ts +60 -0
  80. package/src/account/updateAccountRegistration.ts +35 -0
  81. package/src/account/utils.ts +36 -0
  82. package/src/account/zendesk.test.ts +166 -0
  83. package/src/account/zendesk.ts +199 -0
  84. package/src/alert/AlertBanner.test.tsx +123 -0
  85. package/src/alert/AlertBanner.tsx +84 -0
  86. package/src/alert/actions.ts +127 -0
  87. package/src/alert/reducer.ts +52 -0
  88. package/src/analytics/AppAnalytics.test.ts +334 -0
  89. package/src/analytics/AppAnalytics.ts +369 -0
  90. package/src/analytics/AsyncStoragePersistor.ts +34 -0
  91. package/src/analytics/Events.test.tsx +49 -0
  92. package/src/analytics/Events.tsx +648 -0
  93. package/src/analytics/InjectTraits.ts +34 -0
  94. package/src/analytics/Properties.tsx +1645 -0
  95. package/src/analytics/README.md +24 -0
  96. package/src/analytics/docs.ts +675 -0
  97. package/src/analytics/saga.test.ts +57 -0
  98. package/src/analytics/saga.ts +21 -0
  99. package/src/analytics/selectors.test.ts +391 -0
  100. package/src/analytics/selectors.ts +200 -0
  101. package/src/analytics/types.ts +46 -0
  102. package/src/app/App.test.tsx +25 -0
  103. package/src/app/App.tsx +124 -0
  104. package/src/app/AppInitGate.test.tsx +100 -0
  105. package/src/app/AppInitGate.tsx +77 -0
  106. package/src/app/AppLoading.test.tsx +11 -0
  107. package/src/app/AppLoading.tsx +79 -0
  108. package/src/app/DebugImages.tsx +110 -0
  109. package/src/app/ErrorBoundary.test.tsx +19 -0
  110. package/src/app/ErrorBoundary.tsx +41 -0
  111. package/src/app/ErrorMessages.ts +40 -0
  112. package/src/app/ErrorScreen.test.tsx +26 -0
  113. package/src/app/ErrorScreen.tsx +57 -0
  114. package/src/app/SanctionedCountryErrorScreen.tsx +37 -0
  115. package/src/app/UpgradeScreen.tsx +28 -0
  116. package/src/app/__snapshots__/AppLoading.test.tsx.snap +35 -0
  117. package/src/app/__snapshots__/ErrorScreen.test.tsx.snap +365 -0
  118. package/src/app/actions.ts +301 -0
  119. package/src/app/crowd_mobile.png +0 -0
  120. package/src/app/reducers.ts +204 -0
  121. package/src/app/saga.test.ts +651 -0
  122. package/src/app/saga.ts +367 -0
  123. package/src/app/selectors.ts +53 -0
  124. package/src/app/useDeepLinks.test.tsx +43 -0
  125. package/src/app/useDeepLinks.ts +72 -0
  126. package/src/app/utils.ts +14 -0
  127. package/src/appConfig.test.ts +37 -0
  128. package/src/appConfig.ts +20 -0
  129. package/src/backup/BackupComplete.test.tsx +61 -0
  130. package/src/backup/BackupComplete.tsx +69 -0
  131. package/src/backup/BackupIntroduction.test.tsx +37 -0
  132. package/src/backup/BackupIntroduction.tsx +157 -0
  133. package/src/backup/BackupPhrase.test.tsx +71 -0
  134. package/src/backup/BackupPhrase.tsx +208 -0
  135. package/src/backup/BackupPhraseContainer.test.tsx +43 -0
  136. package/src/backup/BackupPhraseContainer.tsx +207 -0
  137. package/src/backup/BackupQuiz.test.tsx +130 -0
  138. package/src/backup/BackupQuiz.tsx +429 -0
  139. package/src/backup/CancelConfirm.tsx +60 -0
  140. package/src/backup/QuizzBottom.tsx +57 -0
  141. package/src/backup/__snapshots__/BackupComplete.test.tsx.snap +58 -0
  142. package/src/backup/__snapshots__/BackupPhrase.test.tsx.snap +906 -0
  143. package/src/backup/__snapshots__/BackupPhraseContainer.test.tsx.snap +719 -0
  144. package/src/backup/__snapshots__/BackupQuiz.test.tsx.snap +1313 -0
  145. package/src/backup/utils.test.ts +91 -0
  146. package/src/backup/utils.ts +103 -0
  147. package/src/celoNews/CeloNewsFeed.test.tsx +157 -0
  148. package/src/celoNews/CeloNewsFeed.tsx +161 -0
  149. package/src/celoNews/CeloNewsFeedItem.test.tsx +46 -0
  150. package/src/celoNews/CeloNewsFeedItem.tsx +104 -0
  151. package/src/celoNews/types.ts +14 -0
  152. package/src/components/AccountNumber.test.tsx +25 -0
  153. package/src/components/AccountNumber.tsx +78 -0
  154. package/src/components/AccountNumberCard.tsx +23 -0
  155. package/src/components/Avatar.test.tsx +67 -0
  156. package/src/components/Avatar.tsx +72 -0
  157. package/src/components/BackButton.tsx +44 -0
  158. package/src/components/BeatingHeartLoader.tsx +39 -0
  159. package/src/components/BorderlessButton.tsx +25 -0
  160. package/src/components/BottomSheet.tsx +84 -0
  161. package/src/components/BottomSheetBase.tsx +87 -0
  162. package/src/components/BottomSheetScrollView.tsx +54 -0
  163. package/src/components/Button.test.tsx +94 -0
  164. package/src/components/Button.tsx +259 -0
  165. package/src/components/CallToActionsBar.tsx +68 -0
  166. package/src/components/CancelButton.test.tsx +11 -0
  167. package/src/components/CancelButton.tsx +58 -0
  168. package/src/components/Card.tsx +34 -0
  169. package/src/components/CircleButton.test.tsx +35 -0
  170. package/src/components/CircleButton.tsx +64 -0
  171. package/src/components/ClipboardAwarePasteButton.tsx +65 -0
  172. package/src/components/CloseButton.tsx +41 -0
  173. package/src/components/CodeInput.test.tsx +26 -0
  174. package/src/components/CodeInput.tsx +124 -0
  175. package/src/components/CodeRow.test.tsx +27 -0
  176. package/src/components/CodeRow.tsx +163 -0
  177. package/src/components/ContactCircle.test.tsx +67 -0
  178. package/src/components/ContactCircle.tsx +133 -0
  179. package/src/components/ContactCircleSelf.tsx +28 -0
  180. package/src/components/CurrencyDisplay.tsx +242 -0
  181. package/src/components/DataFieldWithCopy.tsx +75 -0
  182. package/src/components/DevSkipButton.tsx +105 -0
  183. package/src/components/Dialog.test.tsx +14 -0
  184. package/src/components/Dialog.tsx +124 -0
  185. package/src/components/Dropdown.tsx +98 -0
  186. package/src/components/EmptyView.tsx +34 -0
  187. package/src/components/ErrorMessageInline.tsx +78 -0
  188. package/src/components/ExchangesBottomSheet.test.tsx +84 -0
  189. package/src/components/ExchangesBottomSheet.tsx +74 -0
  190. package/src/components/Expandable.tsx +57 -0
  191. package/src/components/FeeDrawer.test.tsx +150 -0
  192. package/src/components/FeeDrawer.tsx +127 -0
  193. package/src/components/FeeIcon.test.tsx +14 -0
  194. package/src/components/FeeIcon.tsx +95 -0
  195. package/src/components/FeeInfoBottomSheet.test.tsx +320 -0
  196. package/src/components/FeeInfoBottomSheet.tsx +219 -0
  197. package/src/components/FilterChipsCarousel.tsx +143 -0
  198. package/src/components/FormField.tsx +23 -0
  199. package/src/components/FormLabel.tsx +21 -0
  200. package/src/components/FormTextInput.tsx +16 -0
  201. package/src/components/FullscreenCTA.test.tsx +58 -0
  202. package/src/components/FullscreenCTA.tsx +60 -0
  203. package/src/components/GasFeeWarning.test.tsx +126 -0
  204. package/src/components/GasFeeWarning.tsx +124 -0
  205. package/src/components/GradientBlock.tsx +20 -0
  206. package/src/components/HorizontalLine.tsx +18 -0
  207. package/src/components/IconWithNetworkBadge.test.tsx +49 -0
  208. package/src/components/IconWithNetworkBadge.tsx +69 -0
  209. package/src/components/InLineNotification.test.tsx +74 -0
  210. package/src/components/InLineNotification.tsx +160 -0
  211. package/src/components/InfoBottomSheet.test.tsx +55 -0
  212. package/src/components/InfoBottomSheet.tsx +79 -0
  213. package/src/components/ItemSeparator.test.tsx +8 -0
  214. package/src/components/ItemSeparator.tsx +16 -0
  215. package/src/components/KeyboardAwareScrollView.tsx +104 -0
  216. package/src/components/KeyboardSpacer.tsx +168 -0
  217. package/src/components/LabelWithInfo.tsx +57 -0
  218. package/src/components/LegacyTokenDisplay.test.tsx +282 -0
  219. package/src/components/LegacyTokenDisplay.tsx +63 -0
  220. package/src/components/LegacyTokenTotalLineItem.test.tsx +90 -0
  221. package/src/components/LegacyTokenTotalLineItem.tsx +38 -0
  222. package/src/components/LineItemRow.tsx +74 -0
  223. package/src/components/ListItem.test.tsx +19 -0
  224. package/src/components/ListItem.tsx +44 -0
  225. package/src/components/MessagingCard.tsx +21 -0
  226. package/src/components/Modal.tsx +57 -0
  227. package/src/components/NumberKeypad.test.tsx +21 -0
  228. package/src/components/NumberKeypad.tsx +102 -0
  229. package/src/components/NumberTicker.tsx +115 -0
  230. package/src/components/OnboardingCard.tsx +61 -0
  231. package/src/components/Pagination.tsx +39 -0
  232. package/src/components/PercentageIndicator.test.tsx +118 -0
  233. package/src/components/PercentageIndicator.tsx +75 -0
  234. package/src/components/PhoneNumberInput.test.tsx +99 -0
  235. package/src/components/PhoneNumberInput.tsx +132 -0
  236. package/src/components/PhoneNumberWithFlag.tsx +54 -0
  237. package/src/components/QrScanButton.test.tsx +21 -0
  238. package/src/components/QrScanButton.tsx +30 -0
  239. package/src/components/RecoveryPhraseInput.test.tsx +26 -0
  240. package/src/components/RecoveryPhraseInput.tsx +188 -0
  241. package/src/components/ReviewHeader.test.tsx +21 -0
  242. package/src/components/ReviewHeader.tsx +36 -0
  243. package/src/components/ReviewTransaction.test.tsx +474 -0
  244. package/src/components/ReviewTransaction.tsx +526 -0
  245. package/src/components/RowDivider.tsx +36 -0
  246. package/src/components/SearchInput.tsx +40 -0
  247. package/src/components/SectionHead.test.tsx +9 -0
  248. package/src/components/SectionHead.tsx +33 -0
  249. package/src/components/SegmentedControl.test.tsx +28 -0
  250. package/src/components/SegmentedControl.tsx +156 -0
  251. package/src/components/SelectRecipientButton.tsx +89 -0
  252. package/src/components/SelectionOption.test.tsx +18 -0
  253. package/src/components/SelectionOption.tsx +62 -0
  254. package/src/components/SettingsGearButton.tsx +30 -0
  255. package/src/components/SettingsItem.test.tsx +80 -0
  256. package/src/components/SettingsItem.tsx +195 -0
  257. package/src/components/SimpleMessagingCard.test.tsx +54 -0
  258. package/src/components/SimpleMessagingCard.tsx +90 -0
  259. package/src/components/SingleDigitInput.tsx +53 -0
  260. package/src/components/SkeletonPlaceholder.tsx +33 -0
  261. package/src/components/SmallButton.test.tsx +41 -0
  262. package/src/components/SmallButton.tsx +74 -0
  263. package/src/components/SmartTopAlert.test.tsx +22 -0
  264. package/src/components/SmartTopAlert.tsx +183 -0
  265. package/src/components/Switch.tsx +19 -0
  266. package/src/components/TextButton.tsx +22 -0
  267. package/src/components/TextInput.tsx +133 -0
  268. package/src/components/TextInputWithButtons.test.tsx +24 -0
  269. package/src/components/TextInputWithButtons.tsx +54 -0
  270. package/src/components/Toast.test.tsx +62 -0
  271. package/src/components/Toast.tsx +180 -0
  272. package/src/components/TokenBalance.test.tsx +389 -0
  273. package/src/components/TokenBalance.tsx +321 -0
  274. package/src/components/TokenBottomSheet.test.tsx +356 -0
  275. package/src/components/TokenBottomSheet.tsx +413 -0
  276. package/src/components/TokenDisplay.test.tsx +274 -0
  277. package/src/components/TokenDisplay.tsx +104 -0
  278. package/src/components/TokenEnterAmount.test.tsx +461 -0
  279. package/src/components/TokenEnterAmount.tsx +591 -0
  280. package/src/components/TokenIcon.test.tsx +93 -0
  281. package/src/components/TokenIcon.tsx +142 -0
  282. package/src/components/TokenTotalLineItem.test.tsx +199 -0
  283. package/src/components/TokenTotalLineItem.tsx +103 -0
  284. package/src/components/Touchable.tsx +48 -0
  285. package/src/components/ValidatedTextInput.tsx +96 -0
  286. package/src/components/WebView.tsx +43 -0
  287. package/src/components/WithPasteAware.tsx +113 -0
  288. package/src/components/WithTextInputPasteAware.tsx +51 -0
  289. package/src/components/__snapshots__/AccountNumber.test.tsx.snap +87 -0
  290. package/src/components/__snapshots__/Avatar.test.tsx.snap +435 -0
  291. package/src/components/__snapshots__/Button.test.tsx.snap +292 -0
  292. package/src/components/__snapshots__/CircleButton.test.tsx.snap +211 -0
  293. package/src/components/__snapshots__/CodeRow.test.tsx.snap +211 -0
  294. package/src/components/__snapshots__/ContactCircle.test.tsx.snap +46 -0
  295. package/src/components/__snapshots__/Dialog.test.tsx.snap +248 -0
  296. package/src/components/__snapshots__/FeeIcon.test.tsx.snap +147 -0
  297. package/src/components/__snapshots__/FullscreenCTA.test.tsx.snap +183 -0
  298. package/src/components/__snapshots__/ItemSeparator.test.tsx.snap +13 -0
  299. package/src/components/__snapshots__/NumberKeypad.test.tsx.snap +1434 -0
  300. package/src/components/__snapshots__/PhoneNumberInput.test.tsx.snap +202 -0
  301. package/src/components/__snapshots__/SectionHead.test.tsx.snap +32 -0
  302. package/src/components/__snapshots__/SelectionOption.test.tsx.snap +197 -0
  303. package/src/components/__snapshots__/SettingsItem.test.tsx.snap +226 -0
  304. package/src/components/__snapshots__/SmartTopAlert.test.tsx.snap +103 -0
  305. package/src/components/__snapshots__/TextInputWithButtons.test.tsx.snap +78 -0
  306. package/src/components/header/CustomHeader.tsx +56 -0
  307. package/src/components/multiSelect/MultiSelectBottomSheet.test.tsx +175 -0
  308. package/src/components/multiSelect/MultiSelectBottomSheet.tsx +249 -0
  309. package/src/components/multiSelect/NetworkMultiSelectBottomSheet.test.tsx +77 -0
  310. package/src/components/multiSelect/NetworkMultiSelectBottomSheet.tsx +56 -0
  311. package/src/components/useShowOrHideAnimation.tsx +33 -0
  312. package/src/config.enc +0 -0
  313. package/src/config.ts +186 -0
  314. package/src/dapps/DappShortcutTransactionRequest.test.tsx +187 -0
  315. package/src/dapps/DappShortcutTransactionRequest.tsx +270 -0
  316. package/src/dapps/DappShortcutsRewards.test.tsx +292 -0
  317. package/src/dapps/DappShortcutsRewards.tsx +284 -0
  318. package/src/dapps/DappsScreen.test.tsx +716 -0
  319. package/src/dapps/DappsScreen.tsx +365 -0
  320. package/src/dapps/saga.test.ts +194 -0
  321. package/src/dapps/saga.ts +136 -0
  322. package/src/dapps/selectors.test.ts +127 -0
  323. package/src/dapps/selectors.ts +123 -0
  324. package/src/dapps/slice.ts +110 -0
  325. package/src/dapps/types.ts +30 -0
  326. package/src/dappsExplorer/DappCard.tsx +141 -0
  327. package/src/dappsExplorer/DappFeaturedActions.test.tsx +72 -0
  328. package/src/dappsExplorer/DappFeaturedActions.tsx +121 -0
  329. package/src/dappsExplorer/DiscoverDappsCard.tsx +186 -0
  330. package/src/dappsExplorer/NoResults.tsx +126 -0
  331. package/src/dappsExplorer/TabDiscover.test.tsx +397 -0
  332. package/src/dappsExplorer/TabDiscover.tsx +76 -0
  333. package/src/dappsExplorer/searchDappList.test.tsx +69 -0
  334. package/src/dappsExplorer/searchDappList.tsx +113 -0
  335. package/src/dappsExplorer/useDappFavoritedToast.tsx +56 -0
  336. package/src/dappsExplorer/useOpenDapp.tsx +31 -0
  337. package/src/divviProtocol/saga.test.ts +51 -0
  338. package/src/divviProtocol/saga.ts +44 -0
  339. package/src/earn/ActionCard.tsx +46 -0
  340. package/src/earn/EarnDepositConfirmationScreen.test.tsx +603 -0
  341. package/src/earn/EarnDepositConfirmationScreen.tsx +596 -0
  342. package/src/earn/EarnEnterAmount.test.tsx +1296 -0
  343. package/src/earn/EarnEnterAmount.tsx +815 -0
  344. package/src/earn/EarnEntrypoint.test.tsx +100 -0
  345. package/src/earn/EarnEntrypoint.tsx +127 -0
  346. package/src/earn/EarnHome.test.tsx +237 -0
  347. package/src/earn/EarnHome.tsx +411 -0
  348. package/src/earn/EarnInfoScreen.test.tsx +96 -0
  349. package/src/earn/EarnInfoScreen.tsx +174 -0
  350. package/src/earn/EarnTabBar.test.tsx +43 -0
  351. package/src/earn/EarnTabBar.tsx +73 -0
  352. package/src/earn/EarnWithdrawConfirmationScreen.test.tsx +1022 -0
  353. package/src/earn/EarnWithdrawConfirmationScreen.tsx +476 -0
  354. package/src/earn/PoolCard.test.tsx +68 -0
  355. package/src/earn/PoolCard.tsx +218 -0
  356. package/src/earn/PoolList.tsx +87 -0
  357. package/src/earn/TabEarn.test.tsx +159 -0
  358. package/src/earn/TabEarn.tsx +354 -0
  359. package/src/earn/hooks.test.tsx +328 -0
  360. package/src/earn/hooks.ts +178 -0
  361. package/src/earn/poolInfoScreen/BeforeDepositBottomSheet.test.tsx +411 -0
  362. package/src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx +448 -0
  363. package/src/earn/poolInfoScreen/Cards.tsx +383 -0
  364. package/src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx +498 -0
  365. package/src/earn/poolInfoScreen/EarnPoolInfoScreen.tsx +595 -0
  366. package/src/earn/poolInfoScreen/SafetyCard.test.tsx +108 -0
  367. package/src/earn/poolInfoScreen/SafetyCard.tsx +165 -0
  368. package/src/earn/poolInfoScreen/TokenIcons.tsx +37 -0
  369. package/src/earn/poolInfoScreen/WithdrawBottomSheet.test.tsx +235 -0
  370. package/src/earn/poolInfoScreen/WithdrawBottomSheet.tsx +168 -0
  371. package/src/earn/prepareTransactions.test.ts +616 -0
  372. package/src/earn/prepareTransactions.ts +281 -0
  373. package/src/earn/saga.test.ts +1149 -0
  374. package/src/earn/saga.ts +456 -0
  375. package/src/earn/selectors.ts +5 -0
  376. package/src/earn/simulateTransactions.test.ts +121 -0
  377. package/src/earn/simulateTransactions.ts +58 -0
  378. package/src/earn/slice.test.ts +87 -0
  379. package/src/earn/slice.ts +73 -0
  380. package/src/earn/types.ts +70 -0
  381. package/src/earn/utils.test.ts +48 -0
  382. package/src/earn/utils.ts +54 -0
  383. package/src/fiatExchanges/BidaliScreen.test.tsx +163 -0
  384. package/src/fiatExchanges/BidaliScreen.tsx +189 -0
  385. package/src/fiatExchanges/CashInSuccess.test.tsx +54 -0
  386. package/src/fiatExchanges/CashInSuccess.tsx +104 -0
  387. package/src/fiatExchanges/ExchangeQR.test.tsx +100 -0
  388. package/src/fiatExchanges/ExchangeQR.tsx +94 -0
  389. package/src/fiatExchanges/ExternalExchanges.test.tsx +67 -0
  390. package/src/fiatExchanges/ExternalExchanges.tsx +104 -0
  391. package/src/fiatExchanges/FiatExchangeAmount.test.tsx +418 -0
  392. package/src/fiatExchanges/FiatExchangeAmount.tsx +305 -0
  393. package/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx +309 -0
  394. package/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx +139 -0
  395. package/src/fiatExchanges/PaymentMethodSection.test.tsx +259 -0
  396. package/src/fiatExchanges/PaymentMethodSection.tsx +378 -0
  397. package/src/fiatExchanges/ReviewFees.test.tsx +74 -0
  398. package/src/fiatExchanges/ReviewFees.tsx +202 -0
  399. package/src/fiatExchanges/SelectProvider.test.tsx +415 -0
  400. package/src/fiatExchanges/SelectProvider.tsx +649 -0
  401. package/src/fiatExchanges/SimplexScreen.test.tsx +109 -0
  402. package/src/fiatExchanges/SimplexScreen.tsx +185 -0
  403. package/src/fiatExchanges/Spend.tsx +104 -0
  404. package/src/fiatExchanges/WithdrawSpend.test.tsx +37 -0
  405. package/src/fiatExchanges/WithdrawSpend.tsx +139 -0
  406. package/src/fiatExchanges/__snapshots__/CashInSuccess.test.tsx.snap +351 -0
  407. package/src/fiatExchanges/__snapshots__/FiatExchangeAmount.test.tsx.snap +397 -0
  408. package/src/fiatExchanges/__snapshots__/ReviewFees.test.tsx.snap +844 -0
  409. package/src/fiatExchanges/__snapshots__/SimplexScreen.test.tsx.snap +1083 -0
  410. package/src/fiatExchanges/actions.ts +67 -0
  411. package/src/fiatExchanges/amount.test.tsx +48 -0
  412. package/src/fiatExchanges/amount.tsx +45 -0
  413. package/src/fiatExchanges/quotes/ExternalQuote.test.ts +172 -0
  414. package/src/fiatExchanges/quotes/ExternalQuote.ts +121 -0
  415. package/src/fiatExchanges/quotes/FiatConnectQuote.test.ts +718 -0
  416. package/src/fiatExchanges/quotes/FiatConnectQuote.ts +343 -0
  417. package/src/fiatExchanges/quotes/NormalizedQuote.ts +47 -0
  418. package/src/fiatExchanges/quotes/constants.ts +63 -0
  419. package/src/fiatExchanges/quotes/normalizeQuotes.test.ts +102 -0
  420. package/src/fiatExchanges/quotes/normalizeQuotes.ts +76 -0
  421. package/src/fiatExchanges/quotes/utils.ts +31 -0
  422. package/src/fiatExchanges/reducer.ts +65 -0
  423. package/src/fiatExchanges/saga.test.ts +281 -0
  424. package/src/fiatExchanges/saga.ts +195 -0
  425. package/src/fiatExchanges/types.ts +104 -0
  426. package/src/fiatExchanges/utils.test.ts +159 -0
  427. package/src/fiatExchanges/utils.tsx +287 -0
  428. package/src/fiatconnect/FiatDetailsScreen.test.tsx +371 -0
  429. package/src/fiatconnect/FiatDetailsScreen.tsx +441 -0
  430. package/src/fiatconnect/LinkAccountScreen.test.tsx +107 -0
  431. package/src/fiatconnect/LinkAccountScreen.tsx +180 -0
  432. package/src/fiatconnect/RefetchQuoteScreen.test.tsx +119 -0
  433. package/src/fiatconnect/RefetchQuoteScreen.tsx +68 -0
  434. package/src/fiatconnect/ReviewScreen.test.tsx +505 -0
  435. package/src/fiatconnect/ReviewScreen.tsx +708 -0
  436. package/src/fiatconnect/TransferStatusScreen.test.tsx +399 -0
  437. package/src/fiatconnect/TransferStatusScreen.tsx +351 -0
  438. package/src/fiatconnect/clients.test.tsx +83 -0
  439. package/src/fiatconnect/clients.ts +69 -0
  440. package/src/fiatconnect/consts.ts +41 -0
  441. package/src/fiatconnect/fiatAccountSchemas/accountNumber.test.ts +60 -0
  442. package/src/fiatconnect/fiatAccountSchemas/accountNumber.ts +55 -0
  443. package/src/fiatconnect/fiatAccountSchemas/ibanNumber.test.ts +53 -0
  444. package/src/fiatconnect/fiatAccountSchemas/ibanNumber.ts +56 -0
  445. package/src/fiatconnect/fiatAccountSchemas/ifscAccount.test.ts +45 -0
  446. package/src/fiatconnect/fiatAccountSchemas/ifscAccount.ts +58 -0
  447. package/src/fiatconnect/fiatAccountSchemas/index.test.ts +119 -0
  448. package/src/fiatconnect/fiatAccountSchemas/index.ts +89 -0
  449. package/src/fiatconnect/fiatAccountSchemas/mobileMoney.test.ts +29 -0
  450. package/src/fiatconnect/fiatAccountSchemas/mobileMoney.ts +61 -0
  451. package/src/fiatconnect/fiatAccountSchemas/pixAccount.test.ts +45 -0
  452. package/src/fiatconnect/fiatAccountSchemas/pixAccount.ts +62 -0
  453. package/src/fiatconnect/fiatAccountSchemas/types.ts +40 -0
  454. package/src/fiatconnect/index.test.ts +244 -0
  455. package/src/fiatconnect/index.ts +179 -0
  456. package/src/fiatconnect/kyc/KycDenied.test.tsx +139 -0
  457. package/src/fiatconnect/kyc/KycDenied.tsx +144 -0
  458. package/src/fiatconnect/kyc/KycExpired.test.tsx +128 -0
  459. package/src/fiatconnect/kyc/KycExpired.tsx +127 -0
  460. package/src/fiatconnect/kyc/KycInactive.test.tsx +139 -0
  461. package/src/fiatconnect/kyc/KycInactive.tsx +100 -0
  462. package/src/fiatconnect/kyc/KycPending.test.tsx +82 -0
  463. package/src/fiatconnect/kyc/KycPending.tsx +106 -0
  464. package/src/fiatconnect/kyc/getNavigationOptions.tsx +72 -0
  465. package/src/fiatconnect/saga.test.ts +2594 -0
  466. package/src/fiatconnect/saga.ts +1133 -0
  467. package/src/fiatconnect/selectors.ts +24 -0
  468. package/src/fiatconnect/slice.test.ts +79 -0
  469. package/src/fiatconnect/slice.ts +380 -0
  470. package/src/fiatconnect/types.ts +24 -0
  471. package/src/firebase/actions.ts +11 -0
  472. package/src/firebase/db-rules.json +129 -0
  473. package/src/firebase/firebase.test.ts +190 -0
  474. package/src/firebase/firebase.ts +315 -0
  475. package/src/firebase/notifications.test.ts +180 -0
  476. package/src/firebase/notifications.ts +106 -0
  477. package/src/firebase/saga.test.ts +23 -0
  478. package/src/firebase/saga.ts +81 -0
  479. package/src/flags.ts +76 -0
  480. package/src/home/ActionsCarousel.test.tsx +162 -0
  481. package/src/home/ActionsCarousel.tsx +161 -0
  482. package/src/home/DivviBottomSheet.test.tsx +59 -0
  483. package/src/home/DivviBottomSheet.tsx +197 -0
  484. package/src/home/GetStarted.test.tsx +47 -0
  485. package/src/home/GetStarted.tsx +115 -0
  486. package/src/home/NotificationBell.test.tsx +81 -0
  487. package/src/home/NotificationBell.tsx +42 -0
  488. package/src/home/NotificationBox.test.tsx +373 -0
  489. package/src/home/NotificationBox.tsx +362 -0
  490. package/src/home/NotificationCenter.test.tsx +466 -0
  491. package/src/home/NotificationCenter.tsx +185 -0
  492. package/src/home/SendBar.tsx +60 -0
  493. package/src/home/TabHome.test.tsx +336 -0
  494. package/src/home/TabHome.tsx +181 -0
  495. package/src/home/__snapshots__/NotificationBox.test.tsx.snap +933 -0
  496. package/src/home/actions.ts +154 -0
  497. package/src/home/celebration/ConfettiCelebration.tsx +170 -0
  498. package/src/home/celebration/NftCelebration.test.tsx +137 -0
  499. package/src/home/celebration/NftCelebration.tsx +207 -0
  500. package/src/home/celebration/NftReward.test.tsx +94 -0
  501. package/src/home/celebration/NftReward.tsx +172 -0
  502. package/src/home/celebration/confettiAnimation.json +5126 -0
  503. package/src/home/celebration/utils.test.ts +32 -0
  504. package/src/home/celebration/utils.ts +21 -0
  505. package/src/home/reducers.test.ts +245 -0
  506. package/src/home/reducers.ts +191 -0
  507. package/src/home/saga.test.ts +34 -0
  508. package/src/home/saga.ts +87 -0
  509. package/src/home/selectors.test.ts +302 -0
  510. package/src/home/selectors.ts +82 -0
  511. package/src/home/types.ts +31 -0
  512. package/src/i18n/i18n.test.ts +106 -0
  513. package/src/i18n/index.ts +88 -0
  514. package/src/i18n/otaTranslations.test.ts +34 -0
  515. package/src/i18n/otaTranslations.ts +15 -0
  516. package/src/i18n/saga.test.ts +106 -0
  517. package/src/i18n/saga.ts +92 -0
  518. package/src/i18n/selectors.ts +12 -0
  519. package/src/i18n/slice.ts +46 -0
  520. package/src/i18n/useChangeLanguage.test.tsx +53 -0
  521. package/src/i18n/useChangeLanguage.ts +19 -0
  522. package/src/icons/Activity.tsx +21 -0
  523. package/src/icons/Apple.tsx +14 -0
  524. package/src/icons/ArrowDown.tsx +19 -0
  525. package/src/icons/ArrowRightThick.tsx +16 -0
  526. package/src/icons/Attention.tsx +22 -0
  527. package/src/icons/BackChevron.tsx +24 -0
  528. package/src/icons/Backspace.tsx +31 -0
  529. package/src/icons/BankIcon.tsx +23 -0
  530. package/src/icons/Celebration.tsx +18 -0
  531. package/src/icons/CheckCircle.tsx +19 -0
  532. package/src/icons/Checkmark.tsx +26 -0
  533. package/src/icons/CircleArrowIcon.tsx +39 -0
  534. package/src/icons/CircledIcon.tsx +47 -0
  535. package/src/icons/Clipboard.tsx +17 -0
  536. package/src/icons/ClockIcon.tsx +23 -0
  537. package/src/icons/CloudCheck.tsx +19 -0
  538. package/src/icons/ComingSoon.tsx +18 -0
  539. package/src/icons/CopyIcon.tsx +14 -0
  540. package/src/icons/CrossChainIndicator.tsx +36 -0
  541. package/src/icons/DataDown.tsx +16 -0
  542. package/src/icons/DataUp.tsx +16 -0
  543. package/src/icons/DownArrowIcon.tsx +37 -0
  544. package/src/icons/EarnCoins.tsx +22 -0
  545. package/src/icons/Error.tsx +30 -0
  546. package/src/icons/Exit.tsx +18 -0
  547. package/src/icons/ExploreTokens.tsx +17 -0
  548. package/src/icons/EyeIcon.tsx +22 -0
  549. package/src/icons/ForwardChevron.tsx +30 -0
  550. package/src/icons/GearIcon.tsx +19 -0
  551. package/src/icons/Google.tsx +14 -0
  552. package/src/icons/GradientIcon.tsx +70 -0
  553. package/src/icons/GreenLoadingSpinner.tsx +16 -0
  554. package/src/icons/GreenLoadingSpinnerToCheck.tsx +16 -0
  555. package/src/icons/HamburgerCard.tsx +55 -0
  556. package/src/icons/Help.tsx +21 -0
  557. package/src/icons/HiddenEyeIcon.tsx +26 -0
  558. package/src/icons/ImageErrorIcon.tsx +26 -0
  559. package/src/icons/InfoIcon.tsx +33 -0
  560. package/src/icons/KeylessBackup.tsx +32 -0
  561. package/src/icons/LinkArrow.tsx +27 -0
  562. package/src/icons/LoadingSpinner.tsx +25 -0
  563. package/src/icons/Lock.tsx +19 -0
  564. package/src/icons/MagicWand.tsx +20 -0
  565. package/src/icons/Manage.tsx +22 -0
  566. package/src/icons/NotificationBellIcon.tsx +25 -0
  567. package/src/icons/OpenLinkIcon.tsx +18 -0
  568. package/src/icons/Paste.tsx +33 -0
  569. package/src/icons/Phone.tsx +20 -0
  570. package/src/icons/Preferences.tsx +21 -0
  571. package/src/icons/QRCode.tsx +14 -0
  572. package/src/icons/RadioButton.tsx +39 -0
  573. package/src/icons/RedLoadingSpinnerToInfo.tsx +16 -0
  574. package/src/icons/Refresh.tsx +30 -0
  575. package/src/icons/Reward.tsx +29 -0
  576. package/src/icons/ScanIcon.tsx +26 -0
  577. package/src/icons/Search.tsx +25 -0
  578. package/src/icons/Share.tsx +21 -0
  579. package/src/icons/Social.tsx +15 -0
  580. package/src/icons/Stack.tsx +21 -0
  581. package/src/icons/StarOutline.tsx +14 -0
  582. package/src/icons/SwapAndDeposit.tsx +20 -0
  583. package/src/icons/SwapArrows.tsx +20 -0
  584. package/src/icons/ThumbsUpIllustration.tsx +64 -0
  585. package/src/icons/Times.tsx +38 -0
  586. package/src/icons/TripleDotVertical.tsx +18 -0
  587. package/src/icons/Trophy.tsx +18 -0
  588. package/src/icons/User.tsx +19 -0
  589. package/src/icons/Warning.tsx +22 -0
  590. package/src/icons/biometry/Face.tsx +28 -0
  591. package/src/icons/biometry/FaceID.tsx +18 -0
  592. package/src/icons/biometry/Fingerprint.tsx +16 -0
  593. package/src/icons/biometry/Iris.tsx +22 -0
  594. package/src/icons/biometry/TouchID.tsx +44 -0
  595. package/src/icons/loadingSpinnerGreen.json +401 -0
  596. package/src/icons/lottie-json/greenLoadingSpinner.json +370 -0
  597. package/src/icons/lottie-json/greenLoadingSpinnerToCheck.json +666 -0
  598. package/src/icons/lottie-json/redLoadingSpinnerToInfo.json +950 -0
  599. package/src/icons/navigator/Discover.tsx +17 -0
  600. package/src/icons/navigator/Home.tsx +18 -0
  601. package/src/icons/navigator/Wallet.tsx +18 -0
  602. package/src/icons/quick-actions/Add.tsx +18 -0
  603. package/src/icons/quick-actions/More.tsx +19 -0
  604. package/src/icons/quick-actions/Receive.tsx +18 -0
  605. package/src/icons/quick-actions/Send.tsx +18 -0
  606. package/src/icons/quick-actions/Withdraw.tsx +18 -0
  607. package/src/identity/actions.ts +244 -0
  608. package/src/identity/contactMapping.test.ts +391 -0
  609. package/src/identity/contactMapping.ts +422 -0
  610. package/src/identity/reducer.ts +243 -0
  611. package/src/identity/saga.test.ts +103 -0
  612. package/src/identity/saga.ts +122 -0
  613. package/src/identity/secureSend.ts +171 -0
  614. package/src/identity/selectors.ts +16 -0
  615. package/src/identity/types.ts +14 -0
  616. package/src/images/Blob.tsx +20 -0
  617. package/src/images/Celebration.tsx +35 -0
  618. package/src/images/DivviLogo.tsx +22 -0
  619. package/src/images/GuideKeyIcon.tsx +51 -0
  620. package/src/images/Images.ts +22 -0
  621. package/src/images/Logo.tsx +66 -0
  622. package/src/images/LogoHeart.tsx +206 -0
  623. package/src/images/NftReceivedIcon.tsx +18 -0
  624. package/src/images/NftSentIcon.tsx +18 -0
  625. package/src/images/Palm.tsx +21 -0
  626. package/src/images/Star.tsx +20 -0
  627. package/src/images/WelcomeLogo.tsx +19 -0
  628. package/src/images/assets/account-key-1.png +0 -0
  629. package/src/images/assets/account-key-1@1.5x.png +0 -0
  630. package/src/images/assets/account-key-1@2x.png +0 -0
  631. package/src/images/assets/account-key-1@3x.png +0 -0
  632. package/src/images/assets/account-key-1@4x.png +0 -0
  633. package/src/images/assets/account-key-2.png +0 -0
  634. package/src/images/assets/account-key-2@1.5x.png +0 -0
  635. package/src/images/assets/account-key-2@2x.png +0 -0
  636. package/src/images/assets/account-key-2@3x.png +0 -0
  637. package/src/images/assets/account-key-2@4x.png +0 -0
  638. package/src/images/assets/account-key-3.png +0 -0
  639. package/src/images/assets/account-key-3@1.5x.png +0 -0
  640. package/src/images/assets/account-key-3@2x.png +0 -0
  641. package/src/images/assets/account-key-3@3x.png +0 -0
  642. package/src/images/assets/account-key-3@4x.png +0 -0
  643. package/src/images/assets/account-key-4.png +0 -0
  644. package/src/images/assets/account-key-4@1.5x.png +0 -0
  645. package/src/images/assets/account-key-4@2x.png +0 -0
  646. package/src/images/assets/account-key-4@3x.png +0 -0
  647. package/src/images/assets/account-key-4@4x.png +0 -0
  648. package/src/images/assets/biometry-face-id.png +0 -0
  649. package/src/images/assets/biometry-face-id@1.5x.png +0 -0
  650. package/src/images/assets/biometry-face-id@2x.png +0 -0
  651. package/src/images/assets/biometry-face-id@3x.png +0 -0
  652. package/src/images/assets/biometry-face-id@4x.png +0 -0
  653. package/src/images/assets/biometry-face.png +0 -0
  654. package/src/images/assets/biometry-face@1.5x.png +0 -0
  655. package/src/images/assets/biometry-face@2x.png +0 -0
  656. package/src/images/assets/biometry-face@3x.png +0 -0
  657. package/src/images/assets/biometry-face@4x.png +0 -0
  658. package/src/images/assets/biometry-fingerprint.png +0 -0
  659. package/src/images/assets/biometry-fingerprint@1.5x.png +0 -0
  660. package/src/images/assets/biometry-fingerprint@2x.png +0 -0
  661. package/src/images/assets/biometry-fingerprint@3x.png +0 -0
  662. package/src/images/assets/biometry-fingerprint@4x.png +0 -0
  663. package/src/images/assets/biometry-iris.png +0 -0
  664. package/src/images/assets/biometry-iris@1.5x.png +0 -0
  665. package/src/images/assets/biometry-iris@2x.png +0 -0
  666. package/src/images/assets/biometry-iris@3x.png +0 -0
  667. package/src/images/assets/biometry-iris@4x.png +0 -0
  668. package/src/images/assets/biometry-touch-id.png +0 -0
  669. package/src/images/assets/biometry-touch-id@1.5x.png +0 -0
  670. package/src/images/assets/biometry-touch-id@2x.png +0 -0
  671. package/src/images/assets/biometry-touch-id@3x.png +0 -0
  672. package/src/images/assets/biometry-touch-id@4x.png +0 -0
  673. package/src/images/assets/celo-education-1.png +0 -0
  674. package/src/images/assets/celo-education-1@1.5x.png +0 -0
  675. package/src/images/assets/celo-education-1@2x.png +0 -0
  676. package/src/images/assets/celo-education-1@3x.png +0 -0
  677. package/src/images/assets/celo-education-1@4x.png +0 -0
  678. package/src/images/assets/celo-education-2.png +0 -0
  679. package/src/images/assets/celo-education-2@1.5x.png +0 -0
  680. package/src/images/assets/celo-education-2@2x.png +0 -0
  681. package/src/images/assets/celo-education-2@3x.png +0 -0
  682. package/src/images/assets/celo-education-2@4x.png +0 -0
  683. package/src/images/assets/celo-education-3.png +0 -0
  684. package/src/images/assets/celo-education-3@1.5x.png +0 -0
  685. package/src/images/assets/celo-education-3@2x.png +0 -0
  686. package/src/images/assets/celo-education-3@3x.png +0 -0
  687. package/src/images/assets/celo-education-3@4x.png +0 -0
  688. package/src/images/assets/celo-education-4.png +0 -0
  689. package/src/images/assets/celo-education-4@1.5x.png +0 -0
  690. package/src/images/assets/celo-education-4@2x.png +0 -0
  691. package/src/images/assets/celo-education-4@3x.png +0 -0
  692. package/src/images/assets/celo-education-4@4x.png +0 -0
  693. package/src/images/assets/earn-card-background.png +0 -0
  694. package/src/images/assets/earn-card-background@1.5x.png +0 -0
  695. package/src/images/assets/earn-card-background@2x.png +0 -0
  696. package/src/images/assets/earn-card-background@3x.png +0 -0
  697. package/src/images/assets/earn-card-background@4x.png +0 -0
  698. package/src/images/assets/email.png +0 -0
  699. package/src/images/assets/email@1.5x.png +0 -0
  700. package/src/images/assets/email@2x.png +0 -0
  701. package/src/images/assets/email@3x.png +0 -0
  702. package/src/images/assets/email@4x.png +0 -0
  703. package/src/images/assets/fiat-exchange.png +0 -0
  704. package/src/images/assets/fiat-exchange@1.5x.png +0 -0
  705. package/src/images/assets/fiat-exchange@2x.png +0 -0
  706. package/src/images/assets/fiat-exchange@3x.png +0 -0
  707. package/src/images/assets/fiat-exchange@4x.png +0 -0
  708. package/src/images/assets/get-verified.png +0 -0
  709. package/src/images/assets/get-verified@1.5x.png +0 -0
  710. package/src/images/assets/get-verified@2x.png +0 -0
  711. package/src/images/assets/get-verified@3x.png +0 -0
  712. package/src/images/assets/get-verified@4x.png +0 -0
  713. package/src/images/assets/learn-celo.png +0 -0
  714. package/src/images/assets/learn-celo@1.5x.png +0 -0
  715. package/src/images/assets/learn-celo@2x.png +0 -0
  716. package/src/images/assets/learn-celo@3x.png +0 -0
  717. package/src/images/assets/learn-celo@4x.png +0 -0
  718. package/src/images/assets/pie.png +0 -0
  719. package/src/images/assets/pie@1.5x.png +0 -0
  720. package/src/images/assets/pie@2x.png +0 -0
  721. package/src/images/assets/pie@3x.png +0 -0
  722. package/src/images/assets/pie@4x.png +0 -0
  723. package/src/images/assets/points-card-background.png +0 -0
  724. package/src/images/assets/points-card-background@1.5x.png +0 -0
  725. package/src/images/assets/points-card-background@2x.png +0 -0
  726. package/src/images/assets/points-card-background@3x.png +0 -0
  727. package/src/images/assets/points-card-background@4x.png +0 -0
  728. package/src/images/assets/points-illustration.png +0 -0
  729. package/src/images/assets/points-illustration@1.5x.png +0 -0
  730. package/src/images/assets/points-illustration@2x.png +0 -0
  731. package/src/images/assets/points-illustration@3x.png +0 -0
  732. package/src/images/assets/points-illustration@4x.png +0 -0
  733. package/src/images/assets/wallet-safe.png +0 -0
  734. package/src/images/assets/wallet-safe@1.5x.png +0 -0
  735. package/src/images/assets/wallet-safe@2x.png +0 -0
  736. package/src/images/assets/wallet-safe@3x.png +0 -0
  737. package/src/images/assets/wallet-safe@4x.png +0 -0
  738. package/src/import/ImportWallet.test.tsx +102 -0
  739. package/src/import/ImportWallet.tsx +277 -0
  740. package/src/import/actions.ts +41 -0
  741. package/src/import/reducer.ts +28 -0
  742. package/src/import/saga.test.ts +165 -0
  743. package/src/import/saga.ts +250 -0
  744. package/src/in-house-liquidity/client.test.ts +34 -0
  745. package/src/in-house-liquidity/client.ts +38 -0
  746. package/src/in-house-liquidity/index.test.ts +258 -0
  747. package/src/in-house-liquidity/index.ts +187 -0
  748. package/src/index.d.ts +25 -0
  749. package/src/jumpstart/JumpstartTransactionDetailsScreen.test.tsx +329 -0
  750. package/src/jumpstart/JumpstartTransactionDetailsScreen.tsx +407 -0
  751. package/src/jumpstart/fetchClaimStatus.ts +46 -0
  752. package/src/jumpstart/saga.test.ts +117 -0
  753. package/src/jumpstart/saga.ts +82 -0
  754. package/src/jumpstart/selectors.ts +5 -0
  755. package/src/jumpstart/slice.test.ts +51 -0
  756. package/src/jumpstart/slice.ts +64 -0
  757. package/src/keylessBackup/EnvelopeIcon.tsx +19 -0
  758. package/src/keylessBackup/KeylessBackupCancelButton.test.tsx +55 -0
  759. package/src/keylessBackup/KeylessBackupCancelButton.tsx +26 -0
  760. package/src/keylessBackup/KeylessBackupIntro.test.tsx +76 -0
  761. package/src/keylessBackup/KeylessBackupIntro.tsx +175 -0
  762. package/src/keylessBackup/KeylessBackupPhoneCodeInput.test.tsx +256 -0
  763. package/src/keylessBackup/KeylessBackupPhoneCodeInput.tsx +257 -0
  764. package/src/keylessBackup/KeylessBackupPhoneInput.test.tsx +67 -0
  765. package/src/keylessBackup/KeylessBackupPhoneInput.tsx +203 -0
  766. package/src/keylessBackup/KeylessBackupProgress.test.tsx +371 -0
  767. package/src/keylessBackup/KeylessBackupProgress.tsx +495 -0
  768. package/src/keylessBackup/LinkPhoneNumber.test.tsx +57 -0
  769. package/src/keylessBackup/LinkPhoneNumber.tsx +107 -0
  770. package/src/keylessBackup/SignInWithEmail.test.tsx +271 -0
  771. package/src/keylessBackup/SignInWithEmail.tsx +348 -0
  772. package/src/keylessBackup/SmartphoneIcon.tsx +19 -0
  773. package/src/keylessBackup/WalletSecurityPrimer.test.tsx +31 -0
  774. package/src/keylessBackup/WalletSecurityPrimer.tsx +81 -0
  775. package/src/keylessBackup/encryption.test.ts +139 -0
  776. package/src/keylessBackup/encryption.ts +121 -0
  777. package/src/keylessBackup/hooks.ts +179 -0
  778. package/src/keylessBackup/index.test.ts +204 -0
  779. package/src/keylessBackup/index.ts +98 -0
  780. package/src/keylessBackup/keychain.test.ts +55 -0
  781. package/src/keylessBackup/keychain.ts +30 -0
  782. package/src/keylessBackup/saga.test.ts +427 -0
  783. package/src/keylessBackup/saga.ts +264 -0
  784. package/src/keylessBackup/selectors.ts +8 -0
  785. package/src/keylessBackup/slice.ts +108 -0
  786. package/src/keylessBackup/types.ts +25 -0
  787. package/src/keylessBackup/web3auth.test.ts +74 -0
  788. package/src/keylessBackup/web3auth.ts +54 -0
  789. package/src/language/Language.test.tsx +41 -0
  790. package/src/language/Language.tsx +99 -0
  791. package/src/localCurrency/SelectLocalCurrency.test.tsx +19 -0
  792. package/src/localCurrency/SelectLocalCurrency.tsx +83 -0
  793. package/src/localCurrency/actions.ts +49 -0
  794. package/src/localCurrency/consts.test.ts +9 -0
  795. package/src/localCurrency/consts.ts +97 -0
  796. package/src/localCurrency/convert.test.ts +30 -0
  797. package/src/localCurrency/convert.ts +66 -0
  798. package/src/localCurrency/hooks.test.tsx +146 -0
  799. package/src/localCurrency/hooks.ts +47 -0
  800. package/src/localCurrency/reducer.ts +59 -0
  801. package/src/localCurrency/saga.test.ts +34 -0
  802. package/src/localCurrency/saga.ts +61 -0
  803. package/src/localCurrency/selectors.test.ts +47 -0
  804. package/src/localCurrency/selectors.ts +66 -0
  805. package/src/localCurrency/types.ts +6 -0
  806. package/src/missingGlobals.ts +21 -0
  807. package/src/nameGenerator/index.test.ts +46 -0
  808. package/src/nameGenerator/index.ts +17 -0
  809. package/src/nameGenerator/names.ts +938 -0
  810. package/src/navigator/DemoModeAuthBlock.test.tsx +60 -0
  811. package/src/navigator/DemoModeAuthBlock.tsx +61 -0
  812. package/src/navigator/DemoModeChipIndicator.test.tsx +109 -0
  813. package/src/navigator/DemoModeChipIndicator.tsx +76 -0
  814. package/src/navigator/Headers.tsx +263 -0
  815. package/src/navigator/NavigationService.test.tsx +74 -0
  816. package/src/navigator/NavigationService.ts +244 -0
  817. package/src/navigator/Navigator.tsx +760 -0
  818. package/src/navigator/NavigatorWrapper.test.tsx +65 -0
  819. package/src/navigator/NavigatorWrapper.tsx +248 -0
  820. package/src/navigator/QRNavigator.test.tsx +61 -0
  821. package/src/navigator/QRNavigator.tsx +144 -0
  822. package/src/navigator/Screens.tsx +107 -0
  823. package/src/navigator/ScrollAwareHeader.tsx +57 -0
  824. package/src/navigator/SettingsMenu.test.tsx +253 -0
  825. package/src/navigator/SettingsMenu.tsx +353 -0
  826. package/src/navigator/TabNavigator.test.tsx +181 -0
  827. package/src/navigator/TabNavigator.tsx +142 -0
  828. package/src/navigator/TopBarButton.test.tsx +44 -0
  829. package/src/navigator/TopBarButton.tsx +88 -0
  830. package/src/navigator/TopBarIconButtonV2.test.tsx +17 -0
  831. package/src/navigator/TopBarIconButtonV2.tsx +85 -0
  832. package/src/navigator/initialRoute.test.tsx +32 -0
  833. package/src/navigator/initialRoute.tsx +29 -0
  834. package/src/navigator/types.tsx +346 -0
  835. package/src/networkInfo/actions.ts +28 -0
  836. package/src/networkInfo/reducer.ts +44 -0
  837. package/src/networkInfo/saga.test.ts +43 -0
  838. package/src/networkInfo/saga.ts +100 -0
  839. package/src/networkInfo/selectors.ts +4 -0
  840. package/src/nfts/NftMedia.test.tsx +114 -0
  841. package/src/nfts/NftMedia.tsx +205 -0
  842. package/src/nfts/NftsInfoCarousel.test.tsx +218 -0
  843. package/src/nfts/NftsInfoCarousel.tsx +344 -0
  844. package/src/nfts/NftsLoadError.test.tsx +37 -0
  845. package/src/nfts/NftsLoadError.tsx +111 -0
  846. package/src/nfts/saga.test.tsx +502 -0
  847. package/src/nfts/saga.ts +198 -0
  848. package/src/nfts/selectors.ts +13 -0
  849. package/src/nfts/slice.ts +45 -0
  850. package/src/nfts/types.ts +51 -0
  851. package/src/notifications/NotificationList.test.tsx +25 -0
  852. package/src/notifications/NotificationList.tsx +45 -0
  853. package/src/notifications/__snapshots__/NotificationList.test.tsx.snap +35 -0
  854. package/src/notifications/types.ts +31 -0
  855. package/src/onboarding/LanguageButton.tsx +26 -0
  856. package/src/onboarding/TopBarTextButtonOnboarding.test.tsx +22 -0
  857. package/src/onboarding/TopBarTextButtonOnboarding.tsx +17 -0
  858. package/src/onboarding/actions.ts +46 -0
  859. package/src/onboarding/registration/EnableBiometry.test.tsx +168 -0
  860. package/src/onboarding/registration/EnableBiometry.tsx +207 -0
  861. package/src/onboarding/registration/ImportSelect.test.tsx +54 -0
  862. package/src/onboarding/registration/ImportSelect.tsx +167 -0
  863. package/src/onboarding/registration/OnboardingRecoveryPhrase.test.tsx +83 -0
  864. package/src/onboarding/registration/OnboardingRecoveryPhrase.tsx +197 -0
  865. package/src/onboarding/registration/ProtectWallet.test.tsx +96 -0
  866. package/src/onboarding/registration/ProtectWallet.tsx +153 -0
  867. package/src/onboarding/registration/RegulatoryTerms.test.tsx +75 -0
  868. package/src/onboarding/registration/RegulatoryTerms.tsx +174 -0
  869. package/src/onboarding/registration/SelectCountry.test.tsx +51 -0
  870. package/src/onboarding/registration/SelectCountry.tsx +88 -0
  871. package/src/onboarding/registration/SelectCountryItem.tsx +59 -0
  872. package/src/onboarding/steps.test.ts +464 -0
  873. package/src/onboarding/steps.ts +303 -0
  874. package/src/onboarding/success/OnboardingSuccessScreen.tsx +64 -0
  875. package/src/onboarding/types.ts +14 -0
  876. package/src/onboarding/welcome/Welcome.test.tsx +234 -0
  877. package/src/onboarding/welcome/Welcome.tsx +182 -0
  878. package/src/pincode/PasswordCache.ts +71 -0
  879. package/src/pincode/Pincode.tsx +109 -0
  880. package/src/pincode/PincodeDisplay.tsx +92 -0
  881. package/src/pincode/PincodeEnter.test.tsx +85 -0
  882. package/src/pincode/PincodeEnter.tsx +103 -0
  883. package/src/pincode/PincodeLock.test.tsx +144 -0
  884. package/src/pincode/PincodeLock.tsx +121 -0
  885. package/src/pincode/PincodeSet.test.tsx +213 -0
  886. package/src/pincode/PincodeSet.tsx +263 -0
  887. package/src/pincode/authentication.test.ts +654 -0
  888. package/src/pincode/authentication.ts +425 -0
  889. package/src/points/ActivityCard.test.tsx +63 -0
  890. package/src/points/ActivityCard.tsx +101 -0
  891. package/src/points/ActivityCardSection.tsx +126 -0
  892. package/src/points/PointsDiscoverCard.test.tsx +106 -0
  893. package/src/points/PointsDiscoverCard.tsx +122 -0
  894. package/src/points/PointsHistoryBottomSheet.test.tsx +179 -0
  895. package/src/points/PointsHistoryBottomSheet.tsx +264 -0
  896. package/src/points/PointsHome.test.tsx +230 -0
  897. package/src/points/PointsHome.tsx +357 -0
  898. package/src/points/PointsIntro.test.tsx +67 -0
  899. package/src/points/PointsIntro.tsx +85 -0
  900. package/src/points/cardDefinitions.tsx +94 -0
  901. package/src/points/cardSort.test.ts +58 -0
  902. package/src/points/cardSort.ts +18 -0
  903. package/src/points/saga.test.ts +769 -0
  904. package/src/points/saga.ts +379 -0
  905. package/src/points/selectors.test.ts +73 -0
  906. package/src/points/selectors.ts +68 -0
  907. package/src/points/slice.test.ts +76 -0
  908. package/src/points/slice.ts +164 -0
  909. package/src/points/types.ts +94 -0
  910. package/src/positions/HooksPreviewModeBanner.test.tsx +56 -0
  911. package/src/positions/HooksPreviewModeBanner.tsx +69 -0
  912. package/src/positions/actions.ts +11 -0
  913. package/src/positions/getPositionBalanceUsd.ts +14 -0
  914. package/src/positions/saga.test.ts +468 -0
  915. package/src/positions/saga.ts +378 -0
  916. package/src/positions/selectors.test.ts +281 -0
  917. package/src/positions/selectors.ts +189 -0
  918. package/src/positions/slice.ts +219 -0
  919. package/src/positions/transactions.ts +21 -0
  920. package/src/positions/types.ts +137 -0
  921. package/src/priceHistory/PriceHistoryChart.test.tsx +200 -0
  922. package/src/priceHistory/PriceHistoryChart.tsx +345 -0
  923. package/src/priceHistory/__snapshots__/PriceHistoryChart.test.tsx.snap +419 -0
  924. package/src/priceHistory/saga.test.ts +120 -0
  925. package/src/priceHistory/saga.ts +62 -0
  926. package/src/priceHistory/selectors.test.ts +52 -0
  927. package/src/priceHistory/selectors.ts +17 -0
  928. package/src/priceHistory/slice.test.ts +94 -0
  929. package/src/priceHistory/slice.ts +68 -0
  930. package/src/public/components/Button.tsx +66 -0
  931. package/src/public/createApp.ts +67 -0
  932. package/src/public/getFees.test.ts +24 -0
  933. package/src/public/getFees.ts +8 -0
  934. package/src/public/getPublicClient.test.ts +19 -0
  935. package/src/public/getPublicClient.ts +25 -0
  936. package/src/public/getWalletClient.test.ts +30 -0
  937. package/src/public/getWalletClient.ts +32 -0
  938. package/src/public/hooks/toAsyncStatus.ts +19 -0
  939. package/src/public/hooks/usePrepareTransactions.test.ts +63 -0
  940. package/src/public/hooks/usePrepareTransactions.ts +15 -0
  941. package/src/public/hooks/usePublicClient.test.ts +24 -0
  942. package/src/public/hooks/usePublicClient.ts +7 -0
  943. package/src/public/hooks/useSendTransactions.test.ts +49 -0
  944. package/src/public/hooks/useSendTransactions.ts +15 -0
  945. package/src/public/hooks/useWallet.ts +52 -0
  946. package/src/public/hooks/useWalletClient.test.ts +35 -0
  947. package/src/public/hooks/useWalletClient.ts +24 -0
  948. package/src/public/index.ts +29 -0
  949. package/src/public/navigate.test.ts +168 -0
  950. package/src/public/navigate.ts +168 -0
  951. package/src/public/prepareTransactions.test.ts +76 -0
  952. package/src/public/prepareTransactions.ts +78 -0
  953. package/src/public/sendTransactions.test.ts +37 -0
  954. package/src/public/sendTransactions.ts +25 -0
  955. package/src/public/types.tsx +278 -0
  956. package/src/public/unlockAccount.test.ts +79 -0
  957. package/src/public/unlockAccount.ts +43 -0
  958. package/src/qrcode/NotAuthorizedView.test.tsx +11 -0
  959. package/src/qrcode/NotAuthorizedView.tsx +47 -0
  960. package/src/qrcode/QRCode.test.tsx +117 -0
  961. package/src/qrcode/QRCode.tsx +190 -0
  962. package/src/qrcode/QRScanner.tsx +249 -0
  963. package/src/qrcode/QRTabBar.tsx +137 -0
  964. package/src/qrcode/StyledQRCode.tsx +31 -0
  965. package/src/qrcode/StyledQRGen.tsx +26 -0
  966. package/src/qrcode/__snapshots__/NotAuthorizedView.test.tsx.snap +90 -0
  967. package/src/qrcode/schema.test.ts +121 -0
  968. package/src/qrcode/schema.ts +45 -0
  969. package/src/qrcode/utils.test.tsx +293 -0
  970. package/src/qrcode/utils.ts +230 -0
  971. package/src/recaptcha/RecaptchaService.ts +105 -0
  972. package/src/recaptcha/saga.ts +24 -0
  973. package/src/recipients/RecipientItemV2.test.tsx +153 -0
  974. package/src/recipients/RecipientItemV2.tsx +142 -0
  975. package/src/recipients/RecipientPickerV2.test.tsx +110 -0
  976. package/src/recipients/RecipientPickerV2.tsx +61 -0
  977. package/src/recipients/recipient.test.ts +113 -0
  978. package/src/recipients/recipient.ts +313 -0
  979. package/src/recipients/reducer.ts +107 -0
  980. package/src/recipients/resolve-id.ts +21 -0
  981. package/src/recipients/saga.ts +87 -0
  982. package/src/redux/apiReducersList.ts +11 -0
  983. package/src/redux/createMigrate.test.ts +113 -0
  984. package/src/redux/createMigrate.ts +46 -0
  985. package/src/redux/hooks.ts +7 -0
  986. package/src/redux/migrations.test.ts +1925 -0
  987. package/src/redux/migrations.ts +2069 -0
  988. package/src/redux/persist-helper.ts +14 -0
  989. package/src/redux/reducers.ts +29 -0
  990. package/src/redux/reducersForSchemaGeneration.ts +20 -0
  991. package/src/redux/reducersList.ts +57 -0
  992. package/src/redux/sagas-helpers.ts +29 -0
  993. package/src/redux/sagas.test.ts +19 -0
  994. package/src/redux/sagas.ts +155 -0
  995. package/src/redux/selectors.ts +3 -0
  996. package/src/redux/store.test.ts +391 -0
  997. package/src/redux/store.ts +151 -0
  998. package/src/send/EnterAmount.test.tsx +1030 -0
  999. package/src/send/EnterAmount.tsx +360 -0
  1000. package/src/send/EnterAmountOptions.tsx +170 -0
  1001. package/src/send/PasteAddressButton.tsx +81 -0
  1002. package/src/send/SelectRecipientButtons.test.tsx +256 -0
  1003. package/src/send/SelectRecipientButtons.tsx +202 -0
  1004. package/src/send/SendConfirmation.test.tsx +233 -0
  1005. package/src/send/SendConfirmation.tsx +317 -0
  1006. package/src/send/SendEnterAmount.test.tsx +235 -0
  1007. package/src/send/SendEnterAmount.tsx +123 -0
  1008. package/src/send/SendSelectRecipient.test.tsx +765 -0
  1009. package/src/send/SendSelectRecipient.tsx +504 -0
  1010. package/src/send/SendSelectRecipientSearchInput.tsx +72 -0
  1011. package/src/send/ValidateRecipientAccount.test.tsx +181 -0
  1012. package/src/send/ValidateRecipientAccount.tsx +387 -0
  1013. package/src/send/ValidateRecipientIntro.test.tsx +61 -0
  1014. package/src/send/ValidateRecipientIntro.tsx +136 -0
  1015. package/src/send/__snapshots__/ValidateRecipientAccount.test.tsx.snap +777 -0
  1016. package/src/send/actions.ts +142 -0
  1017. package/src/send/hooks.test.tsx +371 -0
  1018. package/src/send/hooks.ts +445 -0
  1019. package/src/send/reducers.ts +90 -0
  1020. package/src/send/saga.test.ts +247 -0
  1021. package/src/send/saga.ts +176 -0
  1022. package/src/send/selectors.ts +22 -0
  1023. package/src/send/types.ts +18 -0
  1024. package/src/send/useFetchRecipientVerificationStatus.ts +67 -0
  1025. package/src/send/usePrepareSendTransactions.test.ts +135 -0
  1026. package/src/send/usePrepareSendTransactions.ts +69 -0
  1027. package/src/send/utils.test.ts +361 -0
  1028. package/src/send/utils.ts +116 -0
  1029. package/src/sendCalls/constants.ts +11 -0
  1030. package/src/sendCalls/saga.test.ts +31 -0
  1031. package/src/sendCalls/saga.ts +15 -0
  1032. package/src/sendCalls/selectors.test.ts +40 -0
  1033. package/src/sendCalls/selectors.ts +8 -0
  1034. package/src/sendCalls/slice.test.ts +85 -0
  1035. package/src/sendCalls/slice.ts +72 -0
  1036. package/src/sentry/Sentry.ts +75 -0
  1037. package/src/sentry/SentrySpanHub.ts +27 -0
  1038. package/src/sentry/SentrySpans.tsx +57 -0
  1039. package/src/sentry/actions.ts +11 -0
  1040. package/src/sentry/saga.ts +8 -0
  1041. package/src/shared/DisconnectBanner.test.tsx +25 -0
  1042. package/src/shared/DisconnectBanner.tsx +81 -0
  1043. package/src/shared/__snapshots__/DisconnectBanner.test.tsx.snap +29 -0
  1044. package/src/shared/conts.ts +16 -0
  1045. package/src/statsig/client.test.ts +62 -0
  1046. package/src/statsig/client.ts +97 -0
  1047. package/src/statsig/constants.ts +177 -0
  1048. package/src/statsig/index.test.ts +351 -0
  1049. package/src/statsig/index.ts +186 -0
  1050. package/src/statsig/selector.ts +17 -0
  1051. package/src/statsig/types.ts +52 -0
  1052. package/src/storage/keychain.tsx +92 -0
  1053. package/src/styles/accessibility.ts +7 -0
  1054. package/src/styles/appTheme.ts +13 -0
  1055. package/src/styles/colors.tsx +78 -0
  1056. package/src/styles/fonts.tsx +143 -0
  1057. package/src/styles/hapticFeedback.ts +27 -0
  1058. package/src/styles/progressDots.ts +23 -0
  1059. package/src/styles/styles.ts +67 -0
  1060. package/src/styles/variables.tsx +16 -0
  1061. package/src/swap/SwapAmountInput.tsx +228 -0
  1062. package/src/swap/SwapScreen.test.tsx +1927 -0
  1063. package/src/swap/SwapScreen.tsx +1156 -0
  1064. package/src/swap/SwapScreenV2.test.tsx +2180 -0
  1065. package/src/swap/SwapScreenV2.tsx +1201 -0
  1066. package/src/swap/SwapTransactionDetails.test.tsx +217 -0
  1067. package/src/swap/SwapTransactionDetails.tsx +274 -0
  1068. package/src/swap/UnfavorableRateBottomSheet.test.tsx +150 -0
  1069. package/src/swap/UnfavorableRateBottomSheet.tsx +288 -0
  1070. package/src/swap/getCrossChainFee.ts +64 -0
  1071. package/src/swap/getSwapTxsAnalyticsProperties.tsx +49 -0
  1072. package/src/swap/saga.test.ts +863 -0
  1073. package/src/swap/saga.ts +324 -0
  1074. package/src/swap/selectors.ts +5 -0
  1075. package/src/swap/slice.test.ts +133 -0
  1076. package/src/swap/slice.ts +93 -0
  1077. package/src/swap/types.ts +98 -0
  1078. package/src/swap/useFilterChips.ts +69 -0
  1079. package/src/swap/useSwapQuote.ts +292 -0
  1080. package/src/tokens/AssetList.test.tsx +270 -0
  1081. package/src/tokens/AssetList.tsx +388 -0
  1082. package/src/tokens/AssetTabBar.test.tsx +130 -0
  1083. package/src/tokens/AssetTabBar.tsx +106 -0
  1084. package/src/tokens/PasteButton.test.tsx +30 -0
  1085. package/src/tokens/PasteButton.tsx +34 -0
  1086. package/src/tokens/PositionIcon.tsx +22 -0
  1087. package/src/tokens/PositionItem.test.tsx +132 -0
  1088. package/src/tokens/PositionItem.tsx +131 -0
  1089. package/src/tokens/TabWallet.test.tsx +386 -0
  1090. package/src/tokens/TabWallet.tsx +237 -0
  1091. package/src/tokens/TokenBalanceItem.test.tsx +119 -0
  1092. package/src/tokens/TokenBalanceItem.tsx +143 -0
  1093. package/src/tokens/TokenDetails.test.tsx +476 -0
  1094. package/src/tokens/TokenDetails.tsx +391 -0
  1095. package/src/tokens/TokenDetailsMoreActions.test.tsx +120 -0
  1096. package/src/tokens/TokenDetailsMoreActions.tsx +87 -0
  1097. package/src/tokens/TokenImport.test.tsx +376 -0
  1098. package/src/tokens/TokenImport.tsx +381 -0
  1099. package/src/tokens/hooks.test.tsx +419 -0
  1100. package/src/tokens/hooks.ts +164 -0
  1101. package/src/tokens/saga.test.ts +527 -0
  1102. package/src/tokens/saga.ts +248 -0
  1103. package/src/tokens/selectors.test.ts +888 -0
  1104. package/src/tokens/selectors.ts +516 -0
  1105. package/src/tokens/slice.ts +173 -0
  1106. package/src/tokens/types.ts +29 -0
  1107. package/src/tokens/utils.test.tsx +330 -0
  1108. package/src/tokens/utils.ts +218 -0
  1109. package/src/transactions/NoActivity.test.tsx +30 -0
  1110. package/src/transactions/NoActivity.tsx +73 -0
  1111. package/src/transactions/TransferAvatars.tsx +39 -0
  1112. package/src/transactions/UserSection.tsx +133 -0
  1113. package/src/transactions/api.ts +67 -0
  1114. package/src/transactions/apiTestHelpers.ts +55 -0
  1115. package/src/transactions/feed/ClaimRewardFeedItem.test.tsx +164 -0
  1116. package/src/transactions/feed/ClaimRewardFeedItem.tsx +142 -0
  1117. package/src/transactions/feed/DepositOrWithdrawFeedItem.test.tsx +138 -0
  1118. package/src/transactions/feed/DepositOrWithdrawFeedItem.tsx +178 -0
  1119. package/src/transactions/feed/EarnFeedItem.test.tsx +189 -0
  1120. package/src/transactions/feed/EarnFeedItem.tsx +190 -0
  1121. package/src/transactions/feed/NftFeedItem.test.tsx +102 -0
  1122. package/src/transactions/feed/NftFeedItem.tsx +99 -0
  1123. package/src/transactions/feed/SwapFeedItem.test.tsx +137 -0
  1124. package/src/transactions/feed/SwapFeedItem.tsx +128 -0
  1125. package/src/transactions/feed/TokenApprovalFeedItem.test.tsx +37 -0
  1126. package/src/transactions/feed/TokenApprovalFeedItem.tsx +59 -0
  1127. package/src/transactions/feed/TransactionDetails.tsx +160 -0
  1128. package/src/transactions/feed/TransactionDetailsScreen.test.tsx +1228 -0
  1129. package/src/transactions/feed/TransactionDetailsScreen.tsx +157 -0
  1130. package/src/transactions/feed/TransactionFeed.test.tsx +474 -0
  1131. package/src/transactions/feed/TransactionFeed.tsx +172 -0
  1132. package/src/transactions/feed/TransactionFeedItemImage.test.tsx +66 -0
  1133. package/src/transactions/feed/TransactionFeedItemImage.tsx +116 -0
  1134. package/src/transactions/feed/TransactionFeedV2.test.tsx +576 -0
  1135. package/src/transactions/feed/TransactionFeedV2.tsx +504 -0
  1136. package/src/transactions/feed/TransactionPrimaryAction.test.tsx +62 -0
  1137. package/src/transactions/feed/TransactionPrimaryAction.tsx +83 -0
  1138. package/src/transactions/feed/TransactionStatusIndicator.test.tsx +15 -0
  1139. package/src/transactions/feed/TransactionStatusIndicator.tsx +63 -0
  1140. package/src/transactions/feed/TransferFeedItem.test.tsx +579 -0
  1141. package/src/transactions/feed/TransferFeedItem.tsx +148 -0
  1142. package/src/transactions/feed/detailContent/ClaimRewardContent.tsx +84 -0
  1143. package/src/transactions/feed/detailContent/DepositOrWithdrawContent.tsx +169 -0
  1144. package/src/transactions/feed/detailContent/EarnContent.tsx +259 -0
  1145. package/src/transactions/feed/detailContent/FeeRowItem.tsx +90 -0
  1146. package/src/transactions/feed/detailContent/RewardReceivedContent.tsx +46 -0
  1147. package/src/transactions/feed/detailContent/SwapContent.tsx +127 -0
  1148. package/src/transactions/feed/detailContent/TokenApprovalDetails.tsx +59 -0
  1149. package/src/transactions/feed/detailContent/TransferReceivedContent.tsx +73 -0
  1150. package/src/transactions/feed/detailContent/TransferSentContent.tsx +117 -0
  1151. package/src/transactions/feed/queryHelper.test.ts +229 -0
  1152. package/src/transactions/feed/queryHelper.ts +941 -0
  1153. package/src/transactions/saga.test.ts +482 -0
  1154. package/src/transactions/saga.ts +322 -0
  1155. package/src/transactions/selectors.ts +120 -0
  1156. package/src/transactions/send.test.ts +29 -0
  1157. package/src/transactions/send.ts +51 -0
  1158. package/src/transactions/slice.test.ts +372 -0
  1159. package/src/transactions/slice.ts +262 -0
  1160. package/src/transactions/transferFeedUtils.ts +225 -0
  1161. package/src/transactions/types.ts +355 -0
  1162. package/src/transactions/utils.test.ts +98 -0
  1163. package/src/transactions/utils.ts +122 -0
  1164. package/src/utils/AppRestart.ts +12 -0
  1165. package/src/utils/Countries.test.ts +180 -0
  1166. package/src/utils/Countries.ts +121 -0
  1167. package/src/utils/IosVersionUtils.ts +6 -0
  1168. package/src/utils/Logger.test.ts +113 -0
  1169. package/src/utils/Logger.ts +304 -0
  1170. package/src/utils/LoggerLevels.ts +6 -0
  1171. package/src/utils/account.test.ts +390 -0
  1172. package/src/utils/account.ts +497 -0
  1173. package/src/utils/accountChecker.test.ts +75 -0
  1174. package/src/utils/accountChecker.ts +77 -0
  1175. package/src/utils/address.test.ts +62 -0
  1176. package/src/utils/address.ts +34 -0
  1177. package/src/utils/aes.test.ts +36 -0
  1178. package/src/utils/aes.ts +46 -0
  1179. package/src/utils/contacts.ts +78 -0
  1180. package/src/utils/contentTranslations.ts +18 -0
  1181. package/src/utils/country.json +257 -0
  1182. package/src/utils/countryFeatures.ts +21 -0
  1183. package/src/utils/currencies.ts +72 -0
  1184. package/src/utils/displayFormatting.ts +11 -0
  1185. package/src/utils/ensureError.test.ts +32 -0
  1186. package/src/utils/ensureError.ts +13 -0
  1187. package/src/utils/fetchWithTimeout.test.ts +55 -0
  1188. package/src/utils/fetchWithTimeout.ts +15 -0
  1189. package/src/utils/formatting.test.ts +93 -0
  1190. package/src/utils/formatting.ts +107 -0
  1191. package/src/utils/getCountryEmoji.ts +28 -0
  1192. package/src/utils/getPhoneHash.ts +29 -0
  1193. package/src/utils/gql.ts +8 -0
  1194. package/src/utils/identifier.ts +81 -0
  1195. package/src/utils/inputValidation.test.ts +53 -0
  1196. package/src/utils/inputValidation.ts +76 -0
  1197. package/src/utils/io.ts +39 -0
  1198. package/src/utils/linking.ts +42 -0
  1199. package/src/utils/moneyAmount.ts +16 -0
  1200. package/src/utils/parsing.test.ts +30 -0
  1201. package/src/utils/parsing.ts +20 -0
  1202. package/src/utils/phoneNumber.test.ts +236 -0
  1203. package/src/utils/phoneNumbers.ts +240 -0
  1204. package/src/utils/random.test.ts +53 -0
  1205. package/src/utils/random.ts +48 -0
  1206. package/src/utils/safely.test.ts +101 -0
  1207. package/src/utils/safely.ts +30 -0
  1208. package/src/utils/sleep.ts +3 -0
  1209. package/src/utils/string.ts +8 -0
  1210. package/src/utils/stylize.ts +30 -0
  1211. package/src/utils/time.test.ts +76 -0
  1212. package/src/utils/time.ts +99 -0
  1213. package/src/utils/typescript.ts +38 -0
  1214. package/src/utils/useBackHandler.ts +10 -0
  1215. package/src/utils/useClipboard.ts +56 -0
  1216. package/src/utils/versionCheck.test.ts +47 -0
  1217. package/src/utils/versionCheck.ts +35 -0
  1218. package/src/verify/ResendButtonWithDelay.tsx +56 -0
  1219. package/src/verify/VerificationCodeInput.test.tsx +87 -0
  1220. package/src/verify/VerificationCodeInput.tsx +103 -0
  1221. package/src/verify/VerificationCodeInputScreen.test.tsx +364 -0
  1222. package/src/verify/VerificationCodeInputScreen.tsx +138 -0
  1223. package/src/verify/VerificationStartScreen.test.tsx +218 -0
  1224. package/src/verify/VerificationStartScreen.tsx +311 -0
  1225. package/src/verify/hooks.test.tsx +85 -0
  1226. package/src/verify/hooks.ts +261 -0
  1227. package/src/viem/estimateFeesPerGas.test.ts +129 -0
  1228. package/src/viem/estimateFeesPerGas.ts +70 -0
  1229. package/src/viem/getLockableWallet.test.ts +263 -0
  1230. package/src/viem/getLockableWallet.ts +120 -0
  1231. package/src/viem/index.ts +86 -0
  1232. package/src/viem/keychainAccountToAccount.test.ts +55 -0
  1233. package/src/viem/keychainAccountToAccount.ts +58 -0
  1234. package/src/viem/prepareTransactions.test.ts +1668 -0
  1235. package/src/viem/prepareTransactions.ts +741 -0
  1236. package/src/viem/preparedTransactionSerialization.test.ts +192 -0
  1237. package/src/viem/preparedTransactionSerialization.ts +100 -0
  1238. package/src/viem/saga.test.ts +227 -0
  1239. package/src/viem/saga.ts +118 -0
  1240. package/src/walletConnect/actions.test.ts +94 -0
  1241. package/src/walletConnect/actions.ts +232 -0
  1242. package/src/walletConnect/analytics.ts +58 -0
  1243. package/src/walletConnect/capabilities.ts +175 -0
  1244. package/src/walletConnect/constants.ts +157 -0
  1245. package/src/walletConnect/reducer.ts +105 -0
  1246. package/src/walletConnect/request.test.ts +698 -0
  1247. package/src/walletConnect/request.ts +225 -0
  1248. package/src/walletConnect/saga.test.ts +1875 -0
  1249. package/src/walletConnect/saga.ts +1159 -0
  1250. package/src/walletConnect/screens/ActionRequest.test.tsx +727 -0
  1251. package/src/walletConnect/screens/ActionRequest.tsx +227 -0
  1252. package/src/walletConnect/screens/ActionRequestPayload.tsx +84 -0
  1253. package/src/walletConnect/screens/ConnectionTimedOut.tsx +34 -0
  1254. package/src/walletConnect/screens/DappsDisclaimer.tsx +31 -0
  1255. package/src/walletConnect/screens/EstimatedNetworkFee.test.tsx +88 -0
  1256. package/src/walletConnect/screens/EstimatedNetworkFee.tsx +134 -0
  1257. package/src/walletConnect/screens/Logos.tsx +89 -0
  1258. package/src/walletConnect/screens/RequestContent.tsx +224 -0
  1259. package/src/walletConnect/screens/SessionRequest.test.tsx +274 -0
  1260. package/src/walletConnect/screens/SessionRequest.tsx +221 -0
  1261. package/src/walletConnect/screens/Sessions.tsx +142 -0
  1262. package/src/walletConnect/screens/WalletConnectRequest.tsx +63 -0
  1263. package/src/walletConnect/screens/useIsDappListed.test.tsx +51 -0
  1264. package/src/walletConnect/screens/useIsDappListed.ts +20 -0
  1265. package/src/walletConnect/selectors.ts +25 -0
  1266. package/src/walletConnect/types.ts +99 -0
  1267. package/src/walletConnect/walletConnect.ts +87 -0
  1268. package/src/web3/KeychainAccounts.test.ts +326 -0
  1269. package/src/web3/KeychainAccounts.ts +309 -0
  1270. package/src/web3/actions.ts +30 -0
  1271. package/src/web3/consts.ts +8 -0
  1272. package/src/web3/contracts.test.ts +115 -0
  1273. package/src/web3/contracts.ts +74 -0
  1274. package/src/web3/networkConfig.test.ts +18 -0
  1275. package/src/web3/networkConfig.ts +621 -0
  1276. package/src/web3/reducer.ts +39 -0
  1277. package/src/web3/saga.test.ts +200 -0
  1278. package/src/web3/saga.ts +229 -0
  1279. package/src/web3/selectors.ts +47 -0
  1280. package/src/web3/utils.test.ts +12 -0
  1281. package/src/web3/utils.ts +11 -0
  1282. package/src/webview/WebViewAndroidBottomSheet.test.tsx +58 -0
  1283. package/src/webview/WebViewAndroidBottomSheet.tsx +83 -0
  1284. package/src/webview/WebViewScreen.test.tsx +84 -0
  1285. package/src/webview/WebViewScreen.tsx +296 -0
  1286. package/src/webview/__snapshots__/WebViewAndroidBottomSheet.test.tsx.snap +249 -0
  1287. package/tsconfig.base.json +5 -0
  1288. package/tsconfig.json +30 -0
@@ -0,0 +1,1925 @@
1
+ import BigNumber from 'bignumber.js'
2
+ import _ from 'lodash'
3
+ import {
4
+ FinclusiveKycStatus,
5
+ PincodeType,
6
+ RecoveryPhraseInOnboardingStatus,
7
+ } from 'src/account/reducer'
8
+ import { DEEP_LINK_URL_SCHEME, ONBOARDING_FEATURES_ENABLED } from 'src/config'
9
+ import { Screens } from 'src/navigator/Screens'
10
+ import { ToggleableOnboardingFeatures } from 'src/onboarding/types'
11
+ import { exchangeInitialState, migrations } from 'src/redux/migrations'
12
+ import {
13
+ Network,
14
+ NetworkId,
15
+ TokenTransactionTypeV2,
16
+ TransactionStatus,
17
+ } from 'src/transactions/types'
18
+ import { CiCoCurrency, Currency } from 'src/utils/currencies'
19
+ import {
20
+ DEFAULT_DAILY_PAYMENT_LIMIT_CUSD_LEGACY,
21
+ v0Schema,
22
+ v103Schema,
23
+ v104Schema,
24
+ v106Schema,
25
+ v112Schema,
26
+ v115Schema,
27
+ v124Schema,
28
+ v125Schema,
29
+ v130Schema,
30
+ v132Schema,
31
+ v133Schema,
32
+ v136Schema,
33
+ v13Schema,
34
+ v144Schema,
35
+ v145Schema,
36
+ v146Schema,
37
+ v148Schema,
38
+ v14Schema,
39
+ v159Schema,
40
+ v15Schema,
41
+ v164Schema,
42
+ v166Schema,
43
+ v167Schema,
44
+ v16Schema,
45
+ v171Schema,
46
+ v172Schema,
47
+ v174Schema,
48
+ v176Schema,
49
+ v177Schema,
50
+ v178Schema,
51
+ v179Schema,
52
+ v17Schema,
53
+ v18Schema,
54
+ v197Schema,
55
+ v1Schema,
56
+ v200Schema,
57
+ v201Schema,
58
+ v203Schema,
59
+ v214Schema,
60
+ v216Schema,
61
+ v21Schema,
62
+ v222Schema,
63
+ v227Schema,
64
+ v228Schema,
65
+ v230Schema,
66
+ v233Schema,
67
+ v235Schema,
68
+ v251Schema,
69
+ v28Schema,
70
+ v2Schema,
71
+ v35Schema,
72
+ v36Schema,
73
+ v37Schema,
74
+ v41Schema,
75
+ v43Schema,
76
+ v45Schema,
77
+ v46Schema,
78
+ v49Schema,
79
+ v50Schema,
80
+ v51Schema,
81
+ v52Schema,
82
+ v53Schema,
83
+ v56Schema,
84
+ v57Schema,
85
+ v58Schema,
86
+ v59Schema,
87
+ v62Schema,
88
+ v75Schema,
89
+ v7Schema,
90
+ v81Schema,
91
+ v84Schema,
92
+ v8Schema,
93
+ v98Schema,
94
+ v99Schema,
95
+ vNeg1Schema,
96
+ } from 'test/schemas'
97
+ import {
98
+ mockEarnDepositTransaction,
99
+ mockInvitableRecipient,
100
+ mockInvitableRecipient2,
101
+ mockPositionsLegacy,
102
+ mockPositionsLegacy2,
103
+ mockRecipient,
104
+ mockRecipient2,
105
+ mockShortcuts,
106
+ mockShortcutsLegacy,
107
+ } from 'test/values'
108
+
109
+ describe('Redux persist migrations', () => {
110
+ beforeEach(() => {
111
+ jest.replaceProperty(
112
+ ONBOARDING_FEATURES_ENABLED,
113
+ ToggleableOnboardingFeatures.CloudBackup,
114
+ false
115
+ )
116
+ jest.replaceProperty(
117
+ ONBOARDING_FEATURES_ENABLED,
118
+ ToggleableOnboardingFeatures.PhoneVerification,
119
+ false
120
+ )
121
+ })
122
+ it('works for v-1 to v0', () => {
123
+ const mockNumber = '+111111111111'
124
+ const mockAddress = '0x00000000000000000000'
125
+ const vNeg1Stub = {
126
+ ...vNeg1Schema,
127
+ identity: {
128
+ ...vNeg1Schema.identity,
129
+ e164NumberToAddress: { [mockNumber]: mockAddress },
130
+ },
131
+ }
132
+ const migratedSchema = migrations[0](vNeg1Stub)
133
+ expect(migratedSchema.identity.e164NumberToAddress).toEqual({ [mockNumber]: [mockAddress] })
134
+ })
135
+
136
+ it('works for v0 to v1', () => {
137
+ const mockNumber = '+111111111111'
138
+ const mockAddress = '0x00000000000000000000'
139
+ const v0Stub = {
140
+ ...v0Schema,
141
+ invite: {
142
+ ...v0Schema.invite,
143
+ invitees: {
144
+ [mockAddress]: mockNumber,
145
+ },
146
+ },
147
+ }
148
+ const migratedSchema = migrations[1](v0Stub)
149
+ expect(migratedSchema.invite.invitees[0].tempWalletAddress).toEqual(mockAddress)
150
+ })
151
+
152
+ it('works for v1 to v2', () => {
153
+ const v1Stub = {
154
+ ...v1Schema,
155
+ app: {
156
+ ...v1Schema.app,
157
+ numberVerified: true,
158
+ },
159
+ }
160
+ const migratedSchema = migrations[2](v1Stub)
161
+ expect(migratedSchema.app.numberVerified).toEqual(false)
162
+ })
163
+
164
+ it('works for v2 to v3', () => {
165
+ const v2Stub = {
166
+ ...v2Schema,
167
+ send: {
168
+ ...v2Schema.send,
169
+ recentPayments: [{ timestamp: Date.now(), amount: '100' }],
170
+ },
171
+ account: {
172
+ ...v2Schema.account,
173
+ hasMigratedToNewBip39: false,
174
+ },
175
+ }
176
+ const migratedSchema = migrations[3](v2Stub)
177
+ expect(migratedSchema.send.recentPayments.length).toEqual(0)
178
+ })
179
+
180
+ it('works for v3 to v4', () => {
181
+ const v3Stub = {
182
+ ...v2Schema,
183
+ identity: {
184
+ ...v2Schema.identity,
185
+ acceptedAttestationCodes: [{ code: 'code', issuer: 'issuer' }],
186
+ },
187
+ }
188
+ const migratedSchema = migrations[4](v3Stub)
189
+ expect(migratedSchema.identity.acceptedAttestationCodes.length).toEqual(0)
190
+ })
191
+
192
+ it('works for v4 to v5', () => {
193
+ const v4Stub = {
194
+ account: {
195
+ incomingPaymentRequests: [1, 2, 3],
196
+ outgoingPaymentRequests: [],
197
+ },
198
+ web3: {
199
+ commentKey: 'key',
200
+ },
201
+ }
202
+ const migratedSchema = migrations[5](v4Stub)
203
+ expect(migratedSchema.paymentRequest.incomingPaymentRequests).toMatchObject([1, 2, 3])
204
+ expect(migratedSchema.paymentRequest.outgoingPaymentRequests).toMatchObject([])
205
+ expect(migratedSchema.account.incomingPaymentRequests).toBe(undefined)
206
+ expect(migratedSchema.account.outgoingPaymentRequests).toBe(undefined)
207
+ expect(migratedSchema.web3.dataEncryptionKey).toBe('key')
208
+ expect(migratedSchema.web3.commentKey).toBe(undefined)
209
+ })
210
+
211
+ it('works for v5 to v6', () => {
212
+ const v5Stub = {
213
+ invite: {
214
+ redeemComplete: false,
215
+ },
216
+ web3: {
217
+ account: 'some_account',
218
+ },
219
+ }
220
+ const migratedSchema = migrations[6](v5Stub)
221
+ expect(migratedSchema.invite.redeemComplete).toBe(true)
222
+ })
223
+
224
+ it('works for v6 to v7', () => {
225
+ const mockAddress = '0x00000000000000000000'
226
+ const mockName = 'Mock Name'
227
+
228
+ const v6Stub = {
229
+ identity: {
230
+ addressToDisplayName: {
231
+ [mockAddress]: mockName,
232
+ },
233
+ },
234
+ }
235
+ const migratedSchema = migrations[7](v6Stub)
236
+ expect(Object.keys(migratedSchema.identity.addressToDisplayName).length).toEqual(1)
237
+ expect(migratedSchema.identity.addressToDisplayName[mockAddress].name).toEqual(mockName)
238
+ expect(migratedSchema.identity.addressToDisplayName[mockAddress].imageUrl).toBeNull()
239
+ })
240
+
241
+ it('works for v7 to v8', () => {
242
+ const txHash = '0x00000000000000000000'
243
+ const mockName = 'Mock Name'
244
+ const mockIcon = 'Mock icon'
245
+
246
+ const v7Stub = {
247
+ fiatExchanges: {
248
+ txHashToProvider: {
249
+ [txHash]: {
250
+ name: mockName,
251
+ icon: mockIcon,
252
+ },
253
+ },
254
+ lastUsedProvider: {
255
+ name: 'Simplex',
256
+ icon: mockIcon,
257
+ },
258
+ },
259
+ }
260
+ const migratedSchema = migrations[8](v7Stub)
261
+ expect(Object.keys(migratedSchema.fiatExchanges.txHashToProvider).length).toEqual(1)
262
+ expect(migratedSchema.fiatExchanges.txHashToProvider[txHash].name).toEqual(mockName)
263
+ expect(migratedSchema.fiatExchanges.txHashToProvider[txHash].icon).toEqual(mockIcon)
264
+ expect(migratedSchema.fiatExchanges.lastUsedProvider).toEqual('Simplex')
265
+ })
266
+
267
+ it('works for v8 to v9', () => {
268
+ const v8Stub = {
269
+ account: {
270
+ dailyLimitCusd: 500,
271
+ },
272
+ }
273
+ const migratedSchema = migrations[9](v8Stub)
274
+ expect(migratedSchema.account.dailyLimitCusd).toEqual(DEFAULT_DAILY_PAYMENT_LIMIT_CUSD_LEGACY)
275
+ })
276
+ it('works for v9 to v10', () => {
277
+ const v9Stub = v7Schema
278
+ const migratedSchema = migrations[10](v9Stub)
279
+ expect(migratedSchema.identity.feelessAttestationCodes).toBeUndefined()
280
+ expect(migratedSchema.identity.feelessProcessingInputCode).toBeUndefined()
281
+ expect(migratedSchema.identity.feelessAcceptedAttestationCodes).toBeUndefined()
282
+ expect(migratedSchema.identity.feelessNumCompleteAttestations).toBeUndefined()
283
+ expect(migratedSchema.identity.feelessVerificationStatus).toBeUndefined()
284
+ expect(migratedSchema.identity.verificationState).toBeUndefined()
285
+ expect(migratedSchema.identity.feelessVerificationState).toBeUndefined()
286
+ expect(migratedSchema.identity.feelessLastRevealAttempt).toBeUndefined()
287
+ })
288
+ it('works for v10 to v11', () => {
289
+ const migratedSchema = migrations[11](v8Schema)
290
+ expect(migratedSchema.app.pontoEnabled).toBeUndefined()
291
+ expect(migratedSchema.app.kotaniEnabled).toBeUndefined()
292
+ expect(migratedSchema.app.bitfyUrl).toBeUndefined()
293
+ expect(migratedSchema.app.flowBtcUrl).toBeUndefined()
294
+ })
295
+ it('works for v11 to v12', () => {
296
+ const appStub = 'dont delete please'
297
+ const exchangeStub = 'also dont delete please'
298
+ const stub = {
299
+ exchange: {
300
+ otherExchangeProps: exchangeStub,
301
+ history: {
302
+ celoGoldExchangeRates: [1, 2, 3],
303
+ aggregatedExchangeRates: [4, 5, 6],
304
+ granularity: 0,
305
+ range: 0,
306
+ lastTimeUpdated: 100,
307
+ },
308
+ },
309
+ app: appStub,
310
+ }
311
+ const migratedSchema = migrations[12](stub)
312
+ expect(migratedSchema.app).toEqual(appStub)
313
+ expect(migratedSchema.exchange.otherExchangeProps).toEqual(exchangeStub)
314
+ expect(migratedSchema.exchange.history).toEqual(exchangeInitialState.history)
315
+ })
316
+ it('works for v12 to v13', () => {
317
+ const stub = {
318
+ verify: {
319
+ existingProperty: 'verify_existingProperty',
320
+ TEMPORARY_override_withoutVerification: 'oldValue',
321
+ withoutRevealing: true,
322
+ retries: 3,
323
+ },
324
+ identity: {
325
+ existingProperty: 'identity_existingProperty',
326
+ hasSeenVerificationNux: true,
327
+ attestationCodes: ['code1', 'code2'],
328
+ acceptedAttestationCodes: ['code1'],
329
+ attestationInputStatus: ['loading'],
330
+ numCompleteAttestations: 3,
331
+ verificationStatus: 'verified',
332
+ lastRevealAttempt: 'yesterday',
333
+ },
334
+ }
335
+ const migratedSchema = migrations[13](stub)
336
+ expect(migratedSchema.verify.existingProperty).toEqual('verify_existingProperty')
337
+ expect(migratedSchema.identity.existingProperty).toEqual('identity_existingProperty')
338
+ expect(migratedSchema.verify.seenVerificationNux).toEqual(true)
339
+ const deletedIdentityProperties = [
340
+ 'attestationCodes',
341
+ 'acceptedAttestationCodes',
342
+ 'attestationInputStatus',
343
+ 'numCompleteAttestations',
344
+ 'verificationStatus',
345
+ 'lastRevealAttempt',
346
+ ]
347
+ for (const deletedProperty of deletedIdentityProperties) {
348
+ expect(Object.keys(migratedSchema.identity).includes(deletedProperty)).toEqual(false)
349
+ }
350
+ const deletedVerifyProperties = [
351
+ 'TEMPORARY_override_withoutVerification',
352
+ 'withoutRevealing',
353
+ 'retries',
354
+ ]
355
+ for (const deletedProperty of deletedVerifyProperties) {
356
+ expect(Object.keys(migratedSchema.verify).includes(deletedProperty)).toEqual(false)
357
+ }
358
+ })
359
+
360
+ it('works for v13 to v14', () => {
361
+ const migratedSchema = migrations[14](v13Schema)
362
+ expect(migratedSchema.networkInfo.userLocationData).toBeDefined()
363
+ expect(migratedSchema.networkInfo.userLocationData.countryCodeAlpha2).toEqual(null)
364
+ })
365
+
366
+ it('works for v14 to v15', () => {
367
+ const v14Stub = {
368
+ ...v14Schema,
369
+ verify: {
370
+ ...v14Schema.verify,
371
+ seenVerificationNux: true,
372
+ },
373
+ }
374
+ const migratedSchema = migrations[15](v14Stub)
375
+ expect(migratedSchema.identity.hasSeenVerificationNux).toEqual(true)
376
+ expect(migratedSchema.identity).toMatchInlineSnapshot(`
377
+ {
378
+ "acceptedAttestationCodes": [],
379
+ "addressToDataEncryptionKey": {},
380
+ "addressToDisplayName": {},
381
+ "addressToE164Number": {},
382
+ "askedContactsPermission": false,
383
+ "attestationInputStatus": [
384
+ "Inputting",
385
+ "Disabled",
386
+ "Disabled",
387
+ ],
388
+ "attestationsCode": [],
389
+ "contactMappingProgress": {
390
+ "current": 0,
391
+ "total": 0,
392
+ },
393
+ "e164NumberToAddress": {},
394
+ "e164NumberToSalt": {},
395
+ "hasSeenVerificationNux": true,
396
+ "importContactsProgress": {
397
+ "current": 0,
398
+ "status": 0,
399
+ "total": 0,
400
+ },
401
+ "isLoadingImportContacts": false,
402
+ "lastRevealAttempt": null,
403
+ "matchedContacts": {},
404
+ "numCompleteAttestations": 0,
405
+ "secureSendPhoneNumberMapping": {},
406
+ "startedVerification": false,
407
+ "verificationFailed": false,
408
+ "verificationStatus": 0,
409
+ "walletToAccountAddress": {},
410
+ }
411
+ `)
412
+ expect(migratedSchema.verify).toMatchInlineSnapshot(`
413
+ {
414
+ "TEMPORARY_override_withoutVerification": undefined,
415
+ "actionableAttestations": [],
416
+ "currentState": {
417
+ "type": "Idle",
418
+ },
419
+ "komenci": {
420
+ "callbackUrl": undefined,
421
+ "captchaToken": "",
422
+ "errorTimestamps": [],
423
+ "sessionActive": false,
424
+ "sessionToken": "",
425
+ "unverifiedMtwAddress": null,
426
+ },
427
+ "komenciAvailable": "UNKNOWN",
428
+ "retries": 0,
429
+ "status": {
430
+ "completed": 0,
431
+ "isVerified": false,
432
+ "komenci": true,
433
+ "numAttestationsRemaining": 3,
434
+ "total": 0,
435
+ },
436
+ "withoutRevealing": false,
437
+ }
438
+ `)
439
+ })
440
+ it('works for v15 to v16', () => {
441
+ const migratedSchema = migrations[16]({
442
+ ...v15Schema,
443
+ stableToken: {
444
+ ...v15Schema.stableToken,
445
+ balance: '150',
446
+ },
447
+ escrow: {
448
+ isReclaiming: true,
449
+ sentEscrowedPayments: [{ object: 'with keys' }],
450
+ },
451
+ })
452
+ expect(migratedSchema.localCurrency.exchangeRates).toBeDefined()
453
+ expect(migratedSchema.localCurrency.exchangeRates[Currency.Dollar]).toEqual(
454
+ v15Schema.localCurrency.exchangeRate
455
+ )
456
+ expect(migratedSchema.stableToken.balance).toBeUndefined()
457
+ expect(migratedSchema.stableToken.balances[Currency.Dollar]).toEqual('150')
458
+ expect(migratedSchema.escrow.isReclaiming).toBeFalsy()
459
+ expect(migratedSchema.escrow.sentEscrowedPayments.length).toEqual(0)
460
+ })
461
+ it('works for v16 to v17', () => {
462
+ const migratedSchema = migrations[17](v16Schema)
463
+ expect(migratedSchema.fiatExchanges.lastUsedProvider).not.toBeDefined()
464
+ })
465
+ it('works for v17 to v18', () => {
466
+ expect(v17Schema.walletConnect.pairings).toBeDefined()
467
+ const migratedSchema = migrations[18](v17Schema)
468
+ expect(migratedSchema.walletConnect.v2.pairings).not.toBeDefined()
469
+ })
470
+ it('works for v18 to v19', () => {
471
+ // Test normal case
472
+ const migratedSchema = migrations[19](v18Schema)
473
+ // No changes expected
474
+ expect(migratedSchema).toBe(v18Schema)
475
+
476
+ // Test incorrect migrated state from v18 where v2 became an empty object
477
+ // if state.walletConnect was previously undefined
478
+ const v18Stub = {
479
+ ...v18Schema,
480
+ walletConnect: {
481
+ ...v18Schema.walletConnect,
482
+ v2: {},
483
+ },
484
+ }
485
+ const migratedSchema2 = migrations[19](v18Stub)
486
+ expect(migratedSchema2.walletConnect.v1).toBe(v18Schema.walletConnect.v1)
487
+ expect(migratedSchema2.walletConnect.v2).toBeUndefined()
488
+ })
489
+ it('works for v21 to v22', () => {
490
+ const migratedSchema = migrations[22](v21Schema)
491
+
492
+ expect(migratedSchema.i18n).toEqual({
493
+ language: 'es-419',
494
+ allowOtaTranslations: false,
495
+ otaTranslationsLastUpdate: 0,
496
+ otaTranslationsAppVersion: '0',
497
+ otaTranslationsLanguage: '',
498
+ })
499
+ expect(migratedSchema.app.language).toBe(undefined)
500
+ })
501
+
502
+ it('works for v28 to v29', () => {
503
+ expect(v28Schema.web3.fornoMode).toBe(false)
504
+ const migratedSchema = migrations[29](v28Schema)
505
+
506
+ expect(migratedSchema.web3.fornoMode).toBe(true)
507
+ expect(migratedSchema.web3.hadFornoDisabled).toBe(true)
508
+ })
509
+ it('works for v35 to v36', () => {
510
+ const oldSchema = v35Schema
511
+ const migratedSchema = migrations[36](oldSchema)
512
+
513
+ const expectedSchema: any = { ...oldSchema }
514
+ expectedSchema.account.finclusiveKycStatus = FinclusiveKycStatus.NotSubmitted
515
+ expectedSchema.app.maxNumRecentDapps = 0
516
+ expectedSchema.app.recentDapps = []
517
+
518
+ expect(migratedSchema).toMatchObject(expectedSchema)
519
+ })
520
+ it('works for v36 to v37', () => {
521
+ const oldSchema = v36Schema
522
+ const migratedSchema = migrations[37](oldSchema)
523
+
524
+ const expectedSchema: any = { ...oldSchema }
525
+ expectedSchema.app.showPriceChangeIndicatorInBalances = false
526
+
527
+ expect(migratedSchema).toMatchObject(expectedSchema)
528
+ })
529
+ it('works for v37 to v38', () => {
530
+ const oldSchema = v37Schema
531
+ const migratedSchema = migrations[38](oldSchema)
532
+
533
+ const expectedSchema: any = _.cloneDeep(oldSchema)
534
+ expectedSchema.app.skipVerification = false
535
+
536
+ expect(migratedSchema).toMatchObject(expectedSchema)
537
+ })
538
+ it('works for v41 to v42', () => {
539
+ const oldSchema = v41Schema
540
+ const migratedSchema = migrations[42](oldSchema)
541
+
542
+ const expectedSchema: any = _.cloneDeep(oldSchema)
543
+ expectedSchema.app.skipProfilePicture = false
544
+
545
+ expect(migratedSchema).toMatchObject(expectedSchema)
546
+ })
547
+ it('works for v43 to v44', () => {
548
+ const oldSchema = v43Schema
549
+ const migratedSchema = migrations[44](oldSchema)
550
+
551
+ const expectedSchema: any = _.cloneDeep(oldSchema)
552
+ expectedSchema.account.finclusiveRegionSupported = false
553
+ expectedSchema.app.finclusiveUnsupportedStates = ['NY', 'TX']
554
+
555
+ expect(migratedSchema).toMatchObject(expectedSchema)
556
+ })
557
+ it('works for v45 to v46', () => {
558
+ const migratedSchema = migrations[46](v45Schema)
559
+
560
+ const expectedSchema: any = _.cloneDeep(v45Schema)
561
+ expectedSchema.cloudFunctionsApi = undefined
562
+
563
+ expect(migratedSchema).toMatchObject(expectedSchema)
564
+ })
565
+ it('works for v46 to v47', () => {
566
+ const migratedSchema = migrations[47](v46Schema)
567
+
568
+ const expectedSchema: any = _.cloneDeep(v46Schema)
569
+ delete expectedSchema.app.multiTokenUseSendFlow
570
+ delete expectedSchema.app.multiTokenUseUpdatedFeed
571
+ delete expectedSchema.app.multiTokenShowHomeBalances
572
+
573
+ expect(migratedSchema).toMatchObject(expectedSchema)
574
+ })
575
+ it('works for v49 to v50', () => {
576
+ const migratedSchema = migrations[50](v49Schema)
577
+
578
+ const expectedSchema: any = _.cloneDeep(v49Schema)
579
+ delete expectedSchema.app.walletConnectV2Enabled
580
+ delete expectedSchema.walletConnect.v2
581
+
582
+ expect(migratedSchema).toMatchObject(expectedSchema)
583
+ })
584
+
585
+ it('works for v50 to v51', () => {
586
+ const oldSchema = v50Schema
587
+ const migratedSchema = migrations[51](oldSchema)
588
+
589
+ const expectedSchema: any = _.cloneDeep(oldSchema)
590
+ expectedSchema.app.celoWithdrawalEnabledInExchange = true
591
+
592
+ expect(migratedSchema).toMatchObject(expectedSchema)
593
+ })
594
+
595
+ it('works for v51 to v52', () => {
596
+ const oldSchema = v51Schema
597
+ const migratedSchema = migrations[52](oldSchema)
598
+
599
+ const expectedSchema: any = _.cloneDeep(oldSchema)
600
+ expectedSchema.app.fiatConnectCashInEnabled = false
601
+ expectedSchema.app.fiatConnectCashOutEnabled = false
602
+
603
+ expect(migratedSchema).toMatchObject(expectedSchema)
604
+ })
605
+
606
+ it('works for v52 to v53', () => {
607
+ const oldSchema = v52Schema
608
+ const migratedSchema = migrations[53](oldSchema)
609
+
610
+ const expectedSchema: any = _.cloneDeep(oldSchema)
611
+ delete expectedSchema.geth
612
+ delete expectedSchema.account.promptFornoIfNeeded
613
+ delete expectedSchema.account.retryVerificationWithForno
614
+ delete expectedSchema.web3.fornoMode
615
+ delete expectedSchema.web3.hadFornoDisabled
616
+ delete expectedSchema.web3.latestBlockNumber
617
+ delete expectedSchema.web3.syncProgress
618
+
619
+ expect(migratedSchema).toMatchObject(expectedSchema)
620
+ })
621
+
622
+ it('works for v53 to v54', () => {
623
+ const dapp = {
624
+ name: 'Ubeswap',
625
+ description: 'Swap any token, enter a pool, or farm your crypto',
626
+ dappUrl: 'https://app.ubeswap.org/',
627
+ categoryId: 'exchanges',
628
+ iconUrl: 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/ubeswap.png',
629
+ isFeatured: false,
630
+ id: 'ubeswap',
631
+ }
632
+ const dappsInfo = {
633
+ dappsWebViewEnabled: true,
634
+ activeDapp: dapp,
635
+ maxNumRecentDapps: 8,
636
+ recentDapps: [dapp],
637
+ dappListApiUrl: 'https://www.dapplist.com',
638
+ }
639
+
640
+ const oldSchema = {
641
+ ...v53Schema,
642
+ app: {
643
+ ...v53Schema.app,
644
+ ...dappsInfo,
645
+ },
646
+ }
647
+ const migratedSchema = migrations[54](oldSchema)
648
+
649
+ const expectedSchema: any = _.cloneDeep(oldSchema)
650
+ delete expectedSchema.app.dappsWebViewEnabled
651
+ delete expectedSchema.app.activeDapp
652
+ delete expectedSchema.app.maxNumRecentDapps
653
+ delete expectedSchema.app.recentDapps
654
+ delete expectedSchema.app.dappListApiUrl
655
+ expectedSchema.dapps = dappsInfo
656
+
657
+ expect(migratedSchema).toMatchObject(expectedSchema)
658
+ })
659
+
660
+ it('works for v56 to v57', () => {
661
+ const oldSchema = v56Schema
662
+ const migratedSchema = migrations[57](oldSchema)
663
+
664
+ const expectedSchema: any = _.cloneDeep(oldSchema)
665
+ expectedSchema.app.visualizeNFTsEnabledInHomeAssetsPage = false
666
+
667
+ expect(migratedSchema).toMatchObject(expectedSchema)
668
+ })
669
+
670
+ it('works for v57 to v58', () => {
671
+ const oldSchema = v57Schema
672
+ const migratedSchema = migrations[58](oldSchema)
673
+
674
+ const expectedSchema: any = _.cloneDeep(oldSchema)
675
+ expectedSchema.app.coinbasePayEnabled = false
676
+
677
+ expect(migratedSchema).toMatchObject(expectedSchema)
678
+ })
679
+
680
+ it('works for v58 to v59', () => {
681
+ const oldTransactions = [
682
+ {
683
+ metadata: {
684
+ title: null,
685
+ comment: '',
686
+ subtitle: null,
687
+ image: null,
688
+ },
689
+ __typename: 'TokenTransferV2',
690
+ block: '14255636',
691
+ transactionHash: '0xf4e59db43c9051947ffe8a29a09c8f85dcf540699855166aa68f11cda3014b72',
692
+ type: 'RECEIVED',
693
+ amount: {
694
+ value: '0.01',
695
+ tokenAddress: '0x765de816845861e75a25fca122bb6898b8b1282a',
696
+ localAmount: {
697
+ currencyCode: 'USD',
698
+ exchangeRate: '1',
699
+ value: '0.01',
700
+ },
701
+ },
702
+ fees: null,
703
+ timestamp: 1658945996000,
704
+ address: '0xde33e71faecdead20e6a8af8f362d2236cba005f',
705
+ },
706
+ {},
707
+ ]
708
+ const oldSchema = {
709
+ ...v58Schema,
710
+ transactions: {
711
+ ...v58Schema.transactions,
712
+ transactions: oldTransactions,
713
+ },
714
+ }
715
+ const migratedSchema = migrations[59](oldSchema)
716
+
717
+ const expectedSchema: any = _.cloneDeep(oldSchema)
718
+ expectedSchema.transactions.transactions = [oldTransactions[0]]
719
+
720
+ expect(migratedSchema).toMatchObject(expectedSchema)
721
+ })
722
+
723
+ it('works for v59 to v60', () => {
724
+ const oldSchema = v59Schema
725
+ const migratedSchema = migrations[60](oldSchema)
726
+
727
+ const expectedSchema: any = _.cloneDeep(oldSchema)
728
+ expectedSchema.fiatConnect = {}
729
+ expectedSchema.fiatConnect.quotes = []
730
+ expectedSchema.fiatConnect.quotesLoading = false
731
+ expectedSchema.fiatConnect.quotesError = null
732
+
733
+ expect(migratedSchema).toMatchObject(expectedSchema)
734
+ })
735
+
736
+ it('works for v62 to v63', () => {
737
+ const oldSchema = v62Schema
738
+ const migratedSchema = migrations[63](oldSchema)
739
+
740
+ const expectedSchema: any = _.cloneDeep(oldSchema)
741
+ expectedSchema.app.superchargeTokenConfigByToken = {}
742
+ delete expectedSchema.app.superchargeTokens
743
+
744
+ expect(migratedSchema).toStrictEqual(expectedSchema)
745
+ })
746
+
747
+ it('works for v75 to v76', () => {
748
+ const oldSchema = v75Schema
749
+ const migratedSchema = migrations[76](oldSchema)
750
+
751
+ const expectedSchema: any = _.cloneDeep(oldSchema)
752
+ expectedSchema.app.showGuidedOnboardingCopy = false
753
+ // shall be the default value as configured in REMOTE_CONFIG_VALUES_DEFAULTS
754
+ expect(migratedSchema).toStrictEqual(expectedSchema)
755
+ })
756
+
757
+ it('works from v81 to v82', () => {
758
+ const oldSchema = v81Schema
759
+ const migratedSchema = migrations[82](oldSchema)
760
+
761
+ const expectedSchema: any = _.cloneDeep(oldSchema)
762
+ expectedSchema.swap = {
763
+ swapState: 'quote',
764
+ swapInfo: null,
765
+ swapUserInput: null,
766
+ }
767
+
768
+ expect(migratedSchema).toStrictEqual(expectedSchema)
769
+ })
770
+
771
+ it('works from v84 to v85', () => {
772
+ const oldSchema = v84Schema
773
+ const migratedSchema = migrations[85](oldSchema)
774
+
775
+ const expectedSchema: any = _.cloneDeep(oldSchema)
776
+ delete expectedSchema.app.swapFeeEnabled
777
+ delete expectedSchema.app.swapFeePercentage
778
+ expect(migratedSchema).toStrictEqual(expectedSchema)
779
+ })
780
+
781
+ it('works from v98 to v99', () => {
782
+ const oldSchema = {
783
+ ...v98Schema,
784
+ dapps: {
785
+ ...v98Schema.dapps,
786
+ recentDapps: [
787
+ {
788
+ name: 'Ubeswap',
789
+ description: 'Swap any token, enter a pool, or farm your crypto',
790
+ dappUrl: 'https://app.ubeswap.org/',
791
+ categoryId: 'exchanges',
792
+ iconUrl:
793
+ 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/ubeswap.png',
794
+ isFeatured: false,
795
+ id: 'ubeswap',
796
+ },
797
+ ],
798
+ favoriteDapps: [
799
+ {
800
+ name: 'Moola',
801
+ description: 'Lend, borrow, or add to a pool to earn rewards',
802
+ dappUrl: `${DEEP_LINK_URL_SCHEME}://wallet/moolaScreen`,
803
+ categoryId: 'lend',
804
+ iconUrl: 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/moola.png',
805
+ isFeatured: false,
806
+ id: 'moola',
807
+ },
808
+ ],
809
+ },
810
+ }
811
+ const migratedSchema = migrations[99](oldSchema)
812
+
813
+ const expectedSchema: any = {
814
+ ...v98Schema,
815
+ dapps: {
816
+ ...v98Schema.dapps,
817
+ recentDappIds: ['ubeswap'],
818
+ favoriteDappIds: ['moola'],
819
+ },
820
+ }
821
+ delete expectedSchema.dapps.recentDapps
822
+ delete expectedSchema.dapps.favoriteDapps
823
+ expect(migratedSchema).toStrictEqual(expectedSchema)
824
+ })
825
+
826
+ it('works from v99 to v100', () => {
827
+ const oldSchema = v99Schema
828
+ const migratedSchema = migrations[100](oldSchema)
829
+
830
+ const expectedSchema: any = _.cloneDeep(oldSchema)
831
+ delete expectedSchema.app.celoNewsEnabled
832
+
833
+ expect(migratedSchema).toStrictEqual(expectedSchema)
834
+ })
835
+
836
+ it('works from v103 to v104', () => {
837
+ const oldSchema = v103Schema
838
+ const migratedSchema = migrations[104](oldSchema)
839
+
840
+ const expectedSchema: any = _.cloneDeep(oldSchema)
841
+ delete expectedSchema.goldToken
842
+ delete expectedSchema.stableToken
843
+ expectedSchema.account.celoEducationCompleted = oldSchema.goldToken.educationCompleted
844
+
845
+ expect(migratedSchema).toStrictEqual(expectedSchema)
846
+ })
847
+
848
+ it('works from v104 to v105', () => {
849
+ const oldSchema = v104Schema
850
+ const migratedSchema = migrations[105](oldSchema)
851
+
852
+ const expectedSchema: any = _.cloneDeep(oldSchema)
853
+ expectedSchema.web3.twelveWordMnemonicEnabled = false
854
+ expect(migratedSchema).toStrictEqual(expectedSchema)
855
+ })
856
+
857
+ it('works from v106 to v107', () => {
858
+ const oldSchema = {
859
+ ...v106Schema,
860
+ fiatConnect: {
861
+ ...v106Schema.fiatConnect,
862
+ cachedFiatAccountUses: [
863
+ {
864
+ providerId: 'provider-two',
865
+ cryptoType: Currency.Dollar,
866
+ },
867
+ {
868
+ providerId: 'provider-one',
869
+ cryptoType: Currency.Celo,
870
+ },
871
+ ],
872
+ cachedQuoteParams: {
873
+ 'some-provider': {
874
+ ['some-schema']: {
875
+ cryptoAmount: '10',
876
+ fiatAmount: '10',
877
+ cryptoType: Currency.Dollar,
878
+ },
879
+ },
880
+ 'some-other-provider': {
881
+ ['some-schema']: {
882
+ cryptoAmount: '10',
883
+ fiatAmount: '10',
884
+ cryptoType: Currency.Celo,
885
+ },
886
+ },
887
+ },
888
+ },
889
+ }
890
+ const migratedSchema = migrations[107](oldSchema)
891
+
892
+ const freshSchema: any = _.cloneDeep(oldSchema)
893
+ const expectedSchema = {
894
+ ...freshSchema,
895
+ fiatConnect: {
896
+ ...freshSchema.fiatConnect,
897
+ cachedFiatAccountUses: [
898
+ {
899
+ providerId: 'provider-two',
900
+ cryptoType: CiCoCurrency.cUSD,
901
+ },
902
+ {
903
+ providerId: 'provider-one',
904
+ cryptoType: CiCoCurrency.CELO,
905
+ },
906
+ ],
907
+ cachedQuoteParams: {
908
+ 'some-provider': {
909
+ ['some-schema']: {
910
+ cryptoAmount: '10',
911
+ fiatAmount: '10',
912
+ cryptoType: CiCoCurrency.cUSD,
913
+ },
914
+ },
915
+ 'some-other-provider': {
916
+ ['some-schema']: {
917
+ cryptoAmount: '10',
918
+ fiatAmount: '10',
919
+ cryptoType: CiCoCurrency.CELO,
920
+ },
921
+ },
922
+ },
923
+ },
924
+ }
925
+ expect(migratedSchema).toStrictEqual(expectedSchema)
926
+ })
927
+ it('works from v112 to v113', () => {
928
+ const oldSchema = v112Schema
929
+ const migratedSchema = migrations[113](oldSchema)
930
+
931
+ const expectedSchema: any = _.cloneDeep(oldSchema)
932
+ delete expectedSchema.app.skipProfilePicture
933
+ delete expectedSchema.app.showGuidedOnboardingCopy
934
+ delete expectedSchema.app.createAccountCopyTestType
935
+
936
+ expect(migratedSchema).toStrictEqual(expectedSchema)
937
+ })
938
+ it('works from v115 to v116', () => {
939
+ const oldSchema = v115Schema
940
+ const migratedSchema = migrations[116](oldSchema)
941
+ const expectedSchema: any = _.cloneDeep(oldSchema)
942
+ expectedSchema.account.startOnboardingTime = undefined
943
+ expect(migratedSchema).toStrictEqual(expectedSchema)
944
+ })
945
+
946
+ it('works from v124 to v125', () => {
947
+ const oldSchema = v124Schema
948
+ const migratedSchema = migrations[125](oldSchema)
949
+ const expectedSchema: any = _.cloneDeep(oldSchema)
950
+ delete expectedSchema.app.celoNews.enabled
951
+ expect(migratedSchema).toStrictEqual(expectedSchema)
952
+ })
953
+
954
+ it('works from v125 to v126', () => {
955
+ const oldSchmea = v125Schema
956
+ const migratedSchema = migrations[126](oldSchmea)
957
+ const expectedSchema: any = _.cloneDeep(oldSchmea)
958
+ expectedSchema.app.inAppReviewLastInteractionTimestamp = null
959
+ expect(migratedSchema).toStrictEqual(expectedSchema)
960
+ })
961
+
962
+ it('works from v130 to v131', () => {
963
+ const oldSchemaWithV1Dapp = {
964
+ ...v130Schema,
965
+ dapps: {
966
+ ...v130Schema.dapps,
967
+ dappsList: [
968
+ {
969
+ name: 'Ubeswap',
970
+ description: 'Swap any token, enter a pool, or farm your crypto',
971
+ dappUrl: 'https://app.ubeswap.org/',
972
+ categoryId: 'exchanges',
973
+ iconUrl:
974
+ 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/ubeswap.png',
975
+ isFeatured: false,
976
+ id: 'ubeswap',
977
+ },
978
+ ],
979
+ activeDapp: {
980
+ name: 'Ubeswap',
981
+ description: 'Swap any token, enter a pool, or farm your crypto',
982
+ dappUrl: 'https://app.ubeswap.org/',
983
+ categoryId: 'exchanges',
984
+ iconUrl: 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/ubeswap.png',
985
+ isFeatured: false,
986
+ id: 'ubeswap',
987
+ openedFrom: 'featured',
988
+ },
989
+ },
990
+ }
991
+ const expectedSchemaWithV2Dapp: any = {
992
+ ...v130Schema,
993
+ dapps: {
994
+ ...v130Schema.dapps,
995
+ dappsList: [
996
+ {
997
+ name: 'Ubeswap',
998
+ description: 'Swap any token, enter a pool, or farm your crypto',
999
+ dappUrl: 'https://app.ubeswap.org/',
1000
+ categories: ['exchanges'],
1001
+ iconUrl:
1002
+ 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/ubeswap.png',
1003
+ id: 'ubeswap',
1004
+ },
1005
+ ],
1006
+ activeDapp: {
1007
+ name: 'Ubeswap',
1008
+ description: 'Swap any token, enter a pool, or farm your crypto',
1009
+ dappUrl: 'https://app.ubeswap.org/',
1010
+ categories: ['exchanges'],
1011
+ iconUrl: 'https://raw.githubusercontent.com/valora-xyz/dapp-list/main/assets/ubeswap.png',
1012
+ id: 'ubeswap',
1013
+ openedFrom: 'featured',
1014
+ },
1015
+ },
1016
+ }
1017
+
1018
+ const migratedV1Schema = migrations[131](oldSchemaWithV1Dapp)
1019
+ const migratedV2Schema = migrations[131](expectedSchemaWithV2Dapp)
1020
+
1021
+ expect(migratedV1Schema).toMatchObject(expectedSchemaWithV2Dapp)
1022
+ expect(migratedV2Schema).toMatchObject(expectedSchemaWithV2Dapp)
1023
+ })
1024
+
1025
+ it('works from v132 to v133', () => {
1026
+ const oldSchema = v132Schema
1027
+ const migratedSchema = migrations[133](oldSchema)
1028
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1029
+ expectedSchema.nfts = {
1030
+ nfts: [],
1031
+ nftsError: null,
1032
+ nftsLoading: false,
1033
+ }
1034
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1035
+ })
1036
+
1037
+ it('works from v133 to v134', () => {
1038
+ const oldSchema = v133Schema
1039
+ const migratedSchema = migrations[134](oldSchema)
1040
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1041
+ expectedSchema.positions.previewApiUrl = null
1042
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1043
+ })
1044
+
1045
+ it('works from v136 to v137', () => {
1046
+ const oldSchema = v136Schema
1047
+ const migratedSchema = migrations[137](oldSchema)
1048
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1049
+ expectedSchema.walletConnect.sessions = oldSchema.walletConnect.v2.sessions
1050
+ expectedSchema.walletConnect.pendingActions = oldSchema.walletConnect.v2.pendingActions
1051
+ expectedSchema.walletConnect.pendingSessions = oldSchema.walletConnect.v2.pendingSessions
1052
+ delete expectedSchema.walletConnect.v1
1053
+ delete expectedSchema.walletConnect.v2
1054
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1055
+ })
1056
+ it('works from v144 to v145', () => {
1057
+ // Ensure that all of TokenTransfer, TokenExchange, and NftTransfer migrate correctly.
1058
+ // Namely, that the __typename is updated to V3 and that chain is added to each TX.
1059
+ // Also check that chain is added to standby transactions.
1060
+ const oldSchema = {
1061
+ ...v144Schema,
1062
+ transactions: {
1063
+ ...v144Schema.transactions,
1064
+ standbyTransactions: [
1065
+ {
1066
+ context: { id: 'test' },
1067
+ type: TokenTransactionTypeV2.Sent,
1068
+ status: TransactionStatus.Pending,
1069
+ value: '0.5',
1070
+ tokenAddress: 'mock-address',
1071
+ comment: '',
1072
+ timestamp: 1542300000,
1073
+ address: '0xd68360cce1f1ff696d898f58f03e0f1252f2ea33',
1074
+ },
1075
+ ],
1076
+ transactions: [
1077
+ {
1078
+ __typename: 'TokenTransferV2',
1079
+ type: TokenTransactionTypeV2.Sent,
1080
+ transactionHash: '123',
1081
+ timestamp: 456,
1082
+ block: '789',
1083
+ address: 'some-address',
1084
+ amount: {
1085
+ value: new BigNumber(0),
1086
+ tokenAddress: 'some-token-address',
1087
+ localAmount: {
1088
+ value: new BigNumber(1),
1089
+ currencyCode: 'USD',
1090
+ exchangeRate: '1',
1091
+ },
1092
+ },
1093
+ metadata: {},
1094
+ fees: [],
1095
+ },
1096
+ {
1097
+ __typename: 'NftTransferV2',
1098
+ type: TokenTransactionTypeV2.NftReceived,
1099
+ transactionHash: '123',
1100
+ timestamp: 456,
1101
+ block: '789',
1102
+ nfts: [],
1103
+ fees: [],
1104
+ },
1105
+ {
1106
+ __typename: 'TokenExchangeV2',
1107
+ type: TokenTransactionTypeV2.Exchange,
1108
+ transactionHash: '123',
1109
+ timestamp: 456,
1110
+ block: '789',
1111
+ inAmount: {
1112
+ value: new BigNumber(0),
1113
+ tokenAddress: 'some-token-address',
1114
+ localAmount: {
1115
+ value: new BigNumber(1),
1116
+ currencyCode: 'USD',
1117
+ exchangeRate: '1',
1118
+ },
1119
+ },
1120
+ outAmount: {
1121
+ value: new BigNumber(0),
1122
+ tokenAddress: 'some-token-address',
1123
+ localAmount: {
1124
+ value: new BigNumber(1),
1125
+ currencyCode: 'USD',
1126
+ exchangeRate: '1',
1127
+ },
1128
+ },
1129
+ metadata: {},
1130
+ fees: [],
1131
+ },
1132
+ ],
1133
+ },
1134
+ }
1135
+ const expectedSchema = {
1136
+ ...v144Schema,
1137
+ transactions: {
1138
+ ...v144Schema.transactions,
1139
+ standbyTransactions: [
1140
+ {
1141
+ context: { id: 'test' },
1142
+ network: Network.Celo,
1143
+ type: TokenTransactionTypeV2.Sent,
1144
+ status: TransactionStatus.Pending,
1145
+ value: '0.5',
1146
+ tokenAddress: 'mock-address',
1147
+ comment: '',
1148
+ timestamp: 1542300000,
1149
+ address: '0xd68360cce1f1ff696d898f58f03e0f1252f2ea33',
1150
+ },
1151
+ ],
1152
+ transactions: [
1153
+ {
1154
+ __typename: 'TokenTransferV3',
1155
+ network: Network.Celo,
1156
+ type: TokenTransactionTypeV2.Sent,
1157
+ transactionHash: '123',
1158
+ timestamp: 456,
1159
+ block: '789',
1160
+ address: 'some-address',
1161
+ amount: {
1162
+ value: new BigNumber(0),
1163
+ tokenAddress: 'some-token-address',
1164
+ localAmount: {
1165
+ value: new BigNumber(1),
1166
+ currencyCode: 'USD',
1167
+ exchangeRate: '1',
1168
+ },
1169
+ },
1170
+ metadata: {},
1171
+ fees: [],
1172
+ },
1173
+ {
1174
+ __typename: 'NftTransferV3',
1175
+ network: Network.Celo,
1176
+ type: TokenTransactionTypeV2.NftReceived,
1177
+ transactionHash: '123',
1178
+ timestamp: 456,
1179
+ block: '789',
1180
+ nfts: [],
1181
+ fees: [],
1182
+ },
1183
+ {
1184
+ __typename: 'TokenExchangeV3',
1185
+ network: Network.Celo,
1186
+ type: TokenTransactionTypeV2.Exchange,
1187
+ transactionHash: '123',
1188
+ timestamp: 456,
1189
+ block: '789',
1190
+ inAmount: {
1191
+ value: new BigNumber(0),
1192
+ tokenAddress: 'some-token-address',
1193
+ localAmount: {
1194
+ value: new BigNumber(1),
1195
+ currencyCode: 'USD',
1196
+ exchangeRate: '1',
1197
+ },
1198
+ },
1199
+ outAmount: {
1200
+ value: new BigNumber(0),
1201
+ tokenAddress: 'some-token-address',
1202
+ localAmount: {
1203
+ value: new BigNumber(1),
1204
+ currencyCode: 'USD',
1205
+ exchangeRate: '1',
1206
+ },
1207
+ },
1208
+ metadata: {},
1209
+ fees: [],
1210
+ },
1211
+ ],
1212
+ },
1213
+ }
1214
+ const migratedSchema = migrations[145](oldSchema)
1215
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1216
+ })
1217
+
1218
+ it('works from v145 to v146', () => {
1219
+ const oldSchema = v145Schema
1220
+ const migratedSchema = migrations[146](oldSchema)
1221
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1222
+ expectedSchema.localCurrency.usdToLocalRate =
1223
+ oldSchema.localCurrency.exchangeRates[Currency.Dollar]
1224
+ delete expectedSchema.localCurrency.exchangeRates
1225
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1226
+ })
1227
+
1228
+ it('works from v146 to v147', () => {
1229
+ const oldSchema = {
1230
+ ...v146Schema,
1231
+ transactions: {
1232
+ ...v146Schema.transactions,
1233
+ standbyTransactions: [
1234
+ {
1235
+ context: { id: 'test' },
1236
+ network: Network.Celo,
1237
+ type: TokenTransactionTypeV2.Sent,
1238
+ status: TransactionStatus.Pending,
1239
+ value: '0.5',
1240
+ tokenAddress: 'mock-address',
1241
+ comment: '',
1242
+ timestamp: 1542300000,
1243
+ address: '0xd68360cce1f1ff696d898f58f03e0f1252f2ea33',
1244
+ },
1245
+ ],
1246
+ transactions: [
1247
+ {
1248
+ __typename: 'TokenTransferV3',
1249
+ type: TokenTransactionTypeV2.Sent,
1250
+ network: Network.Celo,
1251
+ transactionHash: '123',
1252
+ timestamp: 456,
1253
+ block: '789',
1254
+ address: 'some-address',
1255
+ amount: {
1256
+ value: new BigNumber(0),
1257
+ tokenAddress: 'some-token-address',
1258
+ localAmount: {
1259
+ value: new BigNumber(1),
1260
+ currencyCode: 'USD',
1261
+ exchangeRate: '1',
1262
+ },
1263
+ },
1264
+ metadata: {},
1265
+ fees: [],
1266
+ },
1267
+ {
1268
+ __typename: 'NftTransferV3',
1269
+ network: Network.Ethereum,
1270
+ type: TokenTransactionTypeV2.NftReceived,
1271
+ transactionHash: '123',
1272
+ timestamp: 456,
1273
+ block: '789',
1274
+ nfts: [],
1275
+ fees: [],
1276
+ },
1277
+ ],
1278
+ },
1279
+ }
1280
+ const expectedSchema = {
1281
+ ...v146Schema,
1282
+ transactions: {
1283
+ ...v146Schema.transactions,
1284
+ standbyTransactions: [
1285
+ {
1286
+ context: { id: 'test' },
1287
+ networkId: NetworkId['celo-alfajores'],
1288
+ type: TokenTransactionTypeV2.Sent,
1289
+ status: TransactionStatus.Pending,
1290
+ value: '0.5',
1291
+ tokenAddress: 'mock-address',
1292
+ comment: '',
1293
+ timestamp: 1542300000,
1294
+ address: '0xd68360cce1f1ff696d898f58f03e0f1252f2ea33',
1295
+ },
1296
+ ],
1297
+ transactions: [
1298
+ {
1299
+ __typename: 'TokenTransferV3',
1300
+ networkId: NetworkId['celo-alfajores'],
1301
+ type: TokenTransactionTypeV2.Sent,
1302
+ transactionHash: '123',
1303
+ timestamp: 456,
1304
+ block: '789',
1305
+ address: 'some-address',
1306
+ amount: {
1307
+ value: new BigNumber(0),
1308
+ tokenAddress: 'some-token-address',
1309
+ localAmount: {
1310
+ value: new BigNumber(1),
1311
+ currencyCode: 'USD',
1312
+ exchangeRate: '1',
1313
+ },
1314
+ },
1315
+ metadata: {},
1316
+ fees: [],
1317
+ },
1318
+ {
1319
+ __typename: 'NftTransferV3',
1320
+ networkId: NetworkId['ethereum-sepolia'],
1321
+ type: TokenTransactionTypeV2.NftReceived,
1322
+ transactionHash: '123',
1323
+ timestamp: 456,
1324
+ block: '789',
1325
+ nfts: [],
1326
+ fees: [],
1327
+ },
1328
+ ],
1329
+ },
1330
+ }
1331
+ const migratedSchema = migrations[147](oldSchema)
1332
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1333
+ })
1334
+
1335
+ it('works from v148 to v149', () => {
1336
+ expect(
1337
+ migrations[149]({
1338
+ ...v148Schema,
1339
+ app: {
1340
+ ...v148Schema.app,
1341
+ activeScreen: 'AppLoading',
1342
+ },
1343
+ })
1344
+ ).toStrictEqual({
1345
+ ...v148Schema,
1346
+ app: {
1347
+ ...v148Schema.app,
1348
+ activeScreen: 'Main',
1349
+ },
1350
+ })
1351
+ })
1352
+
1353
+ it('works from 159 to 160', () => {
1354
+ const preMigrationSchema = {
1355
+ ...v159Schema,
1356
+ }
1357
+ preMigrationSchema.app.activeScreen = 'PaymentRequestConfirmation'
1358
+ const migratedSchema = migrations[160](preMigrationSchema)
1359
+
1360
+ // paymentRequest dropped, activeScreen changed to Main from PaymentRequestConfirmation
1361
+ expect('paymentRequest' in migratedSchema).toBe(false)
1362
+ expect(migratedSchema.app.activeScreen).toEqual('Main')
1363
+
1364
+ // should otherwise be equal
1365
+ expect(_.omit(migratedSchema, 'app.activeScreen')).toStrictEqual(
1366
+ _.omit(preMigrationSchema, 'app.activeScreen', 'paymentRequest')
1367
+ )
1368
+ })
1369
+
1370
+ it('works from 160 to 161', () => {
1371
+ const preMigrationSchema = {
1372
+ ...v159Schema,
1373
+ }
1374
+ preMigrationSchema.transactions.standbyTransactions = [
1375
+ {
1376
+ context: { id: 'someId' },
1377
+ networkId: 'celo-alfajores',
1378
+ type: 'SENT',
1379
+ status: TransactionStatus.Pending,
1380
+ value: '123',
1381
+ tokenId: 'someTokenId',
1382
+ tokenAddress: '0xabc',
1383
+ comment: 'some comment',
1384
+ timestamp: 123456789,
1385
+ address: '0x123',
1386
+ hash: 'someHash',
1387
+ },
1388
+ ] as any
1389
+ const migratedSchema = migrations[161](preMigrationSchema)
1390
+
1391
+ expect(migratedSchema.transactions.standbyTransactions).toEqual([
1392
+ {
1393
+ __typename: 'TokenTransferV3',
1394
+ type: TokenTransactionTypeV2.Sent,
1395
+ context: { id: 'someId' },
1396
+ networkId: 'celo-alfajores',
1397
+ amount: {
1398
+ value: '123',
1399
+ tokenId: 'someTokenId',
1400
+ tokenAddress: '0xabc',
1401
+ },
1402
+ timestamp: 123456789,
1403
+ address: '0x123',
1404
+ transactionHash: 'someHash',
1405
+ metadata: {
1406
+ comment: 'some comment',
1407
+ },
1408
+ status: TransactionStatus.Pending,
1409
+ },
1410
+ ])
1411
+ })
1412
+
1413
+ it('works from 164 to 165', () => {
1414
+ const preMigrationSchema = {
1415
+ ...v164Schema,
1416
+ }
1417
+ const celoSwap = {
1418
+ __typename: 'TokenExchangeV3',
1419
+ type: 'SWAP_TRANSACTION',
1420
+ networkId: 'celo-alfajores',
1421
+ block: '22127052',
1422
+ transactionHash: '0x28fc7261a01bbbe97d5cc1f4c41ccf278bb9980ab12b4cd4bf62b76f137a6691',
1423
+ }
1424
+ const celoTransfer = {
1425
+ __typename: 'TokenTransferV3',
1426
+ block: '22115616',
1427
+ transactionHash: '0x9fa0eb09da50ead38ba96fba8e7d8d341af81fd407cda0fae400943c173371c1',
1428
+ type: 'SENT',
1429
+ // no networkId, for older clients
1430
+ }
1431
+ const ethereumTransfer = {
1432
+ __typename: 'TokenTransferV3',
1433
+ block: '22115737',
1434
+ transactionHash: '0x8f3cb9816418ec3df206b914d88285f3eb251b6a07a8b89b11379eed57fec22e',
1435
+ type: 'SENT',
1436
+ networkId: 'ethereum-sepolia',
1437
+ }
1438
+ preMigrationSchema.transactions.transactions = [celoSwap, ethereumTransfer, celoTransfer]
1439
+ const migratedSchema = migrations[165](preMigrationSchema)
1440
+
1441
+ expect(migratedSchema.transactions.transactionsByNetworkId).toEqual({
1442
+ [NetworkId['celo-alfajores']]: [celoSwap, celoTransfer],
1443
+ [NetworkId['ethereum-sepolia']]: [ethereumTransfer],
1444
+ })
1445
+ expect('transactions' in migratedSchema.transactions).toBe(false)
1446
+ })
1447
+
1448
+ it('works from 166 to 167', () => {
1449
+ const oldSchema = v166Schema
1450
+ const migratedSchema = migrations[167](oldSchema)
1451
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1452
+ expectedSchema.app.rampCashInButtonExpEnabled = false
1453
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1454
+ })
1455
+
1456
+ it('works from 167 to 168', () => {
1457
+ const oldSchema = v167Schema
1458
+ const migratedSchema = migrations[168](oldSchema)
1459
+ const expectedSchema: any = _.omit(oldSchema, 'swap.swapUserInput')
1460
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1461
+ })
1462
+
1463
+ it('works from 171 to 172', () => {
1464
+ const oldSchema = v171Schema
1465
+ const migratedSchema = migrations[172](oldSchema)
1466
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1467
+ delete expectedSchema.swap.swapInfo
1468
+ expectedSchema.swap.currentSwap = null
1469
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1470
+ })
1471
+
1472
+ it('works from 172 to 173', () => {
1473
+ const oldSchema = v172Schema
1474
+ const migratedSchema = migrations[173](oldSchema)
1475
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1476
+ delete expectedSchema.swap.swapState
1477
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1478
+ })
1479
+
1480
+ it('works from 174 to 175', () => {
1481
+ const oldSchema = v174Schema
1482
+ const migratedSchema = migrations[175](oldSchema)
1483
+
1484
+ // CELO
1485
+ const celoToken = migratedSchema.tokens.tokenBalances['celo-alfajores:native']
1486
+ expect(celoToken).not.toHaveProperty('isCoreToken')
1487
+ expect(celoToken).toHaveProperty('isFeeCurrency', true)
1488
+ expect(celoToken).toHaveProperty('canTransferWithComment', true)
1489
+
1490
+ // cUSD
1491
+ const cUSDToken =
1492
+ migratedSchema.tokens.tokenBalances[
1493
+ 'celo-alfajores:0x874069fa1eb16d44d622f2e0ca25eea172369bc1'
1494
+ ]
1495
+ expect(cUSDToken).not.toHaveProperty('isCoreToken')
1496
+ expect(cUSDToken).toHaveProperty('isFeeCurrency', true)
1497
+ expect(cUSDToken).toHaveProperty('canTransferWithComment', true)
1498
+
1499
+ // cEUR
1500
+ const cEURToken =
1501
+ migratedSchema.tokens.tokenBalances[
1502
+ 'celo-alfajores:0x10c892a6ec43a53e45d0b916b4b7d383b1b78c0f'
1503
+ ]
1504
+ expect(cEURToken).not.toHaveProperty('isCoreToken')
1505
+ expect(cEURToken).toHaveProperty('isFeeCurrency', true)
1506
+ expect(cEURToken).toHaveProperty('canTransferWithComment', true)
1507
+
1508
+ // Test Token
1509
+ const testToken =
1510
+ migratedSchema.tokens.tokenBalances[
1511
+ 'celo-alfajores:0x048f47d358ec521a6cf384461d674750a3cb58c8'
1512
+ ]
1513
+ expect(testToken).not.toHaveProperty('isCoreToken')
1514
+ expect(testToken).not.toHaveProperty('isFeeCurrency')
1515
+ expect(testToken).not.toHaveProperty('canTransferWithComment')
1516
+
1517
+ // Moola
1518
+ const moolaToken =
1519
+ migratedSchema.tokens.tokenBalances[
1520
+ 'celo-alfajores:0x17700282592D6917F6A73D0bF8AcCf4D578c131e'
1521
+ ]
1522
+ expect(moolaToken).not.toHaveProperty('isCoreToken')
1523
+ expect(moolaToken).not.toHaveProperty('isFeeCurrency')
1524
+ expect(moolaToken).not.toHaveProperty('canTransferWithComment')
1525
+ })
1526
+
1527
+ it('works from 176 to 177', () => {
1528
+ const oldSchema = v176Schema
1529
+ const migratedSchema = migrations[177](oldSchema)
1530
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1531
+ expectedSchema.swap.priceImpactWarningThreshold =
1532
+ expectedSchema.swap.priceImpactWarningThreshold * 100
1533
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1534
+ })
1535
+
1536
+ it('works from 177 to 178', () => {
1537
+ const oldSchema = v177Schema
1538
+ const migratedSchema = migrations[178](oldSchema)
1539
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1540
+ delete expectedSchema.swap.guaranteedSwapPriceEnabled
1541
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1542
+ })
1543
+
1544
+ it('works from 178 to 179', () => {
1545
+ const oldSchema = v178Schema
1546
+ const migratedSchema = migrations[179](oldSchema)
1547
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1548
+ expectedSchema.priceHistory = {}
1549
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1550
+ })
1551
+
1552
+ it('works from 179 to 180', () => {
1553
+ const oldSchema = {
1554
+ ...v179Schema,
1555
+ send: {
1556
+ ...v179Schema.send,
1557
+ recentRecipients: [
1558
+ // invitable recipients don't include an address
1559
+ mockRecipient,
1560
+ mockInvitableRecipient,
1561
+ mockRecipient2,
1562
+ mockInvitableRecipient2,
1563
+ ],
1564
+ },
1565
+ }
1566
+ const migratedSchema = migrations[180](oldSchema)
1567
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1568
+ expectedSchema.send.recentRecipients = [mockRecipient, mockRecipient2]
1569
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1570
+ })
1571
+ it('works from 197 to 198', () => {
1572
+ const oldSchema = {
1573
+ ...v197Schema,
1574
+ home: {
1575
+ ...v197Schema.home,
1576
+ nftCelebration: {
1577
+ networkId: 'celo-alfajores',
1578
+ contractAddress: '0xTEST',
1579
+ displayed: true,
1580
+ },
1581
+ },
1582
+ }
1583
+ const migratedSchema = migrations[198](oldSchema)
1584
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1585
+ expectedSchema.home.nftCelebration = null
1586
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1587
+ })
1588
+ it('works from 200 to 201', () => {
1589
+ const oldSchema = {
1590
+ ...v200Schema,
1591
+ app: {
1592
+ ...v200Schema.app,
1593
+ hideHomeBalances: true,
1594
+ },
1595
+ }
1596
+ const migratedSchema = migrations[201](oldSchema)
1597
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1598
+ expectedSchema.app.hideBalances = true
1599
+ delete expectedSchema.app.hideHomeBalances
1600
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1601
+ })
1602
+
1603
+ it('works from 201 to 202', () => {
1604
+ const oldSchema = v201Schema
1605
+ const migratedSchema = migrations[202](oldSchema)
1606
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1607
+ expectedSchema.walletConnect.pendingSessions = []
1608
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1609
+ })
1610
+
1611
+ it('works from 203 to 204: recently inactive users', () => {
1612
+ // users inactive since 4/2/2024 have legacy values in state
1613
+ const oldSchema = {
1614
+ ...v203Schema,
1615
+ positions: {
1616
+ ...(v203Schema.positions as any),
1617
+ positions: mockPositionsLegacy,
1618
+ shortcuts: mockShortcutsLegacy,
1619
+ },
1620
+ }
1621
+ const expectedSchema = _.cloneDeep(oldSchema)
1622
+ expectedSchema.positions.positions = mockPositionsLegacy2
1623
+ expectedSchema.positions.shortcuts = [mockShortcuts[0]]
1624
+ const migratedSchema = migrations[204](oldSchema)
1625
+
1626
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1627
+ })
1628
+
1629
+ it('works from 203 to 204: recently active users', () => {
1630
+ // api has been returning 'networkId' and 'networkIds' fields since 4/2/2024. users active since then will have noop migration
1631
+ const oldSchema = {
1632
+ ...v203Schema,
1633
+ positions: {
1634
+ positions: mockPositionsLegacy2,
1635
+ shortcuts: mockShortcuts,
1636
+ },
1637
+ }
1638
+ const expectedSchema = _.cloneDeep(oldSchema)
1639
+ const migratedSchema = migrations[204](oldSchema)
1640
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1641
+ })
1642
+
1643
+ it('works from 214 to 215', () => {
1644
+ const oldSchema = v214Schema
1645
+ const migratedSchema = migrations[215](oldSchema)
1646
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1647
+ expectedSchema.points.introHasBeenDismissed = false
1648
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1649
+ })
1650
+
1651
+ it('works from 216 to 217', () => {
1652
+ const oldSchema = v216Schema
1653
+ const migratedSchema = migrations[217](oldSchema)
1654
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1655
+ expectedSchema.points.trackOnceActivities = {
1656
+ 'create-wallet': false,
1657
+ }
1658
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1659
+ })
1660
+
1661
+ it('works from 222 to 223', () => {
1662
+ const oldSchema = v222Schema
1663
+ const migratedSchema = migrations[223](oldSchema)
1664
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1665
+ expectedSchema.recipients = {
1666
+ ..._.omit(oldSchema.recipients, 'valoraRecipientCache'),
1667
+ appRecipientCache: {},
1668
+ }
1669
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1670
+ })
1671
+
1672
+ it('works from 227 to 228', () => {
1673
+ const oldSchema = v227Schema
1674
+ const migratedSchema = migrations[228](oldSchema)
1675
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1676
+ ;(expectedSchema.identity = _.omit(
1677
+ oldSchema.identity,
1678
+ 'walletToAccountAddress',
1679
+ 'e164NumberToSalt',
1680
+ 'addressToDataEncryptionKey'
1681
+ )),
1682
+ (expectedSchema.web3 = _.omit(
1683
+ oldSchema.web3,
1684
+ 'accountInWeb3Keystore',
1685
+ 'dataEncryptionKey',
1686
+ 'isDekRegistered',
1687
+ 'mtwAddress'
1688
+ ))
1689
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1690
+ })
1691
+ it('works from 228 to 229', () => {
1692
+ const oldSchema = {
1693
+ ...v228Schema,
1694
+ transactions: {
1695
+ ...v228Schema.transactions,
1696
+ transactionsByNetworkId: {
1697
+ ...v228Schema.transactions.transactionsByNetworkId,
1698
+ [NetworkId['arbitrum-sepolia']]: [
1699
+ { ...mockEarnDepositTransaction, providerId: 'aave-v3' },
1700
+ ],
1701
+ },
1702
+ standbyTransactions: [
1703
+ {
1704
+ ...mockEarnDepositTransaction,
1705
+ providerId: 'aave-v3',
1706
+ status: TransactionStatus.Pending,
1707
+ },
1708
+ ...v228Schema.transactions.standbyTransactions,
1709
+ ],
1710
+ },
1711
+ }
1712
+ const migratedSchema = migrations[229](oldSchema)
1713
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1714
+ expectedSchema.transactions.transactionsByNetworkId[
1715
+ NetworkId['arbitrum-sepolia']
1716
+ ][0].providerId = 'aave'
1717
+ expectedSchema.transactions.standbyTransactions[0].providerId = 'aave'
1718
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1719
+ })
1720
+ it('works from 230 to 231', () => {
1721
+ const oldSchema = v230Schema
1722
+ const migratedSchema = migrations[231](oldSchema)
1723
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1724
+ expectedSchema.jumpstart.introHasBeenSeen = false
1725
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1726
+ })
1727
+
1728
+ it('works from 233 to 234', () => {
1729
+ const oldSchema = v233Schema
1730
+ const migratedSchema = migrations[234](oldSchema)
1731
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1732
+ expectedSchema.transactions.feedFirstPage = []
1733
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1734
+ })
1735
+
1736
+ // N.B. The 236 -> 237 migration tests are adapted from the old initial route handler tests
1737
+ it('works from 236 to 237: returns language', () => {
1738
+ const oldSchema = {
1739
+ ...v235Schema,
1740
+ i18n: {
1741
+ ...v235Schema.i18n,
1742
+ language: undefined,
1743
+ },
1744
+ }
1745
+ const migratedSchema = migrations[237](oldSchema)
1746
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1747
+ expectedSchema.account.onboardingCompleted = false
1748
+ expectedSchema.account.lastOnboardingStepScreen = Screens.Language
1749
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1750
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1751
+ })
1752
+
1753
+ it('works from 236 to 237: returns welcome if not accepted terms', () => {
1754
+ const oldSchema = {
1755
+ ...v235Schema,
1756
+ account: {
1757
+ ...v235Schema.account,
1758
+ acceptedTerms: false,
1759
+ },
1760
+ }
1761
+ const migratedSchema = migrations[237](oldSchema)
1762
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1763
+ expectedSchema.account.onboardingCompleted = false
1764
+ expectedSchema.account.lastOnboardingStepScreen = Screens.Welcome
1765
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1766
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1767
+ })
1768
+
1769
+ it('works from 236 to 237: returns welcome if no pincode', () => {
1770
+ const oldSchema = {
1771
+ ...v235Schema,
1772
+ account: {
1773
+ ...v235Schema.account,
1774
+ pincodeType: PincodeType.Unset,
1775
+ },
1776
+ }
1777
+ const migratedSchema = migrations[237](oldSchema)
1778
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1779
+ expectedSchema.account.onboardingCompleted = false
1780
+ expectedSchema.account.lastOnboardingStepScreen = Screens.Welcome
1781
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1782
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1783
+ })
1784
+
1785
+ it('works from 236 to 237: returns welcome if no account', () => {
1786
+ const oldSchema = {
1787
+ ...v235Schema,
1788
+ web3: {
1789
+ ...v235Schema.web3,
1790
+ account: undefined,
1791
+ },
1792
+ }
1793
+ const migratedSchema = migrations[237](oldSchema)
1794
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1795
+ expectedSchema.account.onboardingCompleted = false
1796
+ expectedSchema.account.lastOnboardingStepScreen = Screens.Welcome
1797
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1798
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1799
+ })
1800
+
1801
+ it('works from 236 to 237: returns import wallet if no account and restoring', () => {
1802
+ const oldSchema = {
1803
+ ...v235Schema,
1804
+ account: {
1805
+ ...v235Schema.account,
1806
+ choseToRestoreAccount: true,
1807
+ acceptedTerms: true,
1808
+ pincodeType: PincodeType.CustomPin,
1809
+ },
1810
+ web3: {
1811
+ ...v235Schema.web3,
1812
+ account: undefined,
1813
+ },
1814
+ }
1815
+ const migratedSchema = migrations[237](oldSchema)
1816
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1817
+ expectedSchema.account.onboardingCompleted = false
1818
+ expectedSchema.account.lastOnboardingStepScreen = Screens.ImportWallet
1819
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1820
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1821
+ })
1822
+
1823
+ it('works from 236 to 237: returns import select if no account and restoring and CAB enabled', () => {
1824
+ jest.replaceProperty(
1825
+ ONBOARDING_FEATURES_ENABLED,
1826
+ ToggleableOnboardingFeatures.CloudBackup,
1827
+ true
1828
+ )
1829
+ const oldSchema = {
1830
+ ...v235Schema,
1831
+ account: {
1832
+ ...v235Schema.account,
1833
+ choseToRestoreAccount: true,
1834
+ acceptedTerms: true,
1835
+ pincodeType: PincodeType.CustomPin,
1836
+ },
1837
+ web3: {
1838
+ ...v235Schema.web3,
1839
+ account: undefined,
1840
+ },
1841
+ }
1842
+ const migratedSchema = migrations[237](oldSchema)
1843
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1844
+ expectedSchema.account.onboardingCompleted = false
1845
+ expectedSchema.account.lastOnboardingStepScreen = Screens.ImportSelect
1846
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1847
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1848
+ })
1849
+
1850
+ it('works from 236 to 237: returns protect wallet if recovery phrase seen but not saved', () => {
1851
+ const oldSchema = {
1852
+ ...v235Schema,
1853
+ account: {
1854
+ ...v235Schema.account,
1855
+ acceptedTerms: true,
1856
+ pincodeType: PincodeType.CustomPin,
1857
+ recoveryPhraseInOnboardingStatus: RecoveryPhraseInOnboardingStatus.InProgress,
1858
+ },
1859
+ }
1860
+ const migratedSchema = migrations[237](oldSchema)
1861
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1862
+ expectedSchema.account.onboardingCompleted = false
1863
+ expectedSchema.account.lastOnboardingStepScreen = Screens.ProtectWallet
1864
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1865
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1866
+ })
1867
+
1868
+ it('works from 236 to 237: returns PN verification if not seen and enabled', () => {
1869
+ jest.replaceProperty(
1870
+ ONBOARDING_FEATURES_ENABLED,
1871
+ ToggleableOnboardingFeatures.PhoneVerification,
1872
+ true
1873
+ )
1874
+ const oldSchema = {
1875
+ ...v235Schema,
1876
+ account: {
1877
+ ...v235Schema.account,
1878
+ acceptedTerms: true,
1879
+ pincodeType: PincodeType.CustomPin,
1880
+ },
1881
+ identity: {
1882
+ ...v235Schema.identity,
1883
+ hasSeenVerificationNux: false,
1884
+ },
1885
+ }
1886
+ const migratedSchema = migrations[237](oldSchema)
1887
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1888
+ expectedSchema.account.onboardingCompleted = false
1889
+ expectedSchema.account.lastOnboardingStepScreen = Screens.VerificationStartScreen
1890
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1891
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1892
+ })
1893
+
1894
+ it('works from 236 to 237: returns home if not seen verification but disabled', () => {
1895
+ const oldSchema = {
1896
+ ...v235Schema,
1897
+ account: {
1898
+ ...v235Schema.account,
1899
+ acceptedTerms: true,
1900
+ pincodeType: PincodeType.CustomPin,
1901
+ },
1902
+ identity: {
1903
+ ...v235Schema.identity,
1904
+ hasSeenVerificationNux: false,
1905
+ },
1906
+ }
1907
+ const migratedSchema = migrations[237](oldSchema)
1908
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1909
+ expectedSchema.account.onboardingCompleted = true
1910
+ expectedSchema.account.lastOnboardingStepScreen = Screens.TabNavigator
1911
+ expectedSchema.identity = _.omit(oldSchema.identity, 'hasSeenVerificationNux')
1912
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1913
+ })
1914
+
1915
+ it('works from 251 to 252', () => {
1916
+ const oldSchema = {
1917
+ ...v251Schema,
1918
+ }
1919
+ const migratedSchema = migrations[252](oldSchema)
1920
+ const expectedSchema: any = _.cloneDeep(oldSchema)
1921
+ expectedSchema.jumpstart = _.pick(oldSchema.jumpstart, 'reclaimStatus')
1922
+ expectedSchema.app = _.omit(oldSchema.app, 'inviterAddress')
1923
+ expect(migratedSchema).toStrictEqual(expectedSchema)
1924
+ })
1925
+ })