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.
- package/README.md +86 -0
- package/app.plugin.js +1 -0
- package/locales/base/translation.json +2998 -0
- package/locales/de/translation.json +2998 -0
- package/locales/en-US/translation.json +2998 -0
- package/locales/es-419/translation.json +2998 -0
- package/locales/fr-FR/translation.json +2998 -0
- package/locales/index.ts +163 -0
- package/locales/it-IT/translation.json +2998 -0
- package/locales/pl-PL/translation.json +3004 -0
- package/locales/pt-BR/translation.json +2998 -0
- package/locales/ru-RU/translation.json +3004 -0
- package/locales/th-TH/translation.json +2995 -0
- package/locales/tr-TR/translation.json +2998 -0
- package/locales/uk-UA/translation.json +3004 -0
- package/locales/vi-VN/translation.json +2995 -0
- package/locales/zh-CN/translation.json +2995 -0
- package/metro-config.js +40 -0
- package/package.json +227 -0
- package/plugin/build/consts.d.ts +2 -0
- package/plugin/build/consts.js +6 -0
- package/plugin/build/index.d.ts +8 -0
- package/plugin/build/index.js +21 -0
- package/plugin/build/withAndroidUserAgent.d.ts +8 -0
- package/plugin/build/withAndroidUserAgent.js +86 -0
- package/plugin/build/withAndroidWindowSoftInputModeAdjustNothing.d.ts +6 -0
- package/plugin/build/withAndroidWindowSoftInputModeAdjustNothing.js +16 -0
- package/plugin/build/withIosAppDelegateResetKeychain.d.ts +2 -0
- package/plugin/build/withIosAppDelegateResetKeychain.js +77 -0
- package/plugin/build/withIosUserAgent.d.ts +8 -0
- package/plugin/build/withIosUserAgent.js +56 -0
- package/plugin/tsconfig.json +13 -0
- package/src/RevokePhoneNumber.tsx +117 -0
- package/src/abis/IWalletJumpstart.ts +472 -0
- package/src/account/AccountErrorScreen.test.tsx +47 -0
- package/src/account/AccountErrorScreen.tsx +72 -0
- package/src/account/AccountKeyEducation.test.tsx +20 -0
- package/src/account/AccountKeyEducation.tsx +83 -0
- package/src/account/AccountSetupFailureScreen.test.tsx +59 -0
- package/src/account/AccountSetupFailureScreen.tsx +42 -0
- package/src/account/Education.test.tsx +48 -0
- package/src/account/Education.tsx +235 -0
- package/src/account/GoldEducation.test.tsx +35 -0
- package/src/account/GoldEducation.tsx +82 -0
- package/src/account/LegalSubmenu.test.tsx +84 -0
- package/src/account/LegalSubmenu.tsx +74 -0
- package/src/account/LicenseDisclaimer.txt +15310 -0
- package/src/account/Licenses.test.tsx +17 -0
- package/src/account/Licenses.tsx +43 -0
- package/src/account/PreferencesSubmenu.test.tsx +66 -0
- package/src/account/PreferencesSubmenu.tsx +87 -0
- package/src/account/PrivateKey.test.tsx +241 -0
- package/src/account/PrivateKey.tsx +169 -0
- package/src/account/Profile.test.tsx +77 -0
- package/src/account/Profile.tsx +153 -0
- package/src/account/ProfileSubmenu.test.tsx +105 -0
- package/src/account/ProfileSubmenu.tsx +89 -0
- package/src/account/SecuritySubmenu.test.tsx +305 -0
- package/src/account/SecuritySubmenu.tsx +435 -0
- package/src/account/ShakeForSupport.test.tsx +23 -0
- package/src/account/ShakeForSupport.tsx +112 -0
- package/src/account/StoreWipeRecoveryScreen.test.tsx +39 -0
- package/src/account/StoreWipeRecoveryScreen.tsx +50 -0
- package/src/account/Support.test.tsx +67 -0
- package/src/account/Support.tsx +69 -0
- package/src/account/SupportContact.test.tsx +95 -0
- package/src/account/SupportContact.tsx +265 -0
- package/src/account/__snapshots__/AccountKeyEducation.test.tsx.snap +579 -0
- package/src/account/__snapshots__/Education.test.tsx.snap +286 -0
- package/src/account/__snapshots__/GoldEducation.test.tsx.snap +579 -0
- package/src/account/__snapshots__/Licenses.test.tsx.snap +33 -0
- package/src/account/__snapshots__/ShakeForSupport.test.tsx.snap +3 -0
- package/src/account/actions.ts +270 -0
- package/src/account/reducer.test.ts +28 -0
- package/src/account/reducer.ts +296 -0
- package/src/account/saga.test.ts +209 -0
- package/src/account/saga.ts +249 -0
- package/src/account/selectors.test.ts +18 -0
- package/src/account/selectors.ts +60 -0
- package/src/account/updateAccountRegistration.ts +35 -0
- package/src/account/utils.ts +36 -0
- package/src/account/zendesk.test.ts +166 -0
- package/src/account/zendesk.ts +199 -0
- package/src/alert/AlertBanner.test.tsx +123 -0
- package/src/alert/AlertBanner.tsx +84 -0
- package/src/alert/actions.ts +127 -0
- package/src/alert/reducer.ts +52 -0
- package/src/analytics/AppAnalytics.test.ts +334 -0
- package/src/analytics/AppAnalytics.ts +369 -0
- package/src/analytics/AsyncStoragePersistor.ts +34 -0
- package/src/analytics/Events.test.tsx +49 -0
- package/src/analytics/Events.tsx +648 -0
- package/src/analytics/InjectTraits.ts +34 -0
- package/src/analytics/Properties.tsx +1645 -0
- package/src/analytics/README.md +24 -0
- package/src/analytics/docs.ts +675 -0
- package/src/analytics/saga.test.ts +57 -0
- package/src/analytics/saga.ts +21 -0
- package/src/analytics/selectors.test.ts +391 -0
- package/src/analytics/selectors.ts +200 -0
- package/src/analytics/types.ts +46 -0
- package/src/app/App.test.tsx +25 -0
- package/src/app/App.tsx +124 -0
- package/src/app/AppInitGate.test.tsx +100 -0
- package/src/app/AppInitGate.tsx +77 -0
- package/src/app/AppLoading.test.tsx +11 -0
- package/src/app/AppLoading.tsx +79 -0
- package/src/app/DebugImages.tsx +110 -0
- package/src/app/ErrorBoundary.test.tsx +19 -0
- package/src/app/ErrorBoundary.tsx +41 -0
- package/src/app/ErrorMessages.ts +40 -0
- package/src/app/ErrorScreen.test.tsx +26 -0
- package/src/app/ErrorScreen.tsx +57 -0
- package/src/app/SanctionedCountryErrorScreen.tsx +37 -0
- package/src/app/UpgradeScreen.tsx +28 -0
- package/src/app/__snapshots__/AppLoading.test.tsx.snap +35 -0
- package/src/app/__snapshots__/ErrorScreen.test.tsx.snap +365 -0
- package/src/app/actions.ts +301 -0
- package/src/app/crowd_mobile.png +0 -0
- package/src/app/reducers.ts +204 -0
- package/src/app/saga.test.ts +651 -0
- package/src/app/saga.ts +367 -0
- package/src/app/selectors.ts +53 -0
- package/src/app/useDeepLinks.test.tsx +43 -0
- package/src/app/useDeepLinks.ts +72 -0
- package/src/app/utils.ts +14 -0
- package/src/appConfig.test.ts +37 -0
- package/src/appConfig.ts +20 -0
- package/src/backup/BackupComplete.test.tsx +61 -0
- package/src/backup/BackupComplete.tsx +69 -0
- package/src/backup/BackupIntroduction.test.tsx +37 -0
- package/src/backup/BackupIntroduction.tsx +157 -0
- package/src/backup/BackupPhrase.test.tsx +71 -0
- package/src/backup/BackupPhrase.tsx +208 -0
- package/src/backup/BackupPhraseContainer.test.tsx +43 -0
- package/src/backup/BackupPhraseContainer.tsx +207 -0
- package/src/backup/BackupQuiz.test.tsx +130 -0
- package/src/backup/BackupQuiz.tsx +429 -0
- package/src/backup/CancelConfirm.tsx +60 -0
- package/src/backup/QuizzBottom.tsx +57 -0
- package/src/backup/__snapshots__/BackupComplete.test.tsx.snap +58 -0
- package/src/backup/__snapshots__/BackupPhrase.test.tsx.snap +906 -0
- package/src/backup/__snapshots__/BackupPhraseContainer.test.tsx.snap +719 -0
- package/src/backup/__snapshots__/BackupQuiz.test.tsx.snap +1313 -0
- package/src/backup/utils.test.ts +91 -0
- package/src/backup/utils.ts +103 -0
- package/src/celoNews/CeloNewsFeed.test.tsx +157 -0
- package/src/celoNews/CeloNewsFeed.tsx +161 -0
- package/src/celoNews/CeloNewsFeedItem.test.tsx +46 -0
- package/src/celoNews/CeloNewsFeedItem.tsx +104 -0
- package/src/celoNews/types.ts +14 -0
- package/src/components/AccountNumber.test.tsx +25 -0
- package/src/components/AccountNumber.tsx +78 -0
- package/src/components/AccountNumberCard.tsx +23 -0
- package/src/components/Avatar.test.tsx +67 -0
- package/src/components/Avatar.tsx +72 -0
- package/src/components/BackButton.tsx +44 -0
- package/src/components/BeatingHeartLoader.tsx +39 -0
- package/src/components/BorderlessButton.tsx +25 -0
- package/src/components/BottomSheet.tsx +84 -0
- package/src/components/BottomSheetBase.tsx +87 -0
- package/src/components/BottomSheetScrollView.tsx +54 -0
- package/src/components/Button.test.tsx +94 -0
- package/src/components/Button.tsx +259 -0
- package/src/components/CallToActionsBar.tsx +68 -0
- package/src/components/CancelButton.test.tsx +11 -0
- package/src/components/CancelButton.tsx +58 -0
- package/src/components/Card.tsx +34 -0
- package/src/components/CircleButton.test.tsx +35 -0
- package/src/components/CircleButton.tsx +64 -0
- package/src/components/ClipboardAwarePasteButton.tsx +65 -0
- package/src/components/CloseButton.tsx +41 -0
- package/src/components/CodeInput.test.tsx +26 -0
- package/src/components/CodeInput.tsx +124 -0
- package/src/components/CodeRow.test.tsx +27 -0
- package/src/components/CodeRow.tsx +163 -0
- package/src/components/ContactCircle.test.tsx +67 -0
- package/src/components/ContactCircle.tsx +133 -0
- package/src/components/ContactCircleSelf.tsx +28 -0
- package/src/components/CurrencyDisplay.tsx +242 -0
- package/src/components/DataFieldWithCopy.tsx +75 -0
- package/src/components/DevSkipButton.tsx +105 -0
- package/src/components/Dialog.test.tsx +14 -0
- package/src/components/Dialog.tsx +124 -0
- package/src/components/Dropdown.tsx +98 -0
- package/src/components/EmptyView.tsx +34 -0
- package/src/components/ErrorMessageInline.tsx +78 -0
- package/src/components/ExchangesBottomSheet.test.tsx +84 -0
- package/src/components/ExchangesBottomSheet.tsx +74 -0
- package/src/components/Expandable.tsx +57 -0
- package/src/components/FeeDrawer.test.tsx +150 -0
- package/src/components/FeeDrawer.tsx +127 -0
- package/src/components/FeeIcon.test.tsx +14 -0
- package/src/components/FeeIcon.tsx +95 -0
- package/src/components/FeeInfoBottomSheet.test.tsx +320 -0
- package/src/components/FeeInfoBottomSheet.tsx +219 -0
- package/src/components/FilterChipsCarousel.tsx +143 -0
- package/src/components/FormField.tsx +23 -0
- package/src/components/FormLabel.tsx +21 -0
- package/src/components/FormTextInput.tsx +16 -0
- package/src/components/FullscreenCTA.test.tsx +58 -0
- package/src/components/FullscreenCTA.tsx +60 -0
- package/src/components/GasFeeWarning.test.tsx +126 -0
- package/src/components/GasFeeWarning.tsx +124 -0
- package/src/components/GradientBlock.tsx +20 -0
- package/src/components/HorizontalLine.tsx +18 -0
- package/src/components/IconWithNetworkBadge.test.tsx +49 -0
- package/src/components/IconWithNetworkBadge.tsx +69 -0
- package/src/components/InLineNotification.test.tsx +74 -0
- package/src/components/InLineNotification.tsx +160 -0
- package/src/components/InfoBottomSheet.test.tsx +55 -0
- package/src/components/InfoBottomSheet.tsx +79 -0
- package/src/components/ItemSeparator.test.tsx +8 -0
- package/src/components/ItemSeparator.tsx +16 -0
- package/src/components/KeyboardAwareScrollView.tsx +104 -0
- package/src/components/KeyboardSpacer.tsx +168 -0
- package/src/components/LabelWithInfo.tsx +57 -0
- package/src/components/LegacyTokenDisplay.test.tsx +282 -0
- package/src/components/LegacyTokenDisplay.tsx +63 -0
- package/src/components/LegacyTokenTotalLineItem.test.tsx +90 -0
- package/src/components/LegacyTokenTotalLineItem.tsx +38 -0
- package/src/components/LineItemRow.tsx +74 -0
- package/src/components/ListItem.test.tsx +19 -0
- package/src/components/ListItem.tsx +44 -0
- package/src/components/MessagingCard.tsx +21 -0
- package/src/components/Modal.tsx +57 -0
- package/src/components/NumberKeypad.test.tsx +21 -0
- package/src/components/NumberKeypad.tsx +102 -0
- package/src/components/NumberTicker.tsx +115 -0
- package/src/components/OnboardingCard.tsx +61 -0
- package/src/components/Pagination.tsx +39 -0
- package/src/components/PercentageIndicator.test.tsx +118 -0
- package/src/components/PercentageIndicator.tsx +75 -0
- package/src/components/PhoneNumberInput.test.tsx +99 -0
- package/src/components/PhoneNumberInput.tsx +132 -0
- package/src/components/PhoneNumberWithFlag.tsx +54 -0
- package/src/components/QrScanButton.test.tsx +21 -0
- package/src/components/QrScanButton.tsx +30 -0
- package/src/components/RecoveryPhraseInput.test.tsx +26 -0
- package/src/components/RecoveryPhraseInput.tsx +188 -0
- package/src/components/ReviewHeader.test.tsx +21 -0
- package/src/components/ReviewHeader.tsx +36 -0
- package/src/components/ReviewTransaction.test.tsx +474 -0
- package/src/components/ReviewTransaction.tsx +526 -0
- package/src/components/RowDivider.tsx +36 -0
- package/src/components/SearchInput.tsx +40 -0
- package/src/components/SectionHead.test.tsx +9 -0
- package/src/components/SectionHead.tsx +33 -0
- package/src/components/SegmentedControl.test.tsx +28 -0
- package/src/components/SegmentedControl.tsx +156 -0
- package/src/components/SelectRecipientButton.tsx +89 -0
- package/src/components/SelectionOption.test.tsx +18 -0
- package/src/components/SelectionOption.tsx +62 -0
- package/src/components/SettingsGearButton.tsx +30 -0
- package/src/components/SettingsItem.test.tsx +80 -0
- package/src/components/SettingsItem.tsx +195 -0
- package/src/components/SimpleMessagingCard.test.tsx +54 -0
- package/src/components/SimpleMessagingCard.tsx +90 -0
- package/src/components/SingleDigitInput.tsx +53 -0
- package/src/components/SkeletonPlaceholder.tsx +33 -0
- package/src/components/SmallButton.test.tsx +41 -0
- package/src/components/SmallButton.tsx +74 -0
- package/src/components/SmartTopAlert.test.tsx +22 -0
- package/src/components/SmartTopAlert.tsx +183 -0
- package/src/components/Switch.tsx +19 -0
- package/src/components/TextButton.tsx +22 -0
- package/src/components/TextInput.tsx +133 -0
- package/src/components/TextInputWithButtons.test.tsx +24 -0
- package/src/components/TextInputWithButtons.tsx +54 -0
- package/src/components/Toast.test.tsx +62 -0
- package/src/components/Toast.tsx +180 -0
- package/src/components/TokenBalance.test.tsx +389 -0
- package/src/components/TokenBalance.tsx +321 -0
- package/src/components/TokenBottomSheet.test.tsx +356 -0
- package/src/components/TokenBottomSheet.tsx +413 -0
- package/src/components/TokenDisplay.test.tsx +274 -0
- package/src/components/TokenDisplay.tsx +104 -0
- package/src/components/TokenEnterAmount.test.tsx +461 -0
- package/src/components/TokenEnterAmount.tsx +591 -0
- package/src/components/TokenIcon.test.tsx +93 -0
- package/src/components/TokenIcon.tsx +142 -0
- package/src/components/TokenTotalLineItem.test.tsx +199 -0
- package/src/components/TokenTotalLineItem.tsx +103 -0
- package/src/components/Touchable.tsx +48 -0
- package/src/components/ValidatedTextInput.tsx +96 -0
- package/src/components/WebView.tsx +43 -0
- package/src/components/WithPasteAware.tsx +113 -0
- package/src/components/WithTextInputPasteAware.tsx +51 -0
- package/src/components/__snapshots__/AccountNumber.test.tsx.snap +87 -0
- package/src/components/__snapshots__/Avatar.test.tsx.snap +435 -0
- package/src/components/__snapshots__/Button.test.tsx.snap +292 -0
- package/src/components/__snapshots__/CircleButton.test.tsx.snap +211 -0
- package/src/components/__snapshots__/CodeRow.test.tsx.snap +211 -0
- package/src/components/__snapshots__/ContactCircle.test.tsx.snap +46 -0
- package/src/components/__snapshots__/Dialog.test.tsx.snap +248 -0
- package/src/components/__snapshots__/FeeIcon.test.tsx.snap +147 -0
- package/src/components/__snapshots__/FullscreenCTA.test.tsx.snap +183 -0
- package/src/components/__snapshots__/ItemSeparator.test.tsx.snap +13 -0
- package/src/components/__snapshots__/NumberKeypad.test.tsx.snap +1434 -0
- package/src/components/__snapshots__/PhoneNumberInput.test.tsx.snap +202 -0
- package/src/components/__snapshots__/SectionHead.test.tsx.snap +32 -0
- package/src/components/__snapshots__/SelectionOption.test.tsx.snap +197 -0
- package/src/components/__snapshots__/SettingsItem.test.tsx.snap +226 -0
- package/src/components/__snapshots__/SmartTopAlert.test.tsx.snap +103 -0
- package/src/components/__snapshots__/TextInputWithButtons.test.tsx.snap +78 -0
- package/src/components/header/CustomHeader.tsx +56 -0
- package/src/components/multiSelect/MultiSelectBottomSheet.test.tsx +175 -0
- package/src/components/multiSelect/MultiSelectBottomSheet.tsx +249 -0
- package/src/components/multiSelect/NetworkMultiSelectBottomSheet.test.tsx +77 -0
- package/src/components/multiSelect/NetworkMultiSelectBottomSheet.tsx +56 -0
- package/src/components/useShowOrHideAnimation.tsx +33 -0
- package/src/config.enc +0 -0
- package/src/config.ts +186 -0
- package/src/dapps/DappShortcutTransactionRequest.test.tsx +187 -0
- package/src/dapps/DappShortcutTransactionRequest.tsx +270 -0
- package/src/dapps/DappShortcutsRewards.test.tsx +292 -0
- package/src/dapps/DappShortcutsRewards.tsx +284 -0
- package/src/dapps/DappsScreen.test.tsx +716 -0
- package/src/dapps/DappsScreen.tsx +365 -0
- package/src/dapps/saga.test.ts +194 -0
- package/src/dapps/saga.ts +136 -0
- package/src/dapps/selectors.test.ts +127 -0
- package/src/dapps/selectors.ts +123 -0
- package/src/dapps/slice.ts +110 -0
- package/src/dapps/types.ts +30 -0
- package/src/dappsExplorer/DappCard.tsx +141 -0
- package/src/dappsExplorer/DappFeaturedActions.test.tsx +72 -0
- package/src/dappsExplorer/DappFeaturedActions.tsx +121 -0
- package/src/dappsExplorer/DiscoverDappsCard.tsx +186 -0
- package/src/dappsExplorer/NoResults.tsx +126 -0
- package/src/dappsExplorer/TabDiscover.test.tsx +397 -0
- package/src/dappsExplorer/TabDiscover.tsx +76 -0
- package/src/dappsExplorer/searchDappList.test.tsx +69 -0
- package/src/dappsExplorer/searchDappList.tsx +113 -0
- package/src/dappsExplorer/useDappFavoritedToast.tsx +56 -0
- package/src/dappsExplorer/useOpenDapp.tsx +31 -0
- package/src/divviProtocol/saga.test.ts +51 -0
- package/src/divviProtocol/saga.ts +44 -0
- package/src/earn/ActionCard.tsx +46 -0
- package/src/earn/EarnDepositConfirmationScreen.test.tsx +603 -0
- package/src/earn/EarnDepositConfirmationScreen.tsx +596 -0
- package/src/earn/EarnEnterAmount.test.tsx +1296 -0
- package/src/earn/EarnEnterAmount.tsx +815 -0
- package/src/earn/EarnEntrypoint.test.tsx +100 -0
- package/src/earn/EarnEntrypoint.tsx +127 -0
- package/src/earn/EarnHome.test.tsx +237 -0
- package/src/earn/EarnHome.tsx +411 -0
- package/src/earn/EarnInfoScreen.test.tsx +96 -0
- package/src/earn/EarnInfoScreen.tsx +174 -0
- package/src/earn/EarnTabBar.test.tsx +43 -0
- package/src/earn/EarnTabBar.tsx +73 -0
- package/src/earn/EarnWithdrawConfirmationScreen.test.tsx +1022 -0
- package/src/earn/EarnWithdrawConfirmationScreen.tsx +476 -0
- package/src/earn/PoolCard.test.tsx +68 -0
- package/src/earn/PoolCard.tsx +218 -0
- package/src/earn/PoolList.tsx +87 -0
- package/src/earn/TabEarn.test.tsx +159 -0
- package/src/earn/TabEarn.tsx +354 -0
- package/src/earn/hooks.test.tsx +328 -0
- package/src/earn/hooks.ts +178 -0
- package/src/earn/poolInfoScreen/BeforeDepositBottomSheet.test.tsx +411 -0
- package/src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx +448 -0
- package/src/earn/poolInfoScreen/Cards.tsx +383 -0
- package/src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx +498 -0
- package/src/earn/poolInfoScreen/EarnPoolInfoScreen.tsx +595 -0
- package/src/earn/poolInfoScreen/SafetyCard.test.tsx +108 -0
- package/src/earn/poolInfoScreen/SafetyCard.tsx +165 -0
- package/src/earn/poolInfoScreen/TokenIcons.tsx +37 -0
- package/src/earn/poolInfoScreen/WithdrawBottomSheet.test.tsx +235 -0
- package/src/earn/poolInfoScreen/WithdrawBottomSheet.tsx +168 -0
- package/src/earn/prepareTransactions.test.ts +616 -0
- package/src/earn/prepareTransactions.ts +281 -0
- package/src/earn/saga.test.ts +1149 -0
- package/src/earn/saga.ts +456 -0
- package/src/earn/selectors.ts +5 -0
- package/src/earn/simulateTransactions.test.ts +121 -0
- package/src/earn/simulateTransactions.ts +58 -0
- package/src/earn/slice.test.ts +87 -0
- package/src/earn/slice.ts +73 -0
- package/src/earn/types.ts +70 -0
- package/src/earn/utils.test.ts +48 -0
- package/src/earn/utils.ts +54 -0
- package/src/fiatExchanges/BidaliScreen.test.tsx +163 -0
- package/src/fiatExchanges/BidaliScreen.tsx +189 -0
- package/src/fiatExchanges/CashInSuccess.test.tsx +54 -0
- package/src/fiatExchanges/CashInSuccess.tsx +104 -0
- package/src/fiatExchanges/ExchangeQR.test.tsx +100 -0
- package/src/fiatExchanges/ExchangeQR.tsx +94 -0
- package/src/fiatExchanges/ExternalExchanges.test.tsx +67 -0
- package/src/fiatExchanges/ExternalExchanges.tsx +104 -0
- package/src/fiatExchanges/FiatExchangeAmount.test.tsx +418 -0
- package/src/fiatExchanges/FiatExchangeAmount.tsx +305 -0
- package/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx +309 -0
- package/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx +139 -0
- package/src/fiatExchanges/PaymentMethodSection.test.tsx +259 -0
- package/src/fiatExchanges/PaymentMethodSection.tsx +378 -0
- package/src/fiatExchanges/ReviewFees.test.tsx +74 -0
- package/src/fiatExchanges/ReviewFees.tsx +202 -0
- package/src/fiatExchanges/SelectProvider.test.tsx +415 -0
- package/src/fiatExchanges/SelectProvider.tsx +649 -0
- package/src/fiatExchanges/SimplexScreen.test.tsx +109 -0
- package/src/fiatExchanges/SimplexScreen.tsx +185 -0
- package/src/fiatExchanges/Spend.tsx +104 -0
- package/src/fiatExchanges/WithdrawSpend.test.tsx +37 -0
- package/src/fiatExchanges/WithdrawSpend.tsx +139 -0
- package/src/fiatExchanges/__snapshots__/CashInSuccess.test.tsx.snap +351 -0
- package/src/fiatExchanges/__snapshots__/FiatExchangeAmount.test.tsx.snap +397 -0
- package/src/fiatExchanges/__snapshots__/ReviewFees.test.tsx.snap +844 -0
- package/src/fiatExchanges/__snapshots__/SimplexScreen.test.tsx.snap +1083 -0
- package/src/fiatExchanges/actions.ts +67 -0
- package/src/fiatExchanges/amount.test.tsx +48 -0
- package/src/fiatExchanges/amount.tsx +45 -0
- package/src/fiatExchanges/quotes/ExternalQuote.test.ts +172 -0
- package/src/fiatExchanges/quotes/ExternalQuote.ts +121 -0
- package/src/fiatExchanges/quotes/FiatConnectQuote.test.ts +718 -0
- package/src/fiatExchanges/quotes/FiatConnectQuote.ts +343 -0
- package/src/fiatExchanges/quotes/NormalizedQuote.ts +47 -0
- package/src/fiatExchanges/quotes/constants.ts +63 -0
- package/src/fiatExchanges/quotes/normalizeQuotes.test.ts +102 -0
- package/src/fiatExchanges/quotes/normalizeQuotes.ts +76 -0
- package/src/fiatExchanges/quotes/utils.ts +31 -0
- package/src/fiatExchanges/reducer.ts +65 -0
- package/src/fiatExchanges/saga.test.ts +281 -0
- package/src/fiatExchanges/saga.ts +195 -0
- package/src/fiatExchanges/types.ts +104 -0
- package/src/fiatExchanges/utils.test.ts +159 -0
- package/src/fiatExchanges/utils.tsx +287 -0
- package/src/fiatconnect/FiatDetailsScreen.test.tsx +371 -0
- package/src/fiatconnect/FiatDetailsScreen.tsx +441 -0
- package/src/fiatconnect/LinkAccountScreen.test.tsx +107 -0
- package/src/fiatconnect/LinkAccountScreen.tsx +180 -0
- package/src/fiatconnect/RefetchQuoteScreen.test.tsx +119 -0
- package/src/fiatconnect/RefetchQuoteScreen.tsx +68 -0
- package/src/fiatconnect/ReviewScreen.test.tsx +505 -0
- package/src/fiatconnect/ReviewScreen.tsx +708 -0
- package/src/fiatconnect/TransferStatusScreen.test.tsx +399 -0
- package/src/fiatconnect/TransferStatusScreen.tsx +351 -0
- package/src/fiatconnect/clients.test.tsx +83 -0
- package/src/fiatconnect/clients.ts +69 -0
- package/src/fiatconnect/consts.ts +41 -0
- package/src/fiatconnect/fiatAccountSchemas/accountNumber.test.ts +60 -0
- package/src/fiatconnect/fiatAccountSchemas/accountNumber.ts +55 -0
- package/src/fiatconnect/fiatAccountSchemas/ibanNumber.test.ts +53 -0
- package/src/fiatconnect/fiatAccountSchemas/ibanNumber.ts +56 -0
- package/src/fiatconnect/fiatAccountSchemas/ifscAccount.test.ts +45 -0
- package/src/fiatconnect/fiatAccountSchemas/ifscAccount.ts +58 -0
- package/src/fiatconnect/fiatAccountSchemas/index.test.ts +119 -0
- package/src/fiatconnect/fiatAccountSchemas/index.ts +89 -0
- package/src/fiatconnect/fiatAccountSchemas/mobileMoney.test.ts +29 -0
- package/src/fiatconnect/fiatAccountSchemas/mobileMoney.ts +61 -0
- package/src/fiatconnect/fiatAccountSchemas/pixAccount.test.ts +45 -0
- package/src/fiatconnect/fiatAccountSchemas/pixAccount.ts +62 -0
- package/src/fiatconnect/fiatAccountSchemas/types.ts +40 -0
- package/src/fiatconnect/index.test.ts +244 -0
- package/src/fiatconnect/index.ts +179 -0
- package/src/fiatconnect/kyc/KycDenied.test.tsx +139 -0
- package/src/fiatconnect/kyc/KycDenied.tsx +144 -0
- package/src/fiatconnect/kyc/KycExpired.test.tsx +128 -0
- package/src/fiatconnect/kyc/KycExpired.tsx +127 -0
- package/src/fiatconnect/kyc/KycInactive.test.tsx +139 -0
- package/src/fiatconnect/kyc/KycInactive.tsx +100 -0
- package/src/fiatconnect/kyc/KycPending.test.tsx +82 -0
- package/src/fiatconnect/kyc/KycPending.tsx +106 -0
- package/src/fiatconnect/kyc/getNavigationOptions.tsx +72 -0
- package/src/fiatconnect/saga.test.ts +2594 -0
- package/src/fiatconnect/saga.ts +1133 -0
- package/src/fiatconnect/selectors.ts +24 -0
- package/src/fiatconnect/slice.test.ts +79 -0
- package/src/fiatconnect/slice.ts +380 -0
- package/src/fiatconnect/types.ts +24 -0
- package/src/firebase/actions.ts +11 -0
- package/src/firebase/db-rules.json +129 -0
- package/src/firebase/firebase.test.ts +190 -0
- package/src/firebase/firebase.ts +315 -0
- package/src/firebase/notifications.test.ts +180 -0
- package/src/firebase/notifications.ts +106 -0
- package/src/firebase/saga.test.ts +23 -0
- package/src/firebase/saga.ts +81 -0
- package/src/flags.ts +76 -0
- package/src/home/ActionsCarousel.test.tsx +162 -0
- package/src/home/ActionsCarousel.tsx +161 -0
- package/src/home/DivviBottomSheet.test.tsx +59 -0
- package/src/home/DivviBottomSheet.tsx +197 -0
- package/src/home/GetStarted.test.tsx +47 -0
- package/src/home/GetStarted.tsx +115 -0
- package/src/home/NotificationBell.test.tsx +81 -0
- package/src/home/NotificationBell.tsx +42 -0
- package/src/home/NotificationBox.test.tsx +373 -0
- package/src/home/NotificationBox.tsx +362 -0
- package/src/home/NotificationCenter.test.tsx +466 -0
- package/src/home/NotificationCenter.tsx +185 -0
- package/src/home/SendBar.tsx +60 -0
- package/src/home/TabHome.test.tsx +336 -0
- package/src/home/TabHome.tsx +181 -0
- package/src/home/__snapshots__/NotificationBox.test.tsx.snap +933 -0
- package/src/home/actions.ts +154 -0
- package/src/home/celebration/ConfettiCelebration.tsx +170 -0
- package/src/home/celebration/NftCelebration.test.tsx +137 -0
- package/src/home/celebration/NftCelebration.tsx +207 -0
- package/src/home/celebration/NftReward.test.tsx +94 -0
- package/src/home/celebration/NftReward.tsx +172 -0
- package/src/home/celebration/confettiAnimation.json +5126 -0
- package/src/home/celebration/utils.test.ts +32 -0
- package/src/home/celebration/utils.ts +21 -0
- package/src/home/reducers.test.ts +245 -0
- package/src/home/reducers.ts +191 -0
- package/src/home/saga.test.ts +34 -0
- package/src/home/saga.ts +87 -0
- package/src/home/selectors.test.ts +302 -0
- package/src/home/selectors.ts +82 -0
- package/src/home/types.ts +31 -0
- package/src/i18n/i18n.test.ts +106 -0
- package/src/i18n/index.ts +88 -0
- package/src/i18n/otaTranslations.test.ts +34 -0
- package/src/i18n/otaTranslations.ts +15 -0
- package/src/i18n/saga.test.ts +106 -0
- package/src/i18n/saga.ts +92 -0
- package/src/i18n/selectors.ts +12 -0
- package/src/i18n/slice.ts +46 -0
- package/src/i18n/useChangeLanguage.test.tsx +53 -0
- package/src/i18n/useChangeLanguage.ts +19 -0
- package/src/icons/Activity.tsx +21 -0
- package/src/icons/Apple.tsx +14 -0
- package/src/icons/ArrowDown.tsx +19 -0
- package/src/icons/ArrowRightThick.tsx +16 -0
- package/src/icons/Attention.tsx +22 -0
- package/src/icons/BackChevron.tsx +24 -0
- package/src/icons/Backspace.tsx +31 -0
- package/src/icons/BankIcon.tsx +23 -0
- package/src/icons/Celebration.tsx +18 -0
- package/src/icons/CheckCircle.tsx +19 -0
- package/src/icons/Checkmark.tsx +26 -0
- package/src/icons/CircleArrowIcon.tsx +39 -0
- package/src/icons/CircledIcon.tsx +47 -0
- package/src/icons/Clipboard.tsx +17 -0
- package/src/icons/ClockIcon.tsx +23 -0
- package/src/icons/CloudCheck.tsx +19 -0
- package/src/icons/ComingSoon.tsx +18 -0
- package/src/icons/CopyIcon.tsx +14 -0
- package/src/icons/CrossChainIndicator.tsx +36 -0
- package/src/icons/DataDown.tsx +16 -0
- package/src/icons/DataUp.tsx +16 -0
- package/src/icons/DownArrowIcon.tsx +37 -0
- package/src/icons/EarnCoins.tsx +22 -0
- package/src/icons/Error.tsx +30 -0
- package/src/icons/Exit.tsx +18 -0
- package/src/icons/ExploreTokens.tsx +17 -0
- package/src/icons/EyeIcon.tsx +22 -0
- package/src/icons/ForwardChevron.tsx +30 -0
- package/src/icons/GearIcon.tsx +19 -0
- package/src/icons/Google.tsx +14 -0
- package/src/icons/GradientIcon.tsx +70 -0
- package/src/icons/GreenLoadingSpinner.tsx +16 -0
- package/src/icons/GreenLoadingSpinnerToCheck.tsx +16 -0
- package/src/icons/HamburgerCard.tsx +55 -0
- package/src/icons/Help.tsx +21 -0
- package/src/icons/HiddenEyeIcon.tsx +26 -0
- package/src/icons/ImageErrorIcon.tsx +26 -0
- package/src/icons/InfoIcon.tsx +33 -0
- package/src/icons/KeylessBackup.tsx +32 -0
- package/src/icons/LinkArrow.tsx +27 -0
- package/src/icons/LoadingSpinner.tsx +25 -0
- package/src/icons/Lock.tsx +19 -0
- package/src/icons/MagicWand.tsx +20 -0
- package/src/icons/Manage.tsx +22 -0
- package/src/icons/NotificationBellIcon.tsx +25 -0
- package/src/icons/OpenLinkIcon.tsx +18 -0
- package/src/icons/Paste.tsx +33 -0
- package/src/icons/Phone.tsx +20 -0
- package/src/icons/Preferences.tsx +21 -0
- package/src/icons/QRCode.tsx +14 -0
- package/src/icons/RadioButton.tsx +39 -0
- package/src/icons/RedLoadingSpinnerToInfo.tsx +16 -0
- package/src/icons/Refresh.tsx +30 -0
- package/src/icons/Reward.tsx +29 -0
- package/src/icons/ScanIcon.tsx +26 -0
- package/src/icons/Search.tsx +25 -0
- package/src/icons/Share.tsx +21 -0
- package/src/icons/Social.tsx +15 -0
- package/src/icons/Stack.tsx +21 -0
- package/src/icons/StarOutline.tsx +14 -0
- package/src/icons/SwapAndDeposit.tsx +20 -0
- package/src/icons/SwapArrows.tsx +20 -0
- package/src/icons/ThumbsUpIllustration.tsx +64 -0
- package/src/icons/Times.tsx +38 -0
- package/src/icons/TripleDotVertical.tsx +18 -0
- package/src/icons/Trophy.tsx +18 -0
- package/src/icons/User.tsx +19 -0
- package/src/icons/Warning.tsx +22 -0
- package/src/icons/biometry/Face.tsx +28 -0
- package/src/icons/biometry/FaceID.tsx +18 -0
- package/src/icons/biometry/Fingerprint.tsx +16 -0
- package/src/icons/biometry/Iris.tsx +22 -0
- package/src/icons/biometry/TouchID.tsx +44 -0
- package/src/icons/loadingSpinnerGreen.json +401 -0
- package/src/icons/lottie-json/greenLoadingSpinner.json +370 -0
- package/src/icons/lottie-json/greenLoadingSpinnerToCheck.json +666 -0
- package/src/icons/lottie-json/redLoadingSpinnerToInfo.json +950 -0
- package/src/icons/navigator/Discover.tsx +17 -0
- package/src/icons/navigator/Home.tsx +18 -0
- package/src/icons/navigator/Wallet.tsx +18 -0
- package/src/icons/quick-actions/Add.tsx +18 -0
- package/src/icons/quick-actions/More.tsx +19 -0
- package/src/icons/quick-actions/Receive.tsx +18 -0
- package/src/icons/quick-actions/Send.tsx +18 -0
- package/src/icons/quick-actions/Withdraw.tsx +18 -0
- package/src/identity/actions.ts +244 -0
- package/src/identity/contactMapping.test.ts +391 -0
- package/src/identity/contactMapping.ts +422 -0
- package/src/identity/reducer.ts +243 -0
- package/src/identity/saga.test.ts +103 -0
- package/src/identity/saga.ts +122 -0
- package/src/identity/secureSend.ts +171 -0
- package/src/identity/selectors.ts +16 -0
- package/src/identity/types.ts +14 -0
- package/src/images/Blob.tsx +20 -0
- package/src/images/Celebration.tsx +35 -0
- package/src/images/DivviLogo.tsx +22 -0
- package/src/images/GuideKeyIcon.tsx +51 -0
- package/src/images/Images.ts +22 -0
- package/src/images/Logo.tsx +66 -0
- package/src/images/LogoHeart.tsx +206 -0
- package/src/images/NftReceivedIcon.tsx +18 -0
- package/src/images/NftSentIcon.tsx +18 -0
- package/src/images/Palm.tsx +21 -0
- package/src/images/Star.tsx +20 -0
- package/src/images/WelcomeLogo.tsx +19 -0
- package/src/images/assets/account-key-1.png +0 -0
- package/src/images/assets/account-key-1@1.5x.png +0 -0
- package/src/images/assets/account-key-1@2x.png +0 -0
- package/src/images/assets/account-key-1@3x.png +0 -0
- package/src/images/assets/account-key-1@4x.png +0 -0
- package/src/images/assets/account-key-2.png +0 -0
- package/src/images/assets/account-key-2@1.5x.png +0 -0
- package/src/images/assets/account-key-2@2x.png +0 -0
- package/src/images/assets/account-key-2@3x.png +0 -0
- package/src/images/assets/account-key-2@4x.png +0 -0
- package/src/images/assets/account-key-3.png +0 -0
- package/src/images/assets/account-key-3@1.5x.png +0 -0
- package/src/images/assets/account-key-3@2x.png +0 -0
- package/src/images/assets/account-key-3@3x.png +0 -0
- package/src/images/assets/account-key-3@4x.png +0 -0
- package/src/images/assets/account-key-4.png +0 -0
- package/src/images/assets/account-key-4@1.5x.png +0 -0
- package/src/images/assets/account-key-4@2x.png +0 -0
- package/src/images/assets/account-key-4@3x.png +0 -0
- package/src/images/assets/account-key-4@4x.png +0 -0
- package/src/images/assets/biometry-face-id.png +0 -0
- package/src/images/assets/biometry-face-id@1.5x.png +0 -0
- package/src/images/assets/biometry-face-id@2x.png +0 -0
- package/src/images/assets/biometry-face-id@3x.png +0 -0
- package/src/images/assets/biometry-face-id@4x.png +0 -0
- package/src/images/assets/biometry-face.png +0 -0
- package/src/images/assets/biometry-face@1.5x.png +0 -0
- package/src/images/assets/biometry-face@2x.png +0 -0
- package/src/images/assets/biometry-face@3x.png +0 -0
- package/src/images/assets/biometry-face@4x.png +0 -0
- package/src/images/assets/biometry-fingerprint.png +0 -0
- package/src/images/assets/biometry-fingerprint@1.5x.png +0 -0
- package/src/images/assets/biometry-fingerprint@2x.png +0 -0
- package/src/images/assets/biometry-fingerprint@3x.png +0 -0
- package/src/images/assets/biometry-fingerprint@4x.png +0 -0
- package/src/images/assets/biometry-iris.png +0 -0
- package/src/images/assets/biometry-iris@1.5x.png +0 -0
- package/src/images/assets/biometry-iris@2x.png +0 -0
- package/src/images/assets/biometry-iris@3x.png +0 -0
- package/src/images/assets/biometry-iris@4x.png +0 -0
- package/src/images/assets/biometry-touch-id.png +0 -0
- package/src/images/assets/biometry-touch-id@1.5x.png +0 -0
- package/src/images/assets/biometry-touch-id@2x.png +0 -0
- package/src/images/assets/biometry-touch-id@3x.png +0 -0
- package/src/images/assets/biometry-touch-id@4x.png +0 -0
- package/src/images/assets/celo-education-1.png +0 -0
- package/src/images/assets/celo-education-1@1.5x.png +0 -0
- package/src/images/assets/celo-education-1@2x.png +0 -0
- package/src/images/assets/celo-education-1@3x.png +0 -0
- package/src/images/assets/celo-education-1@4x.png +0 -0
- package/src/images/assets/celo-education-2.png +0 -0
- package/src/images/assets/celo-education-2@1.5x.png +0 -0
- package/src/images/assets/celo-education-2@2x.png +0 -0
- package/src/images/assets/celo-education-2@3x.png +0 -0
- package/src/images/assets/celo-education-2@4x.png +0 -0
- package/src/images/assets/celo-education-3.png +0 -0
- package/src/images/assets/celo-education-3@1.5x.png +0 -0
- package/src/images/assets/celo-education-3@2x.png +0 -0
- package/src/images/assets/celo-education-3@3x.png +0 -0
- package/src/images/assets/celo-education-3@4x.png +0 -0
- package/src/images/assets/celo-education-4.png +0 -0
- package/src/images/assets/celo-education-4@1.5x.png +0 -0
- package/src/images/assets/celo-education-4@2x.png +0 -0
- package/src/images/assets/celo-education-4@3x.png +0 -0
- package/src/images/assets/celo-education-4@4x.png +0 -0
- package/src/images/assets/earn-card-background.png +0 -0
- package/src/images/assets/earn-card-background@1.5x.png +0 -0
- package/src/images/assets/earn-card-background@2x.png +0 -0
- package/src/images/assets/earn-card-background@3x.png +0 -0
- package/src/images/assets/earn-card-background@4x.png +0 -0
- package/src/images/assets/email.png +0 -0
- package/src/images/assets/email@1.5x.png +0 -0
- package/src/images/assets/email@2x.png +0 -0
- package/src/images/assets/email@3x.png +0 -0
- package/src/images/assets/email@4x.png +0 -0
- package/src/images/assets/fiat-exchange.png +0 -0
- package/src/images/assets/fiat-exchange@1.5x.png +0 -0
- package/src/images/assets/fiat-exchange@2x.png +0 -0
- package/src/images/assets/fiat-exchange@3x.png +0 -0
- package/src/images/assets/fiat-exchange@4x.png +0 -0
- package/src/images/assets/get-verified.png +0 -0
- package/src/images/assets/get-verified@1.5x.png +0 -0
- package/src/images/assets/get-verified@2x.png +0 -0
- package/src/images/assets/get-verified@3x.png +0 -0
- package/src/images/assets/get-verified@4x.png +0 -0
- package/src/images/assets/learn-celo.png +0 -0
- package/src/images/assets/learn-celo@1.5x.png +0 -0
- package/src/images/assets/learn-celo@2x.png +0 -0
- package/src/images/assets/learn-celo@3x.png +0 -0
- package/src/images/assets/learn-celo@4x.png +0 -0
- package/src/images/assets/pie.png +0 -0
- package/src/images/assets/pie@1.5x.png +0 -0
- package/src/images/assets/pie@2x.png +0 -0
- package/src/images/assets/pie@3x.png +0 -0
- package/src/images/assets/pie@4x.png +0 -0
- package/src/images/assets/points-card-background.png +0 -0
- package/src/images/assets/points-card-background@1.5x.png +0 -0
- package/src/images/assets/points-card-background@2x.png +0 -0
- package/src/images/assets/points-card-background@3x.png +0 -0
- package/src/images/assets/points-card-background@4x.png +0 -0
- package/src/images/assets/points-illustration.png +0 -0
- package/src/images/assets/points-illustration@1.5x.png +0 -0
- package/src/images/assets/points-illustration@2x.png +0 -0
- package/src/images/assets/points-illustration@3x.png +0 -0
- package/src/images/assets/points-illustration@4x.png +0 -0
- package/src/images/assets/wallet-safe.png +0 -0
- package/src/images/assets/wallet-safe@1.5x.png +0 -0
- package/src/images/assets/wallet-safe@2x.png +0 -0
- package/src/images/assets/wallet-safe@3x.png +0 -0
- package/src/images/assets/wallet-safe@4x.png +0 -0
- package/src/import/ImportWallet.test.tsx +102 -0
- package/src/import/ImportWallet.tsx +277 -0
- package/src/import/actions.ts +41 -0
- package/src/import/reducer.ts +28 -0
- package/src/import/saga.test.ts +165 -0
- package/src/import/saga.ts +250 -0
- package/src/in-house-liquidity/client.test.ts +34 -0
- package/src/in-house-liquidity/client.ts +38 -0
- package/src/in-house-liquidity/index.test.ts +258 -0
- package/src/in-house-liquidity/index.ts +187 -0
- package/src/index.d.ts +25 -0
- package/src/jumpstart/JumpstartTransactionDetailsScreen.test.tsx +329 -0
- package/src/jumpstart/JumpstartTransactionDetailsScreen.tsx +407 -0
- package/src/jumpstart/fetchClaimStatus.ts +46 -0
- package/src/jumpstart/saga.test.ts +117 -0
- package/src/jumpstart/saga.ts +82 -0
- package/src/jumpstart/selectors.ts +5 -0
- package/src/jumpstart/slice.test.ts +51 -0
- package/src/jumpstart/slice.ts +64 -0
- package/src/keylessBackup/EnvelopeIcon.tsx +19 -0
- package/src/keylessBackup/KeylessBackupCancelButton.test.tsx +55 -0
- package/src/keylessBackup/KeylessBackupCancelButton.tsx +26 -0
- package/src/keylessBackup/KeylessBackupIntro.test.tsx +76 -0
- package/src/keylessBackup/KeylessBackupIntro.tsx +175 -0
- package/src/keylessBackup/KeylessBackupPhoneCodeInput.test.tsx +256 -0
- package/src/keylessBackup/KeylessBackupPhoneCodeInput.tsx +257 -0
- package/src/keylessBackup/KeylessBackupPhoneInput.test.tsx +67 -0
- package/src/keylessBackup/KeylessBackupPhoneInput.tsx +203 -0
- package/src/keylessBackup/KeylessBackupProgress.test.tsx +371 -0
- package/src/keylessBackup/KeylessBackupProgress.tsx +495 -0
- package/src/keylessBackup/LinkPhoneNumber.test.tsx +57 -0
- package/src/keylessBackup/LinkPhoneNumber.tsx +107 -0
- package/src/keylessBackup/SignInWithEmail.test.tsx +271 -0
- package/src/keylessBackup/SignInWithEmail.tsx +348 -0
- package/src/keylessBackup/SmartphoneIcon.tsx +19 -0
- package/src/keylessBackup/WalletSecurityPrimer.test.tsx +31 -0
- package/src/keylessBackup/WalletSecurityPrimer.tsx +81 -0
- package/src/keylessBackup/encryption.test.ts +139 -0
- package/src/keylessBackup/encryption.ts +121 -0
- package/src/keylessBackup/hooks.ts +179 -0
- package/src/keylessBackup/index.test.ts +204 -0
- package/src/keylessBackup/index.ts +98 -0
- package/src/keylessBackup/keychain.test.ts +55 -0
- package/src/keylessBackup/keychain.ts +30 -0
- package/src/keylessBackup/saga.test.ts +427 -0
- package/src/keylessBackup/saga.ts +264 -0
- package/src/keylessBackup/selectors.ts +8 -0
- package/src/keylessBackup/slice.ts +108 -0
- package/src/keylessBackup/types.ts +25 -0
- package/src/keylessBackup/web3auth.test.ts +74 -0
- package/src/keylessBackup/web3auth.ts +54 -0
- package/src/language/Language.test.tsx +41 -0
- package/src/language/Language.tsx +99 -0
- package/src/localCurrency/SelectLocalCurrency.test.tsx +19 -0
- package/src/localCurrency/SelectLocalCurrency.tsx +83 -0
- package/src/localCurrency/actions.ts +49 -0
- package/src/localCurrency/consts.test.ts +9 -0
- package/src/localCurrency/consts.ts +97 -0
- package/src/localCurrency/convert.test.ts +30 -0
- package/src/localCurrency/convert.ts +66 -0
- package/src/localCurrency/hooks.test.tsx +146 -0
- package/src/localCurrency/hooks.ts +47 -0
- package/src/localCurrency/reducer.ts +59 -0
- package/src/localCurrency/saga.test.ts +34 -0
- package/src/localCurrency/saga.ts +61 -0
- package/src/localCurrency/selectors.test.ts +47 -0
- package/src/localCurrency/selectors.ts +66 -0
- package/src/localCurrency/types.ts +6 -0
- package/src/missingGlobals.ts +21 -0
- package/src/nameGenerator/index.test.ts +46 -0
- package/src/nameGenerator/index.ts +17 -0
- package/src/nameGenerator/names.ts +938 -0
- package/src/navigator/DemoModeAuthBlock.test.tsx +60 -0
- package/src/navigator/DemoModeAuthBlock.tsx +61 -0
- package/src/navigator/DemoModeChipIndicator.test.tsx +109 -0
- package/src/navigator/DemoModeChipIndicator.tsx +76 -0
- package/src/navigator/Headers.tsx +263 -0
- package/src/navigator/NavigationService.test.tsx +74 -0
- package/src/navigator/NavigationService.ts +244 -0
- package/src/navigator/Navigator.tsx +760 -0
- package/src/navigator/NavigatorWrapper.test.tsx +65 -0
- package/src/navigator/NavigatorWrapper.tsx +248 -0
- package/src/navigator/QRNavigator.test.tsx +61 -0
- package/src/navigator/QRNavigator.tsx +144 -0
- package/src/navigator/Screens.tsx +107 -0
- package/src/navigator/ScrollAwareHeader.tsx +57 -0
- package/src/navigator/SettingsMenu.test.tsx +253 -0
- package/src/navigator/SettingsMenu.tsx +353 -0
- package/src/navigator/TabNavigator.test.tsx +181 -0
- package/src/navigator/TabNavigator.tsx +142 -0
- package/src/navigator/TopBarButton.test.tsx +44 -0
- package/src/navigator/TopBarButton.tsx +88 -0
- package/src/navigator/TopBarIconButtonV2.test.tsx +17 -0
- package/src/navigator/TopBarIconButtonV2.tsx +85 -0
- package/src/navigator/initialRoute.test.tsx +32 -0
- package/src/navigator/initialRoute.tsx +29 -0
- package/src/navigator/types.tsx +346 -0
- package/src/networkInfo/actions.ts +28 -0
- package/src/networkInfo/reducer.ts +44 -0
- package/src/networkInfo/saga.test.ts +43 -0
- package/src/networkInfo/saga.ts +100 -0
- package/src/networkInfo/selectors.ts +4 -0
- package/src/nfts/NftMedia.test.tsx +114 -0
- package/src/nfts/NftMedia.tsx +205 -0
- package/src/nfts/NftsInfoCarousel.test.tsx +218 -0
- package/src/nfts/NftsInfoCarousel.tsx +344 -0
- package/src/nfts/NftsLoadError.test.tsx +37 -0
- package/src/nfts/NftsLoadError.tsx +111 -0
- package/src/nfts/saga.test.tsx +502 -0
- package/src/nfts/saga.ts +198 -0
- package/src/nfts/selectors.ts +13 -0
- package/src/nfts/slice.ts +45 -0
- package/src/nfts/types.ts +51 -0
- package/src/notifications/NotificationList.test.tsx +25 -0
- package/src/notifications/NotificationList.tsx +45 -0
- package/src/notifications/__snapshots__/NotificationList.test.tsx.snap +35 -0
- package/src/notifications/types.ts +31 -0
- package/src/onboarding/LanguageButton.tsx +26 -0
- package/src/onboarding/TopBarTextButtonOnboarding.test.tsx +22 -0
- package/src/onboarding/TopBarTextButtonOnboarding.tsx +17 -0
- package/src/onboarding/actions.ts +46 -0
- package/src/onboarding/registration/EnableBiometry.test.tsx +168 -0
- package/src/onboarding/registration/EnableBiometry.tsx +207 -0
- package/src/onboarding/registration/ImportSelect.test.tsx +54 -0
- package/src/onboarding/registration/ImportSelect.tsx +167 -0
- package/src/onboarding/registration/OnboardingRecoveryPhrase.test.tsx +83 -0
- package/src/onboarding/registration/OnboardingRecoveryPhrase.tsx +197 -0
- package/src/onboarding/registration/ProtectWallet.test.tsx +96 -0
- package/src/onboarding/registration/ProtectWallet.tsx +153 -0
- package/src/onboarding/registration/RegulatoryTerms.test.tsx +75 -0
- package/src/onboarding/registration/RegulatoryTerms.tsx +174 -0
- package/src/onboarding/registration/SelectCountry.test.tsx +51 -0
- package/src/onboarding/registration/SelectCountry.tsx +88 -0
- package/src/onboarding/registration/SelectCountryItem.tsx +59 -0
- package/src/onboarding/steps.test.ts +464 -0
- package/src/onboarding/steps.ts +303 -0
- package/src/onboarding/success/OnboardingSuccessScreen.tsx +64 -0
- package/src/onboarding/types.ts +14 -0
- package/src/onboarding/welcome/Welcome.test.tsx +234 -0
- package/src/onboarding/welcome/Welcome.tsx +182 -0
- package/src/pincode/PasswordCache.ts +71 -0
- package/src/pincode/Pincode.tsx +109 -0
- package/src/pincode/PincodeDisplay.tsx +92 -0
- package/src/pincode/PincodeEnter.test.tsx +85 -0
- package/src/pincode/PincodeEnter.tsx +103 -0
- package/src/pincode/PincodeLock.test.tsx +144 -0
- package/src/pincode/PincodeLock.tsx +121 -0
- package/src/pincode/PincodeSet.test.tsx +213 -0
- package/src/pincode/PincodeSet.tsx +263 -0
- package/src/pincode/authentication.test.ts +654 -0
- package/src/pincode/authentication.ts +425 -0
- package/src/points/ActivityCard.test.tsx +63 -0
- package/src/points/ActivityCard.tsx +101 -0
- package/src/points/ActivityCardSection.tsx +126 -0
- package/src/points/PointsDiscoverCard.test.tsx +106 -0
- package/src/points/PointsDiscoverCard.tsx +122 -0
- package/src/points/PointsHistoryBottomSheet.test.tsx +179 -0
- package/src/points/PointsHistoryBottomSheet.tsx +264 -0
- package/src/points/PointsHome.test.tsx +230 -0
- package/src/points/PointsHome.tsx +357 -0
- package/src/points/PointsIntro.test.tsx +67 -0
- package/src/points/PointsIntro.tsx +85 -0
- package/src/points/cardDefinitions.tsx +94 -0
- package/src/points/cardSort.test.ts +58 -0
- package/src/points/cardSort.ts +18 -0
- package/src/points/saga.test.ts +769 -0
- package/src/points/saga.ts +379 -0
- package/src/points/selectors.test.ts +73 -0
- package/src/points/selectors.ts +68 -0
- package/src/points/slice.test.ts +76 -0
- package/src/points/slice.ts +164 -0
- package/src/points/types.ts +94 -0
- package/src/positions/HooksPreviewModeBanner.test.tsx +56 -0
- package/src/positions/HooksPreviewModeBanner.tsx +69 -0
- package/src/positions/actions.ts +11 -0
- package/src/positions/getPositionBalanceUsd.ts +14 -0
- package/src/positions/saga.test.ts +468 -0
- package/src/positions/saga.ts +378 -0
- package/src/positions/selectors.test.ts +281 -0
- package/src/positions/selectors.ts +189 -0
- package/src/positions/slice.ts +219 -0
- package/src/positions/transactions.ts +21 -0
- package/src/positions/types.ts +137 -0
- package/src/priceHistory/PriceHistoryChart.test.tsx +200 -0
- package/src/priceHistory/PriceHistoryChart.tsx +345 -0
- package/src/priceHistory/__snapshots__/PriceHistoryChart.test.tsx.snap +419 -0
- package/src/priceHistory/saga.test.ts +120 -0
- package/src/priceHistory/saga.ts +62 -0
- package/src/priceHistory/selectors.test.ts +52 -0
- package/src/priceHistory/selectors.ts +17 -0
- package/src/priceHistory/slice.test.ts +94 -0
- package/src/priceHistory/slice.ts +68 -0
- package/src/public/components/Button.tsx +66 -0
- package/src/public/createApp.ts +67 -0
- package/src/public/getFees.test.ts +24 -0
- package/src/public/getFees.ts +8 -0
- package/src/public/getPublicClient.test.ts +19 -0
- package/src/public/getPublicClient.ts +25 -0
- package/src/public/getWalletClient.test.ts +30 -0
- package/src/public/getWalletClient.ts +32 -0
- package/src/public/hooks/toAsyncStatus.ts +19 -0
- package/src/public/hooks/usePrepareTransactions.test.ts +63 -0
- package/src/public/hooks/usePrepareTransactions.ts +15 -0
- package/src/public/hooks/usePublicClient.test.ts +24 -0
- package/src/public/hooks/usePublicClient.ts +7 -0
- package/src/public/hooks/useSendTransactions.test.ts +49 -0
- package/src/public/hooks/useSendTransactions.ts +15 -0
- package/src/public/hooks/useWallet.ts +52 -0
- package/src/public/hooks/useWalletClient.test.ts +35 -0
- package/src/public/hooks/useWalletClient.ts +24 -0
- package/src/public/index.ts +29 -0
- package/src/public/navigate.test.ts +168 -0
- package/src/public/navigate.ts +168 -0
- package/src/public/prepareTransactions.test.ts +76 -0
- package/src/public/prepareTransactions.ts +78 -0
- package/src/public/sendTransactions.test.ts +37 -0
- package/src/public/sendTransactions.ts +25 -0
- package/src/public/types.tsx +278 -0
- package/src/public/unlockAccount.test.ts +79 -0
- package/src/public/unlockAccount.ts +43 -0
- package/src/qrcode/NotAuthorizedView.test.tsx +11 -0
- package/src/qrcode/NotAuthorizedView.tsx +47 -0
- package/src/qrcode/QRCode.test.tsx +117 -0
- package/src/qrcode/QRCode.tsx +190 -0
- package/src/qrcode/QRScanner.tsx +249 -0
- package/src/qrcode/QRTabBar.tsx +137 -0
- package/src/qrcode/StyledQRCode.tsx +31 -0
- package/src/qrcode/StyledQRGen.tsx +26 -0
- package/src/qrcode/__snapshots__/NotAuthorizedView.test.tsx.snap +90 -0
- package/src/qrcode/schema.test.ts +121 -0
- package/src/qrcode/schema.ts +45 -0
- package/src/qrcode/utils.test.tsx +293 -0
- package/src/qrcode/utils.ts +230 -0
- package/src/recaptcha/RecaptchaService.ts +105 -0
- package/src/recaptcha/saga.ts +24 -0
- package/src/recipients/RecipientItemV2.test.tsx +153 -0
- package/src/recipients/RecipientItemV2.tsx +142 -0
- package/src/recipients/RecipientPickerV2.test.tsx +110 -0
- package/src/recipients/RecipientPickerV2.tsx +61 -0
- package/src/recipients/recipient.test.ts +113 -0
- package/src/recipients/recipient.ts +313 -0
- package/src/recipients/reducer.ts +107 -0
- package/src/recipients/resolve-id.ts +21 -0
- package/src/recipients/saga.ts +87 -0
- package/src/redux/apiReducersList.ts +11 -0
- package/src/redux/createMigrate.test.ts +113 -0
- package/src/redux/createMigrate.ts +46 -0
- package/src/redux/hooks.ts +7 -0
- package/src/redux/migrations.test.ts +1925 -0
- package/src/redux/migrations.ts +2069 -0
- package/src/redux/persist-helper.ts +14 -0
- package/src/redux/reducers.ts +29 -0
- package/src/redux/reducersForSchemaGeneration.ts +20 -0
- package/src/redux/reducersList.ts +57 -0
- package/src/redux/sagas-helpers.ts +29 -0
- package/src/redux/sagas.test.ts +19 -0
- package/src/redux/sagas.ts +155 -0
- package/src/redux/selectors.ts +3 -0
- package/src/redux/store.test.ts +391 -0
- package/src/redux/store.ts +151 -0
- package/src/send/EnterAmount.test.tsx +1030 -0
- package/src/send/EnterAmount.tsx +360 -0
- package/src/send/EnterAmountOptions.tsx +170 -0
- package/src/send/PasteAddressButton.tsx +81 -0
- package/src/send/SelectRecipientButtons.test.tsx +256 -0
- package/src/send/SelectRecipientButtons.tsx +202 -0
- package/src/send/SendConfirmation.test.tsx +233 -0
- package/src/send/SendConfirmation.tsx +317 -0
- package/src/send/SendEnterAmount.test.tsx +235 -0
- package/src/send/SendEnterAmount.tsx +123 -0
- package/src/send/SendSelectRecipient.test.tsx +765 -0
- package/src/send/SendSelectRecipient.tsx +504 -0
- package/src/send/SendSelectRecipientSearchInput.tsx +72 -0
- package/src/send/ValidateRecipientAccount.test.tsx +181 -0
- package/src/send/ValidateRecipientAccount.tsx +387 -0
- package/src/send/ValidateRecipientIntro.test.tsx +61 -0
- package/src/send/ValidateRecipientIntro.tsx +136 -0
- package/src/send/__snapshots__/ValidateRecipientAccount.test.tsx.snap +777 -0
- package/src/send/actions.ts +142 -0
- package/src/send/hooks.test.tsx +371 -0
- package/src/send/hooks.ts +445 -0
- package/src/send/reducers.ts +90 -0
- package/src/send/saga.test.ts +247 -0
- package/src/send/saga.ts +176 -0
- package/src/send/selectors.ts +22 -0
- package/src/send/types.ts +18 -0
- package/src/send/useFetchRecipientVerificationStatus.ts +67 -0
- package/src/send/usePrepareSendTransactions.test.ts +135 -0
- package/src/send/usePrepareSendTransactions.ts +69 -0
- package/src/send/utils.test.ts +361 -0
- package/src/send/utils.ts +116 -0
- package/src/sendCalls/constants.ts +11 -0
- package/src/sendCalls/saga.test.ts +31 -0
- package/src/sendCalls/saga.ts +15 -0
- package/src/sendCalls/selectors.test.ts +40 -0
- package/src/sendCalls/selectors.ts +8 -0
- package/src/sendCalls/slice.test.ts +85 -0
- package/src/sendCalls/slice.ts +72 -0
- package/src/sentry/Sentry.ts +75 -0
- package/src/sentry/SentrySpanHub.ts +27 -0
- package/src/sentry/SentrySpans.tsx +57 -0
- package/src/sentry/actions.ts +11 -0
- package/src/sentry/saga.ts +8 -0
- package/src/shared/DisconnectBanner.test.tsx +25 -0
- package/src/shared/DisconnectBanner.tsx +81 -0
- package/src/shared/__snapshots__/DisconnectBanner.test.tsx.snap +29 -0
- package/src/shared/conts.ts +16 -0
- package/src/statsig/client.test.ts +62 -0
- package/src/statsig/client.ts +97 -0
- package/src/statsig/constants.ts +177 -0
- package/src/statsig/index.test.ts +351 -0
- package/src/statsig/index.ts +186 -0
- package/src/statsig/selector.ts +17 -0
- package/src/statsig/types.ts +52 -0
- package/src/storage/keychain.tsx +92 -0
- package/src/styles/accessibility.ts +7 -0
- package/src/styles/appTheme.ts +13 -0
- package/src/styles/colors.tsx +78 -0
- package/src/styles/fonts.tsx +143 -0
- package/src/styles/hapticFeedback.ts +27 -0
- package/src/styles/progressDots.ts +23 -0
- package/src/styles/styles.ts +67 -0
- package/src/styles/variables.tsx +16 -0
- package/src/swap/SwapAmountInput.tsx +228 -0
- package/src/swap/SwapScreen.test.tsx +1927 -0
- package/src/swap/SwapScreen.tsx +1156 -0
- package/src/swap/SwapScreenV2.test.tsx +2180 -0
- package/src/swap/SwapScreenV2.tsx +1201 -0
- package/src/swap/SwapTransactionDetails.test.tsx +217 -0
- package/src/swap/SwapTransactionDetails.tsx +274 -0
- package/src/swap/UnfavorableRateBottomSheet.test.tsx +150 -0
- package/src/swap/UnfavorableRateBottomSheet.tsx +288 -0
- package/src/swap/getCrossChainFee.ts +64 -0
- package/src/swap/getSwapTxsAnalyticsProperties.tsx +49 -0
- package/src/swap/saga.test.ts +863 -0
- package/src/swap/saga.ts +324 -0
- package/src/swap/selectors.ts +5 -0
- package/src/swap/slice.test.ts +133 -0
- package/src/swap/slice.ts +93 -0
- package/src/swap/types.ts +98 -0
- package/src/swap/useFilterChips.ts +69 -0
- package/src/swap/useSwapQuote.ts +292 -0
- package/src/tokens/AssetList.test.tsx +270 -0
- package/src/tokens/AssetList.tsx +388 -0
- package/src/tokens/AssetTabBar.test.tsx +130 -0
- package/src/tokens/AssetTabBar.tsx +106 -0
- package/src/tokens/PasteButton.test.tsx +30 -0
- package/src/tokens/PasteButton.tsx +34 -0
- package/src/tokens/PositionIcon.tsx +22 -0
- package/src/tokens/PositionItem.test.tsx +132 -0
- package/src/tokens/PositionItem.tsx +131 -0
- package/src/tokens/TabWallet.test.tsx +386 -0
- package/src/tokens/TabWallet.tsx +237 -0
- package/src/tokens/TokenBalanceItem.test.tsx +119 -0
- package/src/tokens/TokenBalanceItem.tsx +143 -0
- package/src/tokens/TokenDetails.test.tsx +476 -0
- package/src/tokens/TokenDetails.tsx +391 -0
- package/src/tokens/TokenDetailsMoreActions.test.tsx +120 -0
- package/src/tokens/TokenDetailsMoreActions.tsx +87 -0
- package/src/tokens/TokenImport.test.tsx +376 -0
- package/src/tokens/TokenImport.tsx +381 -0
- package/src/tokens/hooks.test.tsx +419 -0
- package/src/tokens/hooks.ts +164 -0
- package/src/tokens/saga.test.ts +527 -0
- package/src/tokens/saga.ts +248 -0
- package/src/tokens/selectors.test.ts +888 -0
- package/src/tokens/selectors.ts +516 -0
- package/src/tokens/slice.ts +173 -0
- package/src/tokens/types.ts +29 -0
- package/src/tokens/utils.test.tsx +330 -0
- package/src/tokens/utils.ts +218 -0
- package/src/transactions/NoActivity.test.tsx +30 -0
- package/src/transactions/NoActivity.tsx +73 -0
- package/src/transactions/TransferAvatars.tsx +39 -0
- package/src/transactions/UserSection.tsx +133 -0
- package/src/transactions/api.ts +67 -0
- package/src/transactions/apiTestHelpers.ts +55 -0
- package/src/transactions/feed/ClaimRewardFeedItem.test.tsx +164 -0
- package/src/transactions/feed/ClaimRewardFeedItem.tsx +142 -0
- package/src/transactions/feed/DepositOrWithdrawFeedItem.test.tsx +138 -0
- package/src/transactions/feed/DepositOrWithdrawFeedItem.tsx +178 -0
- package/src/transactions/feed/EarnFeedItem.test.tsx +189 -0
- package/src/transactions/feed/EarnFeedItem.tsx +190 -0
- package/src/transactions/feed/NftFeedItem.test.tsx +102 -0
- package/src/transactions/feed/NftFeedItem.tsx +99 -0
- package/src/transactions/feed/SwapFeedItem.test.tsx +137 -0
- package/src/transactions/feed/SwapFeedItem.tsx +128 -0
- package/src/transactions/feed/TokenApprovalFeedItem.test.tsx +37 -0
- package/src/transactions/feed/TokenApprovalFeedItem.tsx +59 -0
- package/src/transactions/feed/TransactionDetails.tsx +160 -0
- package/src/transactions/feed/TransactionDetailsScreen.test.tsx +1228 -0
- package/src/transactions/feed/TransactionDetailsScreen.tsx +157 -0
- package/src/transactions/feed/TransactionFeed.test.tsx +474 -0
- package/src/transactions/feed/TransactionFeed.tsx +172 -0
- package/src/transactions/feed/TransactionFeedItemImage.test.tsx +66 -0
- package/src/transactions/feed/TransactionFeedItemImage.tsx +116 -0
- package/src/transactions/feed/TransactionFeedV2.test.tsx +576 -0
- package/src/transactions/feed/TransactionFeedV2.tsx +504 -0
- package/src/transactions/feed/TransactionPrimaryAction.test.tsx +62 -0
- package/src/transactions/feed/TransactionPrimaryAction.tsx +83 -0
- package/src/transactions/feed/TransactionStatusIndicator.test.tsx +15 -0
- package/src/transactions/feed/TransactionStatusIndicator.tsx +63 -0
- package/src/transactions/feed/TransferFeedItem.test.tsx +579 -0
- package/src/transactions/feed/TransferFeedItem.tsx +148 -0
- package/src/transactions/feed/detailContent/ClaimRewardContent.tsx +84 -0
- package/src/transactions/feed/detailContent/DepositOrWithdrawContent.tsx +169 -0
- package/src/transactions/feed/detailContent/EarnContent.tsx +259 -0
- package/src/transactions/feed/detailContent/FeeRowItem.tsx +90 -0
- package/src/transactions/feed/detailContent/RewardReceivedContent.tsx +46 -0
- package/src/transactions/feed/detailContent/SwapContent.tsx +127 -0
- package/src/transactions/feed/detailContent/TokenApprovalDetails.tsx +59 -0
- package/src/transactions/feed/detailContent/TransferReceivedContent.tsx +73 -0
- package/src/transactions/feed/detailContent/TransferSentContent.tsx +117 -0
- package/src/transactions/feed/queryHelper.test.ts +229 -0
- package/src/transactions/feed/queryHelper.ts +941 -0
- package/src/transactions/saga.test.ts +482 -0
- package/src/transactions/saga.ts +322 -0
- package/src/transactions/selectors.ts +120 -0
- package/src/transactions/send.test.ts +29 -0
- package/src/transactions/send.ts +51 -0
- package/src/transactions/slice.test.ts +372 -0
- package/src/transactions/slice.ts +262 -0
- package/src/transactions/transferFeedUtils.ts +225 -0
- package/src/transactions/types.ts +355 -0
- package/src/transactions/utils.test.ts +98 -0
- package/src/transactions/utils.ts +122 -0
- package/src/utils/AppRestart.ts +12 -0
- package/src/utils/Countries.test.ts +180 -0
- package/src/utils/Countries.ts +121 -0
- package/src/utils/IosVersionUtils.ts +6 -0
- package/src/utils/Logger.test.ts +113 -0
- package/src/utils/Logger.ts +304 -0
- package/src/utils/LoggerLevels.ts +6 -0
- package/src/utils/account.test.ts +390 -0
- package/src/utils/account.ts +497 -0
- package/src/utils/accountChecker.test.ts +75 -0
- package/src/utils/accountChecker.ts +77 -0
- package/src/utils/address.test.ts +62 -0
- package/src/utils/address.ts +34 -0
- package/src/utils/aes.test.ts +36 -0
- package/src/utils/aes.ts +46 -0
- package/src/utils/contacts.ts +78 -0
- package/src/utils/contentTranslations.ts +18 -0
- package/src/utils/country.json +257 -0
- package/src/utils/countryFeatures.ts +21 -0
- package/src/utils/currencies.ts +72 -0
- package/src/utils/displayFormatting.ts +11 -0
- package/src/utils/ensureError.test.ts +32 -0
- package/src/utils/ensureError.ts +13 -0
- package/src/utils/fetchWithTimeout.test.ts +55 -0
- package/src/utils/fetchWithTimeout.ts +15 -0
- package/src/utils/formatting.test.ts +93 -0
- package/src/utils/formatting.ts +107 -0
- package/src/utils/getCountryEmoji.ts +28 -0
- package/src/utils/getPhoneHash.ts +29 -0
- package/src/utils/gql.ts +8 -0
- package/src/utils/identifier.ts +81 -0
- package/src/utils/inputValidation.test.ts +53 -0
- package/src/utils/inputValidation.ts +76 -0
- package/src/utils/io.ts +39 -0
- package/src/utils/linking.ts +42 -0
- package/src/utils/moneyAmount.ts +16 -0
- package/src/utils/parsing.test.ts +30 -0
- package/src/utils/parsing.ts +20 -0
- package/src/utils/phoneNumber.test.ts +236 -0
- package/src/utils/phoneNumbers.ts +240 -0
- package/src/utils/random.test.ts +53 -0
- package/src/utils/random.ts +48 -0
- package/src/utils/safely.test.ts +101 -0
- package/src/utils/safely.ts +30 -0
- package/src/utils/sleep.ts +3 -0
- package/src/utils/string.ts +8 -0
- package/src/utils/stylize.ts +30 -0
- package/src/utils/time.test.ts +76 -0
- package/src/utils/time.ts +99 -0
- package/src/utils/typescript.ts +38 -0
- package/src/utils/useBackHandler.ts +10 -0
- package/src/utils/useClipboard.ts +56 -0
- package/src/utils/versionCheck.test.ts +47 -0
- package/src/utils/versionCheck.ts +35 -0
- package/src/verify/ResendButtonWithDelay.tsx +56 -0
- package/src/verify/VerificationCodeInput.test.tsx +87 -0
- package/src/verify/VerificationCodeInput.tsx +103 -0
- package/src/verify/VerificationCodeInputScreen.test.tsx +364 -0
- package/src/verify/VerificationCodeInputScreen.tsx +138 -0
- package/src/verify/VerificationStartScreen.test.tsx +218 -0
- package/src/verify/VerificationStartScreen.tsx +311 -0
- package/src/verify/hooks.test.tsx +85 -0
- package/src/verify/hooks.ts +261 -0
- package/src/viem/estimateFeesPerGas.test.ts +129 -0
- package/src/viem/estimateFeesPerGas.ts +70 -0
- package/src/viem/getLockableWallet.test.ts +263 -0
- package/src/viem/getLockableWallet.ts +120 -0
- package/src/viem/index.ts +86 -0
- package/src/viem/keychainAccountToAccount.test.ts +55 -0
- package/src/viem/keychainAccountToAccount.ts +58 -0
- package/src/viem/prepareTransactions.test.ts +1668 -0
- package/src/viem/prepareTransactions.ts +741 -0
- package/src/viem/preparedTransactionSerialization.test.ts +192 -0
- package/src/viem/preparedTransactionSerialization.ts +100 -0
- package/src/viem/saga.test.ts +227 -0
- package/src/viem/saga.ts +118 -0
- package/src/walletConnect/actions.test.ts +94 -0
- package/src/walletConnect/actions.ts +232 -0
- package/src/walletConnect/analytics.ts +58 -0
- package/src/walletConnect/capabilities.ts +175 -0
- package/src/walletConnect/constants.ts +157 -0
- package/src/walletConnect/reducer.ts +105 -0
- package/src/walletConnect/request.test.ts +698 -0
- package/src/walletConnect/request.ts +225 -0
- package/src/walletConnect/saga.test.ts +1875 -0
- package/src/walletConnect/saga.ts +1159 -0
- package/src/walletConnect/screens/ActionRequest.test.tsx +727 -0
- package/src/walletConnect/screens/ActionRequest.tsx +227 -0
- package/src/walletConnect/screens/ActionRequestPayload.tsx +84 -0
- package/src/walletConnect/screens/ConnectionTimedOut.tsx +34 -0
- package/src/walletConnect/screens/DappsDisclaimer.tsx +31 -0
- package/src/walletConnect/screens/EstimatedNetworkFee.test.tsx +88 -0
- package/src/walletConnect/screens/EstimatedNetworkFee.tsx +134 -0
- package/src/walletConnect/screens/Logos.tsx +89 -0
- package/src/walletConnect/screens/RequestContent.tsx +224 -0
- package/src/walletConnect/screens/SessionRequest.test.tsx +274 -0
- package/src/walletConnect/screens/SessionRequest.tsx +221 -0
- package/src/walletConnect/screens/Sessions.tsx +142 -0
- package/src/walletConnect/screens/WalletConnectRequest.tsx +63 -0
- package/src/walletConnect/screens/useIsDappListed.test.tsx +51 -0
- package/src/walletConnect/screens/useIsDappListed.ts +20 -0
- package/src/walletConnect/selectors.ts +25 -0
- package/src/walletConnect/types.ts +99 -0
- package/src/walletConnect/walletConnect.ts +87 -0
- package/src/web3/KeychainAccounts.test.ts +326 -0
- package/src/web3/KeychainAccounts.ts +309 -0
- package/src/web3/actions.ts +30 -0
- package/src/web3/consts.ts +8 -0
- package/src/web3/contracts.test.ts +115 -0
- package/src/web3/contracts.ts +74 -0
- package/src/web3/networkConfig.test.ts +18 -0
- package/src/web3/networkConfig.ts +621 -0
- package/src/web3/reducer.ts +39 -0
- package/src/web3/saga.test.ts +200 -0
- package/src/web3/saga.ts +229 -0
- package/src/web3/selectors.ts +47 -0
- package/src/web3/utils.test.ts +12 -0
- package/src/web3/utils.ts +11 -0
- package/src/webview/WebViewAndroidBottomSheet.test.tsx +58 -0
- package/src/webview/WebViewAndroidBottomSheet.tsx +83 -0
- package/src/webview/WebViewScreen.test.tsx +84 -0
- package/src/webview/WebViewScreen.tsx +296 -0
- package/src/webview/__snapshots__/WebViewAndroidBottomSheet.test.tsx.snap +249 -0
- package/tsconfig.base.json +5 -0
- 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
|
+
})
|