@getpara/react-sdk 1.6.1-dev.0 → 1.7.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 (155) hide show
  1. package/dist/{modal/components/AddFunds/MoonPayEmbed.js → MoonPayEmbed-Q2HP2BFI.js} +3 -1
  2. package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
  3. package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
  4. package/dist/chunk-MMUBH76A.js.br +0 -0
  5. package/dist/chunk-MMUBH76A.js.gz +0 -0
  6. package/dist/index.js +6659 -6
  7. package/dist/index.js.br +0 -0
  8. package/dist/index.js.gz +0 -0
  9. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
  10. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +2 -1
  11. package/dist/modal/components/common.d.ts +4 -0
  12. package/dist/modal/index.d.ts +1 -0
  13. package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +13 -0
  14. package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +11 -0
  15. package/dist/modal/providers/ExternalWalletContext.d.ts +15 -1
  16. package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +11 -0
  17. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +2 -0
  18. package/dist/modal/types/commonTypes.d.ts +12 -2
  19. package/dist/modal/types/externalWallets.d.ts +2 -0
  20. package/dist/modal/types/modalProps.d.ts +6 -0
  21. package/dist/modal/utils/steps.d.ts +2 -0
  22. package/dist/provider/utils/constants.d.ts +5 -0
  23. package/package.json +5 -5
  24. package/dist/modal/ParaModal.js +0 -337
  25. package/dist/modal/components/Account/Account.js +0 -69
  26. package/dist/modal/components/AddFunds/AddFunds.js +0 -220
  27. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
  28. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
  29. package/dist/modal/components/AddFunds/index.js +0 -4
  30. package/dist/modal/components/AuthInput/AuthInput.js +0 -283
  31. package/dist/modal/components/AuthInput/countryCodes.js +0 -42
  32. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  33. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  34. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
  35. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
  36. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
  37. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  38. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  39. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  40. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
  41. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -52
  42. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
  43. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  44. package/dist/modal/components/Body/Body.js +0 -304
  45. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
  46. package/dist/modal/components/ChainSwitch/config.js +0 -17
  47. package/dist/modal/components/Controls/Controls.js +0 -74
  48. package/dist/modal/components/Controls/Selects.js +0 -213
  49. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -151
  50. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  51. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
  52. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -123
  53. package/dist/modal/components/Footer/Footer.js +0 -93
  54. package/dist/modal/components/Header/Header.js +0 -43
  55. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
  56. package/dist/modal/components/Hero/Hero.js +0 -122
  57. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
  58. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
  59. package/dist/modal/components/ModalContent/ModalContent.js +0 -310
  60. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
  61. package/dist/modal/components/OAuth/OAuth.js +0 -153
  62. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
  63. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  64. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  65. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
  66. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
  67. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
  68. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
  69. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
  70. package/dist/modal/components/Waiting/Waiting.js +0 -17
  71. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  72. package/dist/modal/components/WalletCard/WalletCard.js +0 -127
  73. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
  74. package/dist/modal/components/common.js +0 -83
  75. package/dist/modal/components/index.js +0 -2
  76. package/dist/modal/constants/constants.js +0 -111
  77. package/dist/modal/constants/defaults.js +0 -10
  78. package/dist/modal/constants/oAuthLogos.js +0 -24
  79. package/dist/modal/hooks/useActiveWallet.js +0 -15
  80. package/dist/modal/hooks/useCreateAccount.js +0 -72
  81. package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -39
  82. package/dist/modal/hooks/useGoBack.js +0 -35
  83. package/dist/modal/hooks/useSetLoginURLs.js +0 -45
  84. package/dist/modal/index.js +0 -32
  85. package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -34
  86. package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -38
  87. package/dist/modal/providers/ExternalWalletContext.js +0 -275
  88. package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -19
  89. package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
  90. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -20
  91. package/dist/modal/stores/index.js +0 -4
  92. package/dist/modal/stores/modal/actions.js +0 -70
  93. package/dist/modal/stores/modal/useModalStore.js +0 -65
  94. package/dist/modal/stores/theme/actions.js +0 -28
  95. package/dist/modal/stores/theme/useThemeStore.js +0 -21
  96. package/dist/modal/stores/userInfo/actions.js +0 -30
  97. package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
  98. package/dist/modal/types/commonTypes.js +0 -1
  99. package/dist/modal/types/externalWallets.js +0 -31
  100. package/dist/modal/types/modalProps.js +0 -12
  101. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  102. package/dist/modal/utils/getMailtoLink.js +0 -10
  103. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  104. package/dist/modal/utils/openPopup.js +0 -60
  105. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  106. package/dist/modal/utils/steps.js +0 -228
  107. package/dist/modal/utils/stringFormatters.js +0 -14
  108. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  109. package/dist/provider/ParaProvider.js +0 -22
  110. package/dist/provider/actions/checkIfUserExists.js +0 -21
  111. package/dist/provider/actions/createUser.js +0 -26
  112. package/dist/provider/actions/getAccount.js +0 -22
  113. package/dist/provider/actions/getWallet.js +0 -14
  114. package/dist/provider/actions/initiateLogin.js +0 -20
  115. package/dist/provider/actions/keepSessionAlive.js +0 -20
  116. package/dist/provider/actions/logout.js +0 -17
  117. package/dist/provider/actions/signMessage.js +0 -20
  118. package/dist/provider/actions/signTransaction.js +0 -20
  119. package/dist/provider/actions/waitForAccountCreation.js +0 -21
  120. package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
  121. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
  122. package/dist/provider/hooks/index.js +0 -4
  123. package/dist/provider/hooks/mutations/index.js +0 -24
  124. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
  125. package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
  126. package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
  127. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
  128. package/dist/provider/hooks/mutations/useLogout.js +0 -30
  129. package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
  130. package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
  131. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
  132. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
  133. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
  134. package/dist/provider/hooks/queries/index.js +0 -8
  135. package/dist/provider/hooks/queries/useAccount.js +0 -21
  136. package/dist/provider/hooks/queries/useWallet.js +0 -22
  137. package/dist/provider/hooks/utils/index.js +0 -10
  138. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  139. package/dist/provider/hooks/utils/useClient.js +0 -10
  140. package/dist/provider/hooks/utils/useEventListeners.js +0 -105
  141. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  142. package/dist/provider/hooks/utils/useModal.js +0 -17
  143. package/dist/provider/hooks/utils/useWalletState.js +0 -33
  144. package/dist/provider/index.js +0 -8
  145. package/dist/provider/stores/getters.js +0 -13
  146. package/dist/provider/stores/slices/client.js +0 -9
  147. package/dist/provider/stores/slices/index.js +0 -4
  148. package/dist/provider/stores/slices/modal.js +0 -9
  149. package/dist/provider/stores/slices/wallet.js +0 -11
  150. package/dist/provider/stores/types.js +0 -1
  151. package/dist/provider/stores/useStore.js +0 -27
  152. package/dist/provider/types/provider.js +0 -1
  153. package/dist/provider/types/query.js +0 -1
  154. package/dist/provider/types/utils.js +0 -1
  155. package/dist/provider/utils/renameMutations.js +0 -16
@@ -1,127 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import styled from "styled-components";
5
- import { useModalStore, useThemeStore } from "../../stores/index.js";
6
- import { CpslButton, CpslIdenticon, CpslText } from "@getpara/react-components";
7
- import { truncateAddress } from "@getpara/web-sdk";
8
- import { ModalStep } from "../../utils/steps.js";
9
- import { useWalletState } from "../../../provider/index.js";
10
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
11
- const ExternalWalletCard = ({ address, showAddFunds }) => {
12
- var _a;
13
- const para = useInternalClient();
14
- const wallet = para.externalWallets[address];
15
- if (!wallet) {
16
- return null;
17
- }
18
- return /* @__PURE__ */ jsx(
19
- SharedWalletCard,
20
- {
21
- address: (_a = wallet.ensName) != null ? _a : truncateAddress(wallet.address, wallet.type),
22
- identiconHash: para.getIdenticonHash(wallet.id, wallet.type),
23
- showAddFunds
24
- }
25
- );
26
- };
27
- const WalletCard = ({ id, type, showAddFunds }) => {
28
- var _a, _b;
29
- const para = useInternalClient();
30
- const appName = useThemeStore((state) => state.appName);
31
- const wallet = para.findWallet(id, type);
32
- if (!wallet) {
33
- return null;
34
- }
35
- const address = para.getDisplayAddress(wallet.id, { addressType: type });
36
- return /* @__PURE__ */ jsx(
37
- SharedWalletCard,
38
- {
39
- id: wallet.id,
40
- type: wallet.type,
41
- address: (_a = wallet.ensName) != null ? _a : truncateAddress(address, type, { prefix: para.cosmosPrefix }),
42
- name: (_b = wallet.name) != null ? _b : `${appName ? `${appName} ` : ""}Wallet`,
43
- identiconHash: para.getIdenticonHash(wallet.id, type),
44
- showAddFunds
45
- }
46
- );
47
- };
48
- const SharedWalletCard = ({ address, name, identiconHash, showAddFunds, id, type }) => {
49
- const onRampConfig = useModalStore((state) => state.onRampConfig);
50
- const { setSelectedWallet } = useWalletState();
51
- const setStep = useModalStore((state) => state.setStep);
52
- const isAddFundsEnabled = onRampConfig.isBuyEnabled || onRampConfig.isReceiveEnabled;
53
- const handleAddFundsClick = () => {
54
- if (id && type) {
55
- setSelectedWallet({ id, type });
56
- isAddFundsEnabled && setStep(onRampConfig.isBuyEnabled ? ModalStep.ADD_FUNDS_BUY : ModalStep.ADD_FUNDS_RECEIVE);
57
- }
58
- };
59
- return /* @__PURE__ */ jsxs(Container, { children: [
60
- /* @__PURE__ */ jsxs(InnerContainer, { children: [
61
- /* @__PURE__ */ jsx(CpslIdenticon, { size: "48px", hash: identiconHash }),
62
- /* @__PURE__ */ jsxs(WalletNameContainer, { children: [
63
- !!name && /* @__PURE__ */ jsx(Name, { color: "contrast", variant: "bodyL", weight: "semiBold", children: name }),
64
- /* @__PURE__ */ jsx(Name, { color: "secondary", variant: "bodyS", weight: "medium", children: address })
65
- ] })
66
- ] }),
67
- showAddFunds && isAddFundsEnabled && /* @__PURE__ */ jsx(AddFundsButton, { onClick: handleAddFundsClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "contrast", weight: "medium", children: "Add Funds" }) })
68
- ] });
69
- };
70
- const WalletCards = styled.div`
71
- display: flex;
72
- flex-direction: column;
73
- gap: 8px;
74
- width: 100%;
75
- `;
76
- const Container = styled.div`
77
- width: 100%;
78
- padding: 24px;
79
- display: flex;
80
- justify-content: space-between;
81
- align-items: center;
82
- gap: 16px;
83
- background-color: var(--cpsl-color-background-8);
84
- border-radius: 16px;
85
- `;
86
- const InnerContainer = styled.div`
87
- display: flex;
88
- justify-content: flex-start;
89
- gap: 8px;
90
- align-items: center;
91
- overflow: hidden;
92
- `;
93
- const WalletNameContainer = styled.div`
94
- flex: 1;
95
- display: flex;
96
- flex-direction: column;
97
- gap: 4px;
98
- align-items: flex-start;
99
- justify-content: center;
100
- overflow: hidden;
101
- `;
102
- const Name = styled(CpslText)`
103
- width: 100%;
104
- &::part(text-element) {
105
- line-height: 100%;
106
- text-overflow: ellipsis;
107
- overflow: hidden;
108
- white-space: nowrap;
109
- }
110
- `;
111
- const AddFundsButton = styled(CpslButton)`
112
- --button-primary-background-color: var(--cpsl-color-card-surface);
113
- --button-primary-hover-background-color: var(--cpsl-color-background-4);
114
- --button-primary-color: var(--cpsl-color-text-contrast);
115
- --button-primary-hover-color: var(--cpsl-color-text-contrast);
116
- --button-primary-active-color: var(--cpsl-color-text-contrast);
117
- --button-padding-start: 8px;
118
- --button-padding-end: 8px;
119
- --button-padding-top: 8px;
120
- --button-padding-bottom: 8px;
121
- --button-border-radius: 8px;
122
- `;
123
- export {
124
- ExternalWalletCard,
125
- WalletCard,
126
- WalletCards
127
- };
@@ -1,52 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { CpslButton, CpslText } from "@getpara/react-components";
7
- import { StepContainer, InnerStepContainer, HeroIcon } from "../common.js";
8
- import { useModalStore, useThemeStore } from "../../stores/index.js";
9
- import { ModalStep } from "../../utils/steps.js";
10
- import { WalletCard, WalletCards } from "../WalletCard/WalletCard.js";
11
- import styled from "styled-components";
12
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
13
- const WalletCreationDoneStep = ({ twoFactorAuthEnabled, onClose }) => {
14
- const hideWallets = useThemeStore((state) => state.hideWallets);
15
- const setStep = useModalStore((state) => state.setStep);
16
- const isLogin = useModalStore((state) => state.isLogin());
17
- const onRampConfig = useModalStore((state) => state.onRampConfig);
18
- const para = useInternalClient();
19
- const isOnRampConfigured = (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isWithdrawEnabled);
20
- const handleNext = () => __async(void 0, null, function* () {
21
- if (isLogin) {
22
- if (!twoFactorAuthEnabled) {
23
- setStep(ModalStep.LOGIN_DONE);
24
- return;
25
- }
26
- const is2FAComplete = yield para.check2FAStatus();
27
- setStep(is2FAComplete ? ModalStep.LOGIN_DONE : ModalStep.SETUP_2FA);
28
- } else {
29
- if (twoFactorAuthEnabled) {
30
- setStep(ModalStep.SETUP_2FA);
31
- } else {
32
- onClose();
33
- }
34
- }
35
- });
36
- return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
37
- /* @__PURE__ */ jsx(CardContainer, { children: hideWallets ? /* @__PURE__ */ jsxs(Fragment, { children: [
38
- /* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
39
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "secondary", weight: "medium", style: { marginTop: "16px" }, children: "Your account has been created." })
40
- ] }) : /* @__PURE__ */ jsx(WalletCards, { children: para.currentWalletIdsArray.map(([id, type]) => {
41
- return /* @__PURE__ */ jsx(WalletCard, { id, type, showAddFunds: isOnRampConfigured }, id);
42
- }) }) }),
43
- /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleNext, children: twoFactorAuthEnabled ? "Continue" : "Done" }) })
44
- ] });
45
- };
46
- const CardContainer = styled(InnerStepContainer)`
47
- min-height: 196px;
48
- justify-content: center;
49
- `;
50
- export {
51
- WalletCreationDoneStep
52
- };
@@ -1,83 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- import { CpslIcon, CpslInput, CpslText, CpslTileButton } from "@getpara/react-components";
4
- import { styled } from "styled-components";
5
- const SpinnerContainer = styled.div`
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- `;
10
- const QRContainer = styled.div`
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- width: 286px;
15
- height: 286px;
16
- `;
17
- const InfoBoxContent = styled.div`
18
- display: flex;
19
- flex-direction: column;
20
- gap: 8px;
21
- `;
22
- const InfoBoxHeader = styled.div`
23
- display: flex;
24
- align-items: center;
25
- gap: 4px;
26
-
27
- cpsl-icon {
28
- --height: 20px;
29
- --width: 20px;
30
- }
31
- `;
32
- const FilledDisabledInput = styled(CpslInput)`
33
- --container-border-color: var(--cpsl-color-input-border-placeholder);
34
- --container-background-color: var(--cpsl-color-background-0);
35
- --input-background-color: transparent;
36
- --input-font-weight: 500;
37
- --input-color: var(--cpsl-color-text-secondary);
38
- `;
39
- const FullWidthFilledDisabledInput = styled(FilledDisabledInput)`
40
- width: 100%;
41
- `;
42
- const CenteredText = styled(CpslText)`
43
- width: 100%;
44
- text-align: center;
45
- `;
46
- const InnerStepContainer = styled.div`
47
- width: 100%;
48
- height: 100%;
49
- align-self: center;
50
- display: flex;
51
- flex-direction: column;
52
- align-items: center;
53
- gap: 8px;
54
- `;
55
- const StepContainer = styled(InnerStepContainer)`
56
- gap: ${({ $wide }) => $wide ? "32px" : "24px"};
57
- `;
58
- const Heading = styled(CenteredText)``;
59
- const StyledCpslTileButton = styled(CpslTileButton)`
60
- --button-width: 100%;
61
- --button-height: 87px;
62
- --button-icon-height: 32px;
63
- --button-icon-width: 32px;
64
- `;
65
- const HeroIcon = styled(CpslIcon)`
66
- --height: 80px;
67
- --width: 80px;
68
- --icon-color: var(--cpsl-color-text-primary);
69
- `;
70
- export {
71
- CenteredText,
72
- FilledDisabledInput,
73
- FullWidthFilledDisabledInput,
74
- Heading,
75
- HeroIcon,
76
- InfoBoxContent,
77
- InfoBoxHeader,
78
- InnerStepContainer,
79
- QRContainer,
80
- SpinnerContainer,
81
- StepContainer,
82
- StyledCpslTileButton
83
- };
@@ -1,2 +0,0 @@
1
- "use client";
2
- export * from "./ModalContent/ModalContent.js";
@@ -1,111 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- import { Network, OnRampAsset, OnRampMethod, OnRampProvider } from "@getpara/core-sdk";
4
- const PARA_CONNECT = "https://connect.getpara.com/";
5
- const PARA_TERMS_AND_CONDITIONS = "https://getpara.com/terms";
6
- const ON_RAMP_PROVIDERS = {
7
- [OnRampProvider.STRIPE]: {
8
- name: "Stripe",
9
- feeLower: 0.99,
10
- feeUpper: 4.49,
11
- methods: [OnRampMethod.ACH, OnRampMethod.DEBIT, OnRampMethod.CREDIT],
12
- icon: "stripeBrand",
13
- backgroundColors: ["#6772E5", "#808AF4"]
14
- },
15
- [OnRampProvider.RAMP]: {
16
- name: "Ramp",
17
- feeLower: 0.99,
18
- feeUpper: 4.49,
19
- methods: [OnRampMethod.ACH, OnRampMethod.DEBIT, OnRampMethod.CREDIT],
20
- icon: "rampNetworkBrand",
21
- backgroundColors: ["#21BF73", "#3AE492"]
22
- },
23
- [OnRampProvider.MOONPAY]: {
24
- name: "MoonPay",
25
- feeLower: 1,
26
- feeUpper: 4.5,
27
- methods: [OnRampMethod.ACH, OnRampMethod.DEBIT, OnRampMethod.CREDIT],
28
- icon: "moonpayBrand",
29
- backgroundColors: ["#7715F5", "#9647fd"]
30
- }
31
- };
32
- const NETWORKS = {
33
- [Network.ETHEREUM]: { name: "Ethereum", icon: "ethereum" },
34
- [Network.SEPOLIA]: { name: "Sepolia", icon: "ethereum" },
35
- [Network.ARBITRUM]: { name: "Arbitrum", icon: "arbitrumBrand" },
36
- [Network.BASE]: { name: "Base", icon: "baseBrand" },
37
- [Network.OPTIMISM]: { name: "Optimism", icon: "optimismBrand" },
38
- [Network.POLYGON]: { name: "Polygon", icon: "polygonBrand" },
39
- [Network.SOLANA]: { name: "Solana", icon: "solana" },
40
- [Network.COSMOS]: { name: "Cosmos", icon: "cosmos" },
41
- [Network.CELO]: { name: "Celo", icon: "celoBrand" },
42
- [Network.NOBLE]: { name: "Noble", icon: "nobleBrand" }
43
- };
44
- const ON_RAMP_ASSETS = {
45
- [OnRampAsset.ETHEREUM]: { name: "Ethereum", code: "ETH", icon: "ethereum" },
46
- [OnRampAsset.USDC]: { name: "USDC", code: "USDC", icon: "usdcBrand" },
47
- [OnRampAsset.POLYGON]: { name: "Polygon", code: "MATIC", icon: "polygonBrand" },
48
- [OnRampAsset.SOLANA]: { name: "Solana", code: "SOL", icon: "solana" },
49
- [OnRampAsset.ATOM]: { name: "Atom", code: "ATOM", icon: "cosmos" },
50
- [OnRampAsset.CELO]: { name: "Celo", code: "CELO", icon: "celoBrand" },
51
- [OnRampAsset.TETHER]: { name: "Tether", code: "USDT", icon: "tetherBrand" },
52
- [OnRampAsset.CUSD]: { name: "Celo Dollar", code: "CUSD", icon: "celoBrand" },
53
- [OnRampAsset.CEUR]: { name: "Celo Euro", code: "CEUR", icon: "celoBrand" },
54
- [OnRampAsset.CREAL]: { name: "Celo Real", code: "CREAL", icon: "celoBrand" }
55
- };
56
- function getNetworkName(str) {
57
- var _a, _b;
58
- return (_b = (_a = NETWORKS[str]) == null ? void 0 : _a.name) != null ? _b : `${str[0]}${str.slice(1).toLowerCase()}`;
59
- }
60
- function getNetworkIcon(str) {
61
- var _a, _b;
62
- return (_b = (_a = NETWORKS[str]) == null ? void 0 : _a.icon) != null ? _b : "globe";
63
- }
64
- function getAssetName(str) {
65
- var _a, _b;
66
- return (_b = (_a = ON_RAMP_ASSETS[str]) == null ? void 0 : _a.code) != null ? _b : str;
67
- }
68
- function getAssetIcon(str) {
69
- var _a, _b;
70
- return (_b = (_a = ON_RAMP_ASSETS[str]) == null ? void 0 : _a.icon) != null ? _b : "emptyCircle";
71
- }
72
- const MOBILE_SIZE = 480;
73
- const NETWORK_NOT_SUPPORTED_ERROR = "network not supported";
74
- const EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
75
- const BODY_MOTION_VARIANTS = {
76
- enter: (direction) => {
77
- return {
78
- scale: direction > 0 ? 0.9 : 1.1,
79
- opacity: 0
80
- };
81
- },
82
- center: {
83
- scale: 1,
84
- opacity: 1
85
- },
86
- exit: (direction) => {
87
- return {
88
- scale: direction < 0 ? 0.9 : 1.1,
89
- opacity: 0
90
- };
91
- }
92
- };
93
- const BODY_TRANSITION = {
94
- duration: 0.2
95
- };
96
- export {
97
- BODY_MOTION_VARIANTS,
98
- BODY_TRANSITION,
99
- EMAIL_REGEX,
100
- MOBILE_SIZE,
101
- NETWORKS,
102
- NETWORK_NOT_SUPPORTED_ERROR,
103
- ON_RAMP_ASSETS,
104
- ON_RAMP_PROVIDERS,
105
- PARA_CONNECT,
106
- PARA_TERMS_AND_CONDITIONS,
107
- getAssetIcon,
108
- getAssetName,
109
- getNetworkIcon,
110
- getNetworkName
111
- };
@@ -1,10 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- const DEFAULTS = {
4
- LOGGIN_POLLING_DELAY_MS: 5e3,
5
- POLLING_INTERVAL_MS: 2e3,
6
- ANIMATION_DURATION: 0.15
7
- };
8
- export {
9
- DEFAULTS
10
- };
@@ -1,24 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- const brandedOAuthLogos = {
4
- GOOGLE: "googleBrand",
5
- TWITTER: "twitter",
6
- APPLE: "apple",
7
- DISCORD: "discordBrand",
8
- FACEBOOK: "facebookBrand",
9
- FARCASTER: "farcasterBrand",
10
- TELEGRAM: "telegramBrand"
11
- };
12
- const oAuthLogos = {
13
- GOOGLE: "google",
14
- TWITTER: "twitter",
15
- APPLE: "apple",
16
- DISCORD: "discord",
17
- FACEBOOK: "facebook",
18
- FARCASTER: "farcaster",
19
- TELEGRAM: "telegram"
20
- };
21
- export {
22
- brandedOAuthLogos,
23
- oAuthLogos
24
- };
@@ -1,15 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- import { useMemo } from "react";
4
- import { useWalletState } from "../../provider/index.js";
5
- import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
6
- function useActiveWallet() {
7
- const client = useInternalClient();
8
- const { selectedWallet } = useWalletState();
9
- return useMemo(() => {
10
- return client.findWallet(selectedWallet.id, selectedWallet.type, { forbidPregen: true });
11
- }, [client, selectedWallet]);
12
- }
13
- export {
14
- useActiveWallet
15
- };
@@ -1,72 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
6
- import { DEFAULTS } from "../constants/defaults.js";
7
- import { useModalStore } from "../stores/index.js";
8
- import { openPopup } from "../utils/openPopup.js";
9
- import { ModalStep } from "../utils/steps.js";
10
- import { useGoBack } from "./useGoBack.js";
11
- function useCreateAccount() {
12
- const para = useInternalClient();
13
- const goBack = useGoBack();
14
- const refs = useModalStore((state) => state.refs);
15
- const setStep = useModalStore((state) => state.setStep);
16
- const webAuthURLForCreate = useModalStore((state) => state.webAuthURLForCreate);
17
- const setWebAuthURLForCreate = useModalStore((state) => state.setWebAuthURLForCreate);
18
- const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
19
- const awaitWalletCreationTransition = () => __async(this, null, function* () {
20
- var _a;
21
- const isComplete = yield para.waitForAccountCreation({ popupWindow: refs.popupWindow.current });
22
- window.clearTimeout((_a = refs.poll.current) == null ? void 0 : _a.timeout);
23
- refs.poll.current = void 0;
24
- refs.popupWindow.current = void 0;
25
- if (isComplete) {
26
- setWebAuthURLForCreate("");
27
- setIFrameUrl("");
28
- setStep(ModalStep.AWAITING_WALLET_CREATION);
29
- } else if (refs.currentStep.current === ModalStep.AWAITING_BIOMETRIC_CREATION) {
30
- goBack();
31
- }
32
- });
33
- return {
34
- withPasskey: () => {
35
- var _a, _b;
36
- if (((_a = refs.poll.current) == null ? void 0 : _a.action) === "createPasskey") {
37
- return;
38
- }
39
- clearTimeout((_b = refs.poll.current) == null ? void 0 : _b.timeout);
40
- refs.popupWindow.current = openPopup({
41
- url: webAuthURLForCreate,
42
- target: "ParaPasskey",
43
- type: "CREATE_PASSKEY",
44
- current: refs.popupWindow.current
45
- });
46
- refs.poll.current = {
47
- action: "createPasskey",
48
- timeout: window.setTimeout(awaitWalletCreationTransition, DEFAULTS.POLLING_INTERVAL_MS)
49
- };
50
- if (refs.currentStep.current !== ModalStep.AWAITING_BIOMETRIC_CREATION) {
51
- setStep(ModalStep.AWAITING_BIOMETRIC_CREATION);
52
- }
53
- },
54
- withPassword: () => {
55
- var _a, _b;
56
- if (((_a = refs.poll.current) == null ? void 0 : _a.action) === "createPassword") {
57
- return;
58
- }
59
- clearTimeout((_b = refs.poll.current) == null ? void 0 : _b.timeout);
60
- refs.poll.current = {
61
- action: "createPassword",
62
- timeout: window.setTimeout(awaitWalletCreationTransition, DEFAULTS.POLLING_INTERVAL_MS)
63
- };
64
- if (refs.currentStep.current !== ModalStep.PASSWORD_CREATION) {
65
- setStep(ModalStep.PASSWORD_CREATION);
66
- }
67
- }
68
- };
69
- }
70
- export {
71
- useCreateAccount
72
- };
@@ -1,39 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- import { useExternalWalletProviderStore } from "../stores/externalWalletProvider/useExternalWalletProviderStore.js";
6
- const useEmbeddedExternalConnection = () => {
7
- const connectParaEvmWallet = useExternalWalletProviderStore((state) => state.connectParaEvmWallet);
8
- const EvmProvider = useExternalWalletProviderStore((state) => state.EvmProvider);
9
- const evmContext = useExternalWalletProviderStore((state) => state.evmContext);
10
- const connectParaCosmosWallet = useExternalWalletProviderStore((state) => state.connectParaCosmosWallet);
11
- const CosmosProvider = useExternalWalletProviderStore((state) => state.CosmosProvider);
12
- const cosmosContext = useExternalWalletProviderStore((state) => state.cosmosContext);
13
- const connectEmbeddedToExternalConnectors = () => __async(void 0, null, function* () {
14
- if (evmContext && EvmProvider && connectParaEvmWallet) {
15
- try {
16
- const { error } = yield connectParaEvmWallet();
17
- if (error) {
18
- console.warn("Failed to connect Para EVM wallet to Wagmi:", error);
19
- }
20
- } catch (err) {
21
- console.warn("Error calling connectParaEvmWallet:", err);
22
- }
23
- }
24
- if (cosmosContext && CosmosProvider && connectParaCosmosWallet) {
25
- try {
26
- const { error } = yield connectParaCosmosWallet();
27
- if (error) {
28
- console.warn("Failed to connect Para Cosmos wallet to Graz:", error);
29
- }
30
- } catch (err) {
31
- console.warn("Error calling connectParaCosmosWallet:", err);
32
- }
33
- }
34
- });
35
- return connectEmbeddedToExternalConnectors;
36
- };
37
- export {
38
- useEmbeddedExternalConnection
39
- };
@@ -1,35 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- import { useExternalWallets } from "../providers/ExternalWalletContext.js";
4
- import { useModalStore } from "../stores/index.js";
5
- import { getAddFundsStep, ModalStep } from "../utils/steps.js";
6
- const useGoBack = () => {
7
- const currentStep = useModalStore((state) => state.step);
8
- const setStep = useModalStore((state) => state.setStep);
9
- const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
10
- const decrementStep = useModalStore((state) => state.decrementStep);
11
- const resetState = useModalStore((state) => state.resetState);
12
- const { setChainIdSwitchingTo } = useExternalWallets();
13
- const goBack = () => {
14
- if (currentStep === ModalStep.ADD_FUNDS_AWAITING) {
15
- setStep(getAddFundsStep(accountAddFundTab));
16
- } else {
17
- decrementStep();
18
- }
19
- switch (currentStep) {
20
- case ModalStep.AUTH_MAIN:
21
- case ModalStep.AUTH_MORE: {
22
- resetState();
23
- break;
24
- }
25
- case ModalStep.CHAIN_SWITCH: {
26
- setChainIdSwitchingTo();
27
- break;
28
- }
29
- }
30
- };
31
- return goBack;
32
- };
33
- export {
34
- useGoBack
35
- };
@@ -1,45 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- import { AuthMethod, getPublicKeyHex } from "@getpara/web-sdk";
6
- import { useModalStore } from "../stores/index.js";
7
- import { useInternalClient } from "../../provider/hooks/utils/useInternalClient.js";
8
- const useSetLoginURLs = () => {
9
- const para = useInternalClient();
10
- const setWebAuthURLForLogin = useModalStore((state) => state.setWebAuthURLForLogin);
11
- const setPasswordURLForLogin = useModalStore((state) => state.setPasswordUrlForLogin);
12
- const setSupportedAuthMethods = useModalStore((state) => state.setSupportedAuthMethods);
13
- return (_0) => __async(void 0, [_0], function* ({
14
- supportedAuthMethods,
15
- authType,
16
- displayName,
17
- pfpUrl
18
- }) {
19
- setSupportedAuthMethods(supportedAuthMethods);
20
- const res = yield para.touchSession();
21
- const webAuthUrlForLogin = (supportedAuthMethods == null ? void 0 : supportedAuthMethods.has(AuthMethod.PASSKEY)) ? yield para.getWebAuthURLForLogin({
22
- sessionId: res.data.sessionId,
23
- loginEncryptionPublicKey: getPublicKeyHex(para.loginEncryptionKeyPair),
24
- partnerId: res.data.partnerId,
25
- newDeviceSessionId: res.data.sessionLookupId,
26
- newDeviceEncryptionKey: getPublicKeyHex(para.loginEncryptionKeyPair),
27
- authType,
28
- displayName,
29
- pfpUrl
30
- }) : void 0;
31
- const passwordAuthUrlForLogin = (supportedAuthMethods == null ? void 0 : supportedAuthMethods.has(AuthMethod.PASSWORD)) ? yield para.getPasswordURLForLogin({
32
- sessionId: res.data.sessionId,
33
- loginEncryptionPublicKey: getPublicKeyHex(para.loginEncryptionKeyPair),
34
- partnerId: res.data.partnerId,
35
- authType,
36
- displayName,
37
- pfpUrl
38
- }) : void 0;
39
- setWebAuthURLForLogin(webAuthUrlForLogin);
40
- setPasswordURLForLogin(passwordAuthUrlForLogin);
41
- });
42
- };
43
- export {
44
- useSetLoginURLs
45
- };
@@ -1,32 +0,0 @@
1
- "use client";
2
- import "../chunk-MMUBH76A.js";
3
- export * from "./ParaModal.js";
4
- import { ModalStep } from "./utils/steps.js";
5
- import { AuthLayout } from "./types/modalProps.js";
6
- export * from "./utils/openPopup.js";
7
- import {
8
- ON_RAMP_PROVIDERS,
9
- ON_RAMP_ASSETS,
10
- NETWORKS,
11
- getAssetIcon,
12
- getAssetName,
13
- getNetworkIcon,
14
- getNetworkName
15
- } from "./constants/constants.js";
16
- import { SaveRecoverySecret } from "./components/RecoverySecretStep/RecoverySecretStep.js";
17
- export * from "./utils/validateOnRampConfig.js";
18
- export * from "./types/externalWallets.js";
19
- import { useExternalWalletProviderStore } from "./stores/externalWalletProvider/useExternalWalletProviderStore.js";
20
- export {
21
- AuthLayout,
22
- ModalStep,
23
- NETWORKS,
24
- ON_RAMP_ASSETS,
25
- ON_RAMP_PROVIDERS,
26
- SaveRecoverySecret,
27
- getAssetIcon,
28
- getAssetName,
29
- getNetworkIcon,
30
- getNetworkName,
31
- useExternalWalletProviderStore
32
- };