@getpara/react-sdk-lite 2.0.0-dev.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/cli.mjs +26 -1
- package/dist/modal/ParaModal.js +16 -10
- package/dist/modal/components/Account/Account.js +42 -4
- package/dist/modal/components/Account/AccountHeader.js +10 -16
- package/dist/modal/components/Account/AccountProfile.d.ts +1 -1
- package/dist/modal/components/Account/AccountProfile.js +82 -210
- package/dist/modal/components/Account/AccountProfileEntry.d.ts +12 -0
- package/dist/modal/components/Account/AccountProfileEntry.js +220 -0
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +15 -4
- package/dist/modal/components/Account/AccountSend/AccountSendAsset.d.ts +1 -0
- package/dist/modal/components/Account/AccountSend/AccountSendAsset.js +94 -0
- package/dist/modal/components/Account/AccountSend/AccountSendForm.d.ts +1 -0
- package/dist/modal/components/Account/AccountSend/AccountSendForm.js +343 -0
- package/dist/modal/components/Account/AccountSend/AccountSendNetwork.d.ts +1 -0
- package/dist/modal/components/Account/AccountSend/AccountSendNetwork.js +53 -0
- package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.d.ts +1 -0
- package/dist/modal/components/Account/AccountSend/AccountSendNoAssets.js +56 -0
- package/dist/modal/components/Account/AccountSend/AssetNetwork.d.ts +5 -0
- package/dist/modal/components/Account/AccountSend/AssetNetwork.js +36 -0
- package/dist/modal/components/Account/AccountSend/context.d.ts +38 -0
- package/dist/modal/components/Account/AccountSend/context.js +418 -0
- package/dist/modal/components/Account/AccountSend/index.d.ts +4 -0
- package/dist/modal/components/Account/AccountSend/index.js +67 -0
- package/dist/modal/components/Account/AccountWallet.d.ts +1 -0
- package/dist/modal/components/Account/AccountWallet.js +133 -0
- package/dist/modal/components/{WalletSelect/WalletSelect.d.ts → Account/AccountWalletSelect.d.ts} +1 -1
- package/dist/modal/components/{WalletSelect/WalletSelect.js → Account/AccountWalletSelect.js} +20 -6
- package/dist/modal/components/AddFunds/AddFunds.js +3 -2
- package/dist/modal/components/AddFunds/AddFundsAsset.js +7 -6
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +5 -5
- package/dist/modal/components/AddFunds/AddFundsProvider.js +1 -2
- package/dist/modal/components/AddFunds/AddFundsSettings.js +13 -54
- package/dist/modal/components/AddFunds/common.d.ts +0 -14
- package/dist/modal/components/AddFunds/common.js +1 -8
- package/dist/modal/components/AuthInput/AuthInput.js +2 -2
- package/dist/modal/components/AwaitingAccountStep/AwaitingAccountStep.js +3 -2
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +8 -33
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +5 -2
- package/dist/modal/components/Body/Body.js +81 -48
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +8 -5
- package/dist/modal/components/Controls/ChainSelect.js +1 -2
- package/dist/modal/components/Controls/Controls.js +1 -0
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts +5 -1
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +48 -19
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +5 -2
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +63 -33
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +3 -1
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +22 -12
- package/dist/modal/components/Footer/Footer.js +4 -5
- package/dist/modal/components/Header/Header.js +1 -2
- package/dist/modal/components/Header/hooks/useStepTitle.js +53 -38
- package/dist/modal/components/Hero/Hero.js +5 -3
- package/dist/modal/components/IFrameStep/IFrameStep.js +13 -12
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +4 -1
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +6 -5
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +6 -5
- package/dist/modal/components/OnRampComponents/AddingFunds.js +1 -1
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +1 -2
- package/dist/modal/components/QuantityInput.d.ts +9 -0
- package/dist/modal/components/QuantityInput.js +91 -0
- package/dist/modal/components/SearchableButtonList.d.ts +34 -0
- package/dist/modal/components/SearchableButtonList.js +223 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +4 -1
- package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.d.ts +1 -0
- package/dist/modal/components/SwitchWalletsStep/SwitchWalletsStep.js +10 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +13 -2
- package/dist/modal/components/Waiting/Waiting.d.ts +1 -1
- package/dist/modal/components/Waiting/Waiting.js +7 -2
- package/dist/modal/components/WalletCard/WalletCard.js +2 -3
- package/dist/modal/components/WalletSelectOld/WalletSelectOld.d.ts +7 -1
- package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +33 -12
- package/dist/modal/components/common.d.ts +8 -10
- package/dist/modal/components/common.js +16 -36
- package/dist/modal/hooks/index.d.ts +4 -0
- package/dist/modal/hooks/index.js +5 -0
- package/dist/modal/hooks/useDebounce.d.ts +4 -0
- package/dist/modal/hooks/useDebounce.js +16 -0
- package/dist/modal/hooks/useFarcasterLogin.js +8 -1
- package/dist/modal/hooks/useTelegramLogin.js +4 -0
- package/dist/modal/index.d.ts +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/modal/stores/modal/actions.js +9 -2
- package/dist/modal/stores/modal/useModalStore.d.ts +9 -1
- package/dist/modal/stores/modal/useModalStore.js +6 -2
- package/dist/modal/types/modalProps.d.ts +5 -1
- package/dist/modal/utils/authInputHelpers.js +1 -1
- package/dist/modal/utils/countryCodes.js +50 -1
- package/dist/modal/utils/getWalletDisplayName.js +1 -1
- package/dist/modal/utils/openPopup.d.ts +1 -1
- package/dist/modal/utils/openPopup.js +6 -2
- package/dist/modal/utils/renderTextWithLinks.d.ts +2 -0
- package/dist/modal/utils/renderTextWithLinks.js +34 -0
- package/dist/modal/utils/steps.d.ts +24 -3
- package/dist/modal/utils/steps.js +51 -5
- package/dist/modal/utils/stringFormatters.d.ts +2 -3
- package/dist/modal/utils/stringFormatters.js +11 -7
- package/dist/modal/utils/validatePortalOrigin.d.ts +2 -0
- package/dist/modal/utils/validatePortalOrigin.js +14 -0
- package/dist/provider/ParaProviderMin.js +13 -5
- package/dist/provider/actions/getEmbeddedAccount.d.ts +3 -2
- package/dist/provider/actions/getEmbeddedAccount.js +13 -4
- package/dist/provider/actions/index.d.ts +11 -9
- package/dist/provider/actions/index.js +4 -0
- package/dist/provider/components/CosmosWalletWrapper.js +3 -3
- package/dist/provider/components/EvmWalletWrapper.js +3 -3
- package/dist/provider/components/ExternalWalletWrapper.js +7 -1
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +3 -1
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +3 -1
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +3 -1
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +4 -0
- package/dist/provider/hooks/mutations/useAddAuthMethod.d.ts +42 -0
- package/dist/provider/hooks/mutations/useAddAuthMethod.js +59 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +2 -2
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +2 -2
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +5 -5
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +2 -2
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +2 -2
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +2 -2
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +2 -2
- package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +15 -0
- package/dist/provider/hooks/mutations/useExportPrivateKey.js +32 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +2 -2
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +2 -2
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +2 -2
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +8 -2
- package/dist/provider/hooks/mutations/useLogout.d.ts +2 -2
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +2 -2
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +2 -2
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +2 -2
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +2 -2
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +2 -2
- package/dist/provider/hooks/mutations/useSwitchWallets.d.ts +57 -0
- package/dist/provider/hooks/mutations/useSwitchWallets.js +30 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +2 -2
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +2 -2
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +18 -27
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +5 -5
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +14 -11
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +2 -2
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +5 -5
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +2 -2
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +2 -2
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +2 -2
- package/dist/provider/hooks/queries/index.d.ts +1 -0
- package/dist/provider/hooks/queries/index.js +2 -0
- package/dist/provider/hooks/queries/useAccount.js +58 -24
- package/dist/provider/hooks/queries/useLinkedAccounts.js +4 -2
- package/dist/provider/hooks/queries/useProfileBalance.d.ts +29 -0
- package/dist/provider/hooks/queries/useProfileBalance.js +65 -0
- package/dist/provider/hooks/utils/useAssetInfo.d.ts +3 -0
- package/dist/provider/hooks/utils/useAssetInfo.js +21 -0
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +22 -5
- package/dist/provider/hooks/utils/useModal.js +3 -3
- package/dist/provider/hooks/utils/useWalletState.d.ts +2 -1
- package/dist/provider/hooks/utils/useWalletState.js +2 -1
- package/dist/provider/providers/AccountLinkProvider.js +18 -11
- package/dist/provider/providers/AssetsProvider.d.ts +14 -0
- package/dist/provider/providers/AssetsProvider.js +68 -0
- package/dist/provider/providers/AuthProvider.d.ts +4 -0
- package/dist/provider/providers/AuthProvider.js +187 -43
- package/dist/provider/providers/ExternalWalletProvider.d.ts +19 -5
- package/dist/provider/providers/ExternalWalletProvider.js +363 -44
- package/dist/provider/stores/getters.d.ts +2 -2
- package/dist/provider/stores/slices/modal.js +4 -1
- package/dist/provider/stores/types.d.ts +6 -3
- package/package.json +8 -8
- package/dist/modal/constants/constants.d.ts +0 -35
- package/dist/modal/constants/constants.js +0 -148
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
- package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
package/dist/modal/components/{WalletSelect/WalletSelect.js → Account/AccountWalletSelect.js}
RENAMED
|
@@ -4,7 +4,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { useEffect, useMemo, useRef } from "react";
|
|
5
5
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
6
6
|
import { useDropdownPosition } from "../AuthInput/hooks/useDropdownPosition.js";
|
|
7
|
-
import { getExternalWalletIcon, safeStyled, useCopyToClipboard } from "@getpara/react-common";
|
|
7
|
+
import { getExternalWalletIcon, MOBILE_SIZE, safeStyled, useCopyToClipboard } from "@getpara/react-common";
|
|
8
8
|
import { useAccount, useWallet, useWalletState } from "../../../provider/index.js";
|
|
9
9
|
import { CpslButton, CpslIcon, CpslSelect, CpslSelectItem, CpslText } from "@getpara/react-components";
|
|
10
10
|
import { truncateAddress } from "@getpara/web-sdk";
|
|
@@ -62,7 +62,7 @@ const Wallet = ({
|
|
|
62
62
|
)
|
|
63
63
|
] });
|
|
64
64
|
};
|
|
65
|
-
const
|
|
65
|
+
const AccountWalletSelect = () => {
|
|
66
66
|
var _a, _b, _c;
|
|
67
67
|
const containerRef = useRef(null);
|
|
68
68
|
const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
|
|
@@ -92,7 +92,7 @@ const WalletSelect = () => {
|
|
|
92
92
|
anchorElId: "addressInputContainer",
|
|
93
93
|
dropdownMaxHeight,
|
|
94
94
|
$width: dropdownWidth != null ? dropdownWidth : 0,
|
|
95
|
-
$top: (mobileAnchor != null ? mobileAnchor : 0) +
|
|
95
|
+
$top: (mobileAnchor != null ? mobileAnchor : 0) + 184 + 1,
|
|
96
96
|
selectedItemVariant: "bodyXS",
|
|
97
97
|
icon: isMultiWallet ? "chevronUp" : null,
|
|
98
98
|
disabled: !isMultiWallet,
|
|
@@ -108,6 +108,7 @@ const WalletSelect = () => {
|
|
|
108
108
|
) }) });
|
|
109
109
|
};
|
|
110
110
|
const Container = safeStyled.div`
|
|
111
|
+
flex: 0;
|
|
111
112
|
display: flex;
|
|
112
113
|
flex-direction: column;
|
|
113
114
|
gap: 8px;
|
|
@@ -145,6 +146,18 @@ const Select = safeStyled(CpslSelect)`
|
|
|
145
146
|
min-width: ${({ $width }) => `${$width - 2}px`};
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
&::part(popover) {
|
|
150
|
+
/* Have to adjust the top of the popover here since we're using a transform on the modal which causes fixed position items to not be relative to the viewport */
|
|
151
|
+
@media (max-width: ${MOBILE_SIZE}px) {
|
|
152
|
+
top: ${({ $top }) => $top ? `${$top}px` : "0px"};
|
|
153
|
+
bottom: 16px;
|
|
154
|
+
}
|
|
155
|
+
cpsl-auth-modal.force-mobile-media & {
|
|
156
|
+
top: ${({ $top }) => $top ? `${$top}px` : "0px"};
|
|
157
|
+
bottom: 16px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
148
161
|
&::part(icon) {
|
|
149
162
|
--icon-color: var(--cpsl-color-text-primary);
|
|
150
163
|
}
|
|
@@ -170,7 +183,8 @@ const SelectContainer = safeStyled.div`
|
|
|
170
183
|
border-radius: var(--cpsl-border-radius-tile-button);
|
|
171
184
|
background-color: transparent;
|
|
172
185
|
`;
|
|
173
|
-
const WalletIcon = safeStyled(CpslIcon)`
|
|
186
|
+
const WalletIcon = safeStyled(CpslIcon)`
|
|
187
|
+
--icon-border: 1px solid var(--cpsl-color-background-8);
|
|
174
188
|
--icon-background: var(--cpsl-color-background-0);
|
|
175
189
|
--icon-border-radius: 4px;
|
|
176
190
|
`;
|
|
@@ -181,8 +195,8 @@ const CopyButton = safeStyled(CpslButton)`
|
|
|
181
195
|
}
|
|
182
196
|
`;
|
|
183
197
|
export {
|
|
198
|
+
AccountWalletSelect,
|
|
184
199
|
Select,
|
|
185
200
|
SelectContainer,
|
|
186
|
-
SelectItem
|
|
187
|
-
WalletSelect
|
|
201
|
+
SelectItem
|
|
188
202
|
};
|
|
@@ -17,6 +17,7 @@ import { AnimatePresence } from "framer-motion";
|
|
|
17
17
|
import { AddFundsSettings } from "./AddFundsSettings.js";
|
|
18
18
|
import { WalletSelectOld } from "../WalletSelectOld/WalletSelectOld.js";
|
|
19
19
|
const AddFunds = () => {
|
|
20
|
+
var _a;
|
|
20
21
|
const step = useModalStore((state) => state.step);
|
|
21
22
|
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
22
23
|
const onRampStep = useModalStore((state) => state.onRampStep);
|
|
@@ -29,7 +30,7 @@ const AddFunds = () => {
|
|
|
29
30
|
const tabs = TABS.filter(
|
|
30
31
|
([enabledFlow, key]) => !!(onRampConfig == null ? void 0 : onRampConfig[key]) && (!isGuestMode || enabledFlow === EnabledFlow.RECEIVE)
|
|
31
32
|
);
|
|
32
|
-
const tab = storedTab != null ? storedTab : tabs[0][0];
|
|
33
|
+
const tab = storedTab != null ? storedTab : (_a = tabs[0]) == null ? void 0 : _a[0];
|
|
33
34
|
const isMultiFlow = (tab === EnabledFlow.BUY || tab === EnabledFlow.RECEIVE) && (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) && (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled);
|
|
34
35
|
const onSetTab = (event) => {
|
|
35
36
|
setModalStep(getAddFundsStep(event.detail.tab));
|
|
@@ -52,7 +53,7 @@ const AddFunds = () => {
|
|
|
52
53
|
useEffect(() => {
|
|
53
54
|
setOnRampPurchase(void 0);
|
|
54
55
|
}, []);
|
|
55
|
-
if (!onRampConfig || !activeWallet) {
|
|
56
|
+
if (!onRampConfig || !activeWallet || !tab) {
|
|
56
57
|
return /* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, {}) });
|
|
57
58
|
}
|
|
58
59
|
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
@@ -6,20 +6,20 @@ import {
|
|
|
6
6
|
} from "../../../chunk-MMUBH76A.js";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import * as comp from "@getpara/react-components";
|
|
9
|
-
import { getOnRampNetworks } from "@getpara/web-sdk";
|
|
10
|
-
import { safeStyled } from "@getpara/react-common";
|
|
11
|
-
import { getAssetCode, getAssetName, ON_RAMP_ASSETS } from "../../constants/constants.js";
|
|
9
|
+
import { formatCurrency, getOnRampNetworks } from "@getpara/web-sdk";
|
|
10
|
+
import { safeStyled, getAssetCode, getAssetName, ON_RAMP_ASSETS } from "@getpara/react-common";
|
|
12
11
|
import { useModalStore } from "../../stores/index.js";
|
|
13
12
|
import { useState } from "react";
|
|
14
13
|
import { useAddFunds } from "./AddFundsContext.js";
|
|
15
14
|
import { useWallet } from "../../../provider/hooks/queries/useWallet.js";
|
|
16
|
-
import { AssetIcon, GradientScroll } from "../common.js";
|
|
15
|
+
import { AssetIcon, contentMotionProps, GradientScroll } from "../common.js";
|
|
17
16
|
import { AnimatePresence, motion } from "framer-motion";
|
|
18
|
-
import {
|
|
17
|
+
import { useAssets } from "../../../provider/providers/AssetsProvider.js";
|
|
19
18
|
function AddFundsAsset() {
|
|
20
19
|
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
21
20
|
const { assets, setAsset, network, setNetwork } = useAddFunds();
|
|
22
21
|
const { data: activeWallet } = useWallet();
|
|
22
|
+
const { assetMetadata } = useAssets();
|
|
23
23
|
const [searchStr, setSearchStr] = useState("");
|
|
24
24
|
const onSelect = (_asset) => __async(this, null, function* () {
|
|
25
25
|
yield setAsset(_asset);
|
|
@@ -59,7 +59,8 @@ function AddFundsAsset() {
|
|
|
59
59
|
/* @__PURE__ */ jsxs(Info, { children: [
|
|
60
60
|
/* @__PURE__ */ jsx(Code, { color: "contrast", variant: "bodyL", children: ON_RAMP_ASSETS[asset].code }),
|
|
61
61
|
/* @__PURE__ */ jsx(Name, { color: "contrast", variant: "bodyS", children: ON_RAMP_ASSETS[asset].name })
|
|
62
|
-
] })
|
|
62
|
+
] }),
|
|
63
|
+
(assetMetadata == null ? void 0 : assetMetadata[asset]) && /* @__PURE__ */ jsx(comp.CpslText, { variant: "bodyM", children: formatCurrency(assetMetadata[asset].price) })
|
|
63
64
|
] }, asset)
|
|
64
65
|
},
|
|
65
66
|
asset
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { useWallet } from '../../../provider/hooks/index.js';
|
|
3
|
-
import { EnabledFlow,
|
|
3
|
+
import { EnabledFlow, TNetwork, TOnRampAsset, OnRampConfig, OnRampProvider } from '@getpara/web-sdk';
|
|
4
4
|
import { IconType } from '@getpara/react-components';
|
|
5
5
|
export type Tab = EnabledFlow;
|
|
6
6
|
export declare const TABS: [
|
|
@@ -10,14 +10,14 @@ export declare const TABS: [
|
|
|
10
10
|
ReactNode
|
|
11
11
|
][];
|
|
12
12
|
type Value = {
|
|
13
|
-
network:
|
|
13
|
+
network: TNetwork | undefined;
|
|
14
14
|
setNetwork: Dispatch<SetStateAction<Value['network']>>;
|
|
15
|
-
asset:
|
|
15
|
+
asset: TOnRampAsset | undefined;
|
|
16
16
|
setAsset: Dispatch<SetStateAction<Value['asset']>>;
|
|
17
17
|
fiatQuantity: string | undefined;
|
|
18
18
|
setFiatQuantity: Dispatch<SetStateAction<Value['fiatQuantity']>>;
|
|
19
|
-
networks:
|
|
20
|
-
assets:
|
|
19
|
+
networks: TNetwork[];
|
|
20
|
+
assets: TOnRampAsset[];
|
|
21
21
|
isProviderAllowed: Partial<Record<OnRampProvider, boolean>>;
|
|
22
22
|
tab: Tab;
|
|
23
23
|
activeWallet: ReturnType<typeof useWallet>['data'];
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../../../chunk-MMUBH76A.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { safeStyled } from "@getpara/react-common";
|
|
9
|
-
import { Heading, InnerStepContainer } from "../common.js";
|
|
9
|
+
import { contentMotionProps, Heading, InnerStepContainer } from "../common.js";
|
|
10
10
|
import { CpslText } from "@getpara/react-components";
|
|
11
11
|
import { useAddFunds } from "./AddFundsContext.js";
|
|
12
12
|
import { useModalStore } from "../../stores/index.js";
|
|
@@ -15,7 +15,6 @@ import { motion, AnimatePresence } from "framer-motion";
|
|
|
15
15
|
import { OnRampProviderButton } from "../OnRampComponents/OnRampProviderButton.js";
|
|
16
16
|
import { useWallet } from "../../../provider/index.js";
|
|
17
17
|
import { EnabledFlow, OnRampPurchaseType } from "@getpara/web-sdk";
|
|
18
|
-
import { contentMotionProps } from "./common.js";
|
|
19
18
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
20
19
|
function AddFundsProvider() {
|
|
21
20
|
const para = useInternalClient();
|
|
@@ -6,14 +6,21 @@ import {
|
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useEffect, useMemo, useState } from "react";
|
|
8
8
|
import { useAddFunds } from "./AddFundsContext.js";
|
|
9
|
-
import { CpslButton, CpslIcon,
|
|
10
|
-
import {
|
|
11
|
-
|
|
9
|
+
import { CpslButton, CpslIcon, CpslRow, CpslText } from "@getpara/react-components";
|
|
10
|
+
import {
|
|
11
|
+
AssetIcon,
|
|
12
|
+
contentMotionProps,
|
|
13
|
+
HeaderSelect,
|
|
14
|
+
HeaderSelectContainer,
|
|
15
|
+
HeaderSelectItem,
|
|
16
|
+
NetworkIcon
|
|
17
|
+
} from "../common.js";
|
|
18
|
+
import { QuantityInput } from "../QuantityInput.js";
|
|
12
19
|
import { EnabledFlow, getOnRampNetworks, OnRampPurchaseType } from "@getpara/web-sdk";
|
|
13
20
|
import { OnRampStep, useModalStore } from "../../stores/index.js";
|
|
14
21
|
import { useStore } from "../../../provider/stores/useStore.js";
|
|
15
|
-
import { safeStyled } from "@getpara/react-common";
|
|
16
|
-
import {
|
|
22
|
+
import { safeStyled, getAssetCode, getNetworkName } from "@getpara/react-common";
|
|
23
|
+
import { NoProviders } from "./common.js";
|
|
17
24
|
import { AnimatePresence, motion, useIsPresent } from "framer-motion";
|
|
18
25
|
import { AddFundsAsset } from "./AddFundsAsset.js";
|
|
19
26
|
function NetworkPill({
|
|
@@ -118,40 +125,7 @@ function AddFundsSettings() {
|
|
|
118
125
|
) : network ? /* @__PURE__ */ jsx(NetworkPill, { network, start: NetworkLabel, fix: true }) : null })
|
|
119
126
|
] }),
|
|
120
127
|
/* @__PURE__ */ jsxs(CpslRow, { col: true, gap: "16px", children: [
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
122
|
-
Input,
|
|
123
|
-
{
|
|
124
|
-
value: value || "",
|
|
125
|
-
fitContent: true,
|
|
126
|
-
autoselect: true,
|
|
127
|
-
onKeyDown: (e) => {
|
|
128
|
-
if (!/^(\d|\.)$/.test(e.key) && !["Delete", "Backspace", "Tab", "Shift"].includes(e.key)) {
|
|
129
|
-
e.preventDefault();
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
onChange: (e) => {
|
|
133
|
-
var _a;
|
|
134
|
-
const numericValue = (((_a = e.currentTarget) == null ? void 0 : _a.value) || "").replace(/[^0-9.]/g, "");
|
|
135
|
-
if (numericValue !== "") {
|
|
136
|
-
const formattedValue = parseFloat(numericValue).toFixed(2);
|
|
137
|
-
setValue(formattedValue);
|
|
138
|
-
} else {
|
|
139
|
-
setValue(null);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
onBlur: (e) => {
|
|
143
|
-
const numericValue = (e.currentTarget.value || "").replace(/[^0-9.]/g, "");
|
|
144
|
-
if (numericValue === "") {
|
|
145
|
-
setValue(null);
|
|
146
|
-
} else {
|
|
147
|
-
setValue(parseFloat(numericValue).toFixed(2));
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
placeholder: "0",
|
|
151
|
-
children: /* @__PURE__ */ jsx(CurrencySign, { slot: "start", children: "$" })
|
|
152
|
-
},
|
|
153
|
-
value || ""
|
|
154
|
-
),
|
|
128
|
+
/* @__PURE__ */ jsx(QuantityInput, { value, onChange: setValue, symbol: "$" }),
|
|
155
129
|
/* @__PURE__ */ jsx(CpslRow, { style: { width: "100%" }, children: ["25", "50", "100"].map((quantity) => {
|
|
156
130
|
return /* @__PURE__ */ jsxs(PresetButton, { fullWidth: true, variant: "secondary", onClick: () => setValue(`${quantity}.00`), children: [
|
|
157
131
|
"$",
|
|
@@ -207,12 +181,6 @@ const Container = safeStyled(motion.div)`
|
|
|
207
181
|
const AssetContainer = safeStyled(Container)`
|
|
208
182
|
gap: 8px;
|
|
209
183
|
`;
|
|
210
|
-
const CurrencySign = safeStyled.div`
|
|
211
|
-
font-size: 72px;
|
|
212
|
-
color: var(--cpsl-color-text-primary);
|
|
213
|
-
position: relative;
|
|
214
|
-
right: -16px;
|
|
215
|
-
`;
|
|
216
184
|
const PresetButton = safeStyled(CpslButton)`
|
|
217
185
|
--button-color: var(--cpsl-color-text-contrast);
|
|
218
186
|
--button-font-size: 24px;
|
|
@@ -223,15 +191,6 @@ const PresetButton = safeStyled(CpslButton)`
|
|
|
223
191
|
--button-secondary-hover-border-color: var(--cpsl-color-background-16);
|
|
224
192
|
flex: 1;
|
|
225
193
|
`;
|
|
226
|
-
const Input = safeStyled(CpslInput)`
|
|
227
|
-
--container-background-color: transparent;
|
|
228
|
-
--container-height: 90px;
|
|
229
|
-
--container-border-width: 0;
|
|
230
|
-
--input-background-color: transparent;
|
|
231
|
-
--input-font-size: 72px;
|
|
232
|
-
--input-text-align: center;
|
|
233
|
-
--input-width: 100%;
|
|
234
|
-
`;
|
|
235
194
|
export {
|
|
236
195
|
AddFundsSettings
|
|
237
196
|
};
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
export declare const contentMotionProps: {
|
|
2
|
-
transition: {
|
|
3
|
-
duration: number;
|
|
4
|
-
};
|
|
5
|
-
initial: {
|
|
6
|
-
opacity: number;
|
|
7
|
-
};
|
|
8
|
-
animate: {
|
|
9
|
-
opacity: number;
|
|
10
|
-
};
|
|
11
|
-
exit: {
|
|
12
|
-
opacity: number;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
1
|
export declare const NoProviders: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
16
2
|
ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
|
|
17
3
|
}, {
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { CpslText } from "@getpara/react-components";
|
|
4
4
|
import { safeStyled } from "@getpara/react-common";
|
|
5
|
-
const contentMotionProps = {
|
|
6
|
-
transition: { duration: 0.2 },
|
|
7
|
-
initial: { opacity: 0 },
|
|
8
|
-
animate: { opacity: 1 },
|
|
9
|
-
exit: { opacity: 0 }
|
|
10
|
-
};
|
|
11
5
|
const NoProviders = safeStyled(CpslText)`
|
|
12
6
|
width: 100%;
|
|
13
7
|
text-align: center;
|
|
@@ -19,6 +13,5 @@ const NoProviders = safeStyled(CpslText)`
|
|
|
19
13
|
transition: visibility 0.2s;
|
|
20
14
|
`;
|
|
21
15
|
export {
|
|
22
|
-
NoProviders
|
|
23
|
-
contentMotionProps
|
|
16
|
+
NoProviders
|
|
24
17
|
};
|
|
@@ -13,9 +13,8 @@ import {
|
|
|
13
13
|
CpslText
|
|
14
14
|
} from "@getpara/react-components";
|
|
15
15
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
16
|
-
import { safeStyled } from "@getpara/react-common";
|
|
16
|
+
import { safeStyled, MOBILE_SIZE } from "@getpara/react-common";
|
|
17
17
|
import countryCodes from "../../utils/countryCodes.js";
|
|
18
|
-
import { MOBILE_SIZE } from "../../constants/constants.js";
|
|
19
18
|
import { useDropdownPosition } from "./hooks/useDropdownPosition.js";
|
|
20
19
|
import { defaultPhoneMask, phoneMasks } from "./phoneMasks.js";
|
|
21
20
|
import { extractAuthInfo } from "@getpara/user-management-client";
|
|
@@ -230,6 +229,7 @@ const CountryCodeSelect = safeStyled(CpslSelect)`
|
|
|
230
229
|
--container-gap: 4px;
|
|
231
230
|
--container-background-color: transparent;
|
|
232
231
|
--container-box-shadow: none;
|
|
232
|
+
--dropdown-background-color: var(--cpsl-color-background-4);
|
|
233
233
|
|
|
234
234
|
&::part(dropdown) {
|
|
235
235
|
width: ${({ $width }) => `${$width - 2}px`};
|
|
@@ -4,9 +4,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { useModalStore } from "../../stores/index.js";
|
|
5
5
|
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
6
|
const AwaitingAccountStep = () => {
|
|
7
|
+
var _a;
|
|
7
8
|
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
-
const
|
|
9
|
-
const isSLOPopup =
|
|
9
|
+
const refs = useModalStore((state) => state.refs);
|
|
10
|
+
const isSLOPopup = ((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) === false;
|
|
10
11
|
return /* @__PURE__ */ jsx(
|
|
11
12
|
Waiting,
|
|
12
13
|
{
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
import { jsx
|
|
4
|
-
import {
|
|
5
|
-
import { InfoBoxContent, InfoBoxHeader, StepContainer } from "../common.js";
|
|
6
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { StepContainer } from "../common.js";
|
|
7
5
|
import { Waiting } from "../Waiting/Waiting.js";
|
|
8
6
|
import { useStore } from "../../../provider/stores/useStore.js";
|
|
9
7
|
import { useAccount } from "../../../provider/index.js";
|
|
@@ -12,37 +10,14 @@ const AwaitingWalletCreationStep = ({ isGuestMode = false }) => {
|
|
|
12
10
|
var _a;
|
|
13
11
|
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
14
12
|
});
|
|
15
|
-
const [showInfoBox, setShowInfoBox] = useState(false);
|
|
16
|
-
const showInfoBoxTimeout = useRef();
|
|
17
13
|
const { embedded } = useAccount();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(
|
|
15
|
+
Waiting,
|
|
16
|
+
{
|
|
17
|
+
heading: isGuestMode ? "Creating Guest Account" : (embedded == null ? void 0 : embedded.isGuestMode) ? hideWallets ? "Linking Guest Account" : "Linking Guest Wallet" : hideWallets ? "Creating Your Account" : "Creating Your Wallet",
|
|
18
|
+
subheading: "This should only take a couple of seconds."
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
}, []);
|
|
26
|
-
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
Waiting,
|
|
29
|
-
{
|
|
30
|
-
heading: isGuestMode ? "Creating Guest Account" : (embedded == null ? void 0 : embedded.isGuestMode) ? hideWallets ? "Linking Guest Account" : "Linking Guest Wallet" : hideWallets ? "Creating Your Account" : "Creating Your Wallet",
|
|
31
|
-
subheading: "This should only take a couple of seconds."
|
|
32
|
-
}
|
|
33
|
-
),
|
|
34
|
-
showInfoBox && /* @__PURE__ */ jsx(CpslInfoBox, { children: /* @__PURE__ */ jsxs(InfoBoxContent, { children: [
|
|
35
|
-
/* @__PURE__ */ jsxs(InfoBoxHeader, { children: [
|
|
36
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "clock" }),
|
|
37
|
-
/* @__PURE__ */ jsx(CpslText, { weight: "medium", children: "Hang on" })
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ jsxs(CpslText, { variant: "bodyS", weight: "medium", color: "secondary", children: [
|
|
40
|
-
"Creating your ",
|
|
41
|
-
hideWallets ? "account" : "wallet",
|
|
42
|
-
" is taking a little longer than expected, but we're working on it!"
|
|
43
|
-
] })
|
|
44
|
-
] }) })
|
|
45
|
-
] });
|
|
20
|
+
) });
|
|
46
21
|
};
|
|
47
22
|
export {
|
|
48
23
|
AwaitingWalletCreationStep
|
|
@@ -26,7 +26,10 @@ const BiometricLoginStep = () => {
|
|
|
26
26
|
/* @__PURE__ */ jsx(UserIdentifier, { authInfo: para.authInfo })
|
|
27
27
|
] }),
|
|
28
28
|
/* @__PURE__ */ jsxs(MainContainer, { children: [
|
|
29
|
-
(isPassword || isPIN) && /* @__PURE__ */
|
|
29
|
+
(isPassword || isPIN) && /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: () => presentLoginUi(isPIN ? AuthMethod.PIN : AuthMethod.PASSWORD, loginState), children: [
|
|
30
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
|
|
31
|
+
isPIN && isPassword ? "Login" : isPIN ? "Login with PIN" : "Login with Password"
|
|
32
|
+
] }),
|
|
30
33
|
isPasskey && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
34
|
displayKnownDevices && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
35
|
/* @__PURE__ */ jsx(KnownDevices, { hints: biometricHints, link: passkeyKnownDeviceUrl }),
|
|
@@ -34,7 +37,7 @@ const BiometricLoginStep = () => {
|
|
|
34
37
|
] }),
|
|
35
38
|
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: () => presentLoginUi(AuthMethod.PASSKEY, loginState), children: isPasskeyUnavailable ? "Continue anyway" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
39
|
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
37
|
-
"Login with
|
|
40
|
+
"Login with Passkey"
|
|
38
41
|
] }) })
|
|
39
42
|
] })
|
|
40
43
|
] })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { safeStyled } from "@getpara/react-common";
|
|
4
|
+
import { safeStyled, WarningBanner, BODY_MOTION_VARIANTS, BODY_TRANSITION, MOBILE_SIZE } from "@getpara/react-common";
|
|
5
5
|
import { IFrameSteps, ModalStep } from "../../utils/steps.js";
|
|
6
6
|
import { CpslAlert, CpslIcon } from "@getpara/react-components";
|
|
7
7
|
import { VerificationCodeStep } from "../VerificationCodeStep/VerificationCodeStep.js";
|
|
@@ -21,7 +21,6 @@ import { AddFundsAwaiting, AddFundsDone, AddFunds } from "../AddFunds/index.js";
|
|
|
21
21
|
import { FarcasterOAuthStep } from "../OAuth/FarcasterOAuthStep.js";
|
|
22
22
|
import { Header } from "../Header/Header.js";
|
|
23
23
|
import { AuthMainStep } from "../AuthMainStep/AuthMainStep.js";
|
|
24
|
-
import { BODY_MOTION_VARIANTS, BODY_TRANSITION, MOBILE_SIZE } from "../../constants/constants.js";
|
|
25
24
|
import { Account } from "../Account/Account.js";
|
|
26
25
|
import { AuthOptions } from "../AuthOptions/AuthOptions.js";
|
|
27
26
|
import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
|
|
@@ -43,13 +42,14 @@ import { AccountProfileLink } from "../Account/AccountProfileLink.js";
|
|
|
43
42
|
import { AccountProfileUnlink } from "../Account/AccountProfileUnlink.js";
|
|
44
43
|
import { ExternalWalletNetworkSelectStep } from "../ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js";
|
|
45
44
|
import { AwaitingAccountStep } from "../AwaitingAccountStep/AwaitingAccountStep.js";
|
|
45
|
+
import { SwitchWalletsStep } from "../SwitchWalletsStep/SwitchWalletsStep.js";
|
|
46
46
|
import { Footer } from "../Footer/Footer.js";
|
|
47
|
+
import { renderTextWithLinks } from "../../utils/renderTextWithLinks.js";
|
|
48
|
+
import { AccountWallet } from "../Account/AccountWallet.js";
|
|
49
|
+
import { AccountSend } from "../Account/AccountSend/index.js";
|
|
47
50
|
const MIN_HEIGHT = {
|
|
48
51
|
[ModalStep.ADD_FUNDS_AWAITING]: "680px"
|
|
49
52
|
};
|
|
50
|
-
const PADDING_TOP = {
|
|
51
|
-
[ModalStep.TELEGRAM_OAUTH]: "36px"
|
|
52
|
-
};
|
|
53
53
|
const Body = ({
|
|
54
54
|
oAuthMethods,
|
|
55
55
|
twoFactorAuthEnabled,
|
|
@@ -66,6 +66,8 @@ const Body = ({
|
|
|
66
66
|
const setStepDirection = useModalStore((state) => state.setStepDirection);
|
|
67
67
|
const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
|
|
68
68
|
const setAccountAddFundTab = useModalStore((state) => state.setAccountAddFundTab);
|
|
69
|
+
const modalError = useModalStore((state) => state.modalError);
|
|
70
|
+
const setModalError = useModalStore((state) => state.setModalError);
|
|
69
71
|
const embeddedModal = useStore((state) => {
|
|
70
72
|
var _a;
|
|
71
73
|
return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
|
|
@@ -180,6 +182,9 @@ const Body = ({
|
|
|
180
182
|
case ModalStep.ACCOUNT_PROFILE_REMOVE: {
|
|
181
183
|
return /* @__PURE__ */ jsx(AccountProfileUnlink, {});
|
|
182
184
|
}
|
|
185
|
+
case ModalStep.ACCOUNT_WALLET: {
|
|
186
|
+
return /* @__PURE__ */ jsx(AccountWallet, {});
|
|
187
|
+
}
|
|
183
188
|
case ModalStep.EX_WALLET_SELECTED: {
|
|
184
189
|
return /* @__PURE__ */ jsx(ExternalWalletStep, {});
|
|
185
190
|
}
|
|
@@ -187,11 +192,38 @@ const Body = ({
|
|
|
187
192
|
return /* @__PURE__ */ jsx(ChainSwitch, {});
|
|
188
193
|
}
|
|
189
194
|
case ModalStep.EX_WALLET_NETWORK_SELECT: {
|
|
190
|
-
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, {});
|
|
195
|
+
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "CONNECT" });
|
|
196
|
+
}
|
|
197
|
+
case ModalStep.ADD_EX_WALLET_NETWORK_SELECT: {
|
|
198
|
+
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "ADD_EXTERNAL" });
|
|
199
|
+
}
|
|
200
|
+
case ModalStep.LINK_EX_WALLET_NETWORK_SELECT: {
|
|
201
|
+
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "ACCOUNT_LINKING" });
|
|
202
|
+
}
|
|
203
|
+
case ModalStep.ADD_EX_WALLET_MORE: {
|
|
204
|
+
return /* @__PURE__ */ jsx(ExternalWallets, { isAddingWallets: true });
|
|
205
|
+
}
|
|
206
|
+
case ModalStep.ADD_EX_WALLET_SELECTED: {
|
|
207
|
+
return /* @__PURE__ */ jsx(ExternalWalletStep, { isAddingWallets: true });
|
|
208
|
+
}
|
|
209
|
+
case ModalStep.ADD_EX_WALLET_NETWORK_SELECT: {
|
|
210
|
+
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, { type: "ADD_EXTERNAL" });
|
|
191
211
|
}
|
|
192
212
|
case ModalStep.AWAITING_ACCOUNT: {
|
|
193
213
|
return /* @__PURE__ */ jsx(AwaitingAccountStep, {});
|
|
194
214
|
}
|
|
215
|
+
case ModalStep.SWITCH_WALLETS: {
|
|
216
|
+
return /* @__PURE__ */ jsx(SwitchWalletsStep, {});
|
|
217
|
+
}
|
|
218
|
+
case ModalStep.ACCOUNT_SEND: {
|
|
219
|
+
return /* @__PURE__ */ jsx(AccountSend, { step: "SEND_FORM" });
|
|
220
|
+
}
|
|
221
|
+
case ModalStep.ACCOUNT_SEND_ASSET: {
|
|
222
|
+
return /* @__PURE__ */ jsx(AccountSend, { step: "SEND_ASSET" });
|
|
223
|
+
}
|
|
224
|
+
case ModalStep.ACCOUNT_SEND_NETWORK: {
|
|
225
|
+
return /* @__PURE__ */ jsx(AccountSend, { step: "SEND_NETWORK" });
|
|
226
|
+
}
|
|
195
227
|
default: {
|
|
196
228
|
if (IFrameSteps.includes(currentStep)) {
|
|
197
229
|
return null;
|
|
@@ -234,7 +266,7 @@ const Body = ({
|
|
|
234
266
|
setStepDirection(1);
|
|
235
267
|
},
|
|
236
268
|
custom: stepDirection,
|
|
237
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ jsxs(
|
|
238
270
|
BodyContainer,
|
|
239
271
|
{
|
|
240
272
|
custom: stepDirection,
|
|
@@ -243,34 +275,37 @@ const Body = ({
|
|
|
243
275
|
animate: "center",
|
|
244
276
|
exit: "exit",
|
|
245
277
|
transition: BODY_TRANSITION,
|
|
246
|
-
children:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ jsxs(
|
|
280
|
+
InnerContainer,
|
|
281
|
+
{
|
|
282
|
+
$embeddedModal: !!embeddedModal,
|
|
283
|
+
$step: currentStep,
|
|
284
|
+
$isIFrameStep: IFrameSteps.includes(currentStep),
|
|
285
|
+
children: [
|
|
286
|
+
!IFrameSteps.includes(currentStep) && /* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
|
|
287
|
+
Content(),
|
|
288
|
+
(onRampConfig == null ? void 0 : onRampConfig.testMode) && [
|
|
289
|
+
ModalStep.ADD_FUNDS_BUY,
|
|
290
|
+
ModalStep.ADD_FUNDS_WITHDRAW,
|
|
291
|
+
ModalStep.ADD_FUNDS_AWAITING,
|
|
292
|
+
ModalStep.ADD_FUNDS_FAILURE,
|
|
293
|
+
ModalStep.ADD_FUNDS_SUCCESS
|
|
294
|
+
].includes(currentStep) && isTestModeAlert && accountAddFundTab !== EnabledFlow.RECEIVE && /* @__PURE__ */ jsx(TestModeAlert, { children: /* @__PURE__ */ jsxs("div", { style: { fontSize: "14px" }, children: [
|
|
295
|
+
"This Para Modal is configured to run on-ramp services in ",
|
|
296
|
+
/* @__PURE__ */ jsx("b", { children: "test mode" }),
|
|
297
|
+
" only, for development purposes. If you are a user of ",
|
|
298
|
+
appName,
|
|
299
|
+
", please contact support.",
|
|
300
|
+
/* @__PURE__ */ jsx(CloseButton, { onClick: () => setIsTestModeAlert(false), children: /* @__PURE__ */ jsx(CloseX, { icon: "x" }) })
|
|
301
|
+
] }) })
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
),
|
|
305
|
+
modalError && /* @__PURE__ */ jsx(WarningBanner, { onClose: () => setModalError(void 0), children: renderTextWithLinks(modalError) })
|
|
306
|
+
]
|
|
272
307
|
},
|
|
273
|
-
["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : currentStep
|
|
308
|
+
["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : ["ACCOUNT_SEND", "ACCOUNT_SEND_ASSET", "ACCOUNT_SEND_NETWORK"].includes(currentStep) ? "ACCOUNT_SEND" : currentStep
|
|
274
309
|
)
|
|
275
310
|
}
|
|
276
311
|
),
|
|
@@ -291,7 +326,7 @@ const BodyContainer = safeStyled(motion.div)`
|
|
|
291
326
|
position: relative;
|
|
292
327
|
display: flex;
|
|
293
328
|
flex-direction: column;
|
|
294
|
-
gap:
|
|
329
|
+
gap: 12px;
|
|
295
330
|
will-change: auto !important;
|
|
296
331
|
`;
|
|
297
332
|
const InnerContainer = safeStyled.div`
|
|
@@ -312,14 +347,7 @@ const InnerContainer = safeStyled.div`
|
|
|
312
347
|
}};
|
|
313
348
|
|
|
314
349
|
@media (max-width: ${MOBILE_SIZE}px) {
|
|
315
|
-
padding: ${({ $embeddedModal, $
|
|
316
|
-
var _a;
|
|
317
|
-
return $isIFrameStep ? "0px" : $embeddedModal ? "12px 0px 0px" : `${(_a = PADDING_TOP[$step]) != null ? _a : "72px"} 16px 0px`;
|
|
318
|
-
}};
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
cpsl-auth-modal.force-mobile-media & {
|
|
322
|
-
padding: 72px 16px 0px;
|
|
350
|
+
padding: ${({ $embeddedModal, $isIFrameStep }) => $isIFrameStep ? "0px" : $embeddedModal ? "12px 0px 0px" : "0px"};
|
|
323
351
|
}
|
|
324
352
|
`;
|
|
325
353
|
const TestModeAlert = safeStyled(CpslAlert)`
|
|
@@ -333,14 +361,19 @@ const TestModeAlert = safeStyled(CpslAlert)`
|
|
|
333
361
|
const CloseButton = safeStyled.button`
|
|
334
362
|
background-color: transparent;
|
|
335
363
|
border: none;
|
|
336
|
-
padding:
|
|
364
|
+
padding: 0;
|
|
337
365
|
cursor: pointer;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
366
|
+
flex-shrink: 0;
|
|
367
|
+
display: flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
width: 20px;
|
|
371
|
+
height: 20px;
|
|
341
372
|
`;
|
|
342
373
|
const CloseX = safeStyled(CpslIcon)`
|
|
343
|
-
--icon-color: var(--cpsl-color-
|
|
374
|
+
--icon-color: var(--cpsl-color-utility-yellow-dark, #92400e);
|
|
375
|
+
--height: 18px;
|
|
376
|
+
--width: 18px;
|
|
344
377
|
`;
|
|
345
378
|
export {
|
|
346
379
|
Body
|