@getpara/react-sdk 1.2.0 → 1.3.1-dev.1
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/cli/cli.mjs +43 -0
- package/dist/index.js +6428 -5
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
- package/dist/modal/components/Controls/Selects.d.ts +1 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
- package/dist/modal/components/Footer/Footer.d.ts +1 -1
- package/dist/modal/components/WalletCard/WalletCard.d.ts +2 -2
- package/dist/modal/components/common.d.ts +2 -2
- package/dist/modal/index.d.ts +0 -1
- package/dist/modal/stores/index.d.ts +0 -1
- package/dist/modal/stores/modal/useModalStore.d.ts +6 -3
- package/dist/modal/types/modalProps.d.ts +1 -27
- package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
- package/dist/modal/utils/openPopup.d.ts +1 -1
- package/dist/provider/ParaProvider.d.ts +3 -1
- package/dist/provider/actions/checkIfUserExists.d.ts +2 -7
- package/dist/provider/actions/createUser.d.ts +2 -10
- package/dist/provider/actions/getAccount.d.ts +9 -6
- package/dist/provider/actions/getWallet.d.ts +1 -1
- package/dist/provider/actions/logout.d.ts +4 -1
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +1 -1
- package/dist/provider/components/CosmosWalletWrapper.d.ts +12 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +10 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +6 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +3 -2
- package/dist/provider/hooks/queries/useAccount.d.ts +4 -3
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/utils/useClient.d.ts +1 -1
- package/dist/provider/hooks/utils/useWalletState.d.ts +2 -2
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/{modal/providers/ExternalWalletContext.d.ts → provider/providers/ExternalWalletProvider.d.ts} +20 -29
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/stores/getters.d.ts +3 -3
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/index.d.ts +1 -0
- package/dist/provider/stores/types.d.ts +43 -1
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/provider.d.ts +115 -16
- package/dist/provider/types/utils.d.ts +1 -0
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/package.json +33 -9
- package/dist/modal/ParaModal.js +0 -281
- package/dist/modal/components/Account/Account.js +0 -60
- package/dist/modal/components/AddFunds/AddFunds.js +0 -147
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -65
- package/dist/modal/components/AddFunds/AddFundsDone.js +0 -26
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -2
- package/dist/modal/components/AddFunds/index.js +0 -3
- package/dist/modal/components/AuthInput/AuthInput.js +0 -221
- package/dist/modal/components/AuthInput/countryCodes.js +0 -40
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -23
- package/dist/modal/components/AuthInput/phoneMasks.js +0 -247
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -21
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -89
- package/dist/modal/components/AuthOptions/AuthOptions.js +0 -28
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -7
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -5
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -7
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -18
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -17
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -131
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -26
- package/dist/modal/components/Body/Body.js +0 -232
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -77
- package/dist/modal/components/ChainSwitch/config.js +0 -11
- package/dist/modal/components/Controls/Controls.js +0 -54
- package/dist/modal/components/Controls/Selects.js +0 -159
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -116
- package/dist/modal/components/ExternalWalletStep/config.js +0 -11
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -142
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -7
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -119
- package/dist/modal/components/Footer/Footer.js +0 -71
- package/dist/modal/components/Header/Header.js +0 -24
- package/dist/modal/components/Header/hooks/useStepTitle.js +0 -42
- package/dist/modal/components/Hero/Hero.js +0 -119
- package/dist/modal/components/IFrameStep/IFrameStep.js +0 -41
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -19
- package/dist/modal/components/ModalContent/ModalContent.js +0 -282
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
- package/dist/modal/components/OAuth/OAuth.js +0 -125
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -133
- package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -10
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -72
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -67
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -105
- package/dist/modal/components/StripeComponents/StripeComponents.js +0 -78
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -8
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -135
- package/dist/modal/components/Waiting/Waiting.js +0 -6
- package/dist/modal/components/WalletCard/PartnerIcon.js +0 -29
- package/dist/modal/components/WalletCard/WalletCard.js +0 -93
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -50
- package/dist/modal/components/common.js +0 -67
- package/dist/modal/components/index.js +0 -1
- package/dist/modal/constants/constants.js +0 -93
- package/dist/modal/constants/defaults.js +0 -5
- package/dist/modal/constants/oAuthLogos.js +0 -18
- package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
- package/dist/modal/hooks/useActiveWallet.js +0 -11
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -46
- package/dist/modal/hooks/useGoBack.js +0 -34
- package/dist/modal/index.js +0 -9
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -29
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -18
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -33
- package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -22
- package/dist/modal/providers/ExternalWalletContext.js +0 -253
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -21
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -12
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
- package/dist/modal/stores/externalWalletProvider/actions.js +0 -5
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -20
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -13
- package/dist/modal/stores/index.js +0 -3
- package/dist/modal/stores/modal/actions.js +0 -64
- package/dist/modal/stores/modal/useModalStore.js +0 -41
- package/dist/modal/stores/para/actions.d.ts +0 -3
- package/dist/modal/stores/para/actions.js +0 -5
- package/dist/modal/stores/para/useParaStore.d.ts +0 -10
- package/dist/modal/stores/para/useParaStore.js +0 -3
- package/dist/modal/stores/theme/actions.d.ts +0 -3
- package/dist/modal/stores/theme/actions.js +0 -24
- package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
- package/dist/modal/stores/theme/useThemeStore.js +0 -14
- package/dist/modal/stores/userInfo/actions.js +0 -34
- package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -9
- package/dist/modal/types/commonTypes.js +0 -1
- package/dist/modal/types/externalWallets.js +0 -21
- package/dist/modal/types/modalProps.js +0 -7
- package/dist/modal/utils/authLayoutHelpers.js +0 -2
- package/dist/modal/utils/getMailtoLink.js +0 -5
- package/dist/modal/utils/getTileButtonFlex.js +0 -15
- package/dist/modal/utils/isPasskeySupported.js +0 -10
- package/dist/modal/utils/openPopup.js +0 -55
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -35
- package/dist/modal/utils/steps.js +0 -215
- package/dist/modal/utils/stringFormatters.js +0 -12
- package/dist/modal/utils/validateOnRampConfig.js +0 -26
- package/dist/provider/ParaProvider.js +0 -17
- package/dist/provider/actions/checkIfUserExists.js +0 -26
- package/dist/provider/actions/createUser.js +0 -30
- package/dist/provider/actions/getAccount.js +0 -24
- package/dist/provider/actions/getWallet.js +0 -16
- package/dist/provider/actions/initiateLogin.js +0 -23
- package/dist/provider/actions/keepSessionAlive.js +0 -23
- package/dist/provider/actions/logout.js +0 -20
- package/dist/provider/actions/signMessage.js +0 -23
- package/dist/provider/actions/signTransaction.js +0 -23
- package/dist/provider/actions/waitForAccountCreation.js +0 -24
- package/dist/provider/actions/waitForLoginAndSetup.js +0 -27
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -24
- package/dist/provider/hooks/index.js +0 -3
- package/dist/provider/hooks/mutations/index.js +0 -10
- package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
- package/dist/provider/hooks/mutations/useCreateUser.js +0 -23
- package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -23
- package/dist/provider/hooks/mutations/useLogout.js +0 -33
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
- package/dist/provider/hooks/queries/index.js +0 -2
- package/dist/provider/hooks/queries/useAccount.js +0 -23
- package/dist/provider/hooks/queries/useWallet.js +0 -24
- package/dist/provider/hooks/utils/index.js +0 -3
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -79
- package/dist/provider/hooks/utils/useClient.js +0 -8
- package/dist/provider/hooks/utils/useEventListeners.js +0 -87
- package/dist/provider/hooks/utils/useInternalClient.js +0 -9
- package/dist/provider/hooks/utils/useModal.js +0 -15
- package/dist/provider/hooks/utils/useWalletState.js +0 -33
- package/dist/provider/index.js +0 -3
- package/dist/provider/stores/getters.js +0 -5
- package/dist/provider/stores/slices/client.js +0 -4
- package/dist/provider/stores/slices/index.js +0 -3
- package/dist/provider/stores/slices/modal.js +0 -4
- package/dist/provider/stores/slices/wallet.js +0 -6
- package/dist/provider/stores/types.js +0 -1
- package/dist/provider/stores/useStore.js +0 -14
- package/dist/provider/types/provider.js +0 -1
- package/dist/provider/types/query.js +0 -1
- package/dist/provider/types/utils.js +0 -1
- package/dist/provider/utils/renameMutations.js +0 -19
- /package/dist/{modal/css → css}/modal.css +0 -0
- /package/dist/{modal/public → public}/Inter-VariableFont_slnt,wght.ttf +0 -0
|
@@ -1,215 +0,0 @@
|
|
|
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];
|
|
@@ -1,12 +0,0 @@
|
|
|
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()}`);
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useStore } from './stores/useStore.js';
|
|
3
|
-
import { useAutoSessionKeepAlive } from './hooks/utils/useAutoSessionKeepAlive.js';
|
|
4
|
-
import { useEventListeners } from './hooks/utils/useEventListeners.js';
|
|
5
|
-
import { ParaInternal } from '@getpara/react-common';
|
|
6
|
-
const DEFAULT_CONFIG = { disableAutoSessionKeepAlive: false };
|
|
7
|
-
export const ParaProvider = ({ children, paraClientConfig, callbacks, config = DEFAULT_CONFIG }) => {
|
|
8
|
-
useEventListeners(callbacks);
|
|
9
|
-
useAutoSessionKeepAlive({ disabled: config.disableAutoSessionKeepAlive });
|
|
10
|
-
const setClient = useStore(state => state.setClient);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
var _a;
|
|
13
|
-
const newClient = (_a = config.paraClientOverride) !== null && _a !== void 0 ? _a : new ParaInternal(paraClientConfig.env, paraClientConfig.apiKey, paraClientConfig.opts);
|
|
14
|
-
setClient(newClient);
|
|
15
|
-
}, [paraClientConfig, config.paraClientOverride]);
|
|
16
|
-
return children;
|
|
17
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { CreateUserType } from './createUser.js';
|
|
11
|
-
export const checkIfUserExists = (para, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
-
if (!para) {
|
|
13
|
-
throw new Error('no para instance');
|
|
14
|
-
}
|
|
15
|
-
if (!args) {
|
|
16
|
-
throw new Error('no valid args passed to checkIfUserExists');
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
return yield (args.type === CreateUserType.EMAIL
|
|
20
|
-
? para.checkIfUserExists({ email: args.identifier })
|
|
21
|
-
: para.checkIfUserExistsByPhone({ phone: args.identifier, countryCode: args.countryCode }));
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
throw new Error(e);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export var CreateUserType;
|
|
11
|
-
(function (CreateUserType) {
|
|
12
|
-
CreateUserType["EMAIL"] = "EMAIL";
|
|
13
|
-
CreateUserType["PHONE"] = "PHONE";
|
|
14
|
-
})(CreateUserType || (CreateUserType = {}));
|
|
15
|
-
export const createUser = (para, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
if (!para) {
|
|
17
|
-
throw new Error('no para instance');
|
|
18
|
-
}
|
|
19
|
-
if (!args) {
|
|
20
|
-
throw new Error('no valid args passed to createUser');
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
yield (args.type === CreateUserType.EMAIL
|
|
24
|
-
? para.createUser({ email: args.identifier })
|
|
25
|
-
: para.createUserByPhone({ phone: args.identifier, countryCode: args.countryCode }));
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
throw new Error(e);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const getAccount = (para) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
const isLoggedIn = yield (para === null || para === void 0 ? void 0 : para.isFullyLoggedIn());
|
|
12
|
-
const resp = {
|
|
13
|
-
isConnected: !!isLoggedIn,
|
|
14
|
-
email: undefined,
|
|
15
|
-
phone: undefined,
|
|
16
|
-
wallets: undefined,
|
|
17
|
-
};
|
|
18
|
-
if (para && resp.isConnected) {
|
|
19
|
-
resp.email = para.getEmail();
|
|
20
|
-
resp.phone = para.getPhoneNumber();
|
|
21
|
-
resp.wallets = para.getWallets();
|
|
22
|
-
}
|
|
23
|
-
return resp;
|
|
24
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const getWallet = (para, selectedWallet) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
const isLoggedIn = yield (para === null || para === void 0 ? void 0 : para.isFullyLoggedIn());
|
|
12
|
-
if (!para || !isLoggedIn) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return para.findWallet(selectedWallet === null || selectedWallet === void 0 ? void 0 : selectedWallet.id, selectedWallet === null || selectedWallet === void 0 ? void 0 : selectedWallet.type);
|
|
16
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const initiateLogin = (para, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
if (!args) {
|
|
15
|
-
throw new Error('no valid args passed to initiateLogin');
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
return yield para.initiateUserLoginV2(args);
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
throw new Error(e);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const keepSessionAlive = (para) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
const resp = yield para.keepSessionAlive();
|
|
16
|
-
if (!resp) {
|
|
17
|
-
throw new Error('session expired');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
throw new Error(e);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const logout = (para) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
yield para.logout();
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
throw new Error(e);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const signMessage = (para, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
if (!args) {
|
|
15
|
-
throw new Error('no valid args passed to signMessage');
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
return yield para.signMessage(args);
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
throw new Error(e);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const signTransaction = (para, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
if (!args) {
|
|
15
|
-
throw new Error('no valid args passed to signTransaction');
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
return yield para.signTransaction(args);
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
throw new Error(e);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const waitForAccountCreation = (para) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
const isComplete = yield para.waitForAccountCreation();
|
|
16
|
-
if (!isComplete) {
|
|
17
|
-
throw new Error('error during waitForAccountCreation');
|
|
18
|
-
}
|
|
19
|
-
return isComplete;
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
throw new Error(e);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const waitForLoginAndSetup = (para, args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
if (!args) {
|
|
15
|
-
throw new Error('no valid args passed to waitForLoginAndSetup');
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
const resp = yield para.waitForLoginAndSetup(args);
|
|
19
|
-
if (resp.isError) {
|
|
20
|
-
throw new Error('error during waitForLoginAndSetup');
|
|
21
|
-
}
|
|
22
|
-
return resp;
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
throw new Error(e);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export const waitForPasskeyAndCreateWallet = (para) => __awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error('no para instance');
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
const resp = yield para.waitForPasskeyAndCreateWallet();
|
|
16
|
-
if (!resp) {
|
|
17
|
-
throw new Error('error during waitForAccountCreation');
|
|
18
|
-
}
|
|
19
|
-
return resp;
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
throw new Error(e);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { useWaitForLoginAndSetup } from './useWaitForLoginAndSetup.js';
|
|
2
|
-
export { useWaitForAccountCreation } from './useWaitForAccountCreation.js';
|
|
3
|
-
export { useWaitForPasskeyAndCreateWallet } from './useWaitForPasskeyAndCreateWallet.js';
|
|
4
|
-
export { useCreateUser } from './useCreateUser.js';
|
|
5
|
-
export { useCheckIfUserExists } from './useCheckIfUserExists.js';
|
|
6
|
-
export { useInitiateLogin } from './useInitiateLogin.js';
|
|
7
|
-
export { useLogout } from './useLogout.js';
|
|
8
|
-
export { useKeepSessionAlive } from './useKeepSessionAlive.js';
|
|
9
|
-
export { useSignMessage } from './useSignMessage.js';
|
|
10
|
-
export { useSignTransaction } from './useSignTransaction.js';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { useMutation } from '@tanstack/react-query';
|
|
11
|
-
import { useClient } from '../index.js';
|
|
12
|
-
import { checkIfUserExists } from '../../actions/checkIfUserExists.js';
|
|
13
|
-
import { renameMutations } from '../../utils/renameMutations.js';
|
|
14
|
-
/**
|
|
15
|
-
* Hook for checking is a user exists
|
|
16
|
-
*/
|
|
17
|
-
export const useCheckIfUserExists = () => {
|
|
18
|
-
const client = useClient();
|
|
19
|
-
const mutation = useMutation({
|
|
20
|
-
mutationFn: (args) => __awaiter(void 0, void 0, void 0, function* () { return yield checkIfUserExists(client, args); }),
|
|
21
|
-
});
|
|
22
|
-
return renameMutations(mutation, 'checkIfUserExists');
|
|
23
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { useMutation } from '@tanstack/react-query';
|
|
11
|
-
import { useClient } from '../index.js';
|
|
12
|
-
import { createUser } from '../../actions/createUser.js';
|
|
13
|
-
import { renameMutations } from '../../utils/renameMutations.js';
|
|
14
|
-
/**
|
|
15
|
-
* Hook for creating a new user
|
|
16
|
-
*/
|
|
17
|
-
export const useCreateUser = () => {
|
|
18
|
-
const client = useClient();
|
|
19
|
-
const mutation = useMutation({
|
|
20
|
-
mutationFn: (args) => __awaiter(void 0, void 0, void 0, function* () { return yield createUser(client, args); }),
|
|
21
|
-
});
|
|
22
|
-
return renameMutations(mutation, 'createUser');
|
|
23
|
-
};
|