@getpara/react-sdk 0.1.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/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/modal/ParaModal.d.ts +2 -0
- package/dist/modal/ParaModal.js +250 -0
- package/dist/modal/components/Account/Account.d.ts +5 -0
- package/dist/modal/components/Account/Account.js +59 -0
- package/dist/modal/components/AddFunds/AddFunds.d.ts +3 -0
- package/dist/modal/components/AddFunds/AddFunds.js +146 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +64 -0
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +6 -0
- package/dist/modal/components/AddFunds/AddFundsDone.js +26 -0
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +2 -0
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +2 -0
- package/dist/modal/components/AddFunds/index.d.ts +3 -0
- package/dist/modal/components/AddFunds/index.js +3 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +6 -0
- package/dist/modal/components/AuthInput/AuthInput.js +214 -0
- package/dist/modal/components/AuthInput/countryCodes.d.ts +8 -0
- package/dist/modal/components/AuthInput/countryCodes.js +40 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +7 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +23 -0
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +247 -0
- package/dist/modal/components/AuthInput/phoneMasks.js +247 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +8 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +21 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +8 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +89 -0
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +8 -0
- package/dist/modal/components/AuthOptions/AuthOptions.js +28 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +1 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +7 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +1 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +5 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +1 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +7 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +1 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +18 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +4 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +17 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +127 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +6 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +26 -0
- package/dist/modal/components/Body/Body.d.ts +12 -0
- package/dist/modal/components/Body/Body.js +232 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +77 -0
- package/dist/modal/components/ChainSwitch/config.d.ts +7 -0
- package/dist/modal/components/ChainSwitch/config.js +11 -0
- package/dist/modal/components/Controls/Controls.d.ts +5 -0
- package/dist/modal/components/Controls/Controls.js +54 -0
- package/dist/modal/components/Controls/Selects.d.ts +2 -0
- package/dist/modal/components/Controls/Selects.js +157 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +116 -0
- package/dist/modal/components/ExternalWalletStep/config.d.ts +7 -0
- package/dist/modal/components/ExternalWalletStep/config.js +11 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +1 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +142 -0
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +7 -0
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +118 -0
- package/dist/modal/components/Footer/Footer.d.ts +1 -0
- package/dist/modal/components/Footer/Footer.js +71 -0
- package/dist/modal/components/Header/Header.d.ts +1 -0
- package/dist/modal/components/Header/Header.js +24 -0
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +3 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +42 -0
- package/dist/modal/components/Hero/Hero.d.ts +1 -0
- package/dist/modal/components/Hero/Hero.js +118 -0
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +1 -0
- package/dist/modal/components/IFrameStep/IFrameStep.js +41 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +1 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +18 -0
- package/dist/modal/components/ModalContent/ModalContent.d.ts +10 -0
- package/dist/modal/components/ModalContent/ModalContent.js +276 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +2 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +81 -0
- package/dist/modal/components/OAuth/OAuth.d.ts +6 -0
- package/dist/modal/components/OAuth/OAuth.js +124 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +1 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +132 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +1 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.js +10 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +9 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +72 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +6 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +67 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +5 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +104 -0
- package/dist/modal/components/StripeComponents/StripeComponents.d.ts +16 -0
- package/dist/modal/components/StripeComponents/StripeComponents.js +78 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +5 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +8 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +1 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +130 -0
- package/dist/modal/components/Waiting/Waiting.d.ts +6 -0
- package/dist/modal/components/Waiting/Waiting.js +6 -0
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +6 -0
- package/dist/modal/components/WalletCard/PartnerIcon.js +29 -0
- package/dist/modal/components/WalletCard/WalletCard.d.ts +18 -0
- package/dist/modal/components/WalletCard/WalletCard.js +91 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +6 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +49 -0
- package/dist/modal/components/common.d.ts +19 -0
- package/dist/modal/components/common.js +67 -0
- package/dist/modal/components/index.d.ts +1 -0
- package/dist/modal/components/index.js +1 -0
- package/dist/modal/constants/constants.d.ts +32 -0
- package/dist/modal/constants/constants.js +93 -0
- package/dist/modal/constants/defaults.d.ts +5 -0
- package/dist/modal/constants/defaults.js +5 -0
- package/dist/modal/constants/oAuthLogos.d.ts +8 -0
- package/dist/modal/constants/oAuthLogos.js +18 -0
- package/dist/modal/css/modal.css +13 -0
- package/dist/modal/hooks/useActiveWallet.d.ts +1 -0
- package/dist/modal/hooks/useActiveWallet.js +9 -0
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +1 -0
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +46 -0
- package/dist/modal/hooks/useGoBack.d.ts +1 -0
- package/dist/modal/hooks/useGoBack.js +34 -0
- package/dist/modal/index.d.ts +10 -0
- package/dist/modal/index.js +9 -0
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +29 -0
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +18 -0
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +33 -0
- package/dist/modal/providers/EvmExternalWalletContextStub.js +22 -0
- package/dist/modal/providers/ExternalWalletContext.d.ts +75 -0
- package/dist/modal/providers/ExternalWalletContext.js +252 -0
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +21 -0
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +12 -0
- package/dist/modal/public/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +3 -0
- package/dist/modal/stores/externalWalletProvider/actions.js +5 -0
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +20 -0
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +13 -0
- package/dist/modal/stores/index.d.ts +4 -0
- package/dist/modal/stores/index.js +4 -0
- package/dist/modal/stores/modal/actions.d.ts +3 -0
- package/dist/modal/stores/modal/actions.js +65 -0
- package/dist/modal/stores/modal/useModalStore.d.ts +82 -0
- package/dist/modal/stores/modal/useModalStore.js +41 -0
- package/dist/modal/stores/para/actions.d.ts +3 -0
- package/dist/modal/stores/para/actions.js +5 -0
- package/dist/modal/stores/para/useParaStore.d.ts +10 -0
- package/dist/modal/stores/para/useParaStore.js +3 -0
- package/dist/modal/stores/theme/actions.d.ts +3 -0
- package/dist/modal/stores/theme/actions.js +24 -0
- package/dist/modal/stores/theme/useThemeStore.d.ts +20 -0
- package/dist/modal/stores/theme/useThemeStore.js +14 -0
- package/dist/modal/stores/userInfo/actions.d.ts +3 -0
- package/dist/modal/stores/userInfo/actions.js +28 -0
- package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +19 -0
- package/dist/modal/stores/userInfo/useUserInfoStore.js +9 -0
- package/dist/modal/types/commonTypes.d.ts +48 -0
- package/dist/modal/types/commonTypes.js +1 -0
- package/dist/modal/types/externalWallets.d.ts +31 -0
- package/dist/modal/types/externalWallets.js +21 -0
- package/dist/modal/types/modalProps.d.ts +138 -0
- package/dist/modal/types/modalProps.js +7 -0
- package/dist/modal/utils/authLayoutHelpers.d.ts +3 -0
- package/dist/modal/utils/authLayoutHelpers.js +2 -0
- package/dist/modal/utils/getMailtoLink.d.ts +1 -0
- package/dist/modal/utils/getMailtoLink.js +5 -0
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -0
- package/dist/modal/utils/getTileButtonFlex.js +15 -0
- package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
- package/dist/modal/utils/isPasskeySupported.js +10 -0
- package/dist/modal/utils/openPopup.d.ts +1 -0
- package/dist/modal/utils/openPopup.js +55 -0
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +1 -0
- package/dist/modal/utils/routeMobileExternalWallet.js +35 -0
- package/dist/modal/utils/steps.d.ts +112 -0
- package/dist/modal/utils/steps.js +215 -0
- package/dist/modal/utils/stringFormatters.d.ts +4 -0
- package/dist/modal/utils/stringFormatters.js +12 -0
- package/dist/modal/utils/validateOnRampConfig.d.ts +5 -0
- package/dist/modal/utils/validateOnRampConfig.js +26 -0
- package/package.json +51 -0
- package/styles.css/package.json +3 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TAuthLayout } from '../types/modalProps.js';
|
|
2
|
+
export declare const hasExternalWallet: (authLayout: TAuthLayout[]) => "AUTH:FULL" | "AUTH:CONDENSED" | "EXTERNAL:FULL" | "EXTERNAL:CONDENSED";
|
|
3
|
+
export declare const hasEmbeddedAuth: (authLayout: TAuthLayout[]) => "AUTH:FULL" | "AUTH:CONDENSED" | "EXTERNAL:FULL" | "EXTERNAL:CONDENSED";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getMailtoLink(email: any, recoveryShare: any): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function getMailtoLink(email, recoveryShare) {
|
|
2
|
+
const emailBody = `Hello,%0D%0DBelow is your Para Recovery Secret. Keep this safe!%0D%0D${recoveryShare}%0D%0DPlease get in touch via support@getpara.com if you have any questions`;
|
|
3
|
+
const mailText = `mailto:${email}?subject=Para%20Recovery%20Secret&body=${emailBody}`;
|
|
4
|
+
return mailText;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTileButtonFlex: (index: number, totalItems: number) => "1 1 auto" | "0 0 calc(33.333333% - 5.336px)" | "0 0 calc(50% - 4px)";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const getTileButtonFlex = (index, totalItems) => {
|
|
2
|
+
const gapOffset = 8 - 8 * 0.333;
|
|
3
|
+
if (totalItems < 2) {
|
|
4
|
+
return '1 1 auto';
|
|
5
|
+
}
|
|
6
|
+
if (totalItems % 3 === 0) {
|
|
7
|
+
return `0 0 calc(33.333333% - ${gapOffset}px)`;
|
|
8
|
+
}
|
|
9
|
+
if (totalItems % 3 === 1) {
|
|
10
|
+
return index < 4 ? '0 0 calc(50% - 4px)' : `0 0 calc(33.333333% - ${gapOffset}px)`;
|
|
11
|
+
}
|
|
12
|
+
if (totalItems % 3 === 2) {
|
|
13
|
+
return index < 2 ? '0 0 calc(50% - 4px)' : `0 0 calc(33.333333% - ${gapOffset}px)`;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPasskeySupported: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function openPopup(popupUrl: string, target: string, type: 'OAUTH' | 'LOGIN_PASSKEY' | 'CREATE_PASSKEY' | 'TRANSACTION_REVIEW' | 'CREATE_PASSWORD' | 'LOGIN_PASSWORD'): Window;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function openPopup(popupUrl, target, type) {
|
|
2
|
+
const popUpWidth = 560;
|
|
3
|
+
let popUpHeight;
|
|
4
|
+
switch (type) {
|
|
5
|
+
case 'LOGIN_PASSWORD': {
|
|
6
|
+
popUpHeight = 460;
|
|
7
|
+
break;
|
|
8
|
+
}
|
|
9
|
+
case 'LOGIN_PASSKEY': {
|
|
10
|
+
popUpHeight = 798;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
case 'CREATE_PASSWORD': {
|
|
14
|
+
popUpHeight = 400;
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
case 'CREATE_PASSKEY': {
|
|
18
|
+
popUpHeight = 464;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
case 'TRANSACTION_REVIEW': {
|
|
22
|
+
popUpHeight = 480;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
case 'OAUTH':
|
|
26
|
+
default: {
|
|
27
|
+
popUpHeight = 768;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Fixes position when using multiple monitors
|
|
32
|
+
const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
|
|
33
|
+
const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
|
|
34
|
+
const width = window.innerWidth
|
|
35
|
+
? window.innerWidth
|
|
36
|
+
: document.documentElement.clientWidth
|
|
37
|
+
? document.documentElement.clientWidth
|
|
38
|
+
: screen.width;
|
|
39
|
+
const height = window.innerHeight
|
|
40
|
+
? window.innerHeight
|
|
41
|
+
: document.documentElement.clientHeight
|
|
42
|
+
? document.documentElement.clientHeight
|
|
43
|
+
: screen.height;
|
|
44
|
+
const left = (width - popUpWidth) / 2 + dualScreenLeft;
|
|
45
|
+
const top = (height - popUpHeight) / 2 + dualScreenTop;
|
|
46
|
+
const windowFeatures = `toolbar=no, menubar=no, width=${popUpWidth},
|
|
47
|
+
height=${popUpHeight}, top=${top}, left=${left}`;
|
|
48
|
+
let popupWindow = window.open(popupUrl, target, windowFeatures);
|
|
49
|
+
if (!popupWindow) {
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
popupWindow = window.open(popupUrl, '_blank');
|
|
52
|
+
}, 0);
|
|
53
|
+
}
|
|
54
|
+
return popupWindow;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const routeMobileExternalWallet: (qrUri?: string) => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isAndroid, isMobile, isTelegram } from '@getpara/web-sdk';
|
|
2
|
+
export const routeMobileExternalWallet = (qrUri) => {
|
|
3
|
+
if (isMobile()) {
|
|
4
|
+
if (!qrUri)
|
|
5
|
+
return;
|
|
6
|
+
if (!isTelegram() && qrUri.startsWith('http')) {
|
|
7
|
+
// Workaround for https://github.com/rainbow-me/rainbowkit/issues/524.
|
|
8
|
+
// Using 'window.open' causes issues on iOS in non-Safari browsers and
|
|
9
|
+
// WebViews where a blank tab is left behind after connecting.
|
|
10
|
+
// This is especially bad in some WebView scenarios (e.g. following a
|
|
11
|
+
// link from Twitter) where the user doesn't have any mechanism for
|
|
12
|
+
// closing the blank tab.
|
|
13
|
+
// For whatever reason, links with a target of "_blank" don't suffer
|
|
14
|
+
// from this problem, and programmatically clicking a detached link
|
|
15
|
+
// element with the same attributes also avoids the issue.
|
|
16
|
+
const link = document.createElement('a');
|
|
17
|
+
link.href = qrUri;
|
|
18
|
+
link.target = '_blank';
|
|
19
|
+
link.rel = 'noreferrer noopener';
|
|
20
|
+
link.click();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
if (isTelegram()) {
|
|
24
|
+
let href = qrUri;
|
|
25
|
+
if (isAndroid()) {
|
|
26
|
+
href = encodeURI(qrUri);
|
|
27
|
+
}
|
|
28
|
+
window.open(href, '_blank', 'noreferrer noopener');
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
window.location.href = qrUri;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { EnabledFlow } from '@getpara/web-sdk';
|
|
2
|
+
export declare enum ModalStep {
|
|
3
|
+
AUTH_MAIN = "AUTH_MAIN",
|
|
4
|
+
AUTH_MORE = "AUTH_MORE",
|
|
5
|
+
EX_WALLET_MORE = "EX_WALLET_MORE",
|
|
6
|
+
EX_WALLET_SELECTED = "EX_WALLET_SELECTED",
|
|
7
|
+
VERIFICATIONS = "VERIFICATIONS",
|
|
8
|
+
AWAITING_OAUTH = "AWAITING_OAUTH",
|
|
9
|
+
FARCASTER_OAUTH = "FARCASTER_OAUTH",
|
|
10
|
+
BIOMETRIC_CREATION = "BIOMETRIC_CREATION",
|
|
11
|
+
AWAITING_BIOMETRIC_CREATION = "AWAITING_BIOMETRIC_CREATION",
|
|
12
|
+
PASSWORD_CREATION = "PASSWORD_CREATION",
|
|
13
|
+
AWAITING_PASSWORD_CREATION = "AWAITING_PASSWORD_CREATION",
|
|
14
|
+
AWAITING_WALLET_CREATION = "AWAITING_WALLET_CREATION",
|
|
15
|
+
TELEGRAM_OAUTH = "TELEGRAM_OAUTH",
|
|
16
|
+
WALLET_CREATION_DONE = "WALLET_CREATION_DONE",
|
|
17
|
+
SECRET = "SECRET",
|
|
18
|
+
BIOMETRIC_LOGIN = "BIOMETRIC_LOGIN",
|
|
19
|
+
AWAITING_BIOMETRIC_LOGIN = "AWAITING_BIOMETRIC_LOGIN",
|
|
20
|
+
AWAITING_PASSWORD_LOGIN = "AWAITING_PASSWORD_LOGIN",
|
|
21
|
+
LOGIN_DONE = "LOGIN_DONE",
|
|
22
|
+
SETUP_2FA = "SETUP_2FA",
|
|
23
|
+
VERIFY_2FA = "VERIFY_2FA",
|
|
24
|
+
TWO_FACTOR_DONE = "TWO_FACTOR_DONE",
|
|
25
|
+
ADD_FUNDS_BUY = "ADD_FUNDS_BUY",
|
|
26
|
+
ADD_FUNDS_RECEIVE = "ADD_FUNDS_RECEIVE",
|
|
27
|
+
ADD_FUNDS_WITHDRAW = "ADD_FUNDS_WITHDRAW",
|
|
28
|
+
ADD_FUNDS_AWAITING = "ADD_FUNDS_AWAITING",
|
|
29
|
+
ADD_FUNDS_SUCCESS = "ADD_FUNDS_SUCCESS",
|
|
30
|
+
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE",
|
|
31
|
+
ACCOUNT_MAIN = "ACCOUNT_MAIN",
|
|
32
|
+
CHAIN_SWITCH = "CHAIN_SWITCH"
|
|
33
|
+
}
|
|
34
|
+
export type ModalStepPropU = keyof typeof ModalStep | ModalStep;
|
|
35
|
+
export type ModalStepPropL = Lowercase<ModalStepPropU>;
|
|
36
|
+
export type ModalStepProp = ModalStepPropU | ModalStepPropL;
|
|
37
|
+
declare enum AccountStep {
|
|
38
|
+
ACCOUNT_MAIN = "ACCOUNT_MAIN",
|
|
39
|
+
ADD_FUNDS_BUY = "ADD_FUNDS_BUY",
|
|
40
|
+
ADD_FUNDS_RECEIVE = "ADD_FUNDS_RECEIVE",
|
|
41
|
+
ADD_FUNDS_WITHDRAW = "ADD_FUNDS_WITHDRAW",
|
|
42
|
+
ADD_FUNDS_AWAITING = "ADD_FUNDS_AWAITING",
|
|
43
|
+
ADD_FUNDS_SUCCESS = "ADD_FUNDS_SUCCESS",
|
|
44
|
+
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE",
|
|
45
|
+
CHAIN_SWITCH = "CHAIN_SWITCH"
|
|
46
|
+
}
|
|
47
|
+
export declare const RESET_TO_AUTH_STEPS: ModalStep[];
|
|
48
|
+
export declare const RESET_TO_ACCOUNT_STEPS: ModalStep[];
|
|
49
|
+
export declare const AccountPreviousStep: {
|
|
50
|
+
[key in AccountStep]: ModalStep | undefined;
|
|
51
|
+
};
|
|
52
|
+
declare enum SignUpModalStep {
|
|
53
|
+
AUTH_MAIN = "AUTH_MAIN",
|
|
54
|
+
AUTH_MORE = "AUTH_MORE",
|
|
55
|
+
EX_WALLET_MORE = "EX_WALLET_MORE",
|
|
56
|
+
EX_WALLET_SELECTED = "EX_WALLET_SELECTED",
|
|
57
|
+
VERIFICATIONS = "VERIFICATIONS",
|
|
58
|
+
AWAITING_OAUTH = "AWAITING_OAUTH",
|
|
59
|
+
FARCASTER_OAUTH = "FARCASTER_OAUTH",
|
|
60
|
+
TELEGRAM_OAUTH = "TELEGRAM_OAUTH",
|
|
61
|
+
BIOMETRIC_CREATION = "BIOMETRIC_CREATION",
|
|
62
|
+
AWAITING_BIOMETRIC_CREATION = "AWAITING_BIOMETRIC_CREATION",
|
|
63
|
+
PASSWORD_CREATION = "PASSWORD_CREATION",
|
|
64
|
+
AWAITING_PASSWORD_CREATION = "AWAITING_PASSWORD_CREATION",
|
|
65
|
+
AWAITING_WALLET_CREATION = "AWAITING_WALLET_CREATION",
|
|
66
|
+
WALLET_CREATION_DONE = "WALLET_CREATION_DONE",
|
|
67
|
+
SECRET = "SECRET",
|
|
68
|
+
SETUP_2FA = "SETUP_2FA",
|
|
69
|
+
VERIFY_2FA = "VERIFY_2FA",
|
|
70
|
+
TWO_FACTOR_DONE = "TWO_FACTOR_DONE",
|
|
71
|
+
ADD_FUNDS_BUY = "ADD_FUNDS_BUY",
|
|
72
|
+
ADD_FUNDS_RECEIVE = "ADD_FUNDS_RECEIVE",
|
|
73
|
+
ADD_FUNDS_WITHDRAW = "ADD_FUNDS_WITHDRAW",
|
|
74
|
+
ADD_FUNDS_AWAITING = "ADD_FUNDS_AWAITING",
|
|
75
|
+
ADD_FUNDS_SUCCESS = "ADD_FUNDS_SUCCESS",
|
|
76
|
+
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE"
|
|
77
|
+
}
|
|
78
|
+
export declare const SignUpPreviousStep: {
|
|
79
|
+
[key in SignUpModalStep]: ModalStep | undefined;
|
|
80
|
+
};
|
|
81
|
+
declare enum LoginModalStep {
|
|
82
|
+
AUTH_MAIN = "AUTH_MAIN",
|
|
83
|
+
AUTH_MORE = "AUTH_MORE",
|
|
84
|
+
EX_WALLET_MORE = "EX_WALLET_MORE",
|
|
85
|
+
EX_WALLET_SELECTED = "EX_WALLET_SELECTED",
|
|
86
|
+
AWAITING_OAUTH = "AWAITING_OAUTH",
|
|
87
|
+
FARCASTER_OAUTH = "FARCASTER_OAUTH",
|
|
88
|
+
TELEGRAM_OAUTH = "TELEGRAM_OAUTH",
|
|
89
|
+
BIOMETRIC_LOGIN = "BIOMETRIC_LOGIN",
|
|
90
|
+
AWAITING_BIOMETRIC_LOGIN = "AWAITING_BIOMETRIC_LOGIN",
|
|
91
|
+
AWAITING_PASSWORD_LOGIN = "AWAITING_PASSWORD_LOGIN",
|
|
92
|
+
AWAITING_WALLET_CREATION = "AWAITING_WALLET_CREATION",
|
|
93
|
+
WALLET_CREATION_DONE = "WALLET_CREATION_DONE",
|
|
94
|
+
SECRET = "SECRET",
|
|
95
|
+
SETUP_2FA = "SETUP_2FA",
|
|
96
|
+
VERIFY_2FA = "VERIFY_2FA",
|
|
97
|
+
TWO_FACTOR_DONE = "TWO_FACTOR_DONE",
|
|
98
|
+
LOGIN_DONE = "LOGIN_DONE",
|
|
99
|
+
ADD_FUNDS_BUY = "ADD_FUNDS_BUY",
|
|
100
|
+
ADD_FUNDS_RECEIVE = "ADD_FUNDS_RECEIVE",
|
|
101
|
+
ADD_FUNDS_WITHDRAW = "ADD_FUNDS_WITHDRAW",
|
|
102
|
+
ADD_FUNDS_AWAITING = "ADD_FUNDS_AWAITING",
|
|
103
|
+
ADD_FUNDS_SUCCESS = "ADD_FUNDS_SUCCESS",
|
|
104
|
+
ADD_FUNDS_FAILURE = "ADD_FUNDS_FAILURE"
|
|
105
|
+
}
|
|
106
|
+
export declare const LoginPreviousStep: {
|
|
107
|
+
[key in LoginModalStep]: ModalStep | undefined;
|
|
108
|
+
};
|
|
109
|
+
export declare const getStepHasFooter: (step: ModalStep) => boolean;
|
|
110
|
+
export declare function getAddFundsStep(currentTab: EnabledFlow): ModalStep;
|
|
111
|
+
export declare const IFrameSteps: ModalStep[];
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
export var ModalStep;
|
|
2
|
+
(function (ModalStep) {
|
|
3
|
+
ModalStep["AUTH_MAIN"] = "AUTH_MAIN";
|
|
4
|
+
ModalStep["AUTH_MORE"] = "AUTH_MORE";
|
|
5
|
+
ModalStep["EX_WALLET_MORE"] = "EX_WALLET_MORE";
|
|
6
|
+
ModalStep["EX_WALLET_SELECTED"] = "EX_WALLET_SELECTED";
|
|
7
|
+
ModalStep["VERIFICATIONS"] = "VERIFICATIONS";
|
|
8
|
+
ModalStep["AWAITING_OAUTH"] = "AWAITING_OAUTH";
|
|
9
|
+
ModalStep["FARCASTER_OAUTH"] = "FARCASTER_OAUTH";
|
|
10
|
+
ModalStep["BIOMETRIC_CREATION"] = "BIOMETRIC_CREATION";
|
|
11
|
+
ModalStep["AWAITING_BIOMETRIC_CREATION"] = "AWAITING_BIOMETRIC_CREATION";
|
|
12
|
+
ModalStep["PASSWORD_CREATION"] = "PASSWORD_CREATION";
|
|
13
|
+
ModalStep["AWAITING_PASSWORD_CREATION"] = "AWAITING_PASSWORD_CREATION";
|
|
14
|
+
ModalStep["AWAITING_WALLET_CREATION"] = "AWAITING_WALLET_CREATION";
|
|
15
|
+
ModalStep["TELEGRAM_OAUTH"] = "TELEGRAM_OAUTH";
|
|
16
|
+
ModalStep["WALLET_CREATION_DONE"] = "WALLET_CREATION_DONE";
|
|
17
|
+
ModalStep["SECRET"] = "SECRET";
|
|
18
|
+
ModalStep["BIOMETRIC_LOGIN"] = "BIOMETRIC_LOGIN";
|
|
19
|
+
ModalStep["AWAITING_BIOMETRIC_LOGIN"] = "AWAITING_BIOMETRIC_LOGIN";
|
|
20
|
+
ModalStep["AWAITING_PASSWORD_LOGIN"] = "AWAITING_PASSWORD_LOGIN";
|
|
21
|
+
ModalStep["LOGIN_DONE"] = "LOGIN_DONE";
|
|
22
|
+
ModalStep["SETUP_2FA"] = "SETUP_2FA";
|
|
23
|
+
ModalStep["VERIFY_2FA"] = "VERIFY_2FA";
|
|
24
|
+
ModalStep["TWO_FACTOR_DONE"] = "TWO_FACTOR_DONE";
|
|
25
|
+
ModalStep["ADD_FUNDS_BUY"] = "ADD_FUNDS_BUY";
|
|
26
|
+
ModalStep["ADD_FUNDS_RECEIVE"] = "ADD_FUNDS_RECEIVE";
|
|
27
|
+
ModalStep["ADD_FUNDS_WITHDRAW"] = "ADD_FUNDS_WITHDRAW";
|
|
28
|
+
ModalStep["ADD_FUNDS_AWAITING"] = "ADD_FUNDS_AWAITING";
|
|
29
|
+
ModalStep["ADD_FUNDS_SUCCESS"] = "ADD_FUNDS_SUCCESS";
|
|
30
|
+
ModalStep["ADD_FUNDS_FAILURE"] = "ADD_FUNDS_FAILURE";
|
|
31
|
+
ModalStep["ACCOUNT_MAIN"] = "ACCOUNT_MAIN";
|
|
32
|
+
ModalStep["CHAIN_SWITCH"] = "CHAIN_SWITCH";
|
|
33
|
+
})(ModalStep || (ModalStep = {}));
|
|
34
|
+
var AccountStep;
|
|
35
|
+
(function (AccountStep) {
|
|
36
|
+
AccountStep["ACCOUNT_MAIN"] = "ACCOUNT_MAIN";
|
|
37
|
+
AccountStep["ADD_FUNDS_BUY"] = "ADD_FUNDS_BUY";
|
|
38
|
+
AccountStep["ADD_FUNDS_RECEIVE"] = "ADD_FUNDS_RECEIVE";
|
|
39
|
+
AccountStep["ADD_FUNDS_WITHDRAW"] = "ADD_FUNDS_WITHDRAW";
|
|
40
|
+
AccountStep["ADD_FUNDS_AWAITING"] = "ADD_FUNDS_AWAITING";
|
|
41
|
+
AccountStep["ADD_FUNDS_SUCCESS"] = "ADD_FUNDS_SUCCESS";
|
|
42
|
+
AccountStep["ADD_FUNDS_FAILURE"] = "ADD_FUNDS_FAILURE";
|
|
43
|
+
AccountStep["CHAIN_SWITCH"] = "CHAIN_SWITCH";
|
|
44
|
+
})(AccountStep || (AccountStep = {}));
|
|
45
|
+
export const RESET_TO_AUTH_STEPS = [
|
|
46
|
+
ModalStep.EX_WALLET_MORE,
|
|
47
|
+
ModalStep.EX_WALLET_SELECTED,
|
|
48
|
+
ModalStep.VERIFICATIONS,
|
|
49
|
+
ModalStep.AWAITING_OAUTH,
|
|
50
|
+
ModalStep.FARCASTER_OAUTH,
|
|
51
|
+
ModalStep.TELEGRAM_OAUTH,
|
|
52
|
+
ModalStep.BIOMETRIC_CREATION,
|
|
53
|
+
ModalStep.AWAITING_BIOMETRIC_CREATION,
|
|
54
|
+
ModalStep.PASSWORD_CREATION,
|
|
55
|
+
ModalStep.AWAITING_PASSWORD_CREATION,
|
|
56
|
+
ModalStep.BIOMETRIC_LOGIN,
|
|
57
|
+
ModalStep.AWAITING_BIOMETRIC_LOGIN,
|
|
58
|
+
ModalStep.AWAITING_PASSWORD_LOGIN,
|
|
59
|
+
ModalStep.AWAITING_WALLET_CREATION,
|
|
60
|
+
ModalStep.AWAITING_WALLET_CREATION,
|
|
61
|
+
ModalStep.WALLET_CREATION_DONE,
|
|
62
|
+
ModalStep.SETUP_2FA,
|
|
63
|
+
ModalStep.VERIFY_2FA,
|
|
64
|
+
ModalStep.TWO_FACTOR_DONE,
|
|
65
|
+
ModalStep.LOGIN_DONE,
|
|
66
|
+
];
|
|
67
|
+
export const RESET_TO_ACCOUNT_STEPS = [
|
|
68
|
+
ModalStep.ADD_FUNDS_BUY,
|
|
69
|
+
ModalStep.ADD_FUNDS_RECEIVE,
|
|
70
|
+
ModalStep.ADD_FUNDS_WITHDRAW,
|
|
71
|
+
ModalStep.ADD_FUNDS_AWAITING,
|
|
72
|
+
ModalStep.ADD_FUNDS_SUCCESS,
|
|
73
|
+
ModalStep.ADD_FUNDS_FAILURE,
|
|
74
|
+
ModalStep.CHAIN_SWITCH,
|
|
75
|
+
];
|
|
76
|
+
export const AccountPreviousStep = {
|
|
77
|
+
[AccountStep.ACCOUNT_MAIN]: undefined,
|
|
78
|
+
[AccountStep.ADD_FUNDS_BUY]: ModalStep.ACCOUNT_MAIN,
|
|
79
|
+
[AccountStep.ADD_FUNDS_WITHDRAW]: ModalStep.ACCOUNT_MAIN,
|
|
80
|
+
[AccountStep.ADD_FUNDS_RECEIVE]: ModalStep.ACCOUNT_MAIN,
|
|
81
|
+
[AccountStep.ADD_FUNDS_AWAITING]: ModalStep.ADD_FUNDS_BUY,
|
|
82
|
+
[AccountStep.ADD_FUNDS_SUCCESS]: ModalStep.ACCOUNT_MAIN,
|
|
83
|
+
[AccountStep.ADD_FUNDS_FAILURE]: ModalStep.ACCOUNT_MAIN,
|
|
84
|
+
[AccountStep.CHAIN_SWITCH]: ModalStep.ACCOUNT_MAIN,
|
|
85
|
+
};
|
|
86
|
+
var SignUpModalStep;
|
|
87
|
+
(function (SignUpModalStep) {
|
|
88
|
+
SignUpModalStep["AUTH_MAIN"] = "AUTH_MAIN";
|
|
89
|
+
SignUpModalStep["AUTH_MORE"] = "AUTH_MORE";
|
|
90
|
+
SignUpModalStep["EX_WALLET_MORE"] = "EX_WALLET_MORE";
|
|
91
|
+
SignUpModalStep["EX_WALLET_SELECTED"] = "EX_WALLET_SELECTED";
|
|
92
|
+
SignUpModalStep["VERIFICATIONS"] = "VERIFICATIONS";
|
|
93
|
+
SignUpModalStep["AWAITING_OAUTH"] = "AWAITING_OAUTH";
|
|
94
|
+
SignUpModalStep["FARCASTER_OAUTH"] = "FARCASTER_OAUTH";
|
|
95
|
+
SignUpModalStep["TELEGRAM_OAUTH"] = "TELEGRAM_OAUTH";
|
|
96
|
+
SignUpModalStep["BIOMETRIC_CREATION"] = "BIOMETRIC_CREATION";
|
|
97
|
+
SignUpModalStep["AWAITING_BIOMETRIC_CREATION"] = "AWAITING_BIOMETRIC_CREATION";
|
|
98
|
+
SignUpModalStep["PASSWORD_CREATION"] = "PASSWORD_CREATION";
|
|
99
|
+
SignUpModalStep["AWAITING_PASSWORD_CREATION"] = "AWAITING_PASSWORD_CREATION";
|
|
100
|
+
SignUpModalStep["AWAITING_WALLET_CREATION"] = "AWAITING_WALLET_CREATION";
|
|
101
|
+
SignUpModalStep["WALLET_CREATION_DONE"] = "WALLET_CREATION_DONE";
|
|
102
|
+
SignUpModalStep["SECRET"] = "SECRET";
|
|
103
|
+
SignUpModalStep["SETUP_2FA"] = "SETUP_2FA";
|
|
104
|
+
SignUpModalStep["VERIFY_2FA"] = "VERIFY_2FA";
|
|
105
|
+
SignUpModalStep["TWO_FACTOR_DONE"] = "TWO_FACTOR_DONE";
|
|
106
|
+
SignUpModalStep["ADD_FUNDS_BUY"] = "ADD_FUNDS_BUY";
|
|
107
|
+
SignUpModalStep["ADD_FUNDS_RECEIVE"] = "ADD_FUNDS_RECEIVE";
|
|
108
|
+
SignUpModalStep["ADD_FUNDS_WITHDRAW"] = "ADD_FUNDS_WITHDRAW";
|
|
109
|
+
SignUpModalStep["ADD_FUNDS_AWAITING"] = "ADD_FUNDS_AWAITING";
|
|
110
|
+
SignUpModalStep["ADD_FUNDS_SUCCESS"] = "ADD_FUNDS_SUCCESS";
|
|
111
|
+
SignUpModalStep["ADD_FUNDS_FAILURE"] = "ADD_FUNDS_FAILURE";
|
|
112
|
+
})(SignUpModalStep || (SignUpModalStep = {}));
|
|
113
|
+
export const SignUpPreviousStep = {
|
|
114
|
+
[SignUpModalStep.AUTH_MAIN]: undefined,
|
|
115
|
+
[SignUpModalStep.AUTH_MORE]: ModalStep.AUTH_MAIN,
|
|
116
|
+
[SignUpModalStep.EX_WALLET_MORE]: ModalStep.AUTH_MAIN,
|
|
117
|
+
[SignUpModalStep.EX_WALLET_SELECTED]: ModalStep.AUTH_MAIN,
|
|
118
|
+
[SignUpModalStep.VERIFICATIONS]: ModalStep.AUTH_MAIN,
|
|
119
|
+
[SignUpModalStep.AWAITING_OAUTH]: ModalStep.AUTH_MAIN,
|
|
120
|
+
[SignUpModalStep.TELEGRAM_OAUTH]: ModalStep.AUTH_MAIN,
|
|
121
|
+
[SignUpModalStep.FARCASTER_OAUTH]: ModalStep.AUTH_MAIN,
|
|
122
|
+
[SignUpModalStep.BIOMETRIC_CREATION]: ModalStep.AUTH_MAIN,
|
|
123
|
+
[SignUpModalStep.AWAITING_BIOMETRIC_CREATION]: ModalStep.BIOMETRIC_CREATION,
|
|
124
|
+
[SignUpModalStep.PASSWORD_CREATION]: ModalStep.BIOMETRIC_CREATION,
|
|
125
|
+
[SignUpModalStep.AWAITING_PASSWORD_CREATION]: ModalStep.BIOMETRIC_CREATION,
|
|
126
|
+
[SignUpModalStep.AWAITING_WALLET_CREATION]: undefined,
|
|
127
|
+
[SignUpModalStep.WALLET_CREATION_DONE]: undefined,
|
|
128
|
+
[SignUpModalStep.SECRET]: undefined,
|
|
129
|
+
[SignUpModalStep.SETUP_2FA]: ModalStep.SECRET,
|
|
130
|
+
[SignUpModalStep.VERIFY_2FA]: ModalStep.SETUP_2FA,
|
|
131
|
+
[SignUpModalStep.TWO_FACTOR_DONE]: undefined,
|
|
132
|
+
[SignUpModalStep.ADD_FUNDS_BUY]: ModalStep.WALLET_CREATION_DONE,
|
|
133
|
+
[SignUpModalStep.ADD_FUNDS_RECEIVE]: ModalStep.WALLET_CREATION_DONE,
|
|
134
|
+
[SignUpModalStep.ADD_FUNDS_WITHDRAW]: ModalStep.WALLET_CREATION_DONE,
|
|
135
|
+
[SignUpModalStep.ADD_FUNDS_AWAITING]: ModalStep.ADD_FUNDS_BUY,
|
|
136
|
+
[SignUpModalStep.ADD_FUNDS_SUCCESS]: undefined,
|
|
137
|
+
[SignUpModalStep.ADD_FUNDS_FAILURE]: undefined,
|
|
138
|
+
};
|
|
139
|
+
var LoginModalStep;
|
|
140
|
+
(function (LoginModalStep) {
|
|
141
|
+
LoginModalStep["AUTH_MAIN"] = "AUTH_MAIN";
|
|
142
|
+
LoginModalStep["AUTH_MORE"] = "AUTH_MORE";
|
|
143
|
+
LoginModalStep["EX_WALLET_MORE"] = "EX_WALLET_MORE";
|
|
144
|
+
LoginModalStep["EX_WALLET_SELECTED"] = "EX_WALLET_SELECTED";
|
|
145
|
+
LoginModalStep["AWAITING_OAUTH"] = "AWAITING_OAUTH";
|
|
146
|
+
LoginModalStep["FARCASTER_OAUTH"] = "FARCASTER_OAUTH";
|
|
147
|
+
LoginModalStep["TELEGRAM_OAUTH"] = "TELEGRAM_OAUTH";
|
|
148
|
+
LoginModalStep["BIOMETRIC_LOGIN"] = "BIOMETRIC_LOGIN";
|
|
149
|
+
LoginModalStep["AWAITING_BIOMETRIC_LOGIN"] = "AWAITING_BIOMETRIC_LOGIN";
|
|
150
|
+
LoginModalStep["AWAITING_PASSWORD_LOGIN"] = "AWAITING_PASSWORD_LOGIN";
|
|
151
|
+
LoginModalStep["AWAITING_WALLET_CREATION"] = "AWAITING_WALLET_CREATION";
|
|
152
|
+
LoginModalStep["WALLET_CREATION_DONE"] = "WALLET_CREATION_DONE";
|
|
153
|
+
LoginModalStep["SECRET"] = "SECRET";
|
|
154
|
+
LoginModalStep["SETUP_2FA"] = "SETUP_2FA";
|
|
155
|
+
LoginModalStep["VERIFY_2FA"] = "VERIFY_2FA";
|
|
156
|
+
LoginModalStep["TWO_FACTOR_DONE"] = "TWO_FACTOR_DONE";
|
|
157
|
+
LoginModalStep["LOGIN_DONE"] = "LOGIN_DONE";
|
|
158
|
+
LoginModalStep["ADD_FUNDS_BUY"] = "ADD_FUNDS_BUY";
|
|
159
|
+
LoginModalStep["ADD_FUNDS_RECEIVE"] = "ADD_FUNDS_RECEIVE";
|
|
160
|
+
LoginModalStep["ADD_FUNDS_WITHDRAW"] = "ADD_FUNDS_WITHDRAW";
|
|
161
|
+
LoginModalStep["ADD_FUNDS_AWAITING"] = "ADD_FUNDS_AWAITING";
|
|
162
|
+
LoginModalStep["ADD_FUNDS_SUCCESS"] = "ADD_FUNDS_SUCCESS";
|
|
163
|
+
LoginModalStep["ADD_FUNDS_FAILURE"] = "ADD_FUNDS_FAILURE";
|
|
164
|
+
})(LoginModalStep || (LoginModalStep = {}));
|
|
165
|
+
export const LoginPreviousStep = {
|
|
166
|
+
[LoginModalStep.AUTH_MAIN]: undefined,
|
|
167
|
+
[LoginModalStep.AUTH_MORE]: ModalStep.AUTH_MAIN,
|
|
168
|
+
[SignUpModalStep.EX_WALLET_MORE]: ModalStep.AUTH_MAIN,
|
|
169
|
+
[SignUpModalStep.EX_WALLET_SELECTED]: ModalStep.AUTH_MAIN,
|
|
170
|
+
[LoginModalStep.TELEGRAM_OAUTH]: ModalStep.AUTH_MAIN,
|
|
171
|
+
[LoginModalStep.AWAITING_OAUTH]: ModalStep.AUTH_MAIN,
|
|
172
|
+
[LoginModalStep.FARCASTER_OAUTH]: ModalStep.AUTH_MAIN,
|
|
173
|
+
[LoginModalStep.BIOMETRIC_LOGIN]: ModalStep.AUTH_MAIN,
|
|
174
|
+
[LoginModalStep.AWAITING_BIOMETRIC_LOGIN]: ModalStep.BIOMETRIC_LOGIN,
|
|
175
|
+
[LoginModalStep.AWAITING_PASSWORD_LOGIN]: ModalStep.BIOMETRIC_LOGIN,
|
|
176
|
+
[LoginModalStep.AWAITING_WALLET_CREATION]: undefined,
|
|
177
|
+
[LoginModalStep.WALLET_CREATION_DONE]: undefined,
|
|
178
|
+
[LoginModalStep.SECRET]: undefined,
|
|
179
|
+
[LoginModalStep.SETUP_2FA]: undefined,
|
|
180
|
+
[LoginModalStep.VERIFY_2FA]: ModalStep.SETUP_2FA,
|
|
181
|
+
[LoginModalStep.TWO_FACTOR_DONE]: undefined,
|
|
182
|
+
[LoginModalStep.LOGIN_DONE]: undefined,
|
|
183
|
+
[LoginModalStep.ADD_FUNDS_BUY]: ModalStep.LOGIN_DONE,
|
|
184
|
+
[LoginModalStep.ADD_FUNDS_RECEIVE]: ModalStep.LOGIN_DONE,
|
|
185
|
+
[LoginModalStep.ADD_FUNDS_WITHDRAW]: ModalStep.LOGIN_DONE,
|
|
186
|
+
[LoginModalStep.ADD_FUNDS_AWAITING]: ModalStep.ADD_FUNDS_BUY,
|
|
187
|
+
[LoginModalStep.ADD_FUNDS_SUCCESS]: undefined,
|
|
188
|
+
[LoginModalStep.ADD_FUNDS_FAILURE]: undefined,
|
|
189
|
+
};
|
|
190
|
+
export const getStepHasFooter = (step) => {
|
|
191
|
+
switch (step) {
|
|
192
|
+
case ModalStep.AUTH_MAIN:
|
|
193
|
+
case ModalStep.AUTH_MORE:
|
|
194
|
+
case ModalStep.EX_WALLET_MORE:
|
|
195
|
+
case ModalStep.EX_WALLET_SELECTED:
|
|
196
|
+
case ModalStep.VERIFICATIONS: {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
default: {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
export function getAddFundsStep(currentTab) {
|
|
205
|
+
switch (currentTab) {
|
|
206
|
+
case 'BUY':
|
|
207
|
+
return ModalStep.ADD_FUNDS_BUY;
|
|
208
|
+
case 'RECEIVE':
|
|
209
|
+
return ModalStep.ADD_FUNDS_RECEIVE;
|
|
210
|
+
case 'WITHDRAW':
|
|
211
|
+
default:
|
|
212
|
+
return ModalStep.ADD_FUNDS_WITHDRAW;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
export const IFrameSteps = [ModalStep.PASSWORD_CREATION];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getNetworkName } from '../constants/constants.js';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
export const formatNetworkList = (networks) => {
|
|
4
|
+
return networks.length === 1
|
|
5
|
+
? getNetworkName(networks[0])
|
|
6
|
+
: `${networks
|
|
7
|
+
.map(id => getNetworkName(id))
|
|
8
|
+
.slice(0, -1)
|
|
9
|
+
.join(', ')}${networks.length > 2 ? ',' : ''} and ${getNetworkName(networks[networks.length - 1])}`;
|
|
10
|
+
};
|
|
11
|
+
export const formatWalletCreatedDate = (date) => `${format(new Date(date), 'M/d/y')}`;
|
|
12
|
+
export const camelToSnakeCase = (str) => str.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class OnRampConfigError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(`On-ramp configuration error: ${message}.`);
|
|
4
|
+
this.name = 'OnRampConfigError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
function checkHasProviders({ providers }) {
|
|
8
|
+
if (!providers || providers.length < 1) {
|
|
9
|
+
throw new OnRampConfigError('No providers are configured');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function checkDuplicateProviders({ providers }) {
|
|
13
|
+
providers.forEach((id, index) => {
|
|
14
|
+
if (providers.findIndex(p => p === id) !== index) {
|
|
15
|
+
throw new OnRampConfigError(`Provider ${id} is configured more than once`);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function validateOnRampConfig(obj) {
|
|
20
|
+
if (!obj) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
checkHasProviders(obj);
|
|
24
|
+
checkDuplicateProviders(obj);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@getpara/react-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/index.js",
|
|
9
|
+
"./styles.css": "./dist/modal/css/modal.css"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"*.css"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@getpara/react-common": "0.1.0",
|
|
16
|
+
"@getpara/react-components": "0.1.0",
|
|
17
|
+
"@getpara/web-sdk": "0.1.0",
|
|
18
|
+
"date-fns": "^3.6.0",
|
|
19
|
+
"detect-browser": "^5.3.0",
|
|
20
|
+
"framer-motion": "11.3.28",
|
|
21
|
+
"libphonenumber-js": "^1.11.1",
|
|
22
|
+
"styled-components": "^6.1.8",
|
|
23
|
+
"zustand": "^4.5.2"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "rm -rf dist && tsc && yarn post-build",
|
|
27
|
+
"post-build": "./scripts/post-build.sh",
|
|
28
|
+
"test": "vitest run --coverage"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@testing-library/dom": "^10.1.0",
|
|
32
|
+
"@testing-library/react": "^16.0.0",
|
|
33
|
+
"@types/chrome": "^0.0.237",
|
|
34
|
+
"@types/react": "^18.0.31",
|
|
35
|
+
"@types/react-dom": "^18.2.7",
|
|
36
|
+
"typescript": "^5.4.3"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "*",
|
|
40
|
+
"react-dom": "*"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"package.json",
|
|
45
|
+
"styles.css"
|
|
46
|
+
],
|
|
47
|
+
"resolutions": {
|
|
48
|
+
"styled-components": "^6"
|
|
49
|
+
},
|
|
50
|
+
"gitHead": "625aaa94001a5461dcde8d6775c3b73f3862c76c"
|
|
51
|
+
}
|