@stokr/components-library 3.0.16 → 3.0.18
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 +261 -262
- package/dist/analytics/index.js +180 -0
- package/dist/api/auth.js +15 -0
- package/dist/api/fetchData.js +27 -0
- package/dist/api/fetchDataPublic.js +19 -0
- package/dist/auth/index.js +32 -0
- package/dist/components/2FA/Connect2FA.js +55 -0
- package/dist/components/2FA/EnterCode.js +63 -0
- package/dist/components/2FA/InstallAuthApp.js +64 -0
- package/dist/components/2FA/ResetCode.js +33 -0
- package/dist/components/2FA/Sucess2FA.js +51 -0
- package/dist/components/2FA/disable-2fa-flow.js +91 -0
- package/dist/components/2FA/enable-2fa-flow.js +137 -0
- package/dist/components/2FA/login-with-otp-flow.js +206 -0
- package/dist/components/2FA/main-flow.js +217 -0
- package/dist/components/AccountBalance/AccountBalance.js +35 -0
- package/dist/components/AccountBalance/AccountBalance.styles.js +48 -0
- package/dist/components/AdminDashboard/Table/ReactTable.js +266 -0
- package/dist/components/AdminDashboard/Table/ReactTableWrapper.js +65 -0
- package/dist/components/AdminDashboard/Table/Table.js +123 -0
- package/dist/components/AdminDashboard/Table/Table.styles.js +263 -0
- package/dist/components/AgreementItem/AgreementItem.js +39 -0
- package/dist/components/AgreementItem/AgreementItem.styles.js +32 -0
- package/dist/components/BackButton/BackButton.js +34 -0
- package/dist/components/BackButton/BackButton.styles.js +123 -0
- package/dist/components/Background/Background.js +45 -0
- package/dist/components/Background/Background.styles.js +119 -0
- package/dist/components/BasicTable/BasicTable.js +25 -0
- package/dist/components/BasicTable/BasicTable.styles.js +76 -0
- package/dist/components/BlogPost/BlogPost.js +98 -0
- package/dist/components/BlogPost/BlogPost.styles.js +230 -0
- package/dist/components/Button/Button.styles.js +207 -0
- package/dist/components/ButtonContainer/ButtonContainer.styles.js +51 -0
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.js +18 -0
- package/dist/components/CapitalRaisedSummary/CaptialRaisedSummary.styles.js +41 -0
- package/dist/components/Card/Card.styles.js +97 -0
- package/dist/components/ChartLegend/ChartLegend.js +62 -0
- package/dist/components/ChartLegend/ChartLegend.styles.js +133 -0
- package/dist/components/Checkbox/Checkbox.js +80 -0
- package/dist/components/Checkbox/Checkbox.styles.js +133 -0
- package/dist/components/Checklist/ChecklistCard.js +71 -0
- package/dist/components/Checklist/ChecklistCard.styles.js +82 -0
- package/dist/components/Chips/Chip.js +23 -0
- package/dist/components/Chips/Chip.styles.js +72 -0
- package/dist/components/Chips/ChipWrapper.js +50 -0
- package/dist/components/ComponentScroll/ComponentScroll.js +70 -0
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +127 -0
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +165 -0
- package/dist/components/ConfirmModal/ConfirmModal.js +199 -0
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +44 -0
- package/dist/components/CryptoAddress/ComponentWrap.js +16 -0
- package/dist/components/CryptoAddress/CryptoAddress.js +151 -0
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +443 -0
- package/dist/components/CryptoAddress/RadioWrap.js +47 -0
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.js +34 -0
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.styles.js +125 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.js +25 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +111 -0
- package/dist/components/DoubleButton/DoubleButton.styles.js +27 -0
- package/dist/components/ErrorMessage/ErrorMessage.styles.js +9 -0
- package/dist/components/FAQ/FAQ.js +73 -0
- package/dist/components/FAQ/FAQ.styles.js +128 -0
- package/dist/components/Footer/Footer.js +55 -0
- package/dist/components/Footer/Footer.styles.js +256 -0
- package/dist/components/Footer/FooterLayout.js +145 -0
- package/dist/components/Footer/FooterMenu.js +100 -0
- package/dist/components/Footer/FooterMenu.styles.js +321 -0
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +100 -0
- package/dist/components/Form/Form.js +21 -0
- package/dist/components/Form/Form.styles.js +72 -0
- package/dist/components/Grid/Grid.styles.js +212 -0
- package/dist/components/Header/Header.js +425 -0
- package/dist/components/Header/Header.styles.js +567 -0
- package/dist/components/HeroBlock/HeroVideoBlock.js +105 -0
- package/dist/components/Icon/Icon.style.js +92 -0
- package/dist/components/Icon/Icon2.js +12 -0
- package/dist/components/InfoBox/InfoBox.js +93 -0
- package/dist/components/InfoIcon/InfoIcon.js +62 -0
- package/dist/components/InfoIcon/InfoIcon.styles.js +64 -0
- package/dist/components/Input/DatePickerInput.js +139 -0
- package/dist/components/Input/DatePickerInput.styles.js +165 -0
- package/dist/components/Input/Input.js +108 -0
- package/dist/components/Input/Input.styles.js +154 -0
- package/dist/components/Input/InputPassword.js +122 -0
- package/dist/components/Input/InputPassword.styles.js +166 -0
- package/dist/components/Input/InputUsername.js +92 -0
- package/dist/components/Input/InputWithButton.js +53 -0
- package/dist/components/Input/InputWithButton.styles.js +57 -0
- package/dist/components/Input/MultiSelect.js +306 -0
- package/dist/components/Input/OtpInput.js +70 -0
- package/dist/components/Input/RangeInput.js +80 -0
- package/dist/components/Input/RangeInput.styles.js +129 -0
- package/dist/components/Input/SearchInput.js +68 -0
- package/dist/components/Input/SearchInput.styles.js +92 -0
- package/dist/components/Input/Select.js +151 -0
- package/dist/components/Input/Select.styles.js +148 -0
- package/dist/components/Input/TableFilterDropdown.js +247 -0
- package/dist/components/Input/Textarea.js +51 -0
- package/dist/components/Input/Textarea.styles.js +62 -0
- package/dist/components/InvestCalculator/InvestCalculator.js +283 -0
- package/dist/components/InvestCalculator/InvestCalculator.styles.js +94 -0
- package/dist/components/InvestmentStat/InvestmentStat.js +24 -0
- package/dist/components/InvestmentStat/InvestmentStat.styles.js +62 -0
- package/dist/components/LatestUpdate/LatestUpdate.js +24 -0
- package/dist/components/LatestUpdate/LatestUpdate.styles.js +90 -0
- package/dist/components/Layout/Layout.js +69 -0
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.js +32 -0
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.styles.js +208 -0
- package/dist/components/LearnMorePage/LearnMore.js +190 -0
- package/dist/components/LearnMorePage/LearnMore.propTypes.js +20 -0
- package/dist/components/LearnMorePage/LearnMore.shared.styles.js +56 -0
- package/dist/components/LearnMorePage/LearnMore.styles.js +276 -0
- package/dist/components/LearnMorePage/LearnMoreExampleObject.js +120 -0
- package/dist/components/LearnMorePage/LearnMoreItem.js +57 -0
- package/dist/components/LearnMorePage/LearnMoreItem.styles.js +234 -0
- package/dist/components/LearnMoreSection/LearnMore.js +138 -0
- package/dist/components/LearnMoreSection/LearnMore.styles.js +147 -0
- package/dist/components/LearnMoreSection/LearnMoreItem.js +33 -0
- package/dist/components/LearnMoreSection/LearnMoreItem.styles.js +60 -0
- package/dist/components/LoginModal/LoginModal.js +142 -0
- package/dist/components/MainMenu/DynamicMainMenu.js +38 -0
- package/dist/components/MainMenu/MainMenu.js +210 -0
- package/dist/components/MainMenu/MainMenu.styles.js +362 -0
- package/dist/components/MenuNav/MenuNav.styles.js +66 -0
- package/dist/components/Modal/Modal.js +119 -0
- package/dist/components/Modal/Modal.styles.js +450 -0
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +262 -0
- package/dist/components/Modal/PaymentModal.js +149 -0
- package/dist/components/Modal/SideModal.js +134 -0
- package/dist/components/Modal/SideModal.styles.js +55 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.js +170 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +53 -0
- package/dist/components/MultiProgressBar/MultiProgressBar.js +30 -0
- package/dist/components/MultiProgressBar/MultiProgressBar.styles.js +105 -0
- package/dist/components/Newsletter/Newsletter.js +122 -0
- package/dist/components/Newsletter/Newsletter.styles.js +186 -0
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +38 -0
- package/dist/components/Number/Number.js +50 -0
- package/dist/components/Number/Number.styles.js +23 -0
- package/dist/components/PageTransition/PageTransition.js +51 -0
- package/dist/components/Pagination/Pagination.js +58 -0
- package/dist/components/Pagination/Pagination.styles.js +59 -0
- package/dist/components/Pagination/PaginationControls.js +113 -0
- package/dist/components/Pagination/usePagination.js +40 -0
- package/dist/components/Payment/PaymentDetailsCard.js +359 -0
- package/dist/components/Payment/PaymentDisplay.js +199 -0
- package/dist/components/Payment/TimerComponent.js +92 -0
- package/dist/components/Process/Process.styles.js +84 -0
- package/dist/components/ProfileBadge/ProfileBadge.js +35 -0
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +53 -0
- package/dist/components/ProfileBox/ProfileBox.js +27 -0
- package/dist/components/ProfileBox/ProfileBox.styles.js +67 -0
- package/dist/components/ProfileStat/ProfileStat.js +29 -0
- package/dist/components/ProfileStat/ProfileStat.styles.js +90 -0
- package/dist/components/QRCode/QRCode.js +51 -0
- package/dist/components/Radio/Radio.js +51 -0
- package/dist/components/Radio/Radio.styles.js +100 -0
- package/dist/components/RefreshButton/RefreshButton.js +21 -0
- package/dist/components/RefreshButton/RefreshButton.styles.js +64 -0
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +65 -0
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.styles.js +20 -0
- package/dist/components/RegisterModal/RegisterModal.js +248 -0
- package/dist/components/RequestDataBox/RequestDataBox.js +21 -0
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +43 -0
- package/dist/components/ResetConfirmModal/ResetConfirmModal.js +44 -0
- package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +41 -0
- package/dist/components/ResetPasswordModal/ResetPasswordModal.js +134 -0
- package/dist/components/SEO/SEO.js +66 -0
- package/dist/components/SectionTitle/SectionTitle.styles.js +26 -0
- package/dist/components/SideLine/SideLine.js +7 -0
- package/dist/components/SideLine/SideLine.styles.js +33 -0
- package/dist/components/Slider/Slider.js +31 -0
- package/dist/components/Slider/Slider.styles.js +120 -0
- package/dist/components/Snackbar/Snackbar.js +111 -0
- package/dist/components/Snackbar/Snackbar.styles.js +230 -0
- package/dist/components/Snackbar/SnackbarProvider.js +66 -0
- package/dist/components/Snackbar/useSnackbar.js +12 -0
- package/dist/components/SpanButton/SpanButton.styles.js +19 -0
- package/dist/components/StatusBadge/StatusBadge.styles.js +18 -0
- package/dist/components/StatusTag/StatusTag.js +105 -0
- package/dist/components/StatusTag/StatusTag.styles.js +88 -0
- package/dist/components/StepController/StepController.js +86 -0
- package/dist/components/StepController/StepController.styles.js +33 -0
- package/dist/components/StepController/StepControllerContext.js +65 -0
- package/dist/components/StepController/StepControllerProgress.js +37 -0
- package/dist/components/StepsProgress/StepIndicator.js +40 -0
- package/dist/components/StepsProgress/StepIndicator.styles.js +69 -0
- package/dist/components/StepsProgress/StepsProgress.js +67 -0
- package/dist/components/StepsProgress/StepsProgress.styles.js +105 -0
- package/dist/components/StokrLoader/StokrLoader.js +111 -0
- package/dist/components/StokrLoader/media.js +23 -0
- package/dist/components/SvgIcons/AdminBadgeSvg.js +27 -0
- package/dist/components/SvgIcons/CameraSvg.js +31 -0
- package/dist/components/SvgIcons/CapsLockSvg.js +36 -0
- package/dist/components/SvgIcons/DocumentBackSvg.js +20 -0
- package/dist/components/SvgIcons/DocumentSmallSvg.js +41 -0
- package/dist/components/SvgIcons/DocumentSvg.js +39 -0
- package/dist/components/SvgIcons/EthSvg.js +28 -0
- package/dist/components/SvgIcons/EurSvg.js +27 -0
- package/dist/components/SvgIcons/FaceScanIconSvg.js +17 -0
- package/dist/components/SvgIcons/FourSvg.js +7 -0
- package/dist/components/SvgIcons/Glassess.js +26 -0
- package/dist/components/SvgIcons/LogoSvg.js +17 -0
- package/dist/components/SvgIcons/OneSvg.js +10 -0
- package/dist/components/SvgIcons/PassportSvg.js +37 -0
- package/dist/components/SvgIcons/RefreshSvg.js +28 -0
- package/dist/components/SvgIcons/SocialFacebook.js +22 -0
- package/dist/components/SvgIcons/SocialInstagram.js +13 -0
- package/dist/components/SvgIcons/SocialLinkedIn.js +31 -0
- package/dist/components/SvgIcons/SocialMedium.js +21 -0
- package/dist/components/SvgIcons/SocialReddit.js +21 -0
- package/dist/components/SvgIcons/SocialTelegram.js +60 -0
- package/dist/components/SvgIcons/SocialTwitter.js +62 -0
- package/dist/components/SvgIcons/SocialYoutube.js +22 -0
- package/dist/components/SvgIcons/ThreeSvg.js +7 -0
- package/dist/components/SvgIcons/TwoSidedDocumentSvg.js +48 -0
- package/dist/components/SvgIcons/TwoSvg.js +10 -0
- package/dist/components/SvgIcons/UpdateDefaultSvg.js +12 -0
- package/dist/components/SvgIcons/UpdateHardSvg.js +10 -0
- package/dist/components/SvgIcons/UpdateSoftSvg.js +11 -0
- package/dist/components/SvgIcons/UploadSvg.js +12 -0
- package/dist/components/SvgIcons/VerifiedBadge.js +16 -0
- package/dist/components/Switch/Switch.js +63 -0
- package/dist/components/Switch/Switch.styles.js +126 -0
- package/dist/components/Tabs/Tabs.js +54 -0
- package/dist/components/Tabs/Tabs.styles.js +15 -0
- package/dist/components/TabsNav/TabNav.js +16 -0
- package/dist/components/TabsNav/TabsNav.js +30 -0
- package/dist/components/TabsNav/TabsNav.styles.js +103 -0
- package/dist/components/TeamOverview/TeamOverview.js +80 -0
- package/dist/components/TeamOverview/TeamOverview.styles.js +167 -0
- package/dist/components/TermsModal/TermsModal.js +145 -0
- package/dist/components/TermsModal/_styles.js +313 -0
- package/dist/components/Text/Text.styles.js +220 -0
- package/dist/components/TextLink/TextLink.styles.js +67 -0
- package/dist/components/Timeline/Timeline.js +44 -0
- package/dist/components/Timeline/Timeline.styles.js +147 -0
- package/dist/components/Timeline/TimelineStep.js +58 -0
- package/dist/components/ToDoList/ToDoList.js +172 -0
- package/dist/components/ToDoList/ToDoList.styles.js +122 -0
- package/dist/components/ToDoList/ToDoListTask.js +95 -0
- package/dist/components/ToDoList/ToDoListTask.styles.js +119 -0
- package/dist/components/TransactionDetails/TransactionDetails.js +27 -0
- package/dist/components/TransactionDetails/TransactionDetails.styles.js +38 -0
- package/dist/components/TransactionInfo/TransactionInfo.js +41 -0
- package/dist/components/TransactionInfo/TransactionInfo.styles.js +75 -0
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +122 -0
- package/dist/components/breakdown/Breakdown.js +126 -0
- package/dist/components/headerHo/HeaderHo.js +709 -0
- package/dist/components/icons/Arrow.js +38 -0
- package/dist/components/icons/ArrowSimple.js +34 -0
- package/dist/components/icons/Check.js +16 -0
- package/dist/components/icons/Facebook.js +10 -0
- package/dist/components/icons/Info.js +27 -0
- package/dist/components/icons/Instagram.js +10 -0
- package/dist/components/icons/LinkIcon.js +49 -0
- package/dist/components/icons/LinkedIn.js +13 -0
- package/dist/components/icons/Medium.js +13 -0
- package/dist/components/icons/Reddit.js +16 -0
- package/dist/components/icons/Share.js +31 -0
- package/dist/components/icons/Telegram.js +13 -0
- package/dist/components/icons/Twitter.js +10 -0
- package/dist/components/icons/X.js +10 -0
- package/dist/components/icons/Youtube.js +10 -0
- package/dist/components/icons/index.js +32 -0
- package/dist/components/landing-page/List.js +51 -0
- package/dist/components/landing-page/PageContent.js +65 -0
- package/dist/components/landing-page/PageText.js +171 -0
- package/dist/components/landing-page/PageTitle.js +259 -0
- package/dist/components/logo/Logo.js +57 -0
- package/dist/components/taxId/complete.js +24 -0
- package/dist/components/taxId/flow.js +53 -0
- package/dist/components/taxId/register-taxid.js +166 -0
- package/dist/config.js +44 -0
- package/dist/constants/globalVariables.js +87 -0
- package/dist/constants/style.js +48 -0
- package/dist/context/Auth.js +396 -0
- package/dist/context/AuthContext.js +781 -0
- package/dist/context/Checkbox/CheckboxContext.js +151 -0
- package/dist/firebase-config.js +73 -0
- package/dist/hooks/useNewVentureForm.js +262 -0
- package/dist/hooks/useTimer.js +89 -0
- package/dist/hooks/useTransactionPolling.js +100 -0
- package/dist/index.js +632 -25463
- package/dist/model/axios.js +10 -0
- package/dist/model/axiosPublic.js +9 -0
- package/dist/services/TimerService.js +80 -0
- package/dist/static/animations/checked.lottie.js +4 -0
- package/dist/static/animations/progress.lottie.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.ttf.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.woff.js +4 -0
- package/dist/static/fonts/Ionicons/Ionicons.woff2.js +4 -0
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Bold.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-ExtraBold.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Light.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-Regular.woff2.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.ttf.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff.js +4 -0
- package/dist/static/fonts/OpenSans/OpenSans-SemiBold.woff2.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.eot.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.svg.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.ttf.js +4 -0
- package/dist/static/fonts/icomoon/icomoon.woff.js +4 -0
- package/dist/static/images/add-folder-icon.svg.js +5 -0
- package/dist/static/images/address-refreshing.gif.js +4 -0
- package/dist/static/images/arrow-down-black.svg.js +4 -0
- package/dist/static/images/avatar-placeholder.png.js +4 -0
- package/dist/static/images/background3.png.js +4 -0
- package/dist/static/images/bitcoin-logo.svg.js +4 -0
- package/dist/static/images/bmn2-logo.svg.js +4 -0
- package/dist/static/images/check-icon.svg.js +5 -0
- package/dist/static/images/checkmark-circle-icon.svg.js +5 -0
- package/dist/static/images/close-circle-icon.svg.js +5 -0
- package/dist/static/images/copy_icon.svg.js +5 -0
- package/dist/static/images/cross-icon.svg.js +5 -0
- package/dist/static/images/early-adopter.png.js +4 -0
- package/dist/static/images/eth_logo.svg.js +4 -0
- package/dist/static/images/external-link-icon.svg +3 -0
- package/dist/static/images/external-link-icon.svg.js +4 -0
- package/dist/static/images/filter-icon.svg.js +5 -0
- package/dist/static/images/google_auth.png.js +4 -0
- package/dist/static/images/graduation.png.js +4 -0
- package/dist/static/images/mangopay.svg.js +4 -0
- package/dist/static/images/numbers/number_eight.svg.js +5 -0
- package/dist/static/images/numbers/number_five.svg.js +5 -0
- package/dist/static/images/numbers/number_four.svg.js +5 -0
- package/dist/static/images/numbers/number_nine.svg.js +5 -0
- package/dist/static/images/numbers/number_one.svg.js +5 -0
- package/dist/static/images/numbers/number_seven.svg.js +5 -0
- package/dist/static/images/numbers/number_six.svg.js +5 -0
- package/dist/static/images/numbers/number_three.svg.js +5 -0
- package/dist/static/images/numbers/number_two.svg.js +5 -0
- package/dist/static/images/numbers/number_zero.svg.js +5 -0
- package/dist/static/images/process-waiting.gif.js +4 -0
- package/dist/static/images/search-icon.svg.js +5 -0
- package/dist/static/images/social/Facebook_Logo.png.js +4 -0
- package/dist/static/images/social/LI-In-Bug.png.js +4 -0
- package/dist/static/images/social/Telegram-Logo.png.js +4 -0
- package/dist/static/images/social/X-logo-black.png.js +4 -0
- package/dist/static/images/social/youtube_social_circle_red.png.js +4 -0
- package/dist/static/images/transfer-icon.svg.js +5 -0
- package/dist/static/images/usdc-logo.svg.js +4 -0
- package/dist/static/images/usdq-logo.png.js +4 -0
- package/dist/static/images/warning-filled.svg.js +5 -0
- package/dist/styles/colors.js +57 -0
- package/dist/styles/fonts.js +100 -0
- package/dist/styles/global.js +74 -0
- package/dist/styles/grid.js +11 -0
- package/dist/styles/ioniconsStyles.js +31 -0
- package/dist/styles/reactTippy.js +40 -0
- package/dist/styles/rwd.js +56 -0
- package/dist/styles/semanticUi.js +84 -0
- package/dist/styles/spacing.js +8 -0
- package/dist/styles/theme.js +34 -0
- package/dist/utils/check-sale-time-left.js +85 -0
- package/dist/utils/check-todo-status.js +11 -0
- package/dist/utils/checklistGenerator.js +195 -0
- package/dist/utils/copyToClipboard.js +92 -0
- package/dist/utils/customHooks.js +126 -0
- package/dist/utils/delete-redirect-cookie-and-navigate.js +12 -0
- package/dist/utils/fix-decimals.js +5 -0
- package/dist/utils/formatCurrencyValue.js +95 -0
- package/dist/utils/get-cookie-domain.js +10 -0
- package/dist/utils/get-short-address.js +4 -0
- package/dist/utils/isUSInvestor.js +6 -0
- package/dist/utils/km_ify.js +33 -0
- package/dist/utils/moment.js +26 -0
- package/dist/utils/redirect-url.js +5 -0
- package/dist/utils/saveAs.js +17 -0
- package/dist/utils/scrollUtils.js +63 -0
- package/dist/utils/set-redirect-cookie.js +16 -0
- package/dist/utils/transition.js +101 -0
- package/dist/utils/withRouter.js +24 -0
- package/package.json +11 -11
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const platformDomain = "stokr.info";
|
|
2
|
+
const platformURL = "https://" + platformDomain;
|
|
3
|
+
const walletTypes = {
|
|
4
|
+
LIQUID: "liquid"
|
|
5
|
+
};
|
|
6
|
+
const ProjectTypes = {
|
|
7
|
+
FUND: "fund",
|
|
8
|
+
COMPANY: "company",
|
|
9
|
+
TRANCHES: "tranches",
|
|
10
|
+
EQUITY: "equity"
|
|
11
|
+
};
|
|
12
|
+
const ProjectStatus = {
|
|
13
|
+
ACTIVE: "Active",
|
|
14
|
+
INACTIVE: "Inactive",
|
|
15
|
+
ON_HOLD: "On_hold"
|
|
16
|
+
};
|
|
17
|
+
const ProjectStates = {
|
|
18
|
+
ON_HOLD: "ON HOLD",
|
|
19
|
+
LIVE: "LIVE",
|
|
20
|
+
OPEN: "OPEN",
|
|
21
|
+
CLOSED: "CLOSED",
|
|
22
|
+
CLOSED_SUCCESSFULLY: "CLOSED SUCCESSFULLY",
|
|
23
|
+
UPCOMING: "UPCOMING"
|
|
24
|
+
};
|
|
25
|
+
const UserTypes = {
|
|
26
|
+
investor: "investor",
|
|
27
|
+
investor_entity: "investor_entity"
|
|
28
|
+
};
|
|
29
|
+
const ProfessionalInvestorStatuses = {
|
|
30
|
+
PROFESSIONAL: "professional",
|
|
31
|
+
NOT_PROFESSIONAL: "not professional",
|
|
32
|
+
NOT_CLASIFIED: "not classified"
|
|
33
|
+
};
|
|
34
|
+
const USInvestorAcreditationStatuses = {
|
|
35
|
+
US_ACCREDITED: "US accredited",
|
|
36
|
+
NOT_US_ACCREDITED: "not US accredited",
|
|
37
|
+
NOT_CLASIFIED: "not classified"
|
|
38
|
+
};
|
|
39
|
+
const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
|
|
40
|
+
const LoanActivityTypes = {
|
|
41
|
+
PRINCIPAL_DEPOSIT: "principal_deposit",
|
|
42
|
+
PRINCIPAL_RELEASE: "principal_release",
|
|
43
|
+
INTEREST_PAYMENT: "interest_payment",
|
|
44
|
+
COLLATERAL_DEPOSIT: "collateral_deposit",
|
|
45
|
+
COLLATERAL_RELEASE: "collateral_release",
|
|
46
|
+
COLLATERAL_PARTIAL_DEPOSIT: "collateral_partial_deposit",
|
|
47
|
+
COLLATERAL_PARTIAL_RELEASE: "collateral_partial_release",
|
|
48
|
+
LIQUIDATION: "liquidation"
|
|
49
|
+
};
|
|
50
|
+
const TransactionTypes = {
|
|
51
|
+
SUBSCRIPTION: "subscription",
|
|
52
|
+
REFUND: "refund",
|
|
53
|
+
REDEMPTION: "redemption",
|
|
54
|
+
VENTURE_PAYOUT: "issuer_payout",
|
|
55
|
+
AGGREGATION: "aggregation",
|
|
56
|
+
...LoanActivityTypes
|
|
57
|
+
};
|
|
58
|
+
const transactionTypeDisplayNames = {
|
|
59
|
+
[TransactionTypes.INTEREST_PAYMENT]: "Interest",
|
|
60
|
+
[TransactionTypes.COLLATERAL_DEPOSIT]: "Collateral Deposit",
|
|
61
|
+
[TransactionTypes.COLLATERAL_RELEASE]: "Collateral Release",
|
|
62
|
+
[TransactionTypes.COLLATERAL_PARTIAL_DEPOSIT]: "Collateral Shift (Deposit)",
|
|
63
|
+
[TransactionTypes.COLLATERAL_PARTIAL_RELEASE]: "Collateral Shift (Release)",
|
|
64
|
+
[TransactionTypes.PRINCIPAL_DEPOSIT]: "Principal Increase",
|
|
65
|
+
[TransactionTypes.PRINCIPAL_RELEASE]: "Principal Decrease",
|
|
66
|
+
[TransactionTypes.LIQUIDATION]: "Liquidation",
|
|
67
|
+
[TransactionTypes.REDEMPTION]: "Redemption",
|
|
68
|
+
[TransactionTypes.REFUND]: "Refund",
|
|
69
|
+
[TransactionTypes.AGGREGATION]: "Aggregation",
|
|
70
|
+
[TransactionTypes.VENTURE_PAYOUT]: "Issuer Payout",
|
|
71
|
+
[TransactionTypes.SUBSCRIPTION]: "Issuance"
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
LoanActivityTypes,
|
|
75
|
+
ProfessionalInvestorStatuses,
|
|
76
|
+
ProjectStates,
|
|
77
|
+
ProjectStatus,
|
|
78
|
+
ProjectTypes,
|
|
79
|
+
TransactionTypes,
|
|
80
|
+
USInvestorAcreditationStatuses,
|
|
81
|
+
UserTypes,
|
|
82
|
+
emailRegex,
|
|
83
|
+
platformDomain,
|
|
84
|
+
platformURL,
|
|
85
|
+
transactionTypeDisplayNames,
|
|
86
|
+
walletTypes
|
|
87
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const COLUMN = 64;
|
|
2
|
+
const BASE_FONT_SIZE = 16;
|
|
3
|
+
const BASE_MARGIN = 16;
|
|
4
|
+
const BASE_MARGIN_PX = `${BASE_MARGIN}px`;
|
|
5
|
+
const BASE_MARGIN_2X_PX = `${BASE_MARGIN * 2}px`;
|
|
6
|
+
const MAX_WIDTH = 1920 - BASE_MARGIN * 2;
|
|
7
|
+
const DESKTOP_MEDIA = 1024;
|
|
8
|
+
const TABLET_MEDIA = 769;
|
|
9
|
+
const PHONE_MEDIA = 320;
|
|
10
|
+
const BASE_COLOR_HEX = "#202020";
|
|
11
|
+
const BLUE_BASE_HEX = "#0050ca";
|
|
12
|
+
const BLUE_BASE_RELEASED_HEX = "#004bb7";
|
|
13
|
+
const GRAY_BASE_HEX = "#ededed";
|
|
14
|
+
const GRAY_SECONDARY_HEX = "#9b9b9b";
|
|
15
|
+
const GRAY_DEEP_HEX = "#979797";
|
|
16
|
+
const GREEN = "#84FB6F";
|
|
17
|
+
const WHITE_HEX = "#fff";
|
|
18
|
+
const RED_BASE_HEX = "#ee220d";
|
|
19
|
+
const RED_BASE_RELEASE_HEX = "#D2200D";
|
|
20
|
+
const SLIDER_HEIGHT = "700px";
|
|
21
|
+
const SLIDER_TABLET_HEIGHT = "500px";
|
|
22
|
+
const SLIDER_MOBILE_HEIGHT = "300px";
|
|
23
|
+
const CAPITAL_ANIMATION_LENGTH = 1.5;
|
|
24
|
+
export {
|
|
25
|
+
BASE_COLOR_HEX,
|
|
26
|
+
BASE_FONT_SIZE,
|
|
27
|
+
BASE_MARGIN,
|
|
28
|
+
BASE_MARGIN_2X_PX,
|
|
29
|
+
BASE_MARGIN_PX,
|
|
30
|
+
BLUE_BASE_HEX,
|
|
31
|
+
BLUE_BASE_RELEASED_HEX,
|
|
32
|
+
CAPITAL_ANIMATION_LENGTH,
|
|
33
|
+
COLUMN,
|
|
34
|
+
DESKTOP_MEDIA,
|
|
35
|
+
GRAY_BASE_HEX,
|
|
36
|
+
GRAY_DEEP_HEX,
|
|
37
|
+
GRAY_SECONDARY_HEX,
|
|
38
|
+
GREEN,
|
|
39
|
+
MAX_WIDTH,
|
|
40
|
+
PHONE_MEDIA,
|
|
41
|
+
RED_BASE_HEX,
|
|
42
|
+
RED_BASE_RELEASE_HEX,
|
|
43
|
+
SLIDER_HEIGHT,
|
|
44
|
+
SLIDER_MOBILE_HEIGHT,
|
|
45
|
+
SLIDER_TABLET_HEIGHT,
|
|
46
|
+
TABLET_MEDIA,
|
|
47
|
+
WHITE_HEX
|
|
48
|
+
};
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import Cookies from "js-cookie";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
import axiosInstance from "../model/axios.js";
|
|
4
|
+
import getCookieDomain from "../utils/get-cookie-domain.js";
|
|
5
|
+
import { getConfig, getLastFirebaseConfig } from "../config.js";
|
|
6
|
+
import { getFirebaseAuth, initFirebase } from "../firebase-config.js";
|
|
7
|
+
import { signInWithEmailAndPassword, createUserWithEmailAndPassword, applyActionCode, verifyPasswordResetCode, confirmPasswordReset, onAuthStateChanged, signInWithCustomToken, updatePassword, updateProfile } from "firebase/auth";
|
|
8
|
+
function normalizeCustomToken(token) {
|
|
9
|
+
if (token == null) return "";
|
|
10
|
+
if (typeof token === "object" && token !== null) {
|
|
11
|
+
const nested = (
|
|
12
|
+
/** @type {{ customToken?: string; custom_token?: string; token?: string }} */
|
|
13
|
+
token
|
|
14
|
+
);
|
|
15
|
+
if (typeof nested.customToken === "string") return normalizeCustomToken(nested.customToken);
|
|
16
|
+
if (typeof nested.custom_token === "string") return normalizeCustomToken(nested.custom_token);
|
|
17
|
+
if (typeof nested.token === "string") return normalizeCustomToken(nested.token);
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
if (typeof token !== "string") return "";
|
|
21
|
+
let t = token.trim();
|
|
22
|
+
if (!t) return "";
|
|
23
|
+
try {
|
|
24
|
+
t = decodeURIComponent(t.replace(/\+/g, " "));
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
return t.trim();
|
|
28
|
+
}
|
|
29
|
+
const DEFAULT_TOKEN_EXPIRY_MS = 60 * 60 * 1e3;
|
|
30
|
+
class Auth {
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} token - Access token to store
|
|
33
|
+
* @param {{ expiresInMs?: number }} [options] - Optional. expiresInMs: cookie lifetime in ms (default 1 hour)
|
|
34
|
+
*/
|
|
35
|
+
static setAccessToken(token, options = {}) {
|
|
36
|
+
this.logout();
|
|
37
|
+
const cookieDomain = getCookieDomain();
|
|
38
|
+
const raw = options?.expiresInMs;
|
|
39
|
+
const expiresInMs = typeof raw === "number" && Number.isFinite(raw) && raw > 0 ? raw : Number(DEFAULT_TOKEN_EXPIRY_MS) || 60 * 60 * 1e3;
|
|
40
|
+
const expiresAtMs = Date.now() + expiresInMs;
|
|
41
|
+
const expiresInDays = expiresInMs / (24 * 60 * 60 * 1e3);
|
|
42
|
+
cookieDomain.expires = expiresInDays;
|
|
43
|
+
Cookies.set("STOKR_ACCESS_TOKEN", token, cookieDomain);
|
|
44
|
+
Cookies.set("STOKR_ACCESS_TOKEN_EXPIRES", String(expiresAtMs), cookieDomain);
|
|
45
|
+
}
|
|
46
|
+
static getAccessToken() {
|
|
47
|
+
return Cookies.get("STOKR_ACCESS_TOKEN");
|
|
48
|
+
}
|
|
49
|
+
/** Returns the access token cookie expiry timestamp in ms, or null if not set. */
|
|
50
|
+
static getAccessTokenExpiresAt() {
|
|
51
|
+
const value = Cookies.get("STOKR_ACCESS_TOKEN_EXPIRES");
|
|
52
|
+
if (value == null || value === "") return null;
|
|
53
|
+
const ts = parseInt(value, 10);
|
|
54
|
+
return Number.isFinite(ts) ? ts : null;
|
|
55
|
+
}
|
|
56
|
+
static logout() {
|
|
57
|
+
const cookieDomain = getCookieDomain();
|
|
58
|
+
Cookies.remove("STOKR_ACCESS_TOKEN", cookieDomain);
|
|
59
|
+
Cookies.remove("STOKR_ACCESS_TOKEN_EXPIRES", cookieDomain);
|
|
60
|
+
}
|
|
61
|
+
static async login(email, password) {
|
|
62
|
+
const auth = getFirebaseAuth();
|
|
63
|
+
if (!auth) {
|
|
64
|
+
throw new Error("Firebase is not configured. Set VITE_FIREBASE_API_KEY (and other env vars) for auth.");
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const userCredential = await signInWithEmailAndPassword(auth, email, password);
|
|
68
|
+
return userCredential?.user;
|
|
69
|
+
} catch (sdkError) {
|
|
70
|
+
if (sdkError?.code !== "auth/network-request-failed") {
|
|
71
|
+
throw sdkError;
|
|
72
|
+
}
|
|
73
|
+
console.warn("[Auth.login] SDK signIn failed with network-request-failed, trying REST API fallback…");
|
|
74
|
+
const apiKey = auth.config?.apiKey;
|
|
75
|
+
if (!apiKey) throw sdkError;
|
|
76
|
+
const res = await fetch(`https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=${apiKey}`, {
|
|
77
|
+
method: "POST",
|
|
78
|
+
headers: { "Content-Type": "application/json" },
|
|
79
|
+
body: JSON.stringify({ email, password, returnSecureToken: true })
|
|
80
|
+
});
|
|
81
|
+
const data = await res.json();
|
|
82
|
+
if (!res.ok) {
|
|
83
|
+
const fbCode = data?.error?.message;
|
|
84
|
+
const err = new Error(
|
|
85
|
+
fbCode === "INVALID_LOGIN_CREDENTIALS" ? "The credentials are not correct. Try again?" : data?.error?.message || "Authentication failed"
|
|
86
|
+
);
|
|
87
|
+
err.code = fbCode === "INVALID_LOGIN_CREDENTIALS" ? "auth/invalid-credential" : "auth/internal-error";
|
|
88
|
+
throw err;
|
|
89
|
+
}
|
|
90
|
+
const { signInWithCustomToken: signInCustom } = await import("firebase/auth");
|
|
91
|
+
try {
|
|
92
|
+
const cred = await signInCustom(auth, data.idToken);
|
|
93
|
+
return cred?.user;
|
|
94
|
+
} catch {
|
|
95
|
+
return {
|
|
96
|
+
uid: data.localId,
|
|
97
|
+
email: data.email,
|
|
98
|
+
emailVerified: data.emailVerified ?? false,
|
|
99
|
+
displayName: data.displayName || "",
|
|
100
|
+
getIdToken: () => Promise.resolve(data.idToken),
|
|
101
|
+
toJSON: () => ({ uid: data.localId, email: data.email })
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
static createUser(email, password) {
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
const auth = getFirebaseAuth();
|
|
109
|
+
if (!auth) {
|
|
110
|
+
reject(new Error("Firebase is not configured."));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
createUserWithEmailAndPassword(auth, email, password).then((userCredential) => {
|
|
114
|
+
const user = userCredential?.user;
|
|
115
|
+
resolve(user);
|
|
116
|
+
}).catch((error) => {
|
|
117
|
+
reject(error);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
static twoFactor(data) {
|
|
122
|
+
return new Promise((resolve, reject) => {
|
|
123
|
+
axiosInstance.post(`auth/confirm2fa`, data).then((response) => {
|
|
124
|
+
resolve(response.data);
|
|
125
|
+
}).catch((err) => {
|
|
126
|
+
reject(err);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
static resendActivationEmail(email) {
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
axiosInstance.post(`auth/resend-activation-email`, {
|
|
133
|
+
email
|
|
134
|
+
}).then((response) => {
|
|
135
|
+
resolve(response.data);
|
|
136
|
+
}).catch((err) => {
|
|
137
|
+
reject(err);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
static handleVerifyEmail(actionCode) {
|
|
142
|
+
return new Promise((resolve, reject) => {
|
|
143
|
+
const auth = getFirebaseAuth();
|
|
144
|
+
if (!auth) {
|
|
145
|
+
reject(new Error("Firebase is not configured."));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
applyActionCode(auth, actionCode).then((resp) => {
|
|
149
|
+
resolve(resp);
|
|
150
|
+
}).catch((error) => {
|
|
151
|
+
reject(error);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
static handleResetPassword(actionCode, newPassword) {
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
const auth = getFirebaseAuth();
|
|
158
|
+
if (!auth) {
|
|
159
|
+
reject(new Error("Firebase is not configured."));
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
verifyPasswordResetCode(auth, actionCode).then((email) => {
|
|
163
|
+
const accountEmail = email;
|
|
164
|
+
confirmPasswordReset(auth, actionCode, newPassword).then(() => {
|
|
165
|
+
resolve(accountEmail);
|
|
166
|
+
}).catch((error) => {
|
|
167
|
+
reject(error);
|
|
168
|
+
});
|
|
169
|
+
}).catch((error) => {
|
|
170
|
+
reject(error);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
static getUser() {
|
|
175
|
+
return new Promise((resolve, reject) => {
|
|
176
|
+
axiosInstance.post(`user/get`).then((response) => {
|
|
177
|
+
resolve(response.data);
|
|
178
|
+
}).catch((err) => {
|
|
179
|
+
reject(err);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
static getFirebaseUser() {
|
|
184
|
+
return new Promise((resolve, reject) => {
|
|
185
|
+
const auth = getFirebaseAuth();
|
|
186
|
+
if (!auth) {
|
|
187
|
+
reject(new Error("Firebase is not configured."));
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const unsubscribe = onAuthStateChanged(auth, (user) => {
|
|
191
|
+
unsubscribe();
|
|
192
|
+
if (user) {
|
|
193
|
+
resolve(user);
|
|
194
|
+
} else {
|
|
195
|
+
reject("User is signed out");
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
static refreshIdToken() {
|
|
201
|
+
return new Promise((resolve, reject) => {
|
|
202
|
+
const auth = getFirebaseAuth();
|
|
203
|
+
if (!auth) {
|
|
204
|
+
reject(new Error("Firebase is not configured."));
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
var user = auth.currentUser;
|
|
208
|
+
if (!user) reject("User not available");
|
|
209
|
+
user.getIdToken(true).then((idToken) => {
|
|
210
|
+
resolve(idToken);
|
|
211
|
+
}).catch((error) => {
|
|
212
|
+
reject(error);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
static signInWithToken(token) {
|
|
217
|
+
return new Promise((resolve, reject) => {
|
|
218
|
+
const normalized = normalizeCustomToken(token);
|
|
219
|
+
if (!normalized) {
|
|
220
|
+
reject(
|
|
221
|
+
Object.assign(new Error("Invalid or empty Firebase custom token."), {
|
|
222
|
+
code: "auth/invalid-custom-token"
|
|
223
|
+
})
|
|
224
|
+
);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
let auth = getFirebaseAuth();
|
|
228
|
+
if (!auth) {
|
|
229
|
+
const fb = getLastFirebaseConfig();
|
|
230
|
+
if (fb) {
|
|
231
|
+
initFirebase(fb);
|
|
232
|
+
auth = getFirebaseAuth();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (!auth) {
|
|
236
|
+
reject(new Error("Firebase is not configured. Pass config.firebase via configure() / AuthProvider."));
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
signInWithCustomToken(auth, normalized).then((userCredential) => {
|
|
240
|
+
const user = userCredential?.user;
|
|
241
|
+
if (!user) {
|
|
242
|
+
reject(new Error("signInWithCustomToken returned no user."));
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
resolve(user);
|
|
246
|
+
}).catch((error) => {
|
|
247
|
+
reject(error);
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
static updateUserPassword(user, newPassword) {
|
|
252
|
+
return new Promise((resolve, reject) => {
|
|
253
|
+
updatePassword(user, newPassword).then(() => {
|
|
254
|
+
resolve();
|
|
255
|
+
}).catch((error) => {
|
|
256
|
+
reject(error);
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
static requestUpdateEmail(data) {
|
|
261
|
+
return new Promise((resolve, reject) => {
|
|
262
|
+
axiosInstance.post(`user/requestUpdateEmail`, data).then((response) => {
|
|
263
|
+
resolve(response.data);
|
|
264
|
+
}).catch((err) => {
|
|
265
|
+
reject(err);
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
static checkPrivateInvestor(data) {
|
|
270
|
+
return new Promise((resolve, reject) => {
|
|
271
|
+
axiosInstance.post(`private-investor/check`, data).then((response) => {
|
|
272
|
+
resolve(response.data);
|
|
273
|
+
}).catch((err) => {
|
|
274
|
+
reject(err);
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
static checkIfUserSubscribed(data) {
|
|
279
|
+
return new Promise((resolve, reject) => {
|
|
280
|
+
axiosInstance.post(`emails/checksubscription`, data).then((response) => {
|
|
281
|
+
resolve(response.data);
|
|
282
|
+
}).catch((err) => {
|
|
283
|
+
reject(err);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
static fetchTrackingUserLastTime(data) {
|
|
288
|
+
return new Promise((resolve, reject) => {
|
|
289
|
+
axiosInstance.post(`tracking-user/getLast`, data).then((response) => {
|
|
290
|
+
resolve(response.data);
|
|
291
|
+
}).catch((err) => {
|
|
292
|
+
reject(err);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
static updateUser(data) {
|
|
297
|
+
return new Promise((resolve, reject) => {
|
|
298
|
+
axiosInstance.post(`user/update`, data).then((response) => {
|
|
299
|
+
resolve(response.data);
|
|
300
|
+
}).catch((err) => {
|
|
301
|
+
reject(err);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
static updateFirebaseUser(user, data) {
|
|
306
|
+
return new Promise((resolve, reject) => {
|
|
307
|
+
updateProfile(user, data).then(() => {
|
|
308
|
+
resolve();
|
|
309
|
+
}).catch((error) => {
|
|
310
|
+
reject(error);
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
static sendWelcomeEmail() {
|
|
315
|
+
return new Promise((resolve, reject) => {
|
|
316
|
+
axiosInstance.post(`user/welcomeEmail`).then(() => {
|
|
317
|
+
resolve();
|
|
318
|
+
}).catch((err) => {
|
|
319
|
+
reject(err);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
static createWallet(data) {
|
|
324
|
+
return new Promise((resolve, reject) => {
|
|
325
|
+
axiosInstance.post(`wallets/create`, data).then((response) => {
|
|
326
|
+
resolve(response.data);
|
|
327
|
+
}).catch((err) => {
|
|
328
|
+
reject(err);
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
static uploaProofOfAddress(data, ip) {
|
|
333
|
+
const kycBaseUrl = "https://kycdocs.stokr.io";
|
|
334
|
+
return new Promise((resolve, reject) => {
|
|
335
|
+
axiosInstance.post(`${kycBaseUrl}/kyc/upload?ip=${encodeURIComponent(ip)}`, data, {
|
|
336
|
+
headers: {
|
|
337
|
+
"Content-Type": "multipart/form-data"
|
|
338
|
+
}
|
|
339
|
+
}).then((response) => {
|
|
340
|
+
resolve(response.data);
|
|
341
|
+
}).catch((err) => {
|
|
342
|
+
reject(err);
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
static validateGreenWalletId(id) {
|
|
347
|
+
return new Promise((resolve, reject) => {
|
|
348
|
+
axiosInstance.post(`wallets/validate-gaid`, {
|
|
349
|
+
gaid: id
|
|
350
|
+
}).then((response) => {
|
|
351
|
+
resolve(response.data);
|
|
352
|
+
}).catch((err) => {
|
|
353
|
+
reject(err);
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Upload Photo
|
|
359
|
+
* @param data
|
|
360
|
+
*/
|
|
361
|
+
static uploadPhoto(data) {
|
|
362
|
+
return new Promise((resolve, reject) => {
|
|
363
|
+
axios.post(`${getConfig("photoApiUrl")}/media/picture/create`, data, {
|
|
364
|
+
headers: {
|
|
365
|
+
"Content-Type": "multipart/form-data"
|
|
366
|
+
}
|
|
367
|
+
}).then((response) => {
|
|
368
|
+
resolve(response.data);
|
|
369
|
+
}).catch((err) => {
|
|
370
|
+
reject(err);
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Delete Photo
|
|
376
|
+
* @param data
|
|
377
|
+
*/
|
|
378
|
+
static deletePhoto(data) {
|
|
379
|
+
return new Promise((resolve, reject) => {
|
|
380
|
+
axios.post(`${getConfig("photoApiUrl")}/media/picture/delete`, data, {
|
|
381
|
+
headers: {
|
|
382
|
+
"Content-Type": "multipart/form-data"
|
|
383
|
+
}
|
|
384
|
+
}).then((response) => {
|
|
385
|
+
resolve(response.data);
|
|
386
|
+
}).catch((err) => {
|
|
387
|
+
reject(err);
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
export {
|
|
393
|
+
Auth,
|
|
394
|
+
DEFAULT_TOKEN_EXPIRY_MS,
|
|
395
|
+
Auth as default
|
|
396
|
+
};
|