@oxyhq/services 5.13.40 → 5.15.0
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 +130 -54
- package/lib/commonjs/assets/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/commonjs/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/commonjs/core/HttpService.js +94 -4
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/core/OxyServices.base.js +3 -1
- package/lib/commonjs/core/OxyServices.base.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js +213 -22
- package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.auth.js +70 -99
- package/lib/commonjs/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/commonjs/crypto/index.js +33 -0
- package/lib/commonjs/crypto/index.js.map +1 -0
- package/lib/commonjs/crypto/keyManager.js +208 -0
- package/lib/commonjs/crypto/keyManager.js.map +1 -0
- package/lib/commonjs/crypto/recoveryPhrase.js +137 -0
- package/lib/commonjs/crypto/recoveryPhrase.js.map +1 -0
- package/lib/commonjs/crypto/signatureService.js +230 -0
- package/lib/commonjs/crypto/signatureService.js.map +1 -0
- package/lib/commonjs/i18n/locales/en-US.json +4 -0
- package/lib/commonjs/index.js +22 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/ActivityIndicator.js +203 -0
- package/lib/commonjs/ui/components/ActivityIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/AutoHeightScrollView.js +46 -0
- package/lib/commonjs/ui/components/AutoHeightScrollView.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheet.js +407 -0
- package/lib/commonjs/ui/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js +366 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -0
- package/lib/commonjs/ui/components/CrossFadeIcon.js +106 -0
- package/lib/commonjs/ui/components/CrossFadeIcon.js.map +1 -0
- package/lib/commonjs/ui/components/EmptyState.js +41 -0
- package/lib/commonjs/ui/components/EmptyState.js.map +1 -0
- package/lib/commonjs/ui/components/GroupedItem.js +87 -82
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +25 -25
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +111 -47
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/HelperText.js +103 -0
- package/lib/commonjs/ui/components/HelperText.js.map +1 -0
- package/lib/commonjs/ui/components/Icon.js +109 -0
- package/lib/commonjs/ui/components/Icon.js.map +1 -0
- package/lib/commonjs/ui/components/IconButton/IconButton.js +159 -0
- package/lib/commonjs/ui/components/IconButton/IconButton.js.map +1 -0
- package/lib/commonjs/ui/components/IconButton/utils.js +155 -0
- package/lib/commonjs/ui/components/IconButton/utils.js.map +1 -0
- package/lib/commonjs/ui/components/LoadingState.js +47 -0
- package/lib/commonjs/ui/components/LoadingState.js.map +1 -0
- package/lib/commonjs/ui/components/OxyPayButton.js +1 -14
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +41 -372
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +9 -13
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +7 -4
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/QuickActions.js +7 -4
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +4 -1
- package/lib/commonjs/ui/components/Section.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +6 -3
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/SettingRow.js +77 -0
- package/lib/commonjs/ui/components/SettingRow.js.map +1 -0
- package/lib/commonjs/ui/components/StepBasedScreen.js +188 -172
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/Surface.js +258 -0
- package/lib/commonjs/ui/components/Surface.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Addons/Outline.js +46 -0
- package/lib/commonjs/ui/components/TextField/Addons/Outline.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Addons/Underline.js +53 -0
- package/lib/commonjs/ui/components/TextField/Addons/Underline.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js +155 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAffix.js +144 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAffix.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldIcon.js +137 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldIcon.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/enums.js +22 -0
- package/lib/commonjs/ui/components/TextField/Adornment/enums.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/types.js +6 -0
- package/lib/commonjs/ui/components/TextField/Adornment/types.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js +62 -0
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Label/InputLabel.js +176 -0
- package/lib/commonjs/ui/components/TextField/Label/InputLabel.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Label/LabelBackground.js +84 -0
- package/lib/commonjs/ui/components/TextField/Label/LabelBackground.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/TextFieldFlat.js +377 -0
- package/lib/commonjs/ui/components/TextField/TextFieldFlat.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/TextFieldOutlined.js +361 -0
- package/lib/commonjs/ui/components/TextField/TextFieldOutlined.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/constants.js +50 -0
- package/lib/commonjs/ui/components/TextField/constants.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/helpers.js +490 -0
- package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/types.js +6 -0
- package/lib/commonjs/ui/components/TextField/types.js.map +1 -0
- package/lib/commonjs/ui/components/TextField.js +339 -0
- package/lib/commonjs/ui/components/TextField.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/Pressable.js +12 -0
- package/lib/commonjs/ui/components/TouchableRipple/Pressable.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js +258 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js +107 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/utils.js +56 -0
- package/lib/commonjs/ui/components/TouchableRipple/utils.js.map +1 -0
- package/lib/commonjs/ui/components/Typography/AnimatedText.js +62 -0
- package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -0
- package/lib/commonjs/ui/components/Typography/types.js +26 -0
- package/lib/commonjs/ui/components/Typography/types.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +171 -0
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +409 -0
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +181 -0
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/styles.js +868 -0
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -0
- package/lib/commonjs/ui/components/index.js +29 -1
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/profile/EditBioModal.js +181 -0
- package/lib/commonjs/ui/components/profile/EditBioModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js +207 -0
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditEmailModal.js +184 -0
- package/lib/commonjs/ui/components/profile/EditEmailModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditLinksModal.js +315 -0
- package/lib/commonjs/ui/components/profile/EditLinksModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditLocationModal.js +273 -0
- package/lib/commonjs/ui/components/profile/EditLocationModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js +180 -0
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/TwoFactorSetupModal.js +467 -0
- package/lib/commonjs/ui/components/profile/TwoFactorSetupModal.js.map +1 -0
- package/lib/commonjs/ui/components/styles/overlay.js +85 -0
- package/lib/commonjs/ui/components/styles/overlay.js.map +1 -0
- package/lib/commonjs/ui/components/styles/shadow.js +132 -0
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -0
- package/lib/commonjs/ui/components/theming.js +116 -0
- package/lib/commonjs/ui/components/theming.js.map +1 -0
- package/lib/commonjs/ui/components/types.js +2 -0
- package/lib/commonjs/ui/components/types.js.map +1 -0
- package/lib/commonjs/ui/components/utils/forwardRef.js +18 -0
- package/lib/commonjs/ui/components/utils/forwardRef.js.map +1 -0
- package/lib/commonjs/ui/components/utils/hasTouchHandler.js +13 -0
- package/lib/commonjs/ui/components/utils/hasTouchHandler.js.map +1 -0
- package/lib/commonjs/ui/components/utils/roundLayoutSize.js +9 -0
- package/lib/commonjs/ui/components/utils/roundLayoutSize.js.map +1 -0
- package/lib/commonjs/ui/components/utils/splitStyles.js +50 -0
- package/lib/commonjs/ui/components/utils/splitStyles.js.map +1 -0
- package/lib/commonjs/ui/constants/iconColors.js +84 -0
- package/lib/commonjs/ui/constants/iconColors.js.map +1 -0
- package/lib/commonjs/ui/constants/spacing.js +50 -0
- package/lib/commonjs/ui/constants/spacing.js.map +1 -0
- package/lib/commonjs/ui/constants/theme.js +123 -0
- package/lib/commonjs/ui/constants/theme.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +198 -853
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/ThemeContext.js +36 -0
- package/lib/commonjs/ui/context/ThemeContext.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +349 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +73 -0
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js +112 -0
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js +261 -0
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useStorage.js +79 -0
- package/lib/commonjs/ui/context/hooks/useStorage.js.map +1 -0
- package/lib/commonjs/ui/context/utils/errorHandlers.js +90 -0
- package/lib/commonjs/ui/context/utils/errorHandlers.js.map +1 -0
- package/lib/commonjs/ui/context/utils/sessionHelpers.js +103 -0
- package/lib/commonjs/ui/context/utils/sessionHelpers.js.map +1 -0
- package/lib/commonjs/ui/context/utils/storageHelpers.js +119 -0
- package/lib/commonjs/ui/context/utils/storageHelpers.js.map +1 -0
- package/lib/commonjs/ui/hooks/index.js +14 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/use-color-scheme.js +29 -0
- package/lib/commonjs/ui/hooks/use-color-scheme.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-haptic-press.js +21 -0
- package/lib/commonjs/ui/hooks/use-haptic-press.js.map +1 -0
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceManagement.js +73 -0
- package/lib/commonjs/ui/hooks/useDeviceManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/useLanguageManagement.js +112 -0
- package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js +123 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js +261 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/useStorage.js +79 -0
- package/lib/commonjs/ui/hooks/useStorage.js.map +1 -0
- package/lib/commonjs/ui/hooks/useThemeColors.js +31 -0
- package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -0
- package/lib/commonjs/ui/hooks/useThemeStyles.js +69 -0
- package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -0
- package/lib/commonjs/ui/index.js +1 -4
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +180 -0
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +80 -154
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +67 -67
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +217 -98
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +514 -429
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +44 -59
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +12 -19
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +36 -43
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +14 -14
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +674 -1968
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +26 -23
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +19 -59
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +79 -170
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +13 -40
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +436 -0
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +18 -24
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +21 -9
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +180 -252
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +7 -5
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +32 -70
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +26 -99
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +24 -16
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +8 -10
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +64 -67
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +11 -8
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +124 -122
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +99 -112
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +12 -9
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +552 -79
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +12 -8
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +5 -11
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +60 -2
- package/lib/commonjs/ui/styles/spacing.js.map +1 -1
- package/lib/commonjs/ui/styles/theme.js +1 -1
- package/lib/commonjs/ui/types/fileManagement.js +6 -0
- package/lib/commonjs/ui/types/fileManagement.js.map +1 -0
- package/lib/commonjs/ui/types/navigation.js +6 -0
- package/lib/commonjs/ui/types/navigation.js.map +1 -0
- package/lib/commonjs/ui/utils/colorUtils.js +52 -0
- package/lib/commonjs/ui/utils/colorUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/errorHandlers.js +90 -0
- package/lib/commonjs/ui/utils/errorHandlers.js.map +1 -0
- package/lib/commonjs/ui/utils/fileManagement.js +181 -0
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -0
- package/lib/commonjs/ui/utils/sessionHelpers.js +103 -0
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -0
- package/lib/commonjs/ui/utils/storageHelpers.js +119 -0
- package/lib/commonjs/ui/utils/storageHelpers.js.map +1 -0
- package/lib/commonjs/ui/utils/themeUtils.js +47 -0
- package/lib/commonjs/ui/utils/themeUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/user-utils.js +53 -0
- package/lib/commonjs/ui/utils/user-utils.js.map +1 -0
- package/lib/commonjs/utils/errorUtils.js +14 -4
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/module/assets/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/module/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/module/core/HttpService.js +94 -4
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/core/OxyServices.base.js +3 -1
- package/lib/module/core/OxyServices.base.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.assets.js +212 -20
- package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.auth.js +70 -99
- package/lib/module/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/module/crypto/index.js +16 -0
- package/lib/module/crypto/index.js.map +1 -0
- package/lib/module/crypto/keyManager.js +204 -0
- package/lib/module/crypto/keyManager.js.map +1 -0
- package/lib/module/crypto/recoveryPhrase.js +131 -0
- package/lib/module/crypto/recoveryPhrase.js.map +1 -0
- package/lib/module/crypto/signatureService.js +227 -0
- package/lib/module/crypto/signatureService.js.map +1 -0
- package/lib/module/i18n/locales/en-US.json +4 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/ActivityIndicator.js +198 -0
- package/lib/module/ui/components/ActivityIndicator.js.map +1 -0
- package/lib/module/ui/components/AutoHeightScrollView.js +41 -0
- package/lib/module/ui/components/AutoHeightScrollView.js.map +1 -0
- package/lib/module/ui/components/BottomSheet.js +402 -0
- package/lib/module/ui/components/BottomSheet.js.map +1 -0
- package/lib/module/ui/components/BottomSheetRouter.js +356 -0
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -0
- package/lib/module/ui/components/CrossFadeIcon.js +101 -0
- package/lib/module/ui/components/CrossFadeIcon.js.map +1 -0
- package/lib/module/ui/components/EmptyState.js +36 -0
- package/lib/module/ui/components/EmptyState.js.map +1 -0
- package/lib/module/ui/components/GroupedItem.js +88 -82
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +23 -23
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +109 -46
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/HelperText.js +99 -0
- package/lib/module/ui/components/HelperText.js.map +1 -0
- package/lib/module/ui/components/Icon.js +102 -0
- package/lib/module/ui/components/Icon.js.map +1 -0
- package/lib/module/ui/components/IconButton/IconButton.js +153 -0
- package/lib/module/ui/components/IconButton/IconButton.js.map +1 -0
- package/lib/module/ui/components/IconButton/utils.js +149 -0
- package/lib/module/ui/components/IconButton/utils.js.map +1 -0
- package/lib/module/ui/components/LoadingState.js +42 -0
- package/lib/module/ui/components/LoadingState.js.map +1 -0
- package/lib/module/ui/components/OxyPayButton.js +1 -14
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +45 -377
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +9 -13
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +7 -4
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/QuickActions.js +7 -4
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/Section.js +4 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +6 -3
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/SettingRow.js +72 -0
- package/lib/module/ui/components/SettingRow.js.map +1 -0
- package/lib/module/ui/components/StepBasedScreen.js +190 -174
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/Surface.js +252 -0
- package/lib/module/ui/components/Surface.js.map +1 -0
- package/lib/module/ui/components/TextField/Addons/Outline.js +40 -0
- package/lib/module/ui/components/TextField/Addons/Outline.js.map +1 -0
- package/lib/module/ui/components/TextField/Addons/Underline.js +47 -0
- package/lib/module/ui/components/TextField/Addons/Underline.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js +148 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAffix.js +141 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAffix.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldIcon.js +135 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldIcon.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/enums.js +18 -0
- package/lib/module/ui/components/TextField/Adornment/enums.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/types.js +4 -0
- package/lib/module/ui/components/TextField/Adornment/types.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/utils.js +57 -0
- package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -0
- package/lib/module/ui/components/TextField/Label/InputLabel.js +171 -0
- package/lib/module/ui/components/TextField/Label/InputLabel.js.map +1 -0
- package/lib/module/ui/components/TextField/Label/LabelBackground.js +78 -0
- package/lib/module/ui/components/TextField/Label/LabelBackground.js.map +1 -0
- package/lib/module/ui/components/TextField/TextFieldFlat.js +372 -0
- package/lib/module/ui/components/TextField/TextFieldFlat.js.map +1 -0
- package/lib/module/ui/components/TextField/TextFieldOutlined.js +355 -0
- package/lib/module/ui/components/TextField/TextFieldOutlined.js.map +1 -0
- package/lib/module/ui/components/TextField/constants.js +46 -0
- package/lib/module/ui/components/TextField/constants.js.map +1 -0
- package/lib/module/ui/components/TextField/helpers.js +472 -0
- package/lib/module/ui/components/TextField/helpers.js.map +1 -0
- package/lib/module/ui/components/TextField/types.js +4 -0
- package/lib/module/ui/components/TextField/types.js.map +1 -0
- package/lib/module/ui/components/TextField.js +333 -0
- package/lib/module/ui/components/TextField.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/Pressable.js +9 -0
- package/lib/module/ui/components/TouchableRipple/Pressable.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js +253 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js +101 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/utils.js +50 -0
- package/lib/module/ui/components/TouchableRipple/utils.js.map +1 -0
- package/lib/module/ui/components/Typography/AnimatedText.js +56 -0
- package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -0
- package/lib/module/ui/components/Typography/types.js +22 -0
- package/lib/module/ui/components/Typography/types.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +165 -0
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileViewer.js +402 -0
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -0
- package/lib/module/ui/components/fileManagement/UploadPreview.js +175 -0
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -0
- package/lib/module/ui/components/fileManagement/styles.js +864 -0
- package/lib/module/ui/components/fileManagement/styles.js.map +1 -0
- package/lib/module/ui/components/index.js +4 -1
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/profile/EditBioModal.js +175 -0
- package/lib/module/ui/components/profile/EditBioModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditDisplayNameModal.js +201 -0
- package/lib/module/ui/components/profile/EditDisplayNameModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditEmailModal.js +178 -0
- package/lib/module/ui/components/profile/EditEmailModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditLinksModal.js +309 -0
- package/lib/module/ui/components/profile/EditLinksModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditLocationModal.js +267 -0
- package/lib/module/ui/components/profile/EditLocationModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditUsernameModal.js +174 -0
- package/lib/module/ui/components/profile/EditUsernameModal.js.map +1 -0
- package/lib/module/ui/components/profile/TwoFactorSetupModal.js +460 -0
- package/lib/module/ui/components/profile/TwoFactorSetupModal.js.map +1 -0
- package/lib/module/ui/components/styles/overlay.js +80 -0
- package/lib/module/ui/components/styles/overlay.js.map +1 -0
- package/lib/module/ui/components/styles/shadow.js +128 -0
- package/lib/module/ui/components/styles/shadow.js.map +1 -0
- package/lib/module/ui/components/theming.js +111 -0
- package/lib/module/ui/components/theming.js.map +1 -0
- package/lib/module/ui/components/types.js +2 -0
- package/lib/module/ui/components/types.js.map +1 -0
- package/lib/module/ui/components/utils/forwardRef.js +13 -0
- package/lib/module/ui/components/utils/forwardRef.js.map +1 -0
- package/lib/module/ui/components/utils/hasTouchHandler.js +9 -0
- package/lib/module/ui/components/utils/hasTouchHandler.js.map +1 -0
- package/lib/module/ui/components/utils/roundLayoutSize.js +4 -0
- package/lib/module/ui/components/utils/roundLayoutSize.js.map +1 -0
- package/lib/module/ui/components/utils/splitStyles.js +46 -0
- package/lib/module/ui/components/utils/splitStyles.js.map +1 -0
- package/lib/module/ui/constants/iconColors.js +78 -0
- package/lib/module/ui/constants/iconColors.js.map +1 -0
- package/lib/module/ui/constants/spacing.js +45 -0
- package/lib/module/ui/constants/spacing.js.map +1 -0
- package/lib/module/ui/constants/theme.js +119 -0
- package/lib/module/ui/constants/theme.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +199 -855
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/ThemeContext.js +29 -0
- package/lib/module/ui/context/ThemeContext.js.map +1 -0
- package/lib/module/ui/context/hooks/useAuthOperations.js +344 -0
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -0
- package/lib/module/ui/context/hooks/useDeviceManagement.js +68 -0
- package/lib/module/ui/context/hooks/useDeviceManagement.js.map +1 -0
- package/lib/module/ui/context/hooks/useLanguageManagement.js +107 -0
- package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -0
- package/lib/module/ui/context/hooks/useSessionManagement.js +256 -0
- package/lib/module/ui/context/hooks/useSessionManagement.js.map +1 -0
- package/lib/module/ui/context/hooks/useStorage.js +74 -0
- package/lib/module/ui/context/hooks/useStorage.js.map +1 -0
- package/lib/module/ui/context/utils/errorHandlers.js +83 -0
- package/lib/module/ui/context/utils/errorHandlers.js.map +1 -0
- package/lib/module/ui/context/utils/sessionHelpers.js +96 -0
- package/lib/module/ui/context/utils/sessionHelpers.js.map +1 -0
- package/lib/module/ui/context/utils/storageHelpers.js +111 -0
- package/lib/module/ui/context/utils/storageHelpers.js.map +1 -0
- package/lib/module/ui/hooks/index.js +2 -0
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/use-color-scheme.js +26 -0
- package/lib/module/ui/hooks/use-color-scheme.js.map +1 -0
- package/lib/module/ui/hooks/use-haptic-press.js +17 -0
- package/lib/module/ui/hooks/use-haptic-press.js.map +1 -0
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceManagement.js +68 -0
- package/lib/module/ui/hooks/useDeviceManagement.js.map +1 -0
- package/lib/module/ui/hooks/useLanguageManagement.js +107 -0
- package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -0
- package/lib/module/ui/hooks/useProfileEditing.js +118 -0
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -0
- package/lib/module/ui/hooks/useSessionManagement.js +256 -0
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -0
- package/lib/module/ui/hooks/useStorage.js +74 -0
- package/lib/module/ui/hooks/useStorage.js.map +1 -0
- package/lib/module/ui/hooks/useThemeColors.js +27 -0
- package/lib/module/ui/hooks/useThemeColors.js.map +1 -0
- package/lib/module/ui/hooks/useThemeStyles.js +64 -0
- package/lib/module/ui/hooks/useThemeStyles.js.map +1 -0
- package/lib/module/ui/index.js +2 -4
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +168 -0
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +77 -152
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +67 -67
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +218 -100
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +515 -430
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +45 -60
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +12 -19
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +36 -43
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +14 -14
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +670 -1965
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +26 -23
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +22 -62
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +80 -171
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +16 -43
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +432 -0
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js +18 -24
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +21 -9
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +167 -239
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +7 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +35 -73
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +29 -102
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +24 -16
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +8 -10
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +65 -68
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +11 -8
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +124 -121
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +101 -114
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +12 -9
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +554 -81
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +12 -8
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +5 -11
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +12 -2
- package/lib/module/ui/styles/spacing.js.map +1 -1
- package/lib/module/ui/styles/theme.js +1 -1
- package/lib/module/ui/types/fileManagement.js +4 -0
- package/lib/module/ui/types/fileManagement.js.map +1 -0
- package/lib/module/ui/types/navigation.js +4 -0
- package/lib/module/ui/types/navigation.js.map +1 -0
- package/lib/module/ui/utils/colorUtils.js +46 -0
- package/lib/module/ui/utils/colorUtils.js.map +1 -0
- package/lib/module/ui/utils/errorHandlers.js +83 -0
- package/lib/module/ui/utils/errorHandlers.js.map +1 -0
- package/lib/module/ui/utils/fileManagement.js +172 -0
- package/lib/module/ui/utils/fileManagement.js.map +1 -0
- package/lib/module/ui/utils/sessionHelpers.js +96 -0
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -0
- package/lib/module/ui/utils/storageHelpers.js +111 -0
- package/lib/module/ui/utils/storageHelpers.js.map +1 -0
- package/lib/module/ui/utils/themeUtils.js +41 -0
- package/lib/module/ui/utils/themeUtils.js.map +1 -0
- package/lib/module/ui/utils/user-utils.js +46 -0
- package/lib/module/ui/utils/user-utils.js.map +1 -0
- package/lib/module/utils/errorUtils.js +14 -4
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/typescript/core/HttpService.d.ts +48 -0
- package/lib/typescript/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.assets.d.ts +23 -1
- package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts +70 -42
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.totp.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +26 -34
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/crypto/index.d.ts +11 -0
- package/lib/typescript/crypto/index.d.ts.map +1 -0
- package/lib/typescript/crypto/keyManager.d.ts +73 -0
- package/lib/typescript/crypto/keyManager.d.ts.map +1 -0
- package/lib/typescript/crypto/recoveryPhrase.d.ts +57 -0
- package/lib/typescript/crypto/recoveryPhrase.d.ts.map +1 -0
- package/lib/typescript/crypto/signatureService.d.ts +80 -0
- package/lib/typescript/crypto/signatureService.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +1 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/types/bip39.d.ts +28 -0
- package/lib/typescript/types/color.d.ts +18 -0
- package/lib/typescript/types/elliptic.d.ts +60 -0
- package/lib/typescript/types/expo-crypto.d.ts +28 -0
- package/lib/typescript/types/expo-random.d.ts +8 -0
- package/lib/typescript/types/expo-secure-store.d.ts +20 -0
- package/lib/typescript/types/expo-vector-icons.d.ts +9 -0
- package/lib/typescript/ui/components/ActivityIndicator.d.ts +45 -0
- package/lib/typescript/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/lib/typescript/ui/components/AutoHeightScrollView.d.ts +23 -0
- package/lib/typescript/ui/components/AutoHeightScrollView.d.ts.map +1 -0
- package/lib/typescript/ui/components/BottomSheet.d.ts +29 -0
- package/lib/typescript/ui/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts +14 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts.map +1 -0
- package/lib/typescript/ui/components/CrossFadeIcon.d.ts +27 -0
- package/lib/typescript/ui/components/CrossFadeIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/EmptyState.d.ts +8 -0
- package/lib/typescript/ui/components/EmptyState.d.ts.map +1 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts +5 -9
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +6 -7
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +6 -1
- package/lib/typescript/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/ui/components/HelperText.d.ts +47 -0
- package/lib/typescript/ui/components/HelperText.d.ts.map +1 -0
- package/lib/typescript/ui/components/Icon.d.ts +60 -0
- package/lib/typescript/ui/components/Icon.d.ts.map +1 -0
- package/lib/typescript/ui/components/IconButton/IconButton.d.ts +99 -0
- package/lib/typescript/ui/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/IconButton/utils.d.ts +19 -0
- package/lib/typescript/ui/components/IconButton/utils.d.ts.map +1 -0
- package/lib/typescript/ui/components/LoadingState.d.ts +9 -0
- package/lib/typescript/ui/components/LoadingState.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +4 -5
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts +3 -8
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/ui/components/QuickActions.d.ts.map +1 -1
- package/lib/typescript/ui/components/Section.d.ts +1 -1
- package/lib/typescript/ui/components/Section.d.ts.map +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
- package/lib/typescript/ui/components/SettingRow.d.ts +14 -0
- package/lib/typescript/ui/components/SettingRow.d.ts.map +1 -0
- package/lib/typescript/ui/components/StepBasedScreen.d.ts +3 -2
- package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/ui/components/Surface.d.ts +76 -0
- package/lib/typescript/ui/components/Surface.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts +16 -0
- package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Addons/Underline.d.ts +19 -0
- package/lib/typescript/ui/components/TextField/Addons/Underline.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +45 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAdornment.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAffix.d.ts +73 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAffix.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldIcon.d.ts +78 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/enums.d.ts +13 -0
- package/lib/typescript/ui/components/TextField/Adornment/enums.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/types.d.ts +12 -0
- package/lib/typescript/ui/components/TextField/Adornment/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts +12 -0
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Label/InputLabel.d.ts +5 -0
- package/lib/typescript/ui/components/TextField/Label/InputLabel.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Label/LabelBackground.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/Label/LabelBackground.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/TextFieldFlat.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/TextFieldFlat.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/TextFieldOutlined.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/TextFieldOutlined.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/constants.d.ts +32 -0
- package/lib/typescript/ui/components/TextField/constants.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/helpers.d.ts +97 -0
- package/lib/typescript/ui/components/TextField/helpers.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/types.d.ts +156 -0
- package/lib/typescript/ui/components/TextField/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField.d.ts +192 -0
- package/lib/typescript/ui/components/TextField.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/Pressable.d.ts +13 -0
- package/lib/typescript/ui/components/TouchableRipple/Pressable.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.d.ts +62 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.native.d.ts +25 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/utils.d.ts +11 -0
- package/lib/typescript/ui/components/TouchableRipple/utils.d.ts.map +1 -0
- package/lib/typescript/ui/components/Typography/AnimatedText.d.ts +35 -0
- package/lib/typescript/ui/components/Typography/AnimatedText.d.ts.map +1 -0
- package/lib/typescript/ui/components/Typography/types.d.ts +19 -0
- package/lib/typescript/ui/components/Typography/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/FileDetailsModal.d.ts +15 -0
- package/lib/typescript/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/FileViewer.d.ts +18 -0
- package/lib/typescript/ui/components/fileManagement/FileViewer.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/UploadPreview.d.ts +21 -0
- package/lib/typescript/ui/components/fileManagement/UploadPreview.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/styles.d.ts +860 -0
- package/lib/typescript/ui/components/fileManagement/styles.d.ts.map +1 -0
- package/lib/typescript/ui/components/index.d.ts +4 -1
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/profile/EditBioModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/EditBioModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditDisplayNameModal.d.ts +12 -0
- package/lib/typescript/ui/components/profile/EditDisplayNameModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditEmailModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/EditEmailModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditLinksModal.d.ts +18 -0
- package/lib/typescript/ui/components/profile/EditLinksModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditLocationModal.d.ts +20 -0
- package/lib/typescript/ui/components/profile/EditLocationModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditUsernameModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/EditUsernameModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/TwoFactorSetupModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/TwoFactorSetupModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/styles/overlay.d.ts +4 -0
- package/lib/typescript/ui/components/styles/overlay.d.ts.map +1 -0
- package/lib/typescript/ui/components/styles/shadow.d.ts +3 -0
- package/lib/typescript/ui/components/styles/shadow.d.ts.map +1 -0
- package/lib/typescript/ui/components/theming.d.ts +8 -0
- package/lib/typescript/ui/components/theming.d.ts.map +1 -0
- package/lib/typescript/ui/components/types.d.ts +80 -0
- package/lib/typescript/ui/components/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/forwardRef.d.ts +12 -0
- package/lib/typescript/ui/components/utils/forwardRef.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/hasTouchHandler.d.ts +6 -0
- package/lib/typescript/ui/components/utils/hasTouchHandler.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/roundLayoutSize.d.ts +2 -0
- package/lib/typescript/ui/components/utils/roundLayoutSize.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/splitStyles.d.ts +20 -0
- package/lib/typescript/ui/components/utils/splitStyles.d.ts.map +1 -0
- package/lib/typescript/ui/constants/iconColors.d.ts +130 -0
- package/lib/typescript/ui/constants/iconColors.d.ts.map +1 -0
- package/lib/typescript/ui/constants/spacing.d.ts +33 -0
- package/lib/typescript/ui/constants/spacing.d.ts.map +1 -0
- package/lib/typescript/ui/constants/theme.d.ts +97 -0
- package/lib/typescript/ui/constants/theme.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +23 -17
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/ThemeContext.d.ts +19 -0
- package/lib/typescript/ui/context/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +51 -0
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts +27 -0
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +25 -0
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts +39 -0
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useStorage.d.ts +22 -0
- package/lib/typescript/ui/context/hooks/useStorage.d.ts.map +1 -0
- package/lib/typescript/ui/context/utils/errorHandlers.d.ts +30 -0
- package/lib/typescript/ui/context/utils/errorHandlers.d.ts.map +1 -0
- package/lib/typescript/ui/context/utils/sessionHelpers.d.ts +59 -0
- package/lib/typescript/ui/context/utils/sessionHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/context/utils/storageHelpers.d.ts +31 -0
- package/lib/typescript/ui/context/utils/storageHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/index.d.ts +2 -0
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/use-color-scheme.d.ts +8 -0
- package/lib/typescript/ui/hooks/use-color-scheme.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/use-haptic-press.d.ts +8 -0
- package/lib/typescript/ui/hooks/use-haptic-press.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts +27 -0
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +25 -0
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useProfileEditing.d.ts +36 -0
- package/lib/typescript/ui/hooks/useProfileEditing.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts +39 -0
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useStorage.d.ts +22 -0
- package/lib/typescript/ui/hooks/useStorage.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useThemeColors.d.ts +94 -0
- package/lib/typescript/ui/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useThemeStyles.d.ts +45 -0
- package/lib/typescript/ui/hooks/useThemeStyles.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +2 -2
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/bottomSheetManager.d.ts +74 -0
- package/lib/typescript/ui/navigation/bottomSheetManager.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/routes.d.ts +4 -7
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +1 -36
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts +16 -0
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +1 -2
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +0 -10
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/ui/styles/spacing.d.ts +7 -1
- package/lib/typescript/ui/styles/spacing.d.ts.map +1 -1
- package/lib/typescript/ui/types/fileManagement.d.ts +41 -0
- package/lib/typescript/ui/types/fileManagement.d.ts.map +1 -0
- package/lib/typescript/ui/types/navigation.d.ts +36 -0
- package/lib/typescript/ui/types/navigation.d.ts.map +1 -0
- package/lib/typescript/ui/utils/colorUtils.d.ts +14 -0
- package/lib/typescript/ui/utils/colorUtils.d.ts.map +1 -0
- package/lib/typescript/ui/utils/errorHandlers.d.ts +30 -0
- package/lib/typescript/ui/utils/errorHandlers.d.ts.map +1 -0
- package/lib/typescript/ui/utils/fileManagement.d.ts +39 -0
- package/lib/typescript/ui/utils/fileManagement.d.ts.map +1 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts +59 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/utils/storageHelpers.d.ts +31 -0
- package/lib/typescript/ui/utils/storageHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/utils/themeUtils.d.ts +24 -0
- package/lib/typescript/ui/utils/themeUtils.d.ts.map +1 -0
- package/lib/typescript/ui/utils/user-utils.d.ts +29 -0
- package/lib/typescript/ui/utils/user-utils.d.ts.map +1 -0
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -1
- package/package.json +26 -15
- package/src/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/src/core/HttpService.ts +97 -4
- package/src/core/OxyServices.base.ts +3 -1
- package/src/core/mixins/OxyServices.assets.ts +225 -27
- package/src/core/mixins/OxyServices.auth.ts +144 -80
- package/src/crypto/index.ts +20 -0
- package/src/crypto/keyManager.ts +213 -0
- package/src/crypto/recoveryPhrase.ts +146 -0
- package/src/crypto/signatureService.ts +258 -0
- package/src/i18n/locales/en-US.json +4 -0
- package/src/index.ts +13 -0
- package/src/models/interfaces.ts +1 -0
- package/src/types/bip39.d.ts +28 -0
- package/src/types/color.d.ts +18 -0
- package/src/types/elliptic.d.ts +60 -0
- package/src/types/expo-crypto.d.ts +28 -0
- package/src/types/expo-random.d.ts +8 -0
- package/src/types/expo-secure-store.d.ts +20 -0
- package/src/types/expo-vector-icons.d.ts +9 -0
- package/src/ui/components/ActivityIndicator.tsx +254 -0
- package/src/ui/components/AutoHeightScrollView.tsx +50 -0
- package/src/ui/components/BottomSheet.tsx +443 -0
- package/src/ui/components/BottomSheetRouter.tsx +407 -0
- package/src/ui/components/CrossFadeIcon.tsx +140 -0
- package/src/ui/components/EmptyState.tsx +39 -0
- package/src/ui/components/GroupedItem.tsx +98 -96
- package/src/ui/components/GroupedSection.tsx +24 -29
- package/src/ui/components/Header.tsx +129 -49
- package/src/ui/components/HelperText.tsx +160 -0
- package/src/ui/components/Icon.tsx +181 -0
- package/src/ui/components/IconButton/IconButton.tsx +235 -0
- package/src/ui/components/IconButton/utils.ts +190 -0
- package/src/ui/components/LoadingState.tsx +46 -0
- package/src/ui/components/OxyPayButton.tsx +1 -12
- package/src/ui/components/OxyProvider.tsx +49 -381
- package/src/ui/components/OxySignInButton.tsx +11 -18
- package/src/ui/components/ProfileCard.tsx +7 -4
- package/src/ui/components/QuickActions.tsx +7 -4
- package/src/ui/components/Section.tsx +6 -2
- package/src/ui/components/SectionTitle.tsx +7 -4
- package/src/ui/components/SettingRow.tsx +76 -0
- package/src/ui/components/StepBasedScreen.tsx +205 -187
- package/src/ui/components/Surface.tsx +384 -0
- package/src/ui/components/TextField/Addons/Outline.tsx +64 -0
- package/src/ui/components/TextField/Addons/Underline.tsx +78 -0
- package/src/ui/components/TextField/Adornment/TextFieldAdornment.tsx +208 -0
- package/src/ui/components/TextField/Adornment/TextFieldAffix.tsx +212 -0
- package/src/ui/components/TextField/Adornment/TextFieldIcon.tsx +195 -0
- package/src/ui/components/TextField/Adornment/enums.tsx +12 -0
- package/src/ui/components/TextField/Adornment/types.tsx +11 -0
- package/src/ui/components/TextField/Adornment/utils.ts +66 -0
- package/src/ui/components/TextField/Label/InputLabel.tsx +219 -0
- package/src/ui/components/TextField/Label/LabelBackground.tsx +100 -0
- package/src/ui/components/TextField/TextFieldFlat.tsx +488 -0
- package/src/ui/components/TextField/TextFieldOutlined.tsx +464 -0
- package/src/ui/components/TextField/constants.tsx +48 -0
- package/src/ui/components/TextField/helpers.tsx +612 -0
- package/src/ui/components/TextField/types.tsx +156 -0
- package/src/ui/components/TextField.tsx +578 -0
- package/src/ui/components/TouchableRipple/Pressable.tsx +41 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.native.tsx +146 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.tsx +347 -0
- package/src/ui/components/TouchableRipple/utils.ts +66 -0
- package/src/ui/components/Typography/AnimatedText.tsx +107 -0
- package/src/ui/components/Typography/types.tsx +22 -0
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +137 -0
- package/src/ui/components/fileManagement/FileViewer.tsx +380 -0
- package/src/ui/components/fileManagement/UploadPreview.tsx +175 -0
- package/src/ui/components/fileManagement/styles.ts +860 -0
- package/src/ui/components/index.ts +4 -1
- package/src/ui/components/profile/EditBioModal.tsx +184 -0
- package/src/ui/components/profile/EditDisplayNameModal.tsx +205 -0
- package/src/ui/components/profile/EditEmailModal.tsx +188 -0
- package/src/ui/components/profile/EditLinksModal.tsx +316 -0
- package/src/ui/components/profile/EditLocationModal.tsx +278 -0
- package/src/ui/components/profile/EditUsernameModal.tsx +183 -0
- package/src/ui/components/profile/TwoFactorSetupModal.tsx +442 -0
- package/src/ui/components/styles/overlay.tsx +88 -0
- package/src/ui/components/styles/shadow.tsx +136 -0
- package/src/ui/components/theming.tsx +114 -0
- package/src/ui/components/types.tsx +90 -0
- package/src/ui/components/utils/forwardRef.tsx +23 -0
- package/src/ui/components/utils/hasTouchHandler.tsx +23 -0
- package/src/ui/components/utils/roundLayoutSize.ts +2 -0
- package/src/ui/components/utils/splitStyles.ts +60 -0
- package/src/ui/constants/iconColors.ts +88 -0
- package/src/ui/constants/spacing.ts +45 -0
- package/src/ui/constants/theme.ts +120 -0
- package/src/ui/context/OxyContext.tsx +276 -894
- package/src/ui/context/ThemeContext.tsx +41 -0
- package/src/ui/context/hooks/useAuthOperations.ts +400 -0
- package/src/ui/context/hooks/useDeviceManagement.ts +108 -0
- package/src/ui/context/hooks/useLanguageManagement.ts +152 -0
- package/src/ui/context/hooks/useSessionManagement.ts +378 -0
- package/src/ui/context/hooks/useStorage.ts +104 -0
- package/src/ui/context/utils/errorHandlers.ts +136 -0
- package/src/ui/context/utils/sessionHelpers.ts +146 -0
- package/src/ui/context/utils/storageHelpers.ts +134 -0
- package/src/ui/hooks/index.ts +3 -1
- package/src/ui/hooks/use-color-scheme.ts +24 -0
- package/src/ui/hooks/use-haptic-press.ts +15 -0
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useDeviceManagement.ts +108 -0
- package/src/ui/hooks/useLanguageManagement.ts +152 -0
- package/src/ui/hooks/useProfileEditing.ts +151 -0
- package/src/ui/hooks/useSessionManagement.ts +378 -0
- package/src/ui/hooks/useStorage.ts +104 -0
- package/src/ui/hooks/useThemeColors.ts +26 -0
- package/src/ui/hooks/useThemeStyles.ts +85 -0
- package/src/ui/index.ts +1 -4
- package/src/ui/navigation/bottomSheetManager.ts +191 -0
- package/src/ui/navigation/routes.ts +107 -189
- package/src/ui/screens/AccountCenterScreen.tsx +67 -63
- package/src/ui/screens/AccountOverviewScreen.tsx +237 -95
- package/src/ui/screens/AccountSettingsScreen.tsx +546 -474
- package/src/ui/screens/AccountSwitcherScreen.tsx +113 -116
- package/src/ui/screens/AccountVerificationScreen.tsx +18 -20
- package/src/ui/screens/AppInfoScreen.tsx +37 -38
- package/src/ui/screens/FeedbackScreen.tsx +15 -12
- package/src/ui/screens/FileManagementScreen.tsx +764 -2026
- package/src/ui/screens/HelpSupportScreen.tsx +30 -23
- package/src/ui/screens/HistoryViewScreen.tsx +25 -56
- package/src/ui/screens/LanguageSelectorScreen.tsx +84 -170
- package/src/ui/screens/LegalDocumentsScreen.tsx +18 -41
- package/src/ui/screens/OxyAuthScreen.tsx +402 -0
- package/src/ui/screens/PaymentGatewayScreen.tsx +20 -22
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +13 -10
- package/src/ui/screens/PrivacySettingsScreen.tsx +150 -198
- package/src/ui/screens/ProfileScreen.tsx +7 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +39 -62
- package/src/ui/screens/SearchSettingsScreen.tsx +36 -86
- package/src/ui/screens/SessionManagementScreen.tsx +25 -17
- package/src/ui/screens/UserLinksScreen.tsx +10 -11
- package/src/ui/screens/WelcomeNewUserScreen.tsx +41 -41
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +13 -9
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +70 -70
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +96 -96
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +15 -10
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +605 -60
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +14 -9
- package/src/ui/stores/authStore.ts +1 -1
- package/src/ui/styles/authStyles.ts +5 -11
- package/src/ui/styles/spacing.ts +21 -2
- package/src/ui/styles/theme.ts +1 -1
- package/src/ui/types/fileManagement.ts +51 -0
- package/src/ui/types/navigation.ts +61 -0
- package/src/ui/utils/colorUtils.ts +46 -0
- package/src/ui/utils/errorHandlers.ts +136 -0
- package/src/ui/utils/fileManagement.ts +190 -0
- package/src/ui/utils/sessionHelpers.ts +146 -0
- package/src/ui/utils/storageHelpers.ts +134 -0
- package/src/ui/utils/themeUtils.ts +43 -0
- package/src/ui/utils/user-utils.ts +58 -0
- package/src/utils/errorUtils.ts +14 -4
- package/lib/commonjs/ui/components/internal/TextField.js +0 -733
- package/lib/commonjs/ui/components/internal/TextField.js.map +0 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +0 -213
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +0 -1
- package/lib/commonjs/ui/navigation/types.js +0 -13
- package/lib/commonjs/ui/navigation/types.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +0 -298
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +0 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +0 -137
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +0 -270
- package/lib/commonjs/ui/screens/SignInScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +0 -229
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +0 -135
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +0 -165
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +0 -159
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +0 -144
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +0 -358
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +0 -188
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +0 -509
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +0 -200
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +0 -185
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +0 -138
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +0 -150
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/ui/components/internal/TextField.js +0 -729
- package/lib/module/ui/components/internal/TextField.js.map +0 -1
- package/lib/module/ui/navigation/OxyRouter.js +0 -209
- package/lib/module/ui/navigation/OxyRouter.js.map +0 -1
- package/lib/module/ui/navigation/types.js +0 -22
- package/lib/module/ui/navigation/types.js.map +0 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +0 -295
- package/lib/module/ui/screens/AccountManagementDemo.js.map +0 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +0 -133
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +0 -1
- package/lib/module/ui/screens/SignInScreen.js +0 -265
- package/lib/module/ui/screens/SignInScreen.js.map +0 -1
- package/lib/module/ui/screens/SignUpScreen.js +0 -224
- package/lib/module/ui/screens/SignUpScreen.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +0 -130
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +0 -160
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +0 -154
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +0 -139
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +0 -353
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignInTotpStep.js +0 -183
- package/lib/module/ui/screens/steps/SignInTotpStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +0 -504
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +0 -195
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +0 -180
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +0 -133
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +0 -145
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +0 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +0 -41
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +0 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts +0 -7
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +0 -1
- package/lib/typescript/ui/navigation/types.d.ts +0 -141
- package/lib/typescript/ui/navigation/types.d.ts.map +0 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +0 -8
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +0 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +0 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +0 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts +0 -24
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts +0 -24
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts +0 -19
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts +0 -26
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +0 -30
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts +0 -19
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts +0 -28
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts +0 -26
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts +0 -27
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts +0 -17
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts +0 -14
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +0 -1
- package/src/ui/components/internal/TextField.tsx +0 -876
- package/src/ui/navigation/OxyRouter.tsx +0 -216
- package/src/ui/navigation/types.ts +0 -164
- package/src/ui/screens/AccountManagementDemo.tsx +0 -297
- package/src/ui/screens/RecoverAccountScreen.tsx +0 -141
- package/src/ui/screens/SignInScreen.tsx +0 -297
- package/src/ui/screens/SignUpScreen.tsx +0 -239
- package/src/ui/screens/steps/RecoverRequestStep.tsx +0 -143
- package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +0 -162
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +0 -148
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +0 -154
- package/src/ui/screens/steps/SignInPasswordStep.tsx +0 -343
- package/src/ui/screens/steps/SignInTotpStep.tsx +0 -163
- package/src/ui/screens/steps/SignInUsernameStep.tsx +0 -560
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +0 -217
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +0 -207
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +0 -155
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +0 -127
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OxyAuthenticationError","OxyServicesAuthMixin","Base","constructor","args","
|
|
1
|
+
{"version":3,"names":["OxyAuthenticationError","OxyServicesAuthMixin","Base","constructor","args","register","publicKey","username","signature","timestamp","email","res","makeRequest","cache","Object","keys","length","error","handleError","requestChallenge","verifyChallenge","challenge","deviceName","deviceFingerprint","checkPublicKeyRegistered","encodeURIComponent","undefined","getUserByPublicKey","cacheTTL","getUserBySession","sessionId","getUsersBySessions","sessionIds","Array","isArray","uniqueSessionIds","from","Set","sort","deduplicate","getTokenBySession","retry","setTokens","accessToken","getSessionsBySessionId","logoutSession","targetSessionId","url","logoutAllSessions","validateSession","options","urlParams","useHeaderValidation","checkUsernameAvailability","checkEmailAvailability","signUp","password","signIn"],"sourceRoot":"../../../../src","sources":["core/mixins/OxyServices.auth.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,sBAAsB,QAAQ,uBAAuB;AA6B9D,OAAO,SAASC,oBAAoBA,CAAmCC,IAAO,EAAE;EAC9E,OAAO,cAAcA,IAAI,CAAC;IACxBC,WAAWA,CAAC,GAAGC,IAAW,EAAE;MAC1B,KAAK,CAAC,GAAIA,IAAc,CAAC;IAC3B;;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI,MAAMC,QAAQA,CACZC,SAAiB,EACjBC,QAAgB,EAChBC,SAAiB,EACjBC,SAAiB,EACjBC,KAAc,EAC4B;MAC1C,IAAI;QACF,MAAMC,GAAG,GAAG,MAAM,IAAI,CAACC,WAAW,CAAkC,MAAM,EAAE,oBAAoB,EAAE;UAChGN,SAAS;UACTC,QAAQ;UACRG,KAAK;UACLF,SAAS;UACTC;QACF,CAAC,EAAE;UAAEI,KAAK,EAAE;QAAM,CAAC,CAAC;QAEpB,IAAI,CAACF,GAAG,IAAK,OAAOA,GAAG,KAAK,QAAQ,IAAIG,MAAM,CAACC,IAAI,CAACJ,GAAG,CAAC,CAACK,MAAM,KAAK,CAAE,EAAE;UACtE,MAAM,IAAIhB,sBAAsB,CAAC,qBAAqB,EAAE,iBAAiB,EAAE,GAAG,CAAC;QACjF;QAEA,OAAOW,GAAG;MACZ,CAAC,CAAC,OAAOM,KAAK,EAAE;QACd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AAK,EAAE,EAAEgB,SAAS,EAAE;UAAEb,KAAK,EAAE;QAAM,CAAC,CAAC;MACrG,CAAC,CAAC,OAAOI,KAAK,EAAE;QACd,MAAM,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC;MAC/B;IACF;;IAEA;IACA;IACA;;IAEA;AACJ;AACA;IACI,MAAMsC,MAAMA,CAAChD,QAAgB,EAAEG,KAAa,EAAE8C,QAAgB,EAA2D;MACvH,MAAM,IAAIxD,sBAAsB,CAC9B,+EAA+E,EAC/E,YAAY,EACZ,GACF,CAAC;IACH;;IAEA;AACJ;AACA;IACI,MAAMyD,MAAMA,CACVlD,QAAgB,EAChBiD,QAAgB,EAChBlC,UAAmB,EACnBC,iBAAuB,EACqE;MAC5F,MAAM,IAAIvB,sBAAsB,CAC9B,qFAAqF,EACrF,YAAY,EACZ,GACF,CAAC;IACH;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Oxy Crypto Module
|
|
5
|
+
*
|
|
6
|
+
* Provides cryptographic identity management for the Oxy ecosystem.
|
|
7
|
+
* Handles key generation, secure storage, digital signatures, and recovery phrases.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export { KeyManager } from './keyManager';
|
|
11
|
+
export { SignatureService } from './signatureService';
|
|
12
|
+
export { RecoveryPhraseService } from './recoveryPhrase';
|
|
13
|
+
|
|
14
|
+
// Re-export for convenience
|
|
15
|
+
export { KeyManager as default } from './keyManager';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["KeyManager","SignatureService","RecoveryPhraseService","default"],"sourceRoot":"../../../src","sources":["crypto/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAsB,cAAc;AACvD,SACEC,gBAAgB,QAGX,oBAAoB;AAC3B,SACEC,qBAAqB,QAEhB,kBAAkB;;AAEzB;AACA,SAASF,UAAU,IAAIG,OAAO,QAAQ,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Key Manager - ECDSA secp256k1 Key Generation and Storage
|
|
5
|
+
*
|
|
6
|
+
* Handles secure generation, storage, and retrieval of cryptographic keys.
|
|
7
|
+
* Private keys are stored securely using expo-secure-store and never leave the device.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { ec as EC } from 'elliptic';
|
|
11
|
+
// Lazy imports for React Native specific modules
|
|
12
|
+
let SecureStore = null;
|
|
13
|
+
let ExpoRandom = null;
|
|
14
|
+
const ec = new EC('secp256k1');
|
|
15
|
+
const STORAGE_KEYS = {
|
|
16
|
+
PRIVATE_KEY: 'oxy_identity_private_key',
|
|
17
|
+
PUBLIC_KEY: 'oxy_identity_public_key'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Initialize React Native specific modules
|
|
22
|
+
* This allows the module to work in both Node.js and React Native environments
|
|
23
|
+
*/
|
|
24
|
+
async function initSecureStore() {
|
|
25
|
+
if (!SecureStore) {
|
|
26
|
+
SecureStore = await import('expo-secure-store');
|
|
27
|
+
}
|
|
28
|
+
return SecureStore;
|
|
29
|
+
}
|
|
30
|
+
async function initExpoRandom() {
|
|
31
|
+
if (!ExpoRandom) {
|
|
32
|
+
ExpoRandom = await import('expo-random');
|
|
33
|
+
}
|
|
34
|
+
return ExpoRandom;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Generate cryptographically secure random bytes
|
|
39
|
+
*/
|
|
40
|
+
async function getSecureRandomBytes(length) {
|
|
41
|
+
try {
|
|
42
|
+
const Random = await initExpoRandom();
|
|
43
|
+
return Random.getRandomBytes(length);
|
|
44
|
+
} catch {
|
|
45
|
+
// Fallback for Node.js environment
|
|
46
|
+
const crypto = await import('crypto');
|
|
47
|
+
return new Uint8Array(crypto.randomBytes(length));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export class KeyManager {
|
|
51
|
+
/**
|
|
52
|
+
* Generate a new ECDSA secp256k1 key pair
|
|
53
|
+
* Returns the keys in hexadecimal format
|
|
54
|
+
*/
|
|
55
|
+
static generateKeyPairSync() {
|
|
56
|
+
const keyPair = ec.genKeyPair();
|
|
57
|
+
return {
|
|
58
|
+
privateKey: keyPair.getPrivate('hex'),
|
|
59
|
+
publicKey: keyPair.getPublic('hex')
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Generate a new key pair using secure random bytes
|
|
65
|
+
*/
|
|
66
|
+
static async generateKeyPair() {
|
|
67
|
+
const randomBytes = await getSecureRandomBytes(32);
|
|
68
|
+
const privateKeyHex = Buffer.from(randomBytes).toString('hex');
|
|
69
|
+
const keyPair = ec.keyFromPrivate(privateKeyHex);
|
|
70
|
+
return {
|
|
71
|
+
privateKey: keyPair.getPrivate('hex'),
|
|
72
|
+
publicKey: keyPair.getPublic('hex')
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Generate and securely store a new key pair on the device
|
|
78
|
+
* Returns only the public key (private key is stored securely)
|
|
79
|
+
*/
|
|
80
|
+
static async createIdentity() {
|
|
81
|
+
const store = await initSecureStore();
|
|
82
|
+
const {
|
|
83
|
+
privateKey,
|
|
84
|
+
publicKey
|
|
85
|
+
} = await KeyManager.generateKeyPair();
|
|
86
|
+
|
|
87
|
+
// Store private key securely
|
|
88
|
+
await store.setItemAsync(STORAGE_KEYS.PRIVATE_KEY, privateKey, {
|
|
89
|
+
keychainAccessible: store.WHEN_UNLOCKED_THIS_DEVICE_ONLY
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Store public key (for quick access without deriving)
|
|
93
|
+
await store.setItemAsync(STORAGE_KEYS.PUBLIC_KEY, publicKey);
|
|
94
|
+
return publicKey;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Import an existing key pair (e.g., from recovery phrase)
|
|
99
|
+
*/
|
|
100
|
+
static async importKeyPair(privateKey) {
|
|
101
|
+
const store = await initSecureStore();
|
|
102
|
+
|
|
103
|
+
// Derive public key from private key
|
|
104
|
+
const keyPair = ec.keyFromPrivate(privateKey);
|
|
105
|
+
const publicKey = keyPair.getPublic('hex');
|
|
106
|
+
|
|
107
|
+
// Store both keys
|
|
108
|
+
await store.setItemAsync(STORAGE_KEYS.PRIVATE_KEY, privateKey, {
|
|
109
|
+
keychainAccessible: store.WHEN_UNLOCKED_THIS_DEVICE_ONLY
|
|
110
|
+
});
|
|
111
|
+
await store.setItemAsync(STORAGE_KEYS.PUBLIC_KEY, publicKey);
|
|
112
|
+
return publicKey;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Get the stored private key
|
|
117
|
+
* WARNING: Only use this for signing operations within the app
|
|
118
|
+
*/
|
|
119
|
+
static async getPrivateKey() {
|
|
120
|
+
const store = await initSecureStore();
|
|
121
|
+
return store.getItemAsync(STORAGE_KEYS.PRIVATE_KEY);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get the stored public key
|
|
126
|
+
*/
|
|
127
|
+
static async getPublicKey() {
|
|
128
|
+
const store = await initSecureStore();
|
|
129
|
+
return store.getItemAsync(STORAGE_KEYS.PUBLIC_KEY);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Check if an identity (key pair) exists on this device
|
|
134
|
+
*/
|
|
135
|
+
static async hasIdentity() {
|
|
136
|
+
const privateKey = await KeyManager.getPrivateKey();
|
|
137
|
+
return privateKey !== null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Delete the stored identity (both keys)
|
|
142
|
+
* Use with caution - this is irreversible without a recovery phrase
|
|
143
|
+
*/
|
|
144
|
+
static async deleteIdentity() {
|
|
145
|
+
const store = await initSecureStore();
|
|
146
|
+
await store.deleteItemAsync(STORAGE_KEYS.PRIVATE_KEY);
|
|
147
|
+
await store.deleteItemAsync(STORAGE_KEYS.PUBLIC_KEY);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Get the elliptic curve key object from the stored private key
|
|
152
|
+
* Used internally for signing operations
|
|
153
|
+
*/
|
|
154
|
+
static async getKeyPairObject() {
|
|
155
|
+
const privateKey = await KeyManager.getPrivateKey();
|
|
156
|
+
if (!privateKey) return null;
|
|
157
|
+
return ec.keyFromPrivate(privateKey);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Derive public key from a private key (without storing)
|
|
162
|
+
*/
|
|
163
|
+
static derivePublicKey(privateKey) {
|
|
164
|
+
const keyPair = ec.keyFromPrivate(privateKey);
|
|
165
|
+
return keyPair.getPublic('hex');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Validate that a string is a valid public key
|
|
170
|
+
*/
|
|
171
|
+
static isValidPublicKey(publicKey) {
|
|
172
|
+
try {
|
|
173
|
+
ec.keyFromPublic(publicKey, 'hex');
|
|
174
|
+
return true;
|
|
175
|
+
} catch {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Validate that a string is a valid private key
|
|
182
|
+
*/
|
|
183
|
+
static isValidPrivateKey(privateKey) {
|
|
184
|
+
try {
|
|
185
|
+
const keyPair = ec.keyFromPrivate(privateKey);
|
|
186
|
+
// Verify it can derive a public key
|
|
187
|
+
keyPair.getPublic('hex');
|
|
188
|
+
return true;
|
|
189
|
+
} catch {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Get a shortened version of the public key for display
|
|
196
|
+
* Format: first 8 chars...last 8 chars
|
|
197
|
+
*/
|
|
198
|
+
static shortenPublicKey(publicKey) {
|
|
199
|
+
if (publicKey.length <= 20) return publicKey;
|
|
200
|
+
return `${publicKey.slice(0, 8)}...${publicKey.slice(-8)}`;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export default KeyManager;
|
|
204
|
+
//# sourceMappingURL=keyManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ec","EC","SecureStore","ExpoRandom","STORAGE_KEYS","PRIVATE_KEY","PUBLIC_KEY","initSecureStore","initExpoRandom","getSecureRandomBytes","length","Random","getRandomBytes","crypto","Uint8Array","randomBytes","KeyManager","generateKeyPairSync","keyPair","genKeyPair","privateKey","getPrivate","publicKey","getPublic","generateKeyPair","privateKeyHex","Buffer","from","toString","keyFromPrivate","createIdentity","store","setItemAsync","keychainAccessible","WHEN_UNLOCKED_THIS_DEVICE_ONLY","importKeyPair","getPrivateKey","getItemAsync","getPublicKey","hasIdentity","deleteIdentity","deleteItemAsync","getKeyPairObject","derivePublicKey","isValidPublicKey","keyFromPublic","isValidPrivateKey","shortenPublicKey","slice"],"sourceRoot":"../../../src","sources":["crypto/keyManager.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,EAAE,IAAIC,EAAE,QAAQ,UAAU;AAGnC;AACA,IAAIC,WAAsD,GAAG,IAAI;AACjE,IAAIC,UAA+C,GAAG,IAAI;AAE1D,MAAMH,EAAE,GAAG,IAAIC,EAAE,CAAC,WAAW,CAAC;AAE9B,MAAMG,YAAY,GAAG;EACnBC,WAAW,EAAE,0BAA0B;EACvCC,UAAU,EAAE;AACd,CAAU;;AAEV;AACA;AACA;AACA;AACA,eAAeC,eAAeA,CAAA,EAAgD;EAC5E,IAAI,CAACL,WAAW,EAAE;IAChBA,WAAW,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC;EACjD;EACA,OAAOA,WAAW;AACpB;AA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,KAAK;IACd;EACF;;EAEA;AACF;AACA;AACA;EACE,OAAOwB,gBAAgBA,CAACzB,SAAiB,EAAU;IACjD,IAAIA,SAAS,CAACZ,MAAM,IAAI,EAAE,EAAE,OAAOY,SAAS;IAC5C,OAAO,GAAGA,SAAS,CAAC0B,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM1B,SAAS,CAAC0B,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;EAC5D;AACF;AAEA,eAAehC,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Recovery Phrase Service - BIP39 Mnemonic Generation
|
|
5
|
+
*
|
|
6
|
+
* Handles generation and restoration of recovery phrases (mnemonic seeds)
|
|
7
|
+
* for backing up and restoring user identities.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as bip39 from 'bip39';
|
|
11
|
+
import { KeyManager } from './keyManager';
|
|
12
|
+
export class RecoveryPhraseService {
|
|
13
|
+
/**
|
|
14
|
+
* Generate a new identity with a recovery phrase
|
|
15
|
+
* Returns the mnemonic phrase (should only be shown once to the user)
|
|
16
|
+
*/
|
|
17
|
+
static async generateIdentityWithRecovery() {
|
|
18
|
+
// Generate 128-bit entropy for 12-word mnemonic
|
|
19
|
+
const mnemonic = bip39.generateMnemonic(128);
|
|
20
|
+
|
|
21
|
+
// Derive private key from mnemonic
|
|
22
|
+
// Using the seed directly as the private key (simplified approach)
|
|
23
|
+
const seed = await bip39.mnemonicToSeed(mnemonic);
|
|
24
|
+
|
|
25
|
+
// Use first 32 bytes of seed as private key
|
|
26
|
+
const privateKeyHex = seed.subarray(0, 32).toString('hex');
|
|
27
|
+
|
|
28
|
+
// Import the derived key pair
|
|
29
|
+
const publicKey = await KeyManager.importKeyPair(privateKeyHex);
|
|
30
|
+
return {
|
|
31
|
+
phrase: mnemonic,
|
|
32
|
+
words: mnemonic.split(' '),
|
|
33
|
+
publicKey
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Generate a 24-word recovery phrase for higher security
|
|
39
|
+
*/
|
|
40
|
+
static async generateIdentityWithRecovery24() {
|
|
41
|
+
// Generate 256-bit entropy for 24-word mnemonic
|
|
42
|
+
const mnemonic = bip39.generateMnemonic(256);
|
|
43
|
+
const seed = await bip39.mnemonicToSeed(mnemonic);
|
|
44
|
+
const privateKeyHex = seed.subarray(0, 32).toString('hex');
|
|
45
|
+
const publicKey = await KeyManager.importKeyPair(privateKeyHex);
|
|
46
|
+
return {
|
|
47
|
+
phrase: mnemonic,
|
|
48
|
+
words: mnemonic.split(' '),
|
|
49
|
+
publicKey
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Restore an identity from a recovery phrase
|
|
55
|
+
*/
|
|
56
|
+
static async restoreFromPhrase(phrase) {
|
|
57
|
+
// Normalize and validate the phrase
|
|
58
|
+
const normalizedPhrase = phrase.trim().toLowerCase();
|
|
59
|
+
if (!bip39.validateMnemonic(normalizedPhrase)) {
|
|
60
|
+
throw new Error('Invalid recovery phrase. Please check the words and try again.');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Derive the same private key from the mnemonic
|
|
64
|
+
const seed = await bip39.mnemonicToSeed(normalizedPhrase);
|
|
65
|
+
const privateKeyHex = seed.subarray(0, 32).toString('hex');
|
|
66
|
+
|
|
67
|
+
// Import and store the key pair
|
|
68
|
+
const publicKey = await KeyManager.importKeyPair(privateKeyHex);
|
|
69
|
+
return publicKey;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Validate a recovery phrase without importing it
|
|
74
|
+
*/
|
|
75
|
+
static validatePhrase(phrase) {
|
|
76
|
+
const normalizedPhrase = phrase.trim().toLowerCase();
|
|
77
|
+
return bip39.validateMnemonic(normalizedPhrase);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Get the word list for autocomplete/validation
|
|
82
|
+
*/
|
|
83
|
+
static getWordList() {
|
|
84
|
+
return bip39.wordlists.english;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Check if a word is valid in the BIP39 word list
|
|
89
|
+
*/
|
|
90
|
+
static isValidWord(word) {
|
|
91
|
+
return bip39.wordlists.english.includes(word.toLowerCase());
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get suggestions for a partial word
|
|
96
|
+
*/
|
|
97
|
+
static getSuggestions(partial, limit = 5) {
|
|
98
|
+
const lowerPartial = partial.toLowerCase();
|
|
99
|
+
return bip39.wordlists.english.filter(word => word.startsWith(lowerPartial)).slice(0, limit);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Derive the public key from a phrase without storing
|
|
104
|
+
* Useful for verification before importing
|
|
105
|
+
*/
|
|
106
|
+
static async derivePublicKeyFromPhrase(phrase) {
|
|
107
|
+
const normalizedPhrase = phrase.trim().toLowerCase();
|
|
108
|
+
if (!bip39.validateMnemonic(normalizedPhrase)) {
|
|
109
|
+
throw new Error('Invalid recovery phrase');
|
|
110
|
+
}
|
|
111
|
+
const seed = await bip39.mnemonicToSeed(normalizedPhrase);
|
|
112
|
+
const privateKeyHex = seed.subarray(0, 32).toString('hex');
|
|
113
|
+
return KeyManager.derivePublicKey(privateKeyHex);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Convert a phrase to its word array
|
|
118
|
+
*/
|
|
119
|
+
static phraseToWords(phrase) {
|
|
120
|
+
return phrase.trim().toLowerCase().split(/\s+/);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Convert a word array to a phrase string
|
|
125
|
+
*/
|
|
126
|
+
static wordsToPhrase(words) {
|
|
127
|
+
return words.map(w => w.toLowerCase().trim()).join(' ');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export default RecoveryPhraseService;
|
|
131
|
+
//# sourceMappingURL=recoveryPhrase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bip39","KeyManager","RecoveryPhraseService","generateIdentityWithRecovery","mnemonic","generateMnemonic","seed","mnemonicToSeed","privateKeyHex","subarray","toString","publicKey","importKeyPair","phrase","words","split","generateIdentityWithRecovery24","restoreFromPhrase","normalizedPhrase","trim","toLowerCase","validateMnemonic","Error","validatePhrase","getWordList","wordlists","english","isValidWord","word","includes","getSuggestions","partial","limit","lowerPartial","filter","startsWith","slice","derivePublicKeyFromPhrase","derivePublicKey","phraseToWords","wordsToPhrase","map","w","join"],"sourceRoot":"../../../src","sources":["crypto/recoveryPhrase.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,cAAc;AAQzC,OAAO,MAAMC,qBAAqB,CAAC;EACjC;AACF;AACA;AACA;EACE,aAAaC,4BAA4BA,CAAA,EAAkC;IACzE;IACA,MAAMC,QAAQ,GAAGJ,KAAK,CAACK,gBAAgB,CAAC,GAAG,CAAC;;IAE5C;IACA;IACA,MAAMC,IAAI,GAAG,MAAMN,KAAK,CAACO,cAAc,CAACH,QAAQ,CAAC;;IAEjD;IACA,MAAMI,aAAa,GAAGF,IAAI,CAACG,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAACC,QAAQ,CAAC,KAAK,CAAC;;IAE1D;IACA,MAAMC,SAAS,GAAG,MAAMV,UAAU,CAACW,aAAa,CAACJ,aAAa,CAAC;IAE/D,OAAO;MACLK,MAAM,EAAET,QAAQ;MAChBU,KAAK,EAAEV,QAAQ,CAACW,KAAK,CAAC,GAAG,CAAC;MAC1BJ;IACF,CAAC;EACH;;EAEA;AACF;AACA;EACE,aAAaK,8BAA8BA,CAAA,EAAkC;IAC3E;IACA,MAAMZ,QAAQ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AC1B,KAAe,EAAU;IAC5C,OAAOA,KAAK,CAAC2B,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACtB,WAAW,CAAC,CAAC,CAACD,IAAI,CAAC,CAAC,CAAC,CAACwB,IAAI,CAAC,GAAG,CAAC;EACzD;AACF;AAEA,eAAezC,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Signature Service - ECDSA Digital Signatures
|
|
5
|
+
*
|
|
6
|
+
* Handles signing and verification of messages using ECDSA secp256k1.
|
|
7
|
+
* Used for authenticating requests and proving identity ownership.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { ec as EC } from 'elliptic';
|
|
11
|
+
import { KeyManager } from './keyManager';
|
|
12
|
+
|
|
13
|
+
// Lazy import for expo-crypto
|
|
14
|
+
let ExpoCrypto = null;
|
|
15
|
+
const ec = new EC('secp256k1');
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize expo-crypto module
|
|
19
|
+
*/
|
|
20
|
+
async function initExpoCrypto() {
|
|
21
|
+
if (!ExpoCrypto) {
|
|
22
|
+
ExpoCrypto = await import('expo-crypto');
|
|
23
|
+
}
|
|
24
|
+
return ExpoCrypto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Compute SHA-256 hash of a string
|
|
29
|
+
*/
|
|
30
|
+
async function sha256(message) {
|
|
31
|
+
try {
|
|
32
|
+
const Crypto = await initExpoCrypto();
|
|
33
|
+
return Crypto.digestStringAsync(Crypto.CryptoDigestAlgorithm.SHA256, message);
|
|
34
|
+
} catch {
|
|
35
|
+
// Fallback for Node.js environment
|
|
36
|
+
const crypto = await import('crypto');
|
|
37
|
+
return crypto.createHash('sha256').update(message).digest('hex');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class SignatureService {
|
|
41
|
+
/**
|
|
42
|
+
* Hash a message using SHA-256
|
|
43
|
+
*/
|
|
44
|
+
static async hashMessage(message) {
|
|
45
|
+
return sha256(message);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Sign a message using the stored private key
|
|
50
|
+
* Returns the signature in DER format (hex encoded)
|
|
51
|
+
*/
|
|
52
|
+
static async sign(message) {
|
|
53
|
+
const keyPair = await KeyManager.getKeyPairObject();
|
|
54
|
+
if (!keyPair) {
|
|
55
|
+
throw new Error('No identity found. Please create or import an identity first.');
|
|
56
|
+
}
|
|
57
|
+
const messageHash = await sha256(message);
|
|
58
|
+
const signature = keyPair.sign(messageHash);
|
|
59
|
+
return signature.toDER('hex');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Sign a message with an explicit private key (without storing)
|
|
64
|
+
* Useful for one-time operations or testing
|
|
65
|
+
*/
|
|
66
|
+
static async signWithKey(message, privateKey) {
|
|
67
|
+
const keyPair = ec.keyFromPrivate(privateKey);
|
|
68
|
+
const messageHash = await sha256(message);
|
|
69
|
+
const signature = keyPair.sign(messageHash);
|
|
70
|
+
return signature.toDER('hex');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Verify a signature against a message and public key
|
|
75
|
+
*/
|
|
76
|
+
static async verify(message, signature, publicKey) {
|
|
77
|
+
try {
|
|
78
|
+
const key = ec.keyFromPublic(publicKey, 'hex');
|
|
79
|
+
const messageHash = await sha256(message);
|
|
80
|
+
return key.verify(messageHash, signature);
|
|
81
|
+
} catch {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Synchronous verification (for Node.js backend)
|
|
88
|
+
* Uses crypto module directly for hashing
|
|
89
|
+
*/
|
|
90
|
+
static verifySync(message, signature, publicKey) {
|
|
91
|
+
try {
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
93
|
+
const crypto = require('crypto');
|
|
94
|
+
const key = ec.keyFromPublic(publicKey, 'hex');
|
|
95
|
+
const messageHash = crypto.createHash('sha256').update(message).digest('hex');
|
|
96
|
+
return key.verify(messageHash, signature);
|
|
97
|
+
} catch {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Create a signed message object with metadata
|
|
104
|
+
*/
|
|
105
|
+
static async createSignedMessage(message) {
|
|
106
|
+
const publicKey = await KeyManager.getPublicKey();
|
|
107
|
+
if (!publicKey) {
|
|
108
|
+
throw new Error('No identity found. Please create or import an identity first.');
|
|
109
|
+
}
|
|
110
|
+
const timestamp = Date.now();
|
|
111
|
+
const messageWithTimestamp = `${message}:${timestamp}`;
|
|
112
|
+
const signature = await SignatureService.sign(messageWithTimestamp);
|
|
113
|
+
return {
|
|
114
|
+
message,
|
|
115
|
+
signature,
|
|
116
|
+
publicKey,
|
|
117
|
+
timestamp
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Verify a signed message object
|
|
123
|
+
* Checks both signature validity and timestamp freshness
|
|
124
|
+
*/
|
|
125
|
+
static async verifySignedMessage(signedMessage, maxAgeMs = 5 * 60 * 1000 // 5 minutes default
|
|
126
|
+
) {
|
|
127
|
+
const {
|
|
128
|
+
message,
|
|
129
|
+
signature,
|
|
130
|
+
publicKey,
|
|
131
|
+
timestamp
|
|
132
|
+
} = signedMessage;
|
|
133
|
+
|
|
134
|
+
// Check timestamp freshness
|
|
135
|
+
const now = Date.now();
|
|
136
|
+
if (now - timestamp > maxAgeMs) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Verify signature
|
|
141
|
+
const messageWithTimestamp = `${message}:${timestamp}`;
|
|
142
|
+
return SignatureService.verify(messageWithTimestamp, signature, publicKey);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Create a signed authentication challenge response
|
|
147
|
+
* Used for challenge-response authentication
|
|
148
|
+
*/
|
|
149
|
+
static async signChallenge(challenge) {
|
|
150
|
+
const publicKey = await KeyManager.getPublicKey();
|
|
151
|
+
if (!publicKey) {
|
|
152
|
+
throw new Error('No identity found. Please create or import an identity first.');
|
|
153
|
+
}
|
|
154
|
+
const timestamp = Date.now();
|
|
155
|
+
const message = `auth:${publicKey}:${challenge}:${timestamp}`;
|
|
156
|
+
const signature = await SignatureService.sign(message);
|
|
157
|
+
return {
|
|
158
|
+
challenge: signature,
|
|
159
|
+
publicKey,
|
|
160
|
+
timestamp
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Verify a challenge response
|
|
166
|
+
*/
|
|
167
|
+
static async verifyChallengeResponse(originalChallenge, response, maxAgeMs = 5 * 60 * 1000) {
|
|
168
|
+
const {
|
|
169
|
+
challenge: signature,
|
|
170
|
+
publicKey,
|
|
171
|
+
timestamp
|
|
172
|
+
} = response;
|
|
173
|
+
|
|
174
|
+
// Check timestamp freshness
|
|
175
|
+
const now = Date.now();
|
|
176
|
+
if (now - timestamp > maxAgeMs) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const message = `auth:${publicKey}:${originalChallenge}:${timestamp}`;
|
|
180
|
+
return SignatureService.verify(message, signature, publicKey);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Create a registration signature
|
|
185
|
+
* Used when registering a new identity with the server
|
|
186
|
+
*/
|
|
187
|
+
static async createRegistrationSignature(username, email) {
|
|
188
|
+
const publicKey = await KeyManager.getPublicKey();
|
|
189
|
+
if (!publicKey) {
|
|
190
|
+
throw new Error('No identity found. Please create or import an identity first.');
|
|
191
|
+
}
|
|
192
|
+
const timestamp = Date.now();
|
|
193
|
+
const message = `register:${publicKey}:${username}:${email || ''}:${timestamp}`;
|
|
194
|
+
const signature = await SignatureService.sign(message);
|
|
195
|
+
return {
|
|
196
|
+
signature,
|
|
197
|
+
publicKey,
|
|
198
|
+
timestamp
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Sign arbitrary data for API requests
|
|
204
|
+
* Creates a canonical string representation and signs it
|
|
205
|
+
*/
|
|
206
|
+
static async signRequestData(data) {
|
|
207
|
+
const publicKey = await KeyManager.getPublicKey();
|
|
208
|
+
if (!publicKey) {
|
|
209
|
+
throw new Error('No identity found. Please create or import an identity first.');
|
|
210
|
+
}
|
|
211
|
+
const timestamp = Date.now();
|
|
212
|
+
|
|
213
|
+
// Create canonical string representation
|
|
214
|
+
const sortedKeys = Object.keys(data).sort();
|
|
215
|
+
const canonicalParts = sortedKeys.map(key => `${key}:${JSON.stringify(data[key])}`);
|
|
216
|
+
const canonicalString = canonicalParts.join('|');
|
|
217
|
+
const message = `request:${publicKey}:${timestamp}:${canonicalString}`;
|
|
218
|
+
const signature = await SignatureService.sign(message);
|
|
219
|
+
return {
|
|
220
|
+
signature,
|
|
221
|
+
publicKey,
|
|
222
|
+
timestamp
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
export default SignatureService;
|
|
227
|
+
//# sourceMappingURL=signatureService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ec","EC","KeyManager","ExpoCrypto","initExpoCrypto","sha256","message","Crypto","digestStringAsync","CryptoDigestAlgorithm","SHA256","crypto","createHash","update","digest","SignatureService","hashMessage","sign","keyPair","getKeyPairObject","Error","messageHash","signature","toDER","signWithKey","privateKey","keyFromPrivate","verify","publicKey","key","keyFromPublic","verifySync","require","createSignedMessage","getPublicKey","timestamp","Date","now","messageWithTimestamp","verifySignedMessage","signedMessage","maxAgeMs","signChallenge","challenge","verifyChallengeResponse","originalChallenge","response","createRegistrationSignature","username","email","signRequestData","data","sortedKeys","Object","keys","sort","canonicalParts","map","JSON","stringify","canonicalString","join"],"sourceRoot":"../../../src","sources":["crypto/signature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