@getpara/react-sdk-lite 2.0.0-dev.6 → 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 -11
- 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 +10 -1
- 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 -37
- 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 +34 -18
- 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 +6 -1
- package/dist/provider/providers/AuthProvider.js +204 -44
- 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/cli/cli.mjs
CHANGED
|
@@ -14,7 +14,32 @@ const PACKAGES_TO_STUB = [
|
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
const checkForPackages = async () => {
|
|
17
|
-
|
|
17
|
+
let pathToNodeModules = path.resolve('node_modules');
|
|
18
|
+
|
|
19
|
+
// Check if pnpm-lock.yaml actually exists
|
|
20
|
+
const pnpmLockPath = path.resolve(process.cwd(), 'pnpm-lock.yaml');
|
|
21
|
+
let isPNPM = false;
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
await fs.access(pnpmLockPath);
|
|
25
|
+
isPNPM = true;
|
|
26
|
+
} catch {
|
|
27
|
+
isPNPM = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// If it's a PNPM project, adjust the node_modules path accordingly to account for virtual store
|
|
31
|
+
// NODE_PATH is set by PNPM to include the correct paths
|
|
32
|
+
if (isPNPM && process.env.NODE_PATH) {
|
|
33
|
+
const endingNodePathString = '@getpara/node_modules';
|
|
34
|
+
const nodePathSplit = process.env.NODE_PATH.split(path.delimiter);
|
|
35
|
+
const fullPath = nodePathSplit.find(p => p.endsWith(endingNodePathString));
|
|
36
|
+
if (fullPath) {
|
|
37
|
+
const newPath = fullPath.replace(endingNodePathString, '');
|
|
38
|
+
if (newPath) {
|
|
39
|
+
pathToNodeModules = newPath;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
18
43
|
|
|
19
44
|
for (let i = 0; i < PACKAGES_TO_STUB.length; i++) {
|
|
20
45
|
const packageName = PACKAGES_TO_STUB[i];
|
package/dist/modal/ParaModal.js
CHANGED
|
@@ -14,7 +14,7 @@ import { ModalStep, RESET_TO_ACCOUNT_STEPS, RESET_TO_AUTH_STEPS } from "./utils/
|
|
|
14
14
|
import { AuthLayout } from "./types/modalProps.js";
|
|
15
15
|
import { DEFAULTS } from "./constants/defaults.js";
|
|
16
16
|
import { useGoBack } from "./hooks/useGoBack.js";
|
|
17
|
-
import { safeStyled } from "@getpara/react-common";
|
|
17
|
+
import { safeStyled, SDK_VERSION } from "@getpara/react-common";
|
|
18
18
|
import { hasEmbeddedAuth, hasExternalWallet } from "./utils/authLayoutHelpers.js";
|
|
19
19
|
import { useAccount, useModal, useParaStatus, useWalletState } from "../provider/index.js";
|
|
20
20
|
import { useInternalClient } from "../provider/hooks/utils/useInternalClient.js";
|
|
@@ -23,13 +23,12 @@ import { useStore } from "../provider/stores/useStore.js";
|
|
|
23
23
|
import parsePhoneNumberFromString from "libphonenumber-js";
|
|
24
24
|
import { useAuthActions } from "../provider/providers/AuthProvider.js";
|
|
25
25
|
import { validateInput } from "./utils/authInputHelpers.js";
|
|
26
|
-
import { SDK_VERSION } from "./constants/constants.js";
|
|
27
26
|
defineCustomElements();
|
|
28
27
|
const ParaModal = forwardRef((props, ref) => {
|
|
29
28
|
const storedModalConfig = useStore((state) => state.modalConfig);
|
|
30
|
-
const
|
|
29
|
+
const refs = useStore((state) => state.refs);
|
|
31
30
|
const modalContentRef = useRef(null);
|
|
32
|
-
const
|
|
31
|
+
const modalRefs = useModalStore((state) => state.refs);
|
|
33
32
|
const flow = useModalStore((state) => state.flow);
|
|
34
33
|
const currentStep = useModalStore((state) => state.step);
|
|
35
34
|
const setAuthState = useModalStore((state) => state.setAuthState);
|
|
@@ -57,6 +56,7 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
57
56
|
const externalWallets = useStore((state) => state.externalWallets);
|
|
58
57
|
const providerProps = useStore((state) => state.providerProps);
|
|
59
58
|
const setAccountLinkOptions = useModalStore((state) => state.setAccountLinkOptions);
|
|
59
|
+
const selectedExternalWallet = useModalStore((state) => state.selectedExternalWallet);
|
|
60
60
|
const isInitialized = useRef(false);
|
|
61
61
|
const _a = __spreadValues(__spreadValues({}, storedModalConfig), props), {
|
|
62
62
|
isOpen: configIsOpen,
|
|
@@ -112,7 +112,7 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
112
112
|
}), rest),
|
|
113
113
|
reactSdkVersion: SDK_VERSION
|
|
114
114
|
});
|
|
115
|
-
} catch (
|
|
115
|
+
} catch (e) {
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
trackAnalytics();
|
|
@@ -153,7 +153,7 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
153
153
|
break;
|
|
154
154
|
case isAccount:
|
|
155
155
|
setFlow("account");
|
|
156
|
-
if (!openedToStep.current) {
|
|
156
|
+
if (!refs.openedToStep.current) {
|
|
157
157
|
setStep(ModalStep.ACCOUNT_MAIN);
|
|
158
158
|
}
|
|
159
159
|
break;
|
|
@@ -168,7 +168,6 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
168
168
|
yield disconnectExternalWallet();
|
|
169
169
|
setSelectedWallet({ id: void 0, type: void 0 });
|
|
170
170
|
}
|
|
171
|
-
yield para.logout();
|
|
172
171
|
if (shouldAutoLogin) {
|
|
173
172
|
if (defaultAuthIdentifier && ((_a2 = para.authInfo) == null ? void 0 : _a2.identifier) !== defaultAuthIdentifier) {
|
|
174
173
|
const number = parsePhoneNumberFromString(defaultAuthIdentifier);
|
|
@@ -193,12 +192,18 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
193
192
|
initModal(isOpen);
|
|
194
193
|
isInitialized.current = true;
|
|
195
194
|
}
|
|
195
|
+
let timerId;
|
|
196
196
|
if (!bareModal && isReady && !isOpen && isInitialized.current) {
|
|
197
|
-
setTimeout(() => {
|
|
197
|
+
timerId = setTimeout(() => {
|
|
198
198
|
initModal();
|
|
199
199
|
isInitialized.current = false;
|
|
200
200
|
}, 250);
|
|
201
201
|
}
|
|
202
|
+
return () => {
|
|
203
|
+
if (timerId) {
|
|
204
|
+
clearTimeout(timerId);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
202
207
|
}, [bareModal, isReady, isOpen, isAccountLoading]);
|
|
203
208
|
useEffect(() => {
|
|
204
209
|
let _authLayout = authLayout;
|
|
@@ -224,10 +229,10 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
224
229
|
updateSelectedWallet();
|
|
225
230
|
}, [para]);
|
|
226
231
|
useEffect(() => {
|
|
227
|
-
if (bareModal && !isAccountLoading && !isConnected && !["signup", "login"].includes(flow != null ? flow : "") &&
|
|
232
|
+
if (bareModal && !selectedExternalWallet && !isAccountLoading && !isConnected && !["signup", "login"].includes(flow != null ? flow : "") && modalRefs.currentStep.current !== ModalStep.AUTH_MAIN) {
|
|
228
233
|
setStep(ModalStep.AUTH_MAIN);
|
|
229
234
|
}
|
|
230
|
-
}, [bareModal, flow, isConnected, isAccountLoading]);
|
|
235
|
+
}, [bareModal, flow, isConnected, isAccountLoading, selectedExternalWallet]);
|
|
231
236
|
useEffect(() => {
|
|
232
237
|
setAccountLinkOptions(propsSupportedAccountLinks != null ? propsSupportedAccountLinks : para == null ? void 0 : para.supportedAccountLinks);
|
|
233
238
|
}, [propsSupportedAccountLinks, para == null ? void 0 : para.supportedAccountLinks]);
|
|
@@ -257,7 +262,7 @@ const ParaModal = forwardRef((props, ref) => {
|
|
|
257
262
|
setIsModalMounted(true);
|
|
258
263
|
};
|
|
259
264
|
const handleModalExited = () => __async(void 0, null, function* () {
|
|
260
|
-
openedToStep.current = null;
|
|
265
|
+
refs.openedToStep.current = null;
|
|
261
266
|
setIsModalMounted(false);
|
|
262
267
|
if (RESET_TO_AUTH_STEPS.includes(currentStep)) {
|
|
263
268
|
resetModalState();
|
|
@@ -8,22 +8,36 @@ import { OnRampStep, useModalStore } from "../../stores/index.js";
|
|
|
8
8
|
import { useEffect } from "react";
|
|
9
9
|
import { ModalStep } from "../../utils/steps.js";
|
|
10
10
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
11
|
-
import { useAccount,
|
|
11
|
+
import { useAccount, useWalletState } from "../../../provider/index.js";
|
|
12
12
|
import { EnabledFlow } from "@getpara/web-sdk";
|
|
13
13
|
import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
|
|
14
|
+
import { useAssets } from "../../../provider/providers/AssetsProvider.js";
|
|
14
15
|
import { AccountHeader } from "./AccountHeader.js";
|
|
15
16
|
const Account = () => {
|
|
16
17
|
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
17
18
|
const setStep = useModalStore((state) => state.setStep);
|
|
18
19
|
const setGuestAddFundsTab = useModalStore((state) => state.setGuestAddFundsTab);
|
|
19
20
|
const setOnRampStep = useModalStore((state) => state.setOnRampStep);
|
|
21
|
+
const sendTx = useModalStore((state) => state.sendTx);
|
|
20
22
|
const para = useInternalClient();
|
|
21
23
|
const { embedded } = useAccount();
|
|
22
|
-
const {
|
|
24
|
+
const { selectedWallet, setSelectedWallet } = useWalletState();
|
|
23
25
|
const { isEnabled } = useAccountLinking();
|
|
26
|
+
const { profileBalance } = useAssets();
|
|
24
27
|
const isGuestMode = embedded.isConnected && embedded.isGuestMode;
|
|
25
28
|
const cantBuyAndWithdraw = (para.externalWalletConnectionType === "CONNECTION_ONLY" || para.externalWalletConnectionType === "VERIFICATION") && !para.userId;
|
|
26
29
|
const isOnRampLoaded = !!onRampConfig;
|
|
30
|
+
const handleSendClick = () => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
if ((selectedWallet == null ? void 0 : selectedWallet.type) === "COSMOS" || ((_a = embedded.wallets) == null ? void 0 : _a.some((w) => w.id === (selectedWallet == null ? void 0 : selectedWallet.id) && w.isExternal))) {
|
|
33
|
+
const validWallet = (_b = embedded.wallets) == null ? void 0 : _b.find(({ type, isExternal }) => type !== "COSMOS" && !isExternal);
|
|
34
|
+
if (!validWallet) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setSelectedWallet({ id: validWallet.id, type: validWallet.type });
|
|
38
|
+
}
|
|
39
|
+
setStep(ModalStep.ACCOUNT_SEND);
|
|
40
|
+
};
|
|
27
41
|
const handleBuyClick = () => {
|
|
28
42
|
if (isGuestMode) {
|
|
29
43
|
if (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled) {
|
|
@@ -56,7 +70,7 @@ const Account = () => {
|
|
|
56
70
|
/* @__PURE__ */ jsx(AccountHeader, { withBalance: true }),
|
|
57
71
|
/* @__PURE__ */ jsxs(LowerContainer, { children: [
|
|
58
72
|
isGuestMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
-
|
|
73
|
+
profileBalance && profileBalance.value && profileBalance.value.value > 0 && /* @__PURE__ */ jsxs(Alert, { children: [
|
|
60
74
|
/* @__PURE__ */ jsx(CpslIcon, { icon: "alertTriangle", size: "24px", style: { color: "var(--cpsl-color-utility-yellow)" } }),
|
|
61
75
|
"You've funded this account - complete account setup to maintain access."
|
|
62
76
|
] }),
|
|
@@ -75,8 +89,13 @@ const Account = () => {
|
|
|
75
89
|
}
|
|
76
90
|
)
|
|
77
91
|
] }),
|
|
92
|
+
!!(sendTx == null ? void 0 : sendTx.explorerUrl) && /* @__PURE__ */ jsxs(MonitorLink, { target: "_blank", href: sendTx.explorerUrl, rel: "noopener noreferrer", children: [
|
|
93
|
+
/* @__PURE__ */ jsx("span", { children: "Monitor Transaction" }),
|
|
94
|
+
/* @__PURE__ */ jsx(CpslIcon, { icon: "externalLink", size: "16px", style: { marginLeft: "6px" } })
|
|
95
|
+
] }),
|
|
78
96
|
/* @__PURE__ */ jsx(ButtonContainer, { children: isOnRampLoaded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
97
|
(onRampConfig.isBuyEnabled || onRampConfig.isReceiveEnabled) && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "plusCircle", onClick: handleBuyClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Add Funds" }) }),
|
|
98
|
+
/* @__PURE__ */ jsx(OptionButton, { icon: "send", onClick: handleSendClick, disabled: !profileBalance, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Send" }) }),
|
|
80
99
|
onRampConfig.isWithdrawEnabled && !cantBuyAndWithdraw && /* @__PURE__ */ jsx(OptionButton, { icon: "arrowCircleDown", onClick: handleSellClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: "Withdraw" }) }),
|
|
81
100
|
/* @__PURE__ */ jsx(OptionButton, { icon: "user01", onClick: handleProfileClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: isEnabled ? "Profile" : "Settings" }) })
|
|
82
101
|
] }) : /* @__PURE__ */ jsx(CpslSpinner, {}) })
|
|
@@ -122,8 +141,27 @@ const Alert = safeStyled.div`
|
|
|
122
141
|
const LowerContainer = safeStyled.div`
|
|
123
142
|
display: flex;
|
|
124
143
|
flex-direction: column;
|
|
125
|
-
gap:
|
|
144
|
+
gap: 16px;
|
|
145
|
+
width: 100%;
|
|
146
|
+
`;
|
|
147
|
+
const MonitorLink = safeStyled.a`
|
|
148
|
+
font-family: var(--cpsl-font-family);
|
|
149
|
+
font-size: 14px;
|
|
150
|
+
position: relative;
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
justify-content: center;
|
|
126
154
|
width: 100%;
|
|
155
|
+
background: transparent;
|
|
156
|
+
border: none;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
color: var(--cpsl-color-text-primary);
|
|
159
|
+
--icon-color: var(--cpsl-color-text-primary);
|
|
160
|
+
|
|
161
|
+
&:hover {
|
|
162
|
+
color: var(--cpsl-color-text-contrast);
|
|
163
|
+
--icon-color: var(--cpsl-color-text-contrast);
|
|
164
|
+
}
|
|
127
165
|
`;
|
|
128
166
|
export {
|
|
129
167
|
Account
|
|
@@ -2,32 +2,26 @@
|
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { getExternalWalletIcon, safeStyled } from "@getpara/react-common";
|
|
5
|
-
import { formatBalanceString } from "../../utils/stringFormatters.js";
|
|
6
5
|
import { CpslIcon, CpslText } from "@getpara/react-components";
|
|
7
6
|
import { useMemo } from "react";
|
|
8
7
|
import { truncateAddress } from "@getpara/web-sdk";
|
|
9
8
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const { data: balance } = useWalletBalance();
|
|
14
|
-
return /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", weight: "medium", style: { visibility: !!balance ? "visible" : "hidden" }, children: balance ? formatBalanceString(balance) : "0" });
|
|
15
|
-
};
|
|
9
|
+
import { useAssets } from "../../../provider/providers/AssetsProvider.js";
|
|
10
|
+
import { useAccount, useWallet } from "../../../provider/index.js";
|
|
11
|
+
import { AccountWalletSelect } from "./AccountWalletSelect.js";
|
|
16
12
|
const AccountHeader = ({ withBalance = false } = {}) => {
|
|
17
13
|
const para = useInternalClient();
|
|
18
14
|
const { connectionType } = useAccount();
|
|
15
|
+
const { profileBalance, totalBalance } = useAssets();
|
|
19
16
|
const { data: activeWallet } = useWallet();
|
|
20
17
|
const { name, icon, src } = useMemo(() => {
|
|
21
18
|
var _a;
|
|
22
19
|
let name2, icon2, src2;
|
|
23
20
|
switch (true) {
|
|
24
21
|
case (activeWallet == null ? void 0 : activeWallet.isExternal):
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
src2 = wallet.ensAvatar;
|
|
29
|
-
icon2 = getExternalWalletIcon(wallet.externalProviderId);
|
|
30
|
-
}
|
|
22
|
+
name2 = (_a = activeWallet.ensName) != null ? _a : truncateAddress(activeWallet.address, activeWallet.type, { prefix: para.cosmosPrefix });
|
|
23
|
+
src2 = activeWallet.ensAvatar;
|
|
24
|
+
icon2 = getExternalWalletIcon(activeWallet.externalProviderId);
|
|
31
25
|
break;
|
|
32
26
|
default:
|
|
33
27
|
name2 = `${para.partnerName} Wallet`;
|
|
@@ -36,7 +30,7 @@ const AccountHeader = ({ withBalance = false } = {}) => {
|
|
|
36
30
|
break;
|
|
37
31
|
}
|
|
38
32
|
return { name: name2, icon: icon2, src: src2 };
|
|
39
|
-
}, [
|
|
33
|
+
}, [para.partnerName, para.partnerLogo, activeWallet]);
|
|
40
34
|
return /* @__PURE__ */ jsxs(AccountContainer, { children: [
|
|
41
35
|
/* @__PURE__ */ jsx(
|
|
42
36
|
CpslIcon,
|
|
@@ -50,8 +44,8 @@ const AccountHeader = ({ withBalance = false } = {}) => {
|
|
|
50
44
|
src
|
|
51
45
|
}
|
|
52
46
|
),
|
|
53
|
-
connectionType === "both" ? /* @__PURE__ */ jsx(
|
|
54
|
-
withBalance && /* @__PURE__ */ jsx(
|
|
47
|
+
connectionType === "both" ? /* @__PURE__ */ jsx(AccountWalletSelect, {}) : /* @__PURE__ */ jsx(CpslText, { variant: "headingXS", weight: "semiBold", color: "contrast", children: name }),
|
|
48
|
+
withBalance && typeof totalBalance === "string" && totalBalance !== "" && /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", weight: "medium", style: { visibility: profileBalance ? "visible" : "hidden" }, children: totalBalance })
|
|
55
49
|
] });
|
|
56
50
|
};
|
|
57
51
|
const AccountContainer = safeStyled.div`
|
|
@@ -3,156 +3,113 @@ import {
|
|
|
3
3
|
__spreadProps,
|
|
4
4
|
__spreadValues
|
|
5
5
|
} from "../../../chunk-MMUBH76A.js";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { GradientScroll, StepContainer } from "../common.js";
|
|
8
8
|
import { CpslButton, CpslIcon, CpslText } from "@getpara/react-components";
|
|
9
|
-
import { useAccount
|
|
9
|
+
import { useAccount } from "../../../provider/index.js";
|
|
10
10
|
import { useLinkedAccounts } from "../../../provider/hooks/index.js";
|
|
11
|
-
import { getWalletDisplayName } from "../../utils/getWalletDisplayName.js";
|
|
12
|
-
import { truncateAddress } from "@getpara/web-sdk";
|
|
13
11
|
import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { useEffect, useMemo } from "react";
|
|
13
|
+
import { safeStyled } from "@getpara/react-common";
|
|
16
14
|
import { useStore } from "../../../provider/stores/useStore.js";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
addressShort,
|
|
24
|
-
onUnlink
|
|
25
|
-
}) => {
|
|
26
|
-
const [isCopied, copy] = useCopyToClipboard();
|
|
27
|
-
return /* @__PURE__ */ jsxs(EntryContainer, { children: [
|
|
28
|
-
icon,
|
|
29
|
-
/* @__PURE__ */ jsx(EntryDisplayName, { variant: "bodyM", color: "contrast", children: name }),
|
|
30
|
-
/* @__PURE__ */ jsx(EntryFlex, { children: address ? /* @__PURE__ */ jsxs(EntryAddress, { children: [
|
|
31
|
-
/* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "secondary", children: addressShort != null ? addressShort : address }),
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
CpslButton,
|
|
34
|
-
{
|
|
35
|
-
size: "small",
|
|
36
|
-
variant: "ghost",
|
|
37
|
-
onClick: (e) => {
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
copy(address);
|
|
41
|
-
},
|
|
42
|
-
children: /* @__PURE__ */ jsx(CopyIcon, { id: "ignore-click", slot: "start", isCopied, icon: isCopied ? "check" : "copy" })
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
] }) : null }),
|
|
46
|
-
onUnlink && /* @__PURE__ */ jsx(EntryUnlink, { href: "#", onClick: onUnlink, children: "Unlink" })
|
|
47
|
-
] }, address != null ? address : identifier);
|
|
48
|
-
};
|
|
15
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
16
|
+
import { useModalStore } from "../../stores/index.js";
|
|
17
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
18
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
19
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
20
|
+
import { AccountLinkEntry, WalletEntry } from "./AccountProfileEntry.js";
|
|
49
21
|
const AccountProfile = ({
|
|
50
22
|
isDisconnecting,
|
|
51
23
|
onDisconnect
|
|
52
24
|
}) => {
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const { connectionType, embedded } = useAccount();
|
|
25
|
+
const para = useInternalClient();
|
|
26
|
+
const { embedded } = useAccount();
|
|
56
27
|
const { data: linkedAccounts } = useLinkedAccounts();
|
|
57
|
-
const {
|
|
58
|
-
const { isEnabled, linkAccount, unlinkAccount } = useAccountLinking();
|
|
28
|
+
const { isEnabled: isAccountLinkingEnabled, linkAccount } = useAccountLinking();
|
|
59
29
|
const hideWallets = useStore((state) => {
|
|
60
|
-
var
|
|
61
|
-
return (
|
|
30
|
+
var _a;
|
|
31
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
62
32
|
});
|
|
63
|
-
|
|
64
|
-
|
|
33
|
+
const { switchWallets, switchWalletsUrl, setSwitchWalletsUrl, isSwitchWalletsPending } = useAuthActions();
|
|
34
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
35
|
+
const partnerGroups = useMemo(() => {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = embedded == null ? void 0 : embedded.wallets) == null ? void 0 : _a.reduce((acc, wallet) => {
|
|
38
|
+
if (!wallet.partner || !wallet.partner.id || !wallet.partner.displayName) return acc;
|
|
39
|
+
const partnerGroup = acc.find((group) => {
|
|
40
|
+
var _a2;
|
|
41
|
+
return group.partner.id === ((_a2 = wallet.partner) == null ? void 0 : _a2.id);
|
|
42
|
+
});
|
|
43
|
+
return !!partnerGroup ? acc.map(
|
|
44
|
+
(group) => group.partner.id === wallet.partner.id ? __spreadProps(__spreadValues({}, group), { wallets: [...group.wallets, wallet] }) : group
|
|
45
|
+
) : [...acc, { partner: wallet.partner, wallets: [wallet] }];
|
|
46
|
+
}, []);
|
|
47
|
+
}, [embedded == null ? void 0 : embedded.wallets]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (para) {
|
|
50
|
+
para.getSwitchWalletsUrl().then((url) => {
|
|
51
|
+
setSwitchWalletsUrl(url);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, []);
|
|
55
|
+
if (!para || !switchWalletsUrl) {
|
|
56
|
+
return /* @__PURE__ */ jsx(Waiting, {});
|
|
65
57
|
}
|
|
66
|
-
const externalWallet = (_a = para.authInfo) == null ? void 0 : _a.externalWallet;
|
|
67
58
|
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/* @__PURE__ */ jsx(
|
|
80
|
-
|
|
59
|
+
partnerGroups && partnerGroups.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
60
|
+
partnerGroups.map(({ partner, wallets }) => {
|
|
61
|
+
return /* @__PURE__ */ jsxs(Section, { children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(Title, { variant: "bodyS", color: "secondary", children: [
|
|
63
|
+
partner.displayName,
|
|
64
|
+
" Wallets"
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx(Content, { children: wallets.map((wallet) => /* @__PURE__ */ jsx(WalletEntry, { wallet, isSelectable: true }, `${wallet.address}-${wallet.type}`)) })
|
|
67
|
+
] }, partner.id);
|
|
68
|
+
}),
|
|
69
|
+
!embedded.isGuestMode && /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, variant: "tertiary", onClick: switchWallets, disabled: isSwitchWalletsPending, children: isSwitchWalletsPending ? "Please Wait..." : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(CpslIcon, { icon: "shuffle", slot: "start", size: "16px" }),
|
|
71
|
+
para.isMultiWallet ? "Switch Wallets" : "Switch Wallet"
|
|
72
|
+
] }) })
|
|
81
73
|
] }),
|
|
82
|
-
/* @__PURE__ */ jsxs(Section, { children: [
|
|
74
|
+
!embedded.isGuestMode && /* @__PURE__ */ jsxs(Section, { children: [
|
|
83
75
|
/* @__PURE__ */ jsx(Title, { variant: "bodyS", color: "secondary", children: "Connected Wallets" }),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
) : (_f = para == null ? void 0 : para.availableWallets) == null ? void 0 : _f.map((wallet) => /* @__PURE__ */ jsx(
|
|
104
|
-
Entry,
|
|
105
|
-
{
|
|
106
|
-
icon: /* @__PURE__ */ jsx(WalletTypeIcon, { walletType: wallet.type, externalWallet: wallet.externalProviderId, size: "24px" }),
|
|
107
|
-
name: getWalletDisplayName(para, wallet),
|
|
108
|
-
address: wallet.address,
|
|
109
|
-
addressShort: truncateAddress(wallet.address, wallet.type)
|
|
110
|
-
},
|
|
111
|
-
wallet.address
|
|
112
|
-
)) })
|
|
76
|
+
/* @__PURE__ */ jsxs(Content, { children: [
|
|
77
|
+
para.availableWallets.filter(({ isExternal }) => isExternal).map((wallet) => {
|
|
78
|
+
return /* @__PURE__ */ jsx(WalletEntry, { wallet, isSelectable: true }, wallet.address);
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ jsxs(
|
|
81
|
+
CpslButton,
|
|
82
|
+
{
|
|
83
|
+
fullWidth: true,
|
|
84
|
+
variant: "tertiary",
|
|
85
|
+
onClick: () => {
|
|
86
|
+
setStep(ModalStep.ADD_EX_WALLET_MORE);
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsx(CpslIcon, { icon: "plus", slot: "start" }),
|
|
90
|
+
"Add Wallet"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] })
|
|
113
95
|
] }),
|
|
114
|
-
|
|
96
|
+
isAccountLinkingEnabled && /* @__PURE__ */ jsxs(Section, { children: [
|
|
115
97
|
/* @__PURE__ */ jsx(Title, { variant: "bodyS", color: "secondary", children: "Linked Accounts" }),
|
|
116
98
|
/* @__PURE__ */ jsxs(Content, { children: [
|
|
117
|
-
/* @__PURE__ */ jsx(GradientScroll, { gap: "12px", height: "360px", children: [...((linkedAccounts == null ? void 0 : linkedAccounts.primary) || []).map((p) => __spreadProps(__spreadValues({}, p), { isPrimary: true })), ...(linkedAccounts == null ? void 0 : linkedAccounts.linked) || []].filter(({ externalWallet
|
|
118
|
-
return !
|
|
99
|
+
/* @__PURE__ */ jsx(GradientScroll, { gap: "12px", height: "360px", children: [...((linkedAccounts == null ? void 0 : linkedAccounts.primary) || []).map((p) => __spreadProps(__spreadValues({}, p), { isPrimary: true })), ...(linkedAccounts == null ? void 0 : linkedAccounts.linked) || []].filter(({ externalWallet }) => {
|
|
100
|
+
return !externalWallet || externalWallet.address !== (embedded == null ? void 0 : embedded.externalWalletAddress);
|
|
119
101
|
}).map((linkedAccount) => {
|
|
120
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
121
|
-
const { identifier, displayName, type, isPrimary = false, externalWallet: externalWallet2 } = linkedAccount;
|
|
122
|
-
const externalWalletConnector = wallets.find((wallet) => wallet.id === (externalWallet2 == null ? void 0 : externalWallet2.providerId));
|
|
123
|
-
let accountType = type;
|
|
124
|
-
let src = void 0;
|
|
125
|
-
if (externalWallet2) {
|
|
126
|
-
if (externalWalletConnector) {
|
|
127
|
-
accountType = void 0;
|
|
128
|
-
src = externalWalletConnector.iconUrl;
|
|
129
|
-
} else if (externalWallet2.providerId && ACCOUNT_TYPES[externalWallet2.providerId]) {
|
|
130
|
-
accountType = externalWallet2.providerId;
|
|
131
|
-
src = void 0;
|
|
132
|
-
} else {
|
|
133
|
-
accountType = "EXTERNAL_WALLET";
|
|
134
|
-
src = void 0;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
102
|
return /* @__PURE__ */ jsx(
|
|
138
|
-
|
|
103
|
+
AccountLinkEntry,
|
|
139
104
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
address: (_d2 = externalWallet2 == null ? void 0 : externalWallet2.addressBech32) != null ? _d2 : externalWallet2 == null ? void 0 : externalWallet2.address,
|
|
143
|
-
addressShort: externalWallet2 ? truncateAddress((_e2 = externalWallet2.addressBech32) != null ? _e2 : externalWallet2.address, externalWallet2.type, {
|
|
144
|
-
prefix: para.cosmosPrefix
|
|
145
|
-
}) : void 0,
|
|
146
|
-
onUnlink: isPrimary ? void 0 : (e) => {
|
|
147
|
-
e.preventDefault();
|
|
148
|
-
unlinkAccount(linkedAccount);
|
|
149
|
-
}
|
|
105
|
+
accountLink: linkedAccount,
|
|
106
|
+
isPrimary: linkedAccount.isPrimary
|
|
150
107
|
},
|
|
151
|
-
|
|
108
|
+
linkedAccount.id
|
|
152
109
|
);
|
|
153
110
|
}) }),
|
|
154
111
|
/* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, variant: "tertiary", onClick: () => linkAccount(void 0), children: [
|
|
155
|
-
/* @__PURE__ */ jsx(CpslIcon, { icon: "userPlus", slot: "start" }),
|
|
112
|
+
/* @__PURE__ */ jsx(CpslIcon, { icon: "userPlus", slot: "start", size: "16px" }),
|
|
156
113
|
"Link an account"
|
|
157
114
|
] })
|
|
158
115
|
] })
|
|
@@ -177,95 +134,10 @@ const Content = safeStyled(Section)`
|
|
|
177
134
|
const Title = safeStyled(CpslText)`
|
|
178
135
|
font-weight: 600;
|
|
179
136
|
`;
|
|
180
|
-
const EntryContainer = safeStyled.div`
|
|
181
|
-
overflow: hidden;
|
|
182
|
-
position: relative;
|
|
183
|
-
width: 100%;
|
|
184
|
-
display: flex;
|
|
185
|
-
gap: 8px;
|
|
186
|
-
align-items: center;
|
|
187
|
-
`;
|
|
188
|
-
const EntryDisplayName = safeStyled(CpslText)``;
|
|
189
|
-
const EntryFlex = safeStyled.div`
|
|
190
|
-
flex: 1;
|
|
191
|
-
`;
|
|
192
|
-
const EntryAddress = safeStyled.div`
|
|
193
|
-
display: flex;
|
|
194
|
-
gap: 8px;
|
|
195
|
-
align-items: center;
|
|
196
|
-
`;
|
|
197
|
-
const CopyIcon = safeStyled(CpslIcon)`
|
|
198
|
-
--width: 16px;
|
|
199
|
-
--height: 16px;
|
|
200
|
-
--icon-color: ${({ isCopied }) => isCopied ? "var(--cpsl-color-utility-green) !important" : "var(--cpsl-color-text-secondary)"};
|
|
201
|
-
|
|
202
|
-
&:hover {
|
|
203
|
-
--icon-color: var(--cpsl-color-text-contrast);
|
|
204
|
-
}
|
|
205
|
-
`;
|
|
206
|
-
const EntryUnlink = safeStyled.a`
|
|
207
|
-
color: var(--cpsl-color-utility-red);
|
|
208
|
-
position: absolute;
|
|
209
|
-
right: 0;
|
|
210
|
-
text-decoration: none;
|
|
211
|
-
font-size: 14px;
|
|
212
|
-
font-weight: 500;
|
|
213
|
-
font-family: var(--cpsl-font-family);
|
|
214
|
-
|
|
215
|
-
&:hover {
|
|
216
|
-
text-decoration: underline;
|
|
217
|
-
}
|
|
218
|
-
`;
|
|
219
137
|
const DisconnectButton = safeStyled(CpslButton)`
|
|
220
138
|
--button-border-width: 0px;
|
|
221
139
|
--button-destructive-hover-background-color: rgba(255, 0, 0, 0.2);
|
|
222
140
|
--button-destructive-active-background-color: rgba(255, 0, 0, 0.1);
|
|
223
|
-
|
|
224
|
-
`;
|
|
225
|
-
const ParaConnect = safeStyled.a`
|
|
226
|
-
position: relative;
|
|
227
|
-
box-sizing: border-box;
|
|
228
|
-
width: 100%;
|
|
229
|
-
text-decoration: none;
|
|
230
|
-
color: white !important;
|
|
231
|
-
font-family: 'PP Mori', sans-serif;
|
|
232
|
-
font-weight: 500;
|
|
233
|
-
font-size: 15px;
|
|
234
|
-
padding: 16px;
|
|
235
|
-
height: 69px;
|
|
236
|
-
display: flex;
|
|
237
|
-
align-items: center;
|
|
238
|
-
justify-content: flex-start;
|
|
239
|
-
gap: 8px;
|
|
240
|
-
border-radius: 8px;
|
|
241
|
-
border: 1px solid #FF4E00;
|
|
242
|
-
background: #FF4E00;
|
|
243
|
-
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.05), 0 0 20px 8px rgba(251, 188, 4, 0.20) inset;
|
|
244
|
-
|
|
245
|
-
&:hover, &:active {
|
|
246
|
-
background: #FF6A2B;
|
|
247
|
-
border: 1px solid #FF6A2B;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
`;
|
|
251
|
-
const ParaIcon = safeStyled(CpslIcon)`
|
|
252
|
-
--icon-border-radius: 4px;
|
|
253
|
-
`;
|
|
254
|
-
const Dots = safeStyled.div`
|
|
255
|
-
width: 75px;
|
|
256
|
-
position: absolute;
|
|
257
|
-
right: 14px;
|
|
258
|
-
top: 7px;
|
|
259
|
-
`;
|
|
260
|
-
const DotsIcon = safeStyled(CpslIcon)`
|
|
261
|
-
position: absolute;
|
|
262
|
-
left: ${({ index }) => `${index % 3 * 27.5}px`};
|
|
263
|
-
top: ${({ index }) => `${Math.floor(index / 3) * 27.5}px`};
|
|
264
|
-
`;
|
|
265
|
-
const ParaArrow = safeStyled(CpslIcon)`
|
|
266
|
-
position: absolute;
|
|
267
|
-
top: 12px;
|
|
268
|
-
right: 4px;
|
|
269
141
|
`;
|
|
270
142
|
export {
|
|
271
143
|
AccountProfile
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { AvailableWallet, LinkedAccount } from '@getpara/web-sdk';
|
|
3
|
+
export declare const WalletEntry: ({ wallet, isSelectable, style, className, }: {
|
|
4
|
+
wallet: AvailableWallet;
|
|
5
|
+
isSelectable?: boolean;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
className?: string;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const AccountLinkEntry: ({ accountLink, isPrimary, }: {
|
|
10
|
+
accountLink: LinkedAccount;
|
|
11
|
+
isPrimary?: boolean;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|