@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.
Files changed (205) hide show
  1. package/dist/cli/cli.mjs +43 -0
  2. package/dist/index.js +6428 -5
  3. package/dist/index.js.br +0 -0
  4. package/dist/index.js.gz +0 -0
  5. package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
  6. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
  7. package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
  8. package/dist/modal/components/Controls/Selects.d.ts +1 -1
  9. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
  10. package/dist/modal/components/Footer/Footer.d.ts +1 -1
  11. package/dist/modal/components/WalletCard/WalletCard.d.ts +2 -2
  12. package/dist/modal/components/common.d.ts +2 -2
  13. package/dist/modal/index.d.ts +0 -1
  14. package/dist/modal/stores/index.d.ts +0 -1
  15. package/dist/modal/stores/modal/useModalStore.d.ts +6 -3
  16. package/dist/modal/types/modalProps.d.ts +1 -27
  17. package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
  18. package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
  19. package/dist/modal/utils/openPopup.d.ts +1 -1
  20. package/dist/provider/ParaProvider.d.ts +3 -1
  21. package/dist/provider/actions/checkIfUserExists.d.ts +2 -7
  22. package/dist/provider/actions/createUser.d.ts +2 -10
  23. package/dist/provider/actions/getAccount.d.ts +9 -6
  24. package/dist/provider/actions/getWallet.d.ts +1 -1
  25. package/dist/provider/actions/logout.d.ts +4 -1
  26. package/dist/provider/actions/waitForLoginAndSetup.d.ts +1 -1
  27. package/dist/provider/components/CosmosWalletWrapper.d.ts +12 -0
  28. package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
  29. package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
  30. package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
  31. package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
  32. package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
  33. package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
  34. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +10 -0
  35. package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
  36. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +6 -0
  37. package/dist/provider/hooks/mutations/useLogout.d.ts +3 -2
  38. package/dist/provider/hooks/queries/useAccount.d.ts +4 -3
  39. package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
  40. package/dist/provider/hooks/utils/useClient.d.ts +1 -1
  41. package/dist/provider/hooks/utils/useWalletState.d.ts +2 -2
  42. package/dist/provider/index.d.ts +1 -0
  43. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
  44. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
  45. package/dist/{modal/providers/ExternalWalletContext.d.ts → provider/providers/ExternalWalletProvider.d.ts} +20 -29
  46. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
  47. package/dist/provider/stores/getters.d.ts +3 -3
  48. package/dist/provider/stores/setters.d.ts +1 -0
  49. package/dist/provider/stores/slices/config.d.ts +3 -0
  50. package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
  51. package/dist/provider/stores/slices/index.d.ts +1 -0
  52. package/dist/provider/stores/types.d.ts +43 -1
  53. package/dist/provider/types/externalWalletProviders.d.ts +12 -0
  54. package/dist/provider/types/provider.d.ts +115 -16
  55. package/dist/provider/types/utils.d.ts +1 -0
  56. package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
  57. package/package.json +33 -9
  58. package/dist/modal/ParaModal.js +0 -281
  59. package/dist/modal/components/Account/Account.js +0 -60
  60. package/dist/modal/components/AddFunds/AddFunds.js +0 -147
  61. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -65
  62. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -26
  63. package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -2
  64. package/dist/modal/components/AddFunds/index.js +0 -3
  65. package/dist/modal/components/AuthInput/AuthInput.js +0 -221
  66. package/dist/modal/components/AuthInput/countryCodes.js +0 -40
  67. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -23
  68. package/dist/modal/components/AuthInput/phoneMasks.js +0 -247
  69. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -21
  70. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -89
  71. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -28
  72. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -7
  73. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -5
  74. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -7
  75. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -18
  76. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -17
  77. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -131
  78. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -26
  79. package/dist/modal/components/Body/Body.js +0 -232
  80. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -77
  81. package/dist/modal/components/ChainSwitch/config.js +0 -11
  82. package/dist/modal/components/Controls/Controls.js +0 -54
  83. package/dist/modal/components/Controls/Selects.js +0 -159
  84. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -116
  85. package/dist/modal/components/ExternalWalletStep/config.js +0 -11
  86. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -142
  87. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -7
  88. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -119
  89. package/dist/modal/components/Footer/Footer.js +0 -71
  90. package/dist/modal/components/Header/Header.js +0 -24
  91. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -42
  92. package/dist/modal/components/Hero/Hero.js +0 -119
  93. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -41
  94. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -19
  95. package/dist/modal/components/ModalContent/ModalContent.js +0 -282
  96. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
  97. package/dist/modal/components/OAuth/OAuth.js +0 -125
  98. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -133
  99. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -10
  100. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -72
  101. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -67
  102. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -105
  103. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -78
  104. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -8
  105. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -135
  106. package/dist/modal/components/Waiting/Waiting.js +0 -6
  107. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -29
  108. package/dist/modal/components/WalletCard/WalletCard.js +0 -93
  109. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -50
  110. package/dist/modal/components/common.js +0 -67
  111. package/dist/modal/components/index.js +0 -1
  112. package/dist/modal/constants/constants.js +0 -93
  113. package/dist/modal/constants/defaults.js +0 -5
  114. package/dist/modal/constants/oAuthLogos.js +0 -18
  115. package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
  116. package/dist/modal/hooks/useActiveWallet.js +0 -11
  117. package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
  118. package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -46
  119. package/dist/modal/hooks/useGoBack.js +0 -34
  120. package/dist/modal/index.js +0 -9
  121. package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -29
  122. package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -18
  123. package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -33
  124. package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -22
  125. package/dist/modal/providers/ExternalWalletContext.js +0 -253
  126. package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -21
  127. package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -12
  128. package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
  129. package/dist/modal/stores/externalWalletProvider/actions.js +0 -5
  130. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -20
  131. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -13
  132. package/dist/modal/stores/index.js +0 -3
  133. package/dist/modal/stores/modal/actions.js +0 -64
  134. package/dist/modal/stores/modal/useModalStore.js +0 -41
  135. package/dist/modal/stores/para/actions.d.ts +0 -3
  136. package/dist/modal/stores/para/actions.js +0 -5
  137. package/dist/modal/stores/para/useParaStore.d.ts +0 -10
  138. package/dist/modal/stores/para/useParaStore.js +0 -3
  139. package/dist/modal/stores/theme/actions.d.ts +0 -3
  140. package/dist/modal/stores/theme/actions.js +0 -24
  141. package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
  142. package/dist/modal/stores/theme/useThemeStore.js +0 -14
  143. package/dist/modal/stores/userInfo/actions.js +0 -34
  144. package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -9
  145. package/dist/modal/types/commonTypes.js +0 -1
  146. package/dist/modal/types/externalWallets.js +0 -21
  147. package/dist/modal/types/modalProps.js +0 -7
  148. package/dist/modal/utils/authLayoutHelpers.js +0 -2
  149. package/dist/modal/utils/getMailtoLink.js +0 -5
  150. package/dist/modal/utils/getTileButtonFlex.js +0 -15
  151. package/dist/modal/utils/isPasskeySupported.js +0 -10
  152. package/dist/modal/utils/openPopup.js +0 -55
  153. package/dist/modal/utils/routeMobileExternalWallet.js +0 -35
  154. package/dist/modal/utils/steps.js +0 -215
  155. package/dist/modal/utils/stringFormatters.js +0 -12
  156. package/dist/modal/utils/validateOnRampConfig.js +0 -26
  157. package/dist/provider/ParaProvider.js +0 -17
  158. package/dist/provider/actions/checkIfUserExists.js +0 -26
  159. package/dist/provider/actions/createUser.js +0 -30
  160. package/dist/provider/actions/getAccount.js +0 -24
  161. package/dist/provider/actions/getWallet.js +0 -16
  162. package/dist/provider/actions/initiateLogin.js +0 -23
  163. package/dist/provider/actions/keepSessionAlive.js +0 -23
  164. package/dist/provider/actions/logout.js +0 -20
  165. package/dist/provider/actions/signMessage.js +0 -23
  166. package/dist/provider/actions/signTransaction.js +0 -23
  167. package/dist/provider/actions/waitForAccountCreation.js +0 -24
  168. package/dist/provider/actions/waitForLoginAndSetup.js +0 -27
  169. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -24
  170. package/dist/provider/hooks/index.js +0 -3
  171. package/dist/provider/hooks/mutations/index.js +0 -10
  172. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
  173. package/dist/provider/hooks/mutations/useCreateUser.js +0 -23
  174. package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
  175. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -23
  176. package/dist/provider/hooks/mutations/useLogout.js +0 -33
  177. package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
  178. package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
  179. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
  180. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
  181. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
  182. package/dist/provider/hooks/queries/index.js +0 -2
  183. package/dist/provider/hooks/queries/useAccount.js +0 -23
  184. package/dist/provider/hooks/queries/useWallet.js +0 -24
  185. package/dist/provider/hooks/utils/index.js +0 -3
  186. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -79
  187. package/dist/provider/hooks/utils/useClient.js +0 -8
  188. package/dist/provider/hooks/utils/useEventListeners.js +0 -87
  189. package/dist/provider/hooks/utils/useInternalClient.js +0 -9
  190. package/dist/provider/hooks/utils/useModal.js +0 -15
  191. package/dist/provider/hooks/utils/useWalletState.js +0 -33
  192. package/dist/provider/index.js +0 -3
  193. package/dist/provider/stores/getters.js +0 -5
  194. package/dist/provider/stores/slices/client.js +0 -4
  195. package/dist/provider/stores/slices/index.js +0 -3
  196. package/dist/provider/stores/slices/modal.js +0 -4
  197. package/dist/provider/stores/slices/wallet.js +0 -6
  198. package/dist/provider/stores/types.js +0 -1
  199. package/dist/provider/stores/useStore.js +0 -14
  200. package/dist/provider/types/provider.js +0 -1
  201. package/dist/provider/types/query.js +0 -1
  202. package/dist/provider/types/utils.js +0 -1
  203. package/dist/provider/utils/renameMutations.js +0 -19
  204. /package/dist/{modal/css → css}/modal.css +0 -0
  205. /package/dist/{modal/public → public}/Inter-VariableFont_slnt,wght.ttf +0 -0
@@ -1,282 +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 { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
12
- import { entityToWallet, OnRampProvider, OnRampAsset, Network, EnabledFlow, } from '@getpara/web-sdk';
13
- import { useModalStore, useUserInfoStore } from '../../stores/index.js';
14
- import { ModalStep } from '../../utils/steps.js';
15
- import { Body } from '../Body/Body.js';
16
- import { Footer } from '../Footer/Footer.js';
17
- import { DEFAULTS } from '../../constants/defaults.js';
18
- import { useGoBack } from '../../hooks/useGoBack.js';
19
- import { openPopup } from '../../utils/openPopup.js';
20
- import { useInternalClient } from '../../../provider/hooks/utils/useInternalClient.js';
21
- import { useEmbeddedExternalConnection } from '../../hooks/useEmbeddedExternalConnection.js';
22
- function isRampConfig(config) {
23
- return 'hostApiKey' in config;
24
- }
25
- const AssetNetworks = {
26
- [OnRampAsset.SOLANA]: Network.SOLANA,
27
- [OnRampAsset.ATOM]: Network.COSMOS,
28
- [OnRampAsset.CELO]: Network.CELO,
29
- [OnRampAsset.POLYGON]: Network.POLYGON,
30
- };
31
- const AssetMap = {
32
- SOLANA: OnRampAsset.SOLANA,
33
- SOL: OnRampAsset.SOLANA,
34
- ATOM: OnRampAsset.ATOM,
35
- CELO: OnRampAsset.CELO,
36
- POLYGON: OnRampAsset.POLYGON,
37
- MATIC: OnRampAsset.POLYGON,
38
- USDC: OnRampAsset.USDC,
39
- ETH: OnRampAsset.ETHEREUM,
40
- ETHEREUM: OnRampAsset.ETHEREUM,
41
- };
42
- export const ModalContent = forwardRef(({ onRampConfig: propsOnRampConfig, twoFactorAuthEnabled = false, recoverySecretStepEnabled = false, oAuthMethods, disableEmailLogin, disablePhoneLogin, onClose, onRampTestMode, loginTransitionOverride, createWalletOverride, }, ref) => {
43
- const para = useInternalClient();
44
- const currentStep = useModalStore(state => state.step);
45
- const webAuthURLForLogin = useModalStore(state => state.webAuthURLForLogin);
46
- const webAuthURLForCreate = useModalStore(state => state.webAuthURLForCreate);
47
- const passwordUrlForLogin = useModalStore(state => state.passwordUrlForLogin);
48
- const isLogin = useModalStore(state => state.isLogin());
49
- const popupWindow = useModalStore(state => state.popupWindow);
50
- const onRampConfig = useModalStore(state => state.onRampConfig);
51
- const setStep = useModalStore(state => state.setStep);
52
- const setBiometricLocationHints = useModalStore(state => state.setBiometricLocationHints);
53
- const setWebAuthURLForLogin = useModalStore(state => state.setWebAuthURLForLogin);
54
- const setWebAuthURLForCreate = useModalStore(state => state.setWebAuthURLForCreate);
55
- const setPopupWindow = useModalStore(state => state.setPopupWindow);
56
- const setIFrameUrl = useModalStore(state => state.setIFrameUrl);
57
- const setPasswordUrlForLogin = useModalStore(state => state.setPasswordUrlForLogin);
58
- const setSupportedAuthMethods = useModalStore(state => state.setSupportedAuthMethods);
59
- const setOnRampConfig = useModalStore(state => state.setOnRampConfig);
60
- const accountAddFundTab = useModalStore(state => state.accountAddFundTab);
61
- const setAccountAddFundTab = useModalStore(state => state.setAccountAddFundTab);
62
- const setRecoveryShare = useUserInfoStore(state => state.setRecoveryShare);
63
- const goBack = useGoBack();
64
- const loginTimeout = useRef();
65
- const createAccountTimeout = useRef();
66
- const [walletCreationInProgress, setWalletCreationInProgress] = useState(false);
67
- const connectEmbeddedToExternalConnectors = useEmbeddedExternalConnection();
68
- useImperativeHandle(ref, () => {
69
- return {
70
- handleModalClose() {
71
- handleClose();
72
- },
73
- };
74
- }, []);
75
- const is2FASetup = () => __awaiter(void 0, void 0, void 0, function* () {
76
- if (!twoFactorAuthEnabled) {
77
- return true;
78
- }
79
- try {
80
- const { isSetup } = yield para.check2FAStatus();
81
- return isSetup;
82
- }
83
- catch (error) {
84
- console.error('An error occurred while checking 2FA:', error);
85
- return false;
86
- }
87
- });
88
- function awaitLoginTransition() {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- // TODO: migrate to useWaitForLoginAndSetup hook once we force the use of the CapsuleProvider
91
- const { isComplete, isError, needsWallet } = yield para.waitForLoginAndSetup({ popupWindow });
92
- setPopupWindow(undefined);
93
- if (isError) {
94
- goBack();
95
- return;
96
- }
97
- if (isComplete) {
98
- setWebAuthURLForLogin('');
99
- setPasswordUrlForLogin('');
100
- setSupportedAuthMethods(new Set());
101
- setBiometricLocationHints();
102
- if (needsWallet) {
103
- setStep(ModalStep.AWAITING_WALLET_CREATION);
104
- }
105
- else {
106
- yield connectEmbeddedToExternalConnectors();
107
- if (yield is2FASetup()) {
108
- setStep(ModalStep.LOGIN_DONE);
109
- }
110
- else {
111
- setStep(ModalStep.SETUP_2FA);
112
- }
113
- }
114
- }
115
- });
116
- }
117
- function awaitWalletCreationTransition() {
118
- return __awaiter(this, void 0, void 0, function* () {
119
- // TODO: migrate to useWaitForAccountCreation hook once we force the use of the ParaProvider
120
- const isComplete = yield para.waitForAccountCreation();
121
- if (isComplete) {
122
- setWebAuthURLForCreate('');
123
- setIFrameUrl('');
124
- setStep(ModalStep.AWAITING_WALLET_CREATION);
125
- }
126
- });
127
- }
128
- // generate/claim wallet once we know it's account creation
129
- useEffect(() => {
130
- if (currentStep !== ModalStep.AWAITING_WALLET_CREATION || walletCreationInProgress) {
131
- return;
132
- }
133
- function genWallet() {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- setWalletCreationInProgress(true);
136
- let recoverySecret, walletIds;
137
- if (!createWalletOverride) {
138
- // TODO: migrate to useWaitForPasskeyAndCreateWallet hook once we force the use of the ParaProvider
139
- const created = yield para.waitForPasskeyAndCreateWallet();
140
- recoverySecret = created.recoverySecret;
141
- walletIds = created.walletIds;
142
- }
143
- else {
144
- const created = yield createWalletOverride(para);
145
- const fetchedWallets = (yield para.fetchWallets()).filter(wallet => !!wallet.address);
146
- const newWallets = {};
147
- for (const wallet of fetchedWallets) {
148
- newWallets[wallet.id] = Object.assign(Object.assign({}, entityToWallet(wallet)), { signer: '' });
149
- }
150
- para.setWallets(newWallets);
151
- recoverySecret = created.recoverySecret;
152
- walletIds = created.walletIds;
153
- }
154
- yield para.setCurrentWalletIds(walletIds);
155
- if (recoverySecretStepEnabled) {
156
- setRecoveryShare(recoverySecret);
157
- }
158
- setWalletCreationInProgress(false);
159
- if (!recoverySecret || !recoverySecretStepEnabled) {
160
- setStep(ModalStep.WALLET_CREATION_DONE);
161
- }
162
- else {
163
- setStep(ModalStep.SECRET);
164
- }
165
- });
166
- }
167
- genWallet();
168
- }, [isLogin, currentStep]);
169
- function createAccountWithPassword() {
170
- return __awaiter(this, void 0, void 0, function* () {
171
- setStep(ModalStep.PASSWORD_CREATION);
172
- });
173
- }
174
- function createAccountWithPasskey() {
175
- return __awaiter(this, void 0, void 0, function* () {
176
- clearTimeout(createAccountTimeout.current);
177
- createAccountTimeout.current = window.setTimeout(awaitWalletCreationTransition, DEFAULTS.POLLING_INTERVAL_MS);
178
- openPopup(webAuthURLForCreate, 'ParaPasskey', 'CREATE_PASSKEY');
179
- setStep(ModalStep.AWAITING_BIOMETRIC_CREATION);
180
- });
181
- }
182
- // wait for login auth to do post login setup
183
- useEffect(() => {
184
- if (webAuthURLForLogin || passwordUrlForLogin) {
185
- if (loginTransitionOverride) {
186
- function loginOverride() {
187
- return __awaiter(this, void 0, void 0, function* () {
188
- yield loginTransitionOverride(para);
189
- setWebAuthURLForLogin('');
190
- setPasswordUrlForLogin('');
191
- setBiometricLocationHints();
192
- yield connectEmbeddedToExternalConnectors();
193
- if (yield is2FASetup()) {
194
- setStep(ModalStep.LOGIN_DONE);
195
- }
196
- else {
197
- setStep(ModalStep.SETUP_2FA);
198
- }
199
- });
200
- }
201
- loginOverride();
202
- return;
203
- }
204
- loginTimeout.current = window.setTimeout(awaitLoginTransition, DEFAULTS.LOGGIN_POLLING_DELAY_MS);
205
- }
206
- return () => {
207
- window.clearTimeout(loginTimeout.current);
208
- para.exitLogin();
209
- };
210
- }, [webAuthURLForLogin, passwordUrlForLogin, popupWindow]);
211
- const handleClose = () => {
212
- onClose();
213
- };
214
- useEffect(() => {
215
- if (![ModalStep.BIOMETRIC_CREATION, ModalStep.AWAITING_BIOMETRIC_CREATION].includes(currentStep)) {
216
- para.exitAccountCreation();
217
- }
218
- if (![ModalStep.BIOMETRIC_LOGIN, ModalStep.AWAITING_BIOMETRIC_LOGIN].includes(currentStep)) {
219
- para.exitLogin();
220
- }
221
- if (![ModalStep.AWAITING_OAUTH, ModalStep.FARCASTER_OAUTH].includes(currentStep)) {
222
- para.exitOAuth();
223
- }
224
- if (currentStep === ModalStep.PASSWORD_CREATION) {
225
- clearTimeout(createAccountTimeout.current);
226
- createAccountTimeout.current = window.setTimeout(awaitWalletCreationTransition, DEFAULTS.POLLING_INTERVAL_MS);
227
- }
228
- }, [currentStep]);
229
- useEffect(() => {
230
- if (!onRampConfig) {
231
- para.ctx.client
232
- .getOnRampConfig()
233
- .then(res => {
234
- var _a, _b;
235
- let newOnRampConfig;
236
- if (!!propsOnRampConfig) {
237
- const { enabledFlows, network, asset, providers, testMode } = propsOnRampConfig;
238
- const rampConfig = providers.find(config => isRampConfig(config));
239
- newOnRampConfig = {
240
- isBuyEnabled: !enabledFlows || enabledFlows.some(str => EnabledFlow[str] === EnabledFlow.BUY),
241
- isReceiveEnabled: !enabledFlows || enabledFlows.some(str => EnabledFlow[str] === EnabledFlow.RECEIVE),
242
- isWithdrawEnabled: !enabledFlows || enabledFlows.some(str => EnabledFlow[str] === EnabledFlow.WITHDRAW),
243
- allowedAssets: network
244
- ? { [Network[network]]: asset ? [AssetMap[asset]] : true }
245
- : asset
246
- ? { [(_a = AssetNetworks[AssetMap[asset]]) !== null && _a !== void 0 ? _a : Network.ETHEREUM]: [AssetMap[asset]] }
247
- : res.allowedAssets,
248
- assetInfo: res.assetInfo,
249
- providers: providers.map(({ id }) => OnRampProvider[id]),
250
- rampApiKey: (_b = rampConfig === null || rampConfig === void 0 ? void 0 : rampConfig.hostApiKey) !== null && _b !== void 0 ? _b : res.rampApiKey,
251
- testMode: testMode !== null && testMode !== void 0 ? testMode : onRampTestMode,
252
- };
253
- }
254
- else {
255
- newOnRampConfig = Object.assign(Object.assign({}, res), { testMode: onRampTestMode });
256
- }
257
- setOnRampConfig(newOnRampConfig);
258
- if (!accountAddFundTab) {
259
- setAccountAddFundTab(newOnRampConfig.isBuyEnabled
260
- ? EnabledFlow.BUY
261
- : newOnRampConfig.isReceiveEnabled
262
- ? EnabledFlow.RECEIVE
263
- : newOnRampConfig.isWithdrawEnabled
264
- ? EnabledFlow.WITHDRAW
265
- : undefined);
266
- }
267
- })
268
- .catch();
269
- }
270
- }, []);
271
- useEffect(() => {
272
- if (!!onRampConfig) {
273
- setOnRampConfig(Object.assign(Object.assign({}, onRampConfig), { testMode: onRampTestMode }));
274
- }
275
- }, [onRampTestMode]);
276
- useEffect(() => {
277
- return () => {
278
- para.exitLoops();
279
- };
280
- }, []);
281
- return (_jsxs(_Fragment, { children: [_jsx(Body, { oAuthMethods: oAuthMethods, twoFactorAuthEnabled: twoFactorAuthEnabled, disableEmailLogin: disableEmailLogin, disablePhoneLogin: disablePhoneLogin, onClose: handleClose, createAccountWithPasskey: createAccountWithPasskey, createAccountWithPassword: createAccountWithPassword }), _jsx(Footer, {})] }));
282
- });
@@ -1,81 +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 { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
- import { useEffect, useState } from 'react';
12
- import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from '@getpara/react-components';
13
- import { CenteredText, Heading, InnerStepContainer, QRContainer, StepContainer } from '../common.js';
14
- import { useModalStore, useThemeStore, useUserInfoStore } from '../../stores/index.js';
15
- import { ModalStep } from '../../utils/steps.js';
16
- import { AuthMethod, isMobile } from '@getpara/web-sdk';
17
- import { useInternalClient } from '../../../provider/hooks/utils/useInternalClient.js';
18
- const FarcasterOAuthStep = () => {
19
- const setAuthInfo = useUserInfoStore(state => state.setAuthInfo);
20
- const setStep = useModalStore(state => state.setStep);
21
- const setWebAuthURLForCreate = useModalStore(state => state.setWebAuthURLForCreate);
22
- const setIFrameUrl = useModalStore(state => state.setIFrameUrl);
23
- const setIsIFrameReady = useModalStore(state => state.setIsIFrameReady);
24
- const isIFrameReady = useModalStore(state => state.isIFrameReady);
25
- const setSupportedAuthMethods = useModalStore(state => state.setSupportedAuthMethods);
26
- const setBiometricLocationHints = useModalStore(state => state.setBiometricLocationHints);
27
- const para = useInternalClient();
28
- const setFlow = useModalStore(state => state.setFlow);
29
- const farcasterConnectUri = useModalStore(state => state.farcasterConnectUri);
30
- const setFarcasterConnectUri = useModalStore(state => state.setFarcasterConnectUri);
31
- const theme = useThemeStore(state => state.theme);
32
- const [shouldRouteToStep, setShouldRouteToStep] = useState();
33
- useEffect(() => {
34
- if (!!shouldRouteToStep && isIFrameReady) {
35
- // Using a small timeout here to fully ensure the iframe is loaded before triggering any animation
36
- setTimeout(() => {
37
- setStep(shouldRouteToStep);
38
- }, 200);
39
- }
40
- }, [shouldRouteToStep, isIFrameReady]);
41
- useEffect(() => {
42
- if (farcasterConnectUri) {
43
- const pollStatus = () => __awaiter(void 0, void 0, void 0, function* () {
44
- const { userExists, username, pfpUrl } = yield para.waitForFarcasterStatus();
45
- setAuthInfo({ farcasterUsername: username, pfpUrl });
46
- if (userExists) {
47
- const supportedAuthMethods = yield para.initiateUserLoginV2({ farcasterUsername: username });
48
- if (supportedAuthMethods.size > 0) {
49
- setSupportedAuthMethods(supportedAuthMethods);
50
- const biometricLocationHints = supportedAuthMethods.has(AuthMethod.PASSKEY)
51
- ? yield para.getUserBiometricLocationHints()
52
- : [];
53
- setFlow('login');
54
- setStep(ModalStep.BIOMETRIC_LOGIN);
55
- setBiometricLocationHints(biometricLocationHints);
56
- return;
57
- }
58
- }
59
- const supportedCreateAuthMethods = yield para.getSupportedCreateAuthMethods();
60
- setIsIFrameReady(false);
61
- setFlow('signUp');
62
- const supportsPasskey = supportedCreateAuthMethods.has(AuthMethod.PASSKEY);
63
- if (supportsPasskey) {
64
- setWebAuthURLForCreate(yield para.shortenLoginLink(yield para.getSetUpBiometricsURL({ authType: 'farcaster' })));
65
- setStep(ModalStep.BIOMETRIC_CREATION);
66
- }
67
- if (supportedCreateAuthMethods.has(AuthMethod.PASSWORD)) {
68
- setIFrameUrl(yield para.shortenLoginLink(yield para.getSetupPasswordURL({ authType: 'farcaster', theme })));
69
- setShouldRouteToStep(supportsPasskey ? ModalStep.BIOMETRIC_CREATION : ModalStep.PASSWORD_CREATION);
70
- }
71
- return;
72
- });
73
- pollStatus();
74
- return () => {
75
- setFarcasterConnectUri(undefined);
76
- };
77
- }
78
- }, [farcasterConnectUri]);
79
- return (_jsx(StepContainer, { "$wide": true, children: isMobile() ? (_jsxs(InnerStepContainer, { children: [_jsx(CpslText, { weight: "medium", color: "secondary", children: `Don’t have Farcaster` }), _jsxs(CpslButton, { as: "a", href: 'https://link.warpcast.com/download-qr', target: "_blank", variant: "secondary", children: [_jsx(CpslIcon, { slot: "start", icon: "linkExternal" }), `Get Farcaster`] })] })) : (_jsxs(_Fragment, { children: [_jsx(Heading, { variant: "headingS", weight: "bold", children: "Sign in using Farcaster" }), _jsxs(InnerStepContainer, { children: [_jsx(CenteredText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Scan the QR code with your phone's camera to proceed." }), _jsx(QRContainer, { children: !farcasterConnectUri ? _jsx(CpslSpinner, { size: 100 }) : _jsx(CpslQrCode, { url: farcasterConnectUri }) })] })] })) }));
80
- };
81
- export default FarcasterOAuthStep;
@@ -1,125 +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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { AuthMethod, OAuthMethod } from '@getpara/web-sdk';
12
- import { styled } from 'styled-components';
13
- import { useModalStore, useUserInfoStore } from '../../stores/index.js';
14
- import { ModalStep } from '../../utils/steps.js';
15
- import { openPopup } from '../../utils/openPopup.js';
16
- import { useThemeStore } from '../../stores/theme/useThemeStore.js';
17
- import { getTileButtonFlex } from '../../utils/getTileButtonFlex.js';
18
- import { StyledCpslTileButton } from '../common.js';
19
- import { brandedOAuthLogos, oAuthLogos } from '../../constants/oAuthLogos.js';
20
- import { useEffect } from 'react';
21
- import { routeMobileExternalWallet } from '../../utils/routeMobileExternalWallet.js';
22
- import { useGoBack } from '../../hooks/useGoBack.js';
23
- import { useInternalClient } from '../../../provider/hooks/utils/useInternalClient.js';
24
- const HAS_MORE_LENGTH = 3;
25
- export const OAuth = ({ methods }) => {
26
- const goBack = useGoBack();
27
- const oAuthLogoVariant = useThemeStore(state => state.oAuthLogoVariant);
28
- const isDark = useThemeStore(state => state.isDark);
29
- const para = useInternalClient();
30
- const popupWindow = useModalStore(state => state.popupWindow);
31
- const setFlow = useModalStore(state => state.setFlow);
32
- const setStep = useModalStore(state => state.setStep);
33
- const setPopupWindow = useModalStore(state => state.setPopupWindow);
34
- const setAuthInfo = useUserInfoStore(state => state.setAuthInfo);
35
- const setSupportedAuthMethods = useModalStore(state => state.setSupportedAuthMethods);
36
- const setBiometricLocationHints = useModalStore(state => state.setBiometricLocationHints);
37
- const setFarcasterConnectUri = useModalStore(state => state.setFarcasterConnectUri);
38
- const farcasterConnectUri = useModalStore(state => state.farcasterConnectUri);
39
- const showAll = useModalStore(state => state.step === ModalStep.AUTH_MORE);
40
- useEffect(() => {
41
- const initializeFarcaster = () => __awaiter(void 0, void 0, void 0, function* () {
42
- if (!methods.includes(OAuthMethod.FARCASTER)) {
43
- return;
44
- }
45
- const connectUri = yield para.getFarcasterConnectURL();
46
- setFarcasterConnectUri(connectUri);
47
- });
48
- initializeFarcaster();
49
- }, []);
50
- const hasMore = methods.length > HAS_MORE_LENGTH;
51
- const methodsToShow = showAll || !hasMore ? methods : methods.slice(0, HAS_MORE_LENGTH - 1);
52
- const handleShowAll = () => {
53
- setStep(ModalStep.AUTH_MORE);
54
- };
55
- const handleMethodClick = (method) => () => __awaiter(void 0, void 0, void 0, function* () {
56
- if (!!popupWindow) {
57
- return;
58
- }
59
- switch (method) {
60
- case OAuthMethod.FARCASTER:
61
- if (!farcasterConnectUri) {
62
- return;
63
- }
64
- routeMobileExternalWallet(farcasterConnectUri);
65
- setStep(ModalStep.FARCASTER_OAUTH);
66
- return;
67
- case OAuthMethod.TELEGRAM:
68
- setStep(ModalStep.TELEGRAM_OAUTH);
69
- break;
70
- default: {
71
- setStep(ModalStep.AWAITING_OAUTH);
72
- const oAuthURL = yield para.getOAuthURL({ method });
73
- const oAuthWindow = openPopup(oAuthURL, `${method}AuthPopup`, 'OAUTH');
74
- setPopupWindow(oAuthWindow);
75
- const { email, isError, userExists } = yield para.waitForOAuth({ popupWindow: oAuthWindow });
76
- setPopupWindow(undefined);
77
- if (isError) {
78
- goBack();
79
- return;
80
- }
81
- if (!email) {
82
- setStep(ModalStep.AUTH_MAIN);
83
- throw new Error('email is required');
84
- }
85
- setAuthInfo({ email });
86
- if (userExists) {
87
- const supportedAuthMethods = yield para.initiateUserLoginV2({ email });
88
- if (supportedAuthMethods.size === 0) {
89
- setFlow('signUp');
90
- setStep(ModalStep.BIOMETRIC_CREATION);
91
- }
92
- else {
93
- const biometricLocationHints = supportedAuthMethods.has(AuthMethod.PASSKEY)
94
- ? yield para.getUserBiometricLocationHints()
95
- : [];
96
- setFlow('login');
97
- setStep(ModalStep.BIOMETRIC_LOGIN);
98
- setSupportedAuthMethods(supportedAuthMethods);
99
- setBiometricLocationHints(biometricLocationHints);
100
- return;
101
- }
102
- }
103
- yield para.createUser({ email });
104
- setFlow('signUp');
105
- setStep(ModalStep.VERIFICATIONS);
106
- return;
107
- }
108
- }
109
- });
110
- const useBrandedLogos = oAuthLogoVariant === 'default';
111
- const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== 'dark';
112
- const showMoreButton = !showAll && hasMore;
113
- return (_jsxs(OAuthContainer, { children: [methodsToShow.map((method, index) => (_jsx(OAuthButton, { "$isDark": useDarkLogos, icon: useBrandedLogos ? brandedOAuthLogos[method] : oAuthLogos[method], onClick: handleMethodClick(method), "$index": index, "$totalItems": showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length }, method))), showMoreButton && (_jsx(OAuthButton, { "$isDark": useDarkLogos, icon: "moreLoginOptions", onClick: handleShowAll, "$index": HAS_MORE_LENGTH - 1, "$totalItems": HAS_MORE_LENGTH }))] }));
114
- };
115
- const OAuthContainer = styled.div `
116
- display: flex;
117
- justify-content: center;
118
- gap: 8px;
119
- flex-wrap: wrap;
120
- `;
121
- const OAuthButton = styled(StyledCpslTileButton) `
122
- flex: ${({ $index, $totalItems }) => getTileButtonFlex($index, $totalItems)};
123
-
124
- --button-icon-color: ${({ $isDark }) => ($isDark ? 'white' : 'black')};
125
- `;
@@ -1,133 +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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { AuthMethod, OAuthMethod } from '@getpara/web-sdk';
12
- import { useModalStore, useThemeStore, useUserInfoStore } from '../../stores/index.js';
13
- import styled from 'styled-components';
14
- import { useEffect, useRef, useState } from 'react';
15
- import { HeroSpinner } from '@getpara/react-common';
16
- import { ModalStep } from '../../utils/steps.js';
17
- import { CpslSpinner } from '@getpara/react-components';
18
- import { useInternalClient } from '../../../provider/hooks/utils/useInternalClient.js';
19
- export function TelegramOAuthStep() {
20
- const iframe = useRef();
21
- const para = useInternalClient();
22
- const setFlow = useModalStore(state => state.setFlow);
23
- const setStep = useModalStore(state => state.setStep);
24
- const setAuthInfo = useUserInfoStore(state => state.setAuthInfo);
25
- const setBiometricLocationHints = useModalStore(state => state.setBiometricLocationHints);
26
- const setSupportedAuthMethods = useModalStore(state => state.setSupportedAuthMethods);
27
- const setIFrameUrl = useModalStore(state => state.setIFrameUrl);
28
- const setIsIFrameReady = useModalStore(state => state.setIsIFrameReady);
29
- const isIFrameReady = useModalStore(state => state.isIFrameReady);
30
- const setWebAuthURLForCreate = useModalStore(state => state.setWebAuthURLForCreate);
31
- const theme = useThemeStore(state => state.theme);
32
- const [url, setUrl] = useState(undefined);
33
- const [isWaiting, setIsWaiting] = useState(false);
34
- const [isLoaded, setIsLoaded] = useState(false);
35
- const [isError, setIsError] = useState(false);
36
- const [shouldRouteToStep, setShouldRouteToStep] = useState();
37
- useEffect(() => {
38
- if (!!shouldRouteToStep && isIFrameReady) {
39
- // Using a small timeout here to fully ensure the iframe is loaded before triggering any animation
40
- setTimeout(() => {
41
- setStep(shouldRouteToStep);
42
- }, 200);
43
- }
44
- }, [shouldRouteToStep, isIFrameReady]);
45
- useEffect(() => {
46
- if (!url) {
47
- para.getOAuthURL({ method: OAuthMethod.TELEGRAM }).then(url => {
48
- setUrl(url);
49
- });
50
- }
51
- }, [url]);
52
- useEffect(() => {
53
- const updateState = (event) => __awaiter(this, void 0, void 0, function* () {
54
- switch (event.data.type) {
55
- case 'TELEGRAM_LOGIN':
56
- setIsWaiting(true);
57
- setIsError(false);
58
- break;
59
- case 'TELEGRAM_FAILED':
60
- setIsWaiting(false);
61
- setIsError(true);
62
- break;
63
- case 'TELEGRAM_SUCCESS':
64
- if (!!event.data.payload) {
65
- const authObject = event.data.payload;
66
- const result = yield para.verifyTelegram(authObject);
67
- if (!result.isValid) {
68
- setIsWaiting(false);
69
- setIsError(true);
70
- iframe.current && iframe.current.contentWindow.postMessage({ type: 'TELEGRAM_FAILED' }, '*');
71
- return;
72
- }
73
- const { telegramUserId, isNewUser, supportedAuthMethods, biometricHints } = result;
74
- setAuthInfo({
75
- telegramUserId,
76
- pfpUrl: authObject.photo_url,
77
- displayName: authObject.username
78
- ? `@${authObject.username}`
79
- : authObject.first_name
80
- ? `${authObject.first_name}${authObject.last_name ? ` ${authObject.last_name}` : ''}`
81
- : `Telegram User @${telegramUserId}`,
82
- });
83
- if (isNewUser) {
84
- const supportedCreateAuthMethods = yield para.getSupportedCreateAuthMethods();
85
- setIsIFrameReady(false);
86
- setFlow('signUp');
87
- const supportsPasskey = supportedCreateAuthMethods.has(AuthMethod.PASSKEY);
88
- if (supportsPasskey) {
89
- setWebAuthURLForCreate(yield para.shortenLoginLink(yield para.getSetUpBiometricsURL({ authType: 'telegram' })));
90
- setStep(ModalStep.BIOMETRIC_CREATION);
91
- }
92
- if (supportedCreateAuthMethods.has(AuthMethod.PASSWORD)) {
93
- setIFrameUrl(yield para.shortenLoginLink(yield para.getSetupPasswordURL({ authType: 'telegram', theme })));
94
- setShouldRouteToStep(supportsPasskey ? ModalStep.BIOMETRIC_CREATION : ModalStep.PASSWORD_CREATION);
95
- }
96
- }
97
- else {
98
- setFlow('login');
99
- supportedAuthMethods && setSupportedAuthMethods(new Set(supportedAuthMethods));
100
- biometricHints && setBiometricLocationHints(biometricHints);
101
- setStep(ModalStep.BIOMETRIC_LOGIN);
102
- }
103
- }
104
- break;
105
- }
106
- });
107
- window === null || window === void 0 ? void 0 : window.addEventListener('message', updateState, false);
108
- return () => {
109
- window === null || window === void 0 ? void 0 : window.removeEventListener('message', updateState, false);
110
- };
111
- }, []);
112
- return (_jsxs(Container, { children: [_jsx(HeroContainer, { children: _jsx(HeroSpinner, { icon: "telegramBrand", status: isWaiting ? 'loading' : isError ? 'error' : 'inactive', text: isWaiting ? 'Follow the on-screen prompts.' : isError ? 'Login Failed' : undefined }) }), url && (_jsx(IFrame, { ref: iframe, style: { display: isLoaded ? 'block' : 'none' }, src: url, onLoad: () => setIsLoaded(true) })), (!url || !isLoaded) && _jsx(CpslSpinner, {})] }));
113
- }
114
- const Container = styled.div `
115
- display: flex;
116
- flex-direction: column;
117
- align-items: center;
118
- justify-content: center;
119
- width: 100%;
120
- `;
121
- const HeroContainer = styled.div `
122
- display: flex;
123
- min-height: 276px;
124
- flex-direction: column;
125
- align-items: center;
126
- gap: 16px;
127
- flex: 1;
128
- `;
129
- const IFrame = styled.iframe `
130
- width: 100%;
131
- height: 52px;
132
- border: none;
133
- `;
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { OnRampPurchaseStatus } from '@getpara/web-sdk';
3
- import { SpinnerContainer } from '../common.js';
4
- import { ON_RAMP_PROVIDERS } from '../../constants/constants.js';
5
- import { useModalStore } from '../../stores/index.js';
6
- import { CpslSpinner, CpslText } from '@getpara/react-components';
7
- export const AddingFunds = () => {
8
- const onRampPurchase = useModalStore(state => state.onRampPurchase);
9
- return (_jsxs(_Fragment, { children: [_jsx(SpinnerContainer, { children: _jsx(CpslSpinner, { size: 100 }) }), _jsxs(CpslText, { children: ["Follow the prompts presented by", ' ', OnRampPurchaseStatus ? ON_RAMP_PROVIDERS[onRampPurchase.provider].name : 'the provider', "."] })] }));
10
- };