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,497 @@
|
|
|
1
|
+
// Initially copied from https://github.com/celo-org/developer-tooling/blob/467d4e16444535d341bd2296d41c386f1dab187f/packages/sdk/cryptographic-utils/src/account.ts
|
|
2
|
+
import * as bip39 from '@scure/bip39'
|
|
3
|
+
import { get as levenshteinDistance } from 'fast-levenshtein'
|
|
4
|
+
// Provides fast and secure cryptographic functions from OpenSSL
|
|
5
|
+
// Note: we could also just import "crypto", since react-native-quick-crypto polyfills it
|
|
6
|
+
// But at least it's explicit here and we have more guarantees the expected implementation is being used
|
|
7
|
+
import crypto from 'react-native-quick-crypto'
|
|
8
|
+
import { privateKeyToAddress } from 'src/utils/address'
|
|
9
|
+
import { bytesToHex } from 'viem'
|
|
10
|
+
import {
|
|
11
|
+
HDKey,
|
|
12
|
+
english,
|
|
13
|
+
french,
|
|
14
|
+
italian,
|
|
15
|
+
japanese,
|
|
16
|
+
korean,
|
|
17
|
+
portuguese,
|
|
18
|
+
simplifiedChinese,
|
|
19
|
+
spanish,
|
|
20
|
+
traditionalChinese,
|
|
21
|
+
} from 'viem/accounts'
|
|
22
|
+
|
|
23
|
+
export const CELO_DERIVATION_PATH_BASE = "m/44'/52752'/0'"
|
|
24
|
+
|
|
25
|
+
export enum MnemonicStrength {
|
|
26
|
+
s128_12words = 128,
|
|
27
|
+
s256_24words = 256,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum MnemonicLanguages {
|
|
31
|
+
chinese_simplified,
|
|
32
|
+
chinese_traditional,
|
|
33
|
+
english,
|
|
34
|
+
french,
|
|
35
|
+
italian,
|
|
36
|
+
japanese,
|
|
37
|
+
korean,
|
|
38
|
+
spanish,
|
|
39
|
+
portuguese,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface Bip39 {
|
|
43
|
+
mnemonicToSeed: (mnemonic: string, password?: string) => Promise<Uint8Array>
|
|
44
|
+
generateMnemonic: (strength?: number, wordlist?: string[]) => Promise<string>
|
|
45
|
+
validateMnemonic: (mnemonic: string, wordlist?: string[]) => boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const wordlists: Record<MnemonicLanguages, string[]> = {
|
|
49
|
+
[MnemonicLanguages.english]: english,
|
|
50
|
+
[MnemonicLanguages.french]: french,
|
|
51
|
+
[MnemonicLanguages.italian]: italian,
|
|
52
|
+
[MnemonicLanguages.japanese]: japanese,
|
|
53
|
+
[MnemonicLanguages.korean]: korean,
|
|
54
|
+
[MnemonicLanguages.portuguese]: portuguese,
|
|
55
|
+
[MnemonicLanguages.chinese_simplified]: simplifiedChinese,
|
|
56
|
+
[MnemonicLanguages.spanish]: spanish,
|
|
57
|
+
[MnemonicLanguages.chinese_traditional]: traditionalChinese,
|
|
58
|
+
} as const
|
|
59
|
+
|
|
60
|
+
function salt(passphrase: string) {
|
|
61
|
+
return `mnemonic${passphrase}`.normalize('NFKD')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Note: here we don't use bip39.mnemonicToSeed because it's currently implemented in JS
|
|
65
|
+
// and it's slow:
|
|
66
|
+
// - 3+ seconds on a iPhone 13 Pro
|
|
67
|
+
// - 10+ seconds on a Pixel 4a
|
|
68
|
+
async function _mnemonicToSeed(mnemonic: string, passphrase = '') {
|
|
69
|
+
const mnemonicBuffer = Buffer.from(mnemonic, 'utf8')
|
|
70
|
+
const saltBuffer = Buffer.from(salt(passphrase), 'utf8')
|
|
71
|
+
return new Promise<Uint8Array>((resolve, reject) =>
|
|
72
|
+
crypto.pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'SHA-512', (err, derivedKey) => {
|
|
73
|
+
if (err) {
|
|
74
|
+
reject(err)
|
|
75
|
+
} else {
|
|
76
|
+
if (!derivedKey) {
|
|
77
|
+
// This should never happen
|
|
78
|
+
reject(new Error('No derived key'))
|
|
79
|
+
} else {
|
|
80
|
+
resolve(derivedKey)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Note: we could use bip39.generateMnemonic
|
|
88
|
+
// because it uses crypto.randomBytes too
|
|
89
|
+
// but at least we have the guarantee that the expected implementation is being used
|
|
90
|
+
function _generateMnemonic(
|
|
91
|
+
strength?: number,
|
|
92
|
+
wordlist: string[] = wordlists[MnemonicLanguages.english]
|
|
93
|
+
): Promise<string> {
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
strength = strength || 128
|
|
96
|
+
|
|
97
|
+
crypto.randomBytes(strength / 8, (error, randomBytesBuffer) => {
|
|
98
|
+
if (error) {
|
|
99
|
+
reject(error)
|
|
100
|
+
} else {
|
|
101
|
+
if (!randomBytesBuffer) {
|
|
102
|
+
// This should never happen
|
|
103
|
+
reject(new Error('No random bytes generated'))
|
|
104
|
+
} else {
|
|
105
|
+
resolve(bip39.entropyToMnemonic(randomBytesBuffer, wordlist))
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function _validateMnemonic(
|
|
113
|
+
mnemonic: string,
|
|
114
|
+
wordlist: string[] = wordlists[MnemonicLanguages.english]
|
|
115
|
+
) {
|
|
116
|
+
return bip39.validateMnemonic(mnemonic, wordlist)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const bip39Wrapper: Bip39 = {
|
|
120
|
+
mnemonicToSeed: _mnemonicToSeed,
|
|
121
|
+
generateMnemonic: _generateMnemonic,
|
|
122
|
+
validateMnemonic: _validateMnemonic,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export async function generateMnemonic(
|
|
126
|
+
strength: MnemonicStrength = MnemonicStrength.s256_24words,
|
|
127
|
+
language?: MnemonicLanguages
|
|
128
|
+
): Promise<string> {
|
|
129
|
+
return bip39Wrapper.generateMnemonic(strength, getWordList(language))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function validateMnemonic(mnemonic: string, language?: MnemonicLanguages) {
|
|
133
|
+
if (language !== undefined) {
|
|
134
|
+
return bip39Wrapper.validateMnemonic(mnemonic, getWordList(language))
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const languages = getAllLanguages()
|
|
138
|
+
for (const guessedLanguage of languages) {
|
|
139
|
+
if (bip39Wrapper.validateMnemonic(mnemonic, getWordList(guessedLanguage))) {
|
|
140
|
+
return true
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return false
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Return a list of the words in the mnemonic that are not in the list of valid BIP-39 words for the
|
|
149
|
+
* specified or detected language.
|
|
150
|
+
*
|
|
151
|
+
* @remarks Will return undefined if the language cannot be detected (e.g. all the words are
|
|
152
|
+
* invalid, or half of the valid words are from one language and the other half from another.)
|
|
153
|
+
*/
|
|
154
|
+
export function invalidMnemonicWords(
|
|
155
|
+
mnemonic: string,
|
|
156
|
+
language?: MnemonicLanguages
|
|
157
|
+
): string[] | undefined {
|
|
158
|
+
const words = splitMnemonic(mnemonic)
|
|
159
|
+
const detectedLanguage = language ?? detectMnemonicLanguage(words)
|
|
160
|
+
if (detectedLanguage === undefined) {
|
|
161
|
+
return undefined
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const wordSet = new Set(getWordList(detectedLanguage))
|
|
165
|
+
return words.filter((word) => !wordSet.has(word))
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Normalize the mnemonic phrase to eliminate a number of inconsistencies with standard BIP-39
|
|
170
|
+
* phrases that are likely to arise when a user manually enters a phrase.
|
|
171
|
+
*
|
|
172
|
+
* @remarks Note that this does not guarantee that the output is a valid mnemonic phrase, or even
|
|
173
|
+
* that all the words in the phrase are contained in a valid wordlist.
|
|
174
|
+
*/
|
|
175
|
+
export function normalizeMnemonic(mnemonic: string, language?: MnemonicLanguages): string {
|
|
176
|
+
const words = splitMnemonic(mnemonic)
|
|
177
|
+
const lowered = words.map((word) => word.toLowerCase())
|
|
178
|
+
const detectedLanguage = language ?? detectMnemonicLanguage(lowered)
|
|
179
|
+
|
|
180
|
+
// If the language is unknown, do not run further normalizations.
|
|
181
|
+
if (detectedLanguage === undefined) {
|
|
182
|
+
return joinMnemonic(lowered, detectedLanguage)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return joinMnemonic(formatNonAccentedWords(lowered, detectedLanguage), detectedLanguage)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
|
|
189
|
+
function normalizeAccents(str: string) {
|
|
190
|
+
return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Scans the provided phrase and adds accents to words where the are not provided, or provided
|
|
195
|
+
* inconsistently with the BIP-39 standard. Ensures that phrases differing only by accents will
|
|
196
|
+
* validate after being cast into the normalized form.
|
|
197
|
+
*
|
|
198
|
+
* @remarks Words should be converted to lower case before being given to this function.
|
|
199
|
+
*/
|
|
200
|
+
function formatNonAccentedWords(words: string[], language: MnemonicLanguages): string[] {
|
|
201
|
+
if (isLatinBasedLanguage(language)) {
|
|
202
|
+
const wordList = getWordList(language)
|
|
203
|
+
const normalizedWordMap = new Map(wordList.map((word) => [normalizeAccents(word), word]))
|
|
204
|
+
return words.map((word) => normalizedWordMap.get(normalizeAccents(word)) ?? word)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return words
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function isLatinBasedLanguage(language: MnemonicLanguages): boolean {
|
|
211
|
+
// Use exhaustive switch to ensure that every language is accounted for.
|
|
212
|
+
switch (language) {
|
|
213
|
+
case MnemonicLanguages.english:
|
|
214
|
+
case MnemonicLanguages.french:
|
|
215
|
+
case MnemonicLanguages.italian:
|
|
216
|
+
case MnemonicLanguages.spanish:
|
|
217
|
+
case MnemonicLanguages.portuguese:
|
|
218
|
+
return true
|
|
219
|
+
case MnemonicLanguages.chinese_simplified:
|
|
220
|
+
case MnemonicLanguages.chinese_traditional:
|
|
221
|
+
case MnemonicLanguages.japanese:
|
|
222
|
+
case MnemonicLanguages.korean:
|
|
223
|
+
return false
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Unify the bip39.wordlists (otherwise depends on the instance of the bip39)
|
|
228
|
+
export function getWordList(language: MnemonicLanguages = MnemonicLanguages.english): string[] {
|
|
229
|
+
return wordlists[language]
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function getAllLanguages(): MnemonicLanguages[] {
|
|
233
|
+
return [
|
|
234
|
+
MnemonicLanguages.chinese_simplified,
|
|
235
|
+
MnemonicLanguages.chinese_traditional,
|
|
236
|
+
MnemonicLanguages.english,
|
|
237
|
+
MnemonicLanguages.french,
|
|
238
|
+
MnemonicLanguages.italian,
|
|
239
|
+
MnemonicLanguages.japanese,
|
|
240
|
+
MnemonicLanguages.korean,
|
|
241
|
+
MnemonicLanguages.spanish,
|
|
242
|
+
MnemonicLanguages.portuguese,
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function mnemonicLengthFromStrength(strength: MnemonicStrength): number {
|
|
247
|
+
switch (strength) {
|
|
248
|
+
case MnemonicStrength.s128_12words:
|
|
249
|
+
return 12
|
|
250
|
+
case MnemonicStrength.s256_24words:
|
|
251
|
+
return 24
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Splits a mnemonic phrase into words, handling extra whitespace anywhere in the phrase.
|
|
257
|
+
*/
|
|
258
|
+
function splitMnemonic(mnemonic: string): string[] {
|
|
259
|
+
return [...mnemonic.trim().split(/\s+/)]
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Joins a list of words into a mnemonic phrase. Inverse of splitMnemonic.
|
|
264
|
+
*/
|
|
265
|
+
function joinMnemonic(words: string[], language: MnemonicLanguages | undefined): string {
|
|
266
|
+
return words.join(language === MnemonicLanguages.japanese ? '\u3000' : ' ')
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Detects the language of tokenized mnemonic phrase by applying a heuristic.
|
|
271
|
+
*
|
|
272
|
+
* @remarks Uses a heuristic of returning the language with the most matching words. In practice, we
|
|
273
|
+
* expect all words to come from a single language, also some may be misspelled or otherwise
|
|
274
|
+
* malformed. It may occasionally occur that a typo results in word from another language (e.g. bag
|
|
275
|
+
* -> bagr) but this should occur at most once or twice per phrase.
|
|
276
|
+
*/
|
|
277
|
+
function detectMnemonicLanguage(
|
|
278
|
+
words: string[],
|
|
279
|
+
candidates?: MnemonicLanguages[]
|
|
280
|
+
): MnemonicLanguages | undefined {
|
|
281
|
+
// Assign a match score to each language by how many words of the phrase are in each language.
|
|
282
|
+
const scores: [MnemonicLanguages, number][] = (candidates ?? getAllLanguages()).map(
|
|
283
|
+
(candidate) => {
|
|
284
|
+
const wordSet = new Set(getWordList(candidate))
|
|
285
|
+
const score = words.reduce((count, word) => (wordSet.has(word) ? count + 1 : count), 0)
|
|
286
|
+
return [candidate, score]
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
// Reduce to the highest scoring candidate(s). Note that it is possible for multiple candidates to
|
|
291
|
+
// have the same score, but it likely to occur only for specially constructed phrases.
|
|
292
|
+
const [winners, highscore] = scores.reduce(
|
|
293
|
+
([leaders, leadingScore], [candidate, score]) => {
|
|
294
|
+
if (score > leadingScore) {
|
|
295
|
+
return [[candidate], score]
|
|
296
|
+
} else if (score === leadingScore) {
|
|
297
|
+
return [[...leaders, candidate], leadingScore]
|
|
298
|
+
}
|
|
299
|
+
return [leaders, leadingScore]
|
|
300
|
+
},
|
|
301
|
+
[[], 0] as [MnemonicLanguages[], number]
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
if (winners.length !== 1 || highscore < 1) {
|
|
305
|
+
return undefined
|
|
306
|
+
}
|
|
307
|
+
return winners[0]
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Generates a list of suggested corrections to the mnemonic phrase based on a set of heuristics.
|
|
312
|
+
*
|
|
313
|
+
* @remarks
|
|
314
|
+
* Each yielded suggestion represents an attempt to correct the seed phrase by replacing any invalid
|
|
315
|
+
* words with the most likely valid words. Returned suggestions phrases are ordered by probability
|
|
316
|
+
* based on a noisy channel model, described in detail in CIP-39.
|
|
317
|
+
*
|
|
318
|
+
* The generated list of suggestions is exponential in size, and effectively infinite. One should
|
|
319
|
+
* not attempt to generate the entire list.
|
|
320
|
+
*
|
|
321
|
+
* All yielded suggestions will have a valid checksum, but are not guaranteed to correspond to any
|
|
322
|
+
* given wallet. If the phrase is being used to recover a wallet with non-zero balance, it is
|
|
323
|
+
* suggested that the caller check the balance of the derived wallet address. If the balance is
|
|
324
|
+
* non-zero, they can be sure that the phrase is correct. If it is zero, then they should continue
|
|
325
|
+
* and try the next suggestion.
|
|
326
|
+
*
|
|
327
|
+
* It is recommended to normalize the mnemonic phrase before inputting to this function.
|
|
328
|
+
*
|
|
329
|
+
* @privateRemarks
|
|
330
|
+
* TODO(victor): Include a heuristic rule for phrase-level corrections, such as word ordering swaps.
|
|
331
|
+
*/
|
|
332
|
+
export function* suggestMnemonicCorrections(
|
|
333
|
+
mnemonic: string,
|
|
334
|
+
language?: MnemonicLanguages,
|
|
335
|
+
strength?: MnemonicStrength
|
|
336
|
+
): Generator<string> {
|
|
337
|
+
const words = splitMnemonic(mnemonic)
|
|
338
|
+
|
|
339
|
+
// Function does not currently attempt to correct phrases with an incorrect number of words.
|
|
340
|
+
const expectedLength = strength && mnemonicLengthFromStrength(strength)
|
|
341
|
+
if ((expectedLength && words.length !== expectedLength) || words.length % 3 !== 0) {
|
|
342
|
+
return
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// If the language is not provided or detected, no suggestions can be given.
|
|
346
|
+
const lang = language ?? detectMnemonicLanguage(words)
|
|
347
|
+
if (lang === undefined) {
|
|
348
|
+
return
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Iterate over the generator of corrections, and return those that have a valid checksum.
|
|
352
|
+
for (const suggestion of suggestUnvalidatedCorrections(words, lang)) {
|
|
353
|
+
const phrase = joinMnemonic(suggestion, lang)
|
|
354
|
+
if (validateMnemonic(phrase, lang)) {
|
|
355
|
+
yield phrase
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Suggestions for a particular word in a phrase keyed by distance. Values are unordered suggested
|
|
361
|
+
// word lists at the edit distance indicated by the key.
|
|
362
|
+
type SuggestionsByDistance = Map<number, string[]>
|
|
363
|
+
|
|
364
|
+
/// Generates a list of suggested phases based on an edit distance correction heuristic.
|
|
365
|
+
function* suggestUnvalidatedCorrections(
|
|
366
|
+
words: string[],
|
|
367
|
+
language: MnemonicLanguages
|
|
368
|
+
): Generator<string[]> {
|
|
369
|
+
// Create a list of suggestions for each word in the phrase.
|
|
370
|
+
// Note that for valid words, the input word will be in the suggestions lists at edit distance 0.
|
|
371
|
+
// Valid words are not considered separately because it's possible for an error to yield a valid
|
|
372
|
+
// word, (e.g. "tent" mistyped as "rent", both of which are valid words)
|
|
373
|
+
const spotSuggestions: SuggestionsByDistance[] = words.map((word) =>
|
|
374
|
+
wordSuggestions(word, language)
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
// Combine the given suggestions lists to produce all combinations with weight, defined as the sum
|
|
378
|
+
// edit distances for all chosen words, equal to the given weight value.
|
|
379
|
+
// The set of suggestions yielded with a given weight is disjoint from the set of suggestions
|
|
380
|
+
// yielded with any other given weight.
|
|
381
|
+
function* combineSuggestions(
|
|
382
|
+
suggestionsLists: SuggestionsByDistance[],
|
|
383
|
+
weight: number
|
|
384
|
+
): Generator<string[], undefined, undefined> {
|
|
385
|
+
if (suggestionsLists.length < 1 || weight < 0) {
|
|
386
|
+
throw Error('programming error: suggestions map must have at least one entry')
|
|
387
|
+
}
|
|
388
|
+
const suggestions = suggestionsLists[0]
|
|
389
|
+
|
|
390
|
+
// Base case: When there is only one entry, "consume" the rest of the weight by yielding all
|
|
391
|
+
// words in the suggestions list at edit distance `weight` as singleton lists (i.e. 1 word
|
|
392
|
+
// phrases).
|
|
393
|
+
if (suggestionsLists.length === 1) {
|
|
394
|
+
yield* suggestions.get(weight)?.map((suggestion): string[] => [suggestion]) ?? []
|
|
395
|
+
return
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Recursion case: When more than one entry exists, consume iteratively 0 to weight units and
|
|
399
|
+
// combine it with all arrays of the remaining weight, generated from removing one entry.
|
|
400
|
+
const remaining = [...suggestionsLists.slice(1)]
|
|
401
|
+
for (const distance of [...suggestions.keys()].sort()) {
|
|
402
|
+
if (distance > weight) {
|
|
403
|
+
break
|
|
404
|
+
}
|
|
405
|
+
for (const list of combineSuggestions(remaining, weight - distance)) {
|
|
406
|
+
for (const suggestion of suggestions.get(distance) ?? []) {
|
|
407
|
+
yield [suggestion, ...list]
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Increase the weight counter incrementally. At each weight, all returned suggestions are
|
|
414
|
+
// considered equally probably. All suggestions of a higher weight are disjoint from and
|
|
415
|
+
// considered less probably than all suggestions of a lower weight.
|
|
416
|
+
// Note that the stopping condition is chosen arbitrarily to be weight of 1000. In practice, the
|
|
417
|
+
// number of strings with weight less than 1000 is exponentially large and impossible to generate.
|
|
418
|
+
// The stopping condition is included to eventually break when handle malformed phrases.
|
|
419
|
+
//
|
|
420
|
+
// TODO(victor) In the current formulation, only integral weights can be handled, and it is
|
|
421
|
+
// inefficeint to loop over weights that cannot be constructed. Ideally this should be corrected
|
|
422
|
+
// to allow for non-integral weights.
|
|
423
|
+
for (let weight = 0; weight < 1000; weight++) {
|
|
424
|
+
for (const suggestedWords of combineSuggestions(spotSuggestions, weight)) {
|
|
425
|
+
yield suggestedWords
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Given a word and lnaguage, returns a map of all words in the BIP-39 word list for the given
|
|
431
|
+
// language by edit distance. This is used as word replacement suggestions.
|
|
432
|
+
function wordSuggestions(typo: string, language: MnemonicLanguages): SuggestionsByDistance {
|
|
433
|
+
return getWordList(language)
|
|
434
|
+
.map((word) => ({ distance: levenshteinDistance(typo, word), word }))
|
|
435
|
+
.reduce((map, { distance, word }) => {
|
|
436
|
+
// Reduction uses mutation, instead of spread, as an optimization.
|
|
437
|
+
const list = map.get(distance)
|
|
438
|
+
if (list !== undefined) {
|
|
439
|
+
list.push(word)
|
|
440
|
+
} else {
|
|
441
|
+
map.set(distance, [word])
|
|
442
|
+
}
|
|
443
|
+
return map
|
|
444
|
+
}, new Map<number, string[]>())
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export async function generateKeys(
|
|
448
|
+
mnemonic: string,
|
|
449
|
+
password?: string,
|
|
450
|
+
changeIndex: number = 0,
|
|
451
|
+
addressIndex: number = 0,
|
|
452
|
+
derivationPath: string = CELO_DERIVATION_PATH_BASE
|
|
453
|
+
): Promise<{ privateKey: string; publicKey: string; address: string }> {
|
|
454
|
+
const seed: Buffer = await generateSeed(mnemonic, password)
|
|
455
|
+
return generateKeysFromSeed(seed, changeIndex, addressIndex, derivationPath)
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// keyByteLength truncates the seed. *Avoid its use*
|
|
459
|
+
// It was added only because a backwards compatibility bug
|
|
460
|
+
async function generateSeed(
|
|
461
|
+
mnemonic: string,
|
|
462
|
+
password?: string,
|
|
463
|
+
keyByteLength: number = 64
|
|
464
|
+
): Promise<Buffer> {
|
|
465
|
+
let seed = Buffer.from(await bip39Wrapper.mnemonicToSeed(mnemonic, password ?? ''))
|
|
466
|
+
if (keyByteLength > 0 && seed.byteLength > keyByteLength) {
|
|
467
|
+
const bufAux = Buffer.allocUnsafe(keyByteLength)
|
|
468
|
+
seed.copy(bufAux, 0, 0, keyByteLength)
|
|
469
|
+
seed = bufAux
|
|
470
|
+
}
|
|
471
|
+
return seed
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function generateKeysFromSeed(
|
|
475
|
+
seed: Buffer,
|
|
476
|
+
changeIndex: number = 0,
|
|
477
|
+
addressIndex: number = 0,
|
|
478
|
+
derivationPath: string = CELO_DERIVATION_PATH_BASE
|
|
479
|
+
): { privateKey: string; publicKey: string; address: string } {
|
|
480
|
+
const node = HDKey.fromMasterSeed(seed)
|
|
481
|
+
const newNode = node.derive(
|
|
482
|
+
`${derivationPath ? `${derivationPath}/` : ''}${changeIndex}/${addressIndex}`
|
|
483
|
+
)
|
|
484
|
+
if (!newNode.privateKey) {
|
|
485
|
+
// As we are generating the node from a seed, the node will always have a private key and this would never happened
|
|
486
|
+
throw new Error('utils-accounts@generateKeys: invalid node to derivate')
|
|
487
|
+
}
|
|
488
|
+
const privateKeyHex = bytesToHex(newNode.privateKey)
|
|
489
|
+
const privateKey = privateKeyHex.slice(2)
|
|
490
|
+
const publicKey = bytesToHex(newNode.publicKey!).slice(2)
|
|
491
|
+
|
|
492
|
+
return {
|
|
493
|
+
privateKey,
|
|
494
|
+
publicKey,
|
|
495
|
+
address: privateKeyToAddress(privateKeyHex),
|
|
496
|
+
}
|
|
497
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as Keychain from '@divvi/react-native-keychain'
|
|
2
|
+
import * as Sentry from '@sentry/react-native'
|
|
3
|
+
import AppAnalytics from 'src/analytics/AppAnalytics'
|
|
4
|
+
import { resetStateOnInvalidStoredAccount } from 'src/utils/accountChecker'
|
|
5
|
+
import { clearStoredAccounts } from 'src/web3/KeychainAccounts'
|
|
6
|
+
import { walletAddressSelector } from 'src/web3/selectors'
|
|
7
|
+
import { getMockStoreData } from 'test/utils'
|
|
8
|
+
|
|
9
|
+
jest.mock('src/web3/KeychainAccounts')
|
|
10
|
+
|
|
11
|
+
const mockedKeychain = jest.mocked(Keychain)
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
jest.clearAllMocks()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
describe('resetStateOnInvalidStoredAccount', () => {
|
|
18
|
+
it("returns the same state when there's no account", async () => {
|
|
19
|
+
const state = getMockStoreData({ web3: { account: null } })
|
|
20
|
+
expect(walletAddressSelector(state)).toEqual(null)
|
|
21
|
+
const result = await resetStateOnInvalidStoredAccount(state)
|
|
22
|
+
|
|
23
|
+
expect(result === state).toEqual(true)
|
|
24
|
+
expect(clearStoredAccounts).toHaveBeenCalledTimes(0)
|
|
25
|
+
expect(Sentry.captureException).toHaveBeenCalledTimes(0)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('returns the same state when given an invalid state', async () => {
|
|
29
|
+
const invalidState: any = {}
|
|
30
|
+
const result = await resetStateOnInvalidStoredAccount(invalidState)
|
|
31
|
+
|
|
32
|
+
expect(result === invalidState).toEqual(true)
|
|
33
|
+
expect(clearStoredAccounts).toHaveBeenCalledTimes(0)
|
|
34
|
+
expect(Sentry.captureException).toHaveBeenCalledTimes(1)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('returns the same state when given an undefined state', async () => {
|
|
38
|
+
const result = await resetStateOnInvalidStoredAccount(undefined)
|
|
39
|
+
|
|
40
|
+
expect(result === undefined).toEqual(true)
|
|
41
|
+
expect(clearStoredAccounts).toHaveBeenCalledTimes(0)
|
|
42
|
+
// This is normal flow, we don't expect an exception
|
|
43
|
+
expect(Sentry.captureException).toHaveBeenCalledTimes(0)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it("returns the same state when there's an account and a matching password hash in the keychain", async () => {
|
|
47
|
+
mockedKeychain.getGenericPassword.mockResolvedValue({
|
|
48
|
+
password: 'some hash',
|
|
49
|
+
username: 'username',
|
|
50
|
+
service: 'service',
|
|
51
|
+
storage: Keychain.STORAGE_TYPE.RSA,
|
|
52
|
+
})
|
|
53
|
+
const state = getMockStoreData()
|
|
54
|
+
expect(walletAddressSelector(state)).toEqual('0x0000000000000000000000000000000000007e57')
|
|
55
|
+
const result = await resetStateOnInvalidStoredAccount(state)
|
|
56
|
+
|
|
57
|
+
expect(result === state).toEqual(true)
|
|
58
|
+
expect(clearStoredAccounts).toHaveBeenCalledTimes(0)
|
|
59
|
+
expect(Sentry.captureException).toHaveBeenCalledTimes(0)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it("returns an undefined state when there's an account and no matching password hash in the keychain", async () => {
|
|
63
|
+
mockedKeychain.getGenericPassword.mockResolvedValue(false)
|
|
64
|
+
const state = getMockStoreData()
|
|
65
|
+
expect(walletAddressSelector(state)).toEqual('0x0000000000000000000000000000000000007e57')
|
|
66
|
+
const result = await resetStateOnInvalidStoredAccount(state)
|
|
67
|
+
|
|
68
|
+
expect(result === undefined).toEqual(true)
|
|
69
|
+
expect(clearStoredAccounts).toHaveBeenCalledTimes(1)
|
|
70
|
+
expect(Sentry.captureException).toHaveBeenCalledTimes(0)
|
|
71
|
+
expect(AppAnalytics.track).toHaveBeenCalledWith('redux_no_matching_keychain_account', {
|
|
72
|
+
walletAddress: '0x0000000000000000000000000000000000007e57',
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
})
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import AppAnalytics from 'src/analytics/AppAnalytics'
|
|
2
|
+
import { AppEvents } from 'src/analytics/Events'
|
|
3
|
+
import { currentLanguageSelector } from 'src/i18n/selectors'
|
|
4
|
+
import { navigateClearingStack } from 'src/navigator/NavigationService'
|
|
5
|
+
import { Screens } from 'src/navigator/Screens'
|
|
6
|
+
import { passwordHashStorageKey } from 'src/pincode/authentication'
|
|
7
|
+
import { RootState } from 'src/redux/reducers'
|
|
8
|
+
import { retrieveStoredItem } from 'src/storage/keychain'
|
|
9
|
+
import Logger from 'src/utils/Logger'
|
|
10
|
+
import { ensureError } from 'src/utils/ensureError'
|
|
11
|
+
import { clearStoredAccounts } from 'src/web3/KeychainAccounts'
|
|
12
|
+
import { getKeychainAccounts } from 'src/web3/contracts'
|
|
13
|
+
import { walletAddressSelector } from 'src/web3/selectors'
|
|
14
|
+
import { call, select } from 'typed-redux-saga'
|
|
15
|
+
|
|
16
|
+
const TAG = 'utils/accountChecker'
|
|
17
|
+
|
|
18
|
+
export function* checkAccountExistenceSaga() {
|
|
19
|
+
const accounts = yield* call(getKeychainAccounts)
|
|
20
|
+
|
|
21
|
+
const keychainAccounts = accounts.getAccounts()
|
|
22
|
+
const walletAddress = yield* select(walletAddressSelector)
|
|
23
|
+
if (!walletAddress && keychainAccounts.length > 0) {
|
|
24
|
+
const account = keychainAccounts[0]
|
|
25
|
+
AppAnalytics.track(AppEvents.redux_keychain_mismatch, {
|
|
26
|
+
account,
|
|
27
|
+
})
|
|
28
|
+
const language = yield* select(currentLanguageSelector)
|
|
29
|
+
if (!language) {
|
|
30
|
+
navigateClearingStack(Screens.Language, { nextScreen: Screens.StoreWipeRecoveryScreen })
|
|
31
|
+
} else {
|
|
32
|
+
navigateClearingStack(Screens.StoreWipeRecoveryScreen)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// This function ensures the stored account in redux has a matching password hash in the system keychain/keystore
|
|
38
|
+
// so we can actually use the account private key
|
|
39
|
+
// If it's not in sync, the keychain/keystore has been wiped and there's nothing we can do about it.
|
|
40
|
+
// This happens when restoring the app data from iCloud backups. This is by design as we don't want the keychain data to be backed up.
|
|
41
|
+
// In that case we reset the redux state so the user can restore their account by entering the seed phrase or creating a new one.
|
|
42
|
+
//
|
|
43
|
+
// Note: this function is meant to be used before the redux state has been rehydrated.
|
|
44
|
+
// With the way the app init is currently done, this was the less disruptive place.
|
|
45
|
+
// I tried adding this to checkAccountExistenceSaga above, but it was causing issues because of sagas initializing in parallel.
|
|
46
|
+
export async function resetStateOnInvalidStoredAccount(state: RootState | undefined) {
|
|
47
|
+
try {
|
|
48
|
+
const walletAddress = state && walletAddressSelector(state)
|
|
49
|
+
Logger.info(TAG, `Stored wallet address: ${walletAddress}`)
|
|
50
|
+
if (walletAddress) {
|
|
51
|
+
let passwordHash
|
|
52
|
+
let keychainError: string | undefined
|
|
53
|
+
try {
|
|
54
|
+
passwordHash = await retrieveStoredItem(passwordHashStorageKey(walletAddress))
|
|
55
|
+
} catch (err) {
|
|
56
|
+
const error = ensureError(err).message
|
|
57
|
+
Logger.warn(TAG, `Failed to retrieve password hash for ${walletAddress}: ${error}`)
|
|
58
|
+
keychainError = error
|
|
59
|
+
}
|
|
60
|
+
if (!passwordHash) {
|
|
61
|
+
// No password hash present, we need to reset the redux state and remove existing accounts from the keychain
|
|
62
|
+
// which we can't unlock without the password hash
|
|
63
|
+
AppAnalytics.track(AppEvents.redux_no_matching_keychain_account, {
|
|
64
|
+
walletAddress,
|
|
65
|
+
keychainError,
|
|
66
|
+
})
|
|
67
|
+
await clearStoredAccounts()
|
|
68
|
+
Logger.info(TAG, `State reset`)
|
|
69
|
+
return undefined
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
Logger.error(TAG, 'Failed to validate stored account', error)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return state
|
|
77
|
+
}
|