@getpara/react-sdk-lite 2.0.0-alpha.42 → 2.0.0-alpha.43

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 (29) hide show
  1. package/dist/modal/components/Account/AccountHeader.js +8 -6
  2. package/dist/modal/components/Account/AccountProfile.js +2 -3
  3. package/dist/modal/components/Account/AccountProfileLinkOptions.js +1 -2
  4. package/dist/modal/components/Account/AccountProfileUnlink.js +1 -2
  5. package/dist/modal/components/AddFunds/AddFunds.js +3 -3
  6. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +1 -2
  7. package/dist/modal/components/ChainSwitch/config.d.ts +1 -1
  8. package/dist/modal/components/Controls/ChainSelect.js +18 -7
  9. package/dist/modal/components/ExternalWalletStep/config.d.ts +1 -1
  10. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +1 -1
  11. package/dist/modal/components/Header/hooks/useStepTitle.js +4 -4
  12. package/dist/modal/components/OAuth/OAuth.js +1 -2
  13. package/dist/modal/components/WalletSelect/WalletSelect.js +83 -48
  14. package/dist/modal/components/WalletSelectOld/WalletSelectOld.d.ts +11 -0
  15. package/dist/modal/components/WalletSelectOld/WalletSelectOld.js +158 -0
  16. package/dist/modal/components/common.d.ts +1 -1
  17. package/dist/modal/components/common.js +18 -6
  18. package/dist/modal/constants/constants.d.ts +2 -2
  19. package/dist/modal/constants/constants.js +1 -1
  20. package/dist/modal/utils/openPopup.js +1 -1
  21. package/dist/provider/hooks/queries/useAccount.js +3 -2
  22. package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +0 -1
  23. package/package.json +8 -8
  24. package/dist/modal/constants/oAuthLogos.d.ts +0 -12
  25. package/dist/modal/constants/oAuthLogos.js +0 -160
  26. package/dist/modal/types/commonTypes.d.ts +0 -15
  27. package/dist/modal/types/commonTypes.js +0 -1
  28. package/dist/modal/utils/icons.d.ts +0 -5
  29. package/dist/modal/utils/icons.js +0 -17
@@ -1,25 +1,27 @@
1
1
  "use client";
2
2
  import "../../../chunk-MMUBH76A.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
- import { safeStyled } from "@getpara/react-common";
4
+ import { getExternalWalletIcon, safeStyled } from "@getpara/react-common";
5
5
  import { formatBalanceString } from "../../utils/stringFormatters.js";
6
6
  import { CpslIcon, CpslText } from "@getpara/react-components";
7
7
  import { useMemo } from "react";
8
8
  import { truncateAddress } from "@getpara/web-sdk";
9
9
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
10
- import { getExternalWalletIcon } from "../../utils/icons.js";
11
- import { useWalletBalance } from "../../../provider/index.js";
10
+ import { useAccount, useWallet, useWalletBalance } from "../../../provider/index.js";
11
+ import { WalletSelect } from "../WalletSelect/WalletSelect.js";
12
12
  const Balance = () => {
13
13
  const { data: balance } = useWalletBalance();
14
14
  return /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", weight: "medium", style: { visibility: !!balance ? "visible" : "hidden" }, children: balance ? formatBalanceString(balance) : "0" });
15
15
  };
16
16
  const AccountHeader = ({ withBalance = false } = {}) => {
17
17
  const para = useInternalClient();
18
+ const { connectionType } = useAccount();
19
+ const { data: activeWallet } = useWallet();
18
20
  const { name, icon, src } = useMemo(() => {
19
21
  var _a;
20
22
  let name2, icon2, src2;
21
23
  switch (true) {
22
- case Object.keys(para == null ? void 0 : para.externalWallets).length > 0:
24
+ case (activeWallet == null ? void 0 : activeWallet.isExternal):
23
25
  {
24
26
  const wallet = Object.values(para.externalWallets)[0];
25
27
  name2 = (_a = wallet.ensName) != null ? _a : truncateAddress(wallet.address, wallet.type, { prefix: para.cosmosPrefix });
@@ -34,7 +36,7 @@ const AccountHeader = ({ withBalance = false } = {}) => {
34
36
  break;
35
37
  }
36
38
  return { name: name2, icon: icon2, src: src2 };
37
- }, [para.partnerName, para.partnerLogo, para.externalWallets]);
39
+ }, [activeWallet, para.partnerName, para.partnerLogo, para.externalWallets]);
38
40
  return /* @__PURE__ */ jsxs(AccountContainer, { children: [
39
41
  /* @__PURE__ */ jsx(
40
42
  CpslIcon,
@@ -48,7 +50,7 @@ const AccountHeader = ({ withBalance = false } = {}) => {
48
50
  src
49
51
  }
50
52
  ),
51
- /* @__PURE__ */ jsx(CpslText, { variant: "headingXS", weight: "semiBold", color: "contrast", children: name }),
53
+ connectionType === "both" ? /* @__PURE__ */ jsx(WalletSelect, {}) : /* @__PURE__ */ jsx(CpslText, { variant: "headingXS", weight: "semiBold", color: "contrast", children: name }),
52
54
  withBalance && /* @__PURE__ */ jsx(Balance, {})
53
55
  ] });
54
56
  };
@@ -11,9 +11,8 @@ import { useLinkedAccounts } from "../../../provider/hooks/index.js";
11
11
  import { getWalletDisplayName } from "../../utils/getWalletDisplayName.js";
12
12
  import { truncateAddress } from "@getpara/web-sdk";
13
13
  import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
14
- import { safeStyled, useCopyToClipboard } from "@getpara/react-common";
14
+ import { ACCOUNT_TYPES, safeStyled, useCopyToClipboard } from "@getpara/react-common";
15
15
  import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
16
- import { ACCOUNT_TYPES } from "../../constants/oAuthLogos.js";
17
16
  import { useStore } from "../../../provider/stores/useStore.js";
18
17
  import { AccountHeader } from "./AccountHeader.js";
19
18
  const Entry = ({
@@ -250,7 +249,7 @@ const ParaConnect = safeStyled.a`
250
249
 
251
250
  `;
252
251
  const ParaIcon = safeStyled(CpslIcon)`
253
- --border-radius: 4px;
252
+ --icon-border-radius: 4px;
254
253
  `;
255
254
  const Dots = safeStyled.div`
256
255
  width: 75px;
@@ -4,12 +4,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { AuthInput } from "../AuthInput/AuthInput.js";
5
5
  import { AccountTypeIcon, GradientScroll, StepContainer } from "../common.js";
6
6
  import { CpslButton, CpslDivider, CpslText } from "@getpara/react-components";
7
- import { getAccountTypeName } from "../../constants/oAuthLogos.js";
8
7
  import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
9
8
  import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
10
9
  import { useEffect, useMemo } from "react";
11
10
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
12
- import { safeStyled } from "@getpara/react-common";
11
+ import { getAccountTypeName, safeStyled } from "@getpara/react-common";
13
12
  function AccountProfileLinkOptions() {
14
13
  const para = useInternalClient();
15
14
  const { accountLinkOptions, linkAccount, isLinkAccountPending, linkAccountError, setLinkAccountError, resetMutations } = useAccountLinking();
@@ -4,9 +4,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { CpslButton, CpslText } from "@getpara/react-components";
5
5
  import { useEffect, useState } from "react";
6
6
  import { AccountTypeIcon } from "../common.js";
7
- import { getAccountTypeName } from "../../constants/oAuthLogos.js";
8
7
  import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
9
- import { safeStyled } from "@getpara/react-common";
8
+ import { getAccountTypeName, safeStyled } from "@getpara/react-common";
10
9
  function AccountProfileUnlink() {
11
10
  var _a, _b;
12
11
  const { unlinkingAccount, unlinkAccountConfirm, isUnlinkAccountPending } = useAccountLinking(), [accountType, setAccountType] = useState((_b = (_a = unlinkingAccount == null ? void 0 : unlinkingAccount.externalWallet) == null ? void 0 : _a.providerId) != null ? _b : unlinkingAccount == null ? void 0 : unlinkingAccount.type), [isUnlinkingExternalWallet, setIsUnlinkingExternalWallet] = useState(false);
@@ -15,7 +15,7 @@ import { AddFundsReceive } from "./AddFundsReceive.js";
15
15
  import { AddFundsContextProvider, TABS } from "./AddFundsContext.js";
16
16
  import { AnimatePresence } from "framer-motion";
17
17
  import { AddFundsSettings } from "./AddFundsSettings.js";
18
- import { WalletSelect } from "../WalletSelect/WalletSelect.js";
18
+ import { WalletSelectOld } from "../WalletSelectOld/WalletSelectOld.js";
19
19
  const AddFunds = () => {
20
20
  const step = useModalStore((state) => state.step);
21
21
  const onRampConfig = useModalStore((state) => state.onRampConfig);
@@ -56,13 +56,13 @@ const AddFunds = () => {
56
56
  return /* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, {}) });
57
57
  }
58
58
  return /* @__PURE__ */ jsxs(StepContainer, { children: [
59
- isMultiFlow && /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslTabs, { selectedTab: tab, onCpslTabsChanged: onSetTab, children: TABS.filter(([enabledFlow]) => enabledFlow === EnabledFlow.BUY || enabledFlow === EnabledFlow.WITHDRAW).map(
59
+ isMultiFlow && /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslTabs, { selectedTab: tab, onCpslTabsChanged: onSetTab, children: TABS.filter(([enabledFlow]) => enabledFlow === EnabledFlow.BUY || enabledFlow === EnabledFlow.RECEIVE).map(
60
60
  ([tab2, _, icon, title]) => /* @__PURE__ */ jsxs(CpslTab, { tab: tab2, children: [
61
61
  /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon }),
62
62
  title
63
63
  ] }, tab2)
64
64
  ) }) }),
65
- (step === ModalStep.ADD_FUNDS_RECEIVE || (embedded == null ? void 0 : embedded.wallets) && embedded.wallets.length > 1) && /* @__PURE__ */ jsx(WalletSelect, {}),
65
+ (step === ModalStep.ADD_FUNDS_RECEIVE || (embedded == null ? void 0 : embedded.wallets) && embedded.wallets.length > 1) && /* @__PURE__ */ jsx(WalletSelectOld, {}),
66
66
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(AddFundsContextProvider, { "data-testid": "add-funds", tab, children: Content }) })
67
67
  ] });
68
68
  };
@@ -3,12 +3,11 @@ import "../../../chunk-MMUBH76A.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Fragment as Fragment2, useMemo } from "react";
5
5
  import { CpslButton, CpslDivider, CpslIcon, CpslIconGroup } from "@getpara/react-components";
6
- import { safeStyled } from "@getpara/react-common";
6
+ import { ACCOUNT_TYPES, safeStyled } from "@getpara/react-common";
7
7
  import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
8
8
  import { useModalStore } from "../../stores/index.js";
9
9
  import { ModalStep } from "../../utils/steps.js";
10
10
  import { AuthLayout } from "../../types/modalProps.js";
11
- import { ACCOUNT_TYPES } from "../../constants/oAuthLogos.js";
12
11
  import { AuthOptions } from "../AuthOptions/AuthOptions.js";
13
12
  import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
14
13
  import { useStore } from "../../../provider/stores/useStore.js";
@@ -1,4 +1,4 @@
1
- import { Tab } from '../../types/commonTypes.js';
1
+ import { Tab } from '@getpara/react-common';
2
2
  export declare enum TabValue {
3
3
  extension = "extension",
4
4
  mobile = "mobile",
@@ -11,9 +11,14 @@ import { useWallet } from "../../../provider/index.js";
11
11
  import { HeaderSelect, HeaderSelectContainer, HeaderSelectItem, NetworkIcon } from "../common.js";
12
12
  import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
13
13
  import { getNetworkName } from "../../constants/constants.js";
14
- const Chain = ({ chainId, slot, isLarge = false }) => {
15
- const network = getNetworkFromChainId(chainId);
16
- const name = getNetworkName(network);
14
+ const Chain = ({
15
+ chain: { id, name },
16
+ slot,
17
+ isLarge = false
18
+ }) => {
19
+ var _a;
20
+ const network = getNetworkFromChainId(id.toString());
21
+ const networkName = (_a = name != null ? name : getNetworkName(id.toString())) != null ? _a : `Chain ID ${id.toString()}`;
17
22
  return /* @__PURE__ */ jsxs(
18
23
  "div",
19
24
  {
@@ -21,13 +26,13 @@ const Chain = ({ chainId, slot, isLarge = false }) => {
21
26
  style: { display: "flex", alignItems: "center", gap: "4px", padding: isLarge ? "0px" : "4px 0 4px 8px" },
22
27
  children: [
23
28
  /* @__PURE__ */ jsx(NetworkIcon, { network, size: isLarge ? "24px" : "16px" }),
24
- /* @__PURE__ */ jsx(ChainName, { variant: isLarge ? "bodyS" : "bodyXS", color: "contrast", children: name })
29
+ /* @__PURE__ */ jsx(ChainName, { variant: isLarge ? "bodyS" : "bodyXS", color: "contrast", children: networkName })
25
30
  ]
26
31
  }
27
32
  );
28
33
  };
29
34
  const ChainSelect = () => {
30
- var _a;
35
+ var _a, _b;
31
36
  const containerRef = useRef(null);
32
37
  const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
33
38
  const { data: activeWallet } = useWallet();
@@ -61,8 +66,14 @@ const ChainSelect = () => {
61
66
  alignCenter: true,
62
67
  selectedItemVariant: "bodyXS",
63
68
  children: [
64
- chainIdToUse && /* @__PURE__ */ jsx(Chain, { slot: "selected-item", chainId: chainIdToUse }),
65
- chains == null ? void 0 : chains.map((chain) => /* @__PURE__ */ jsx(HeaderSelectItem, { slot: "items", value: chain.id.toString(), children: /* @__PURE__ */ jsx(Chain, { isLarge: true, chainId: chain.id.toString() }) }, chain.id))
69
+ chainIdToUse && /* @__PURE__ */ jsx(
70
+ Chain,
71
+ {
72
+ slot: "selected-item",
73
+ chain: { id: chainIdToUse, name: (_b = chains.find((c) => c.id.toString() === chainIdToUse)) == null ? void 0 : _b.name }
74
+ }
75
+ ),
76
+ chains == null ? void 0 : chains.map((chain) => /* @__PURE__ */ jsx(HeaderSelectItem, { slot: "items", value: chain.id.toString(), children: /* @__PURE__ */ jsx(Chain, { isLarge: true, chain }) }, chain.id))
66
77
  ]
67
78
  }
68
79
  ) }) });
@@ -1,4 +1,4 @@
1
- import { Tab } from '../../types/commonTypes.js';
1
+ import { Tab } from '@getpara/react-common';
2
2
  export declare enum TabValue {
3
3
  extension = "extension",
4
4
  mobile = "mobile",
@@ -3,5 +3,5 @@ export declare const connectWalletTitle = "Connect Wallet";
3
3
  export declare const useStepTitle: () => {
4
4
  title: any;
5
5
  isTitleDisplayed: boolean;
6
- isControls: boolean;
6
+ isControls: boolean | undefined;
7
7
  };
@@ -6,7 +6,7 @@ import { ModalStep } from "../../../utils/steps.js";
6
6
  import { useExternalWallets } from "../../../../provider/providers/ExternalWalletProvider.js";
7
7
  import { useStore } from "../../../../provider/stores/useStore.js";
8
8
  import { useAccountLinking } from "../../../../provider/providers/AccountLinkProvider.js";
9
- import { useAccount } from "../../../../provider/index.js";
9
+ import { useWallet } from "../../../../provider/index.js";
10
10
  const signUpOrLogInTitle = "Sign Up or Login";
11
11
  const connectWalletTitle = "Connect Wallet";
12
12
  const useStepTitle = () => {
@@ -22,7 +22,7 @@ const useStepTitle = () => {
22
22
  const isLogin = useModalStore((state) => state.isLogin());
23
23
  const currentStep = useModalStore((state) => state.step);
24
24
  const authLayout = useModalStore((state) => state.authLayout) || [];
25
- const { connectionType } = useAccount();
25
+ const { data: activeWallet } = useWallet();
26
26
  const [isAuthFirst, isAuthCondensed, isExternalFirst, isExternalCondensed, isBothCondensed] = [
27
27
  (_a = authLayout[0]) == null ? void 0 : _a.includes("AUTH"),
28
28
  authLayout.includes("AUTH:CONDENSED"),
@@ -81,8 +81,8 @@ const useStepTitle = () => {
81
81
  return null;
82
82
  }, [currentStep, titles]);
83
83
  const isControls = useMemo(() => {
84
- return connectionType === "external" && [ModalStep.ACCOUNT_MAIN, ModalStep.CHAIN_SWITCH].includes(currentStep);
85
- }, [connectionType, currentStep]);
84
+ return (activeWallet == null ? void 0 : activeWallet.isExternal) && (activeWallet == null ? void 0 : activeWallet.type) === "EVM" && [ModalStep.ACCOUNT_MAIN, ModalStep.CHAIN_SWITCH].includes(currentStep);
85
+ }, [activeWallet, currentStep]);
86
86
  const isTitleDisplayed = useMemo(() => {
87
87
  return !isControls && (currentStep !== ModalStep.AUTH_MAIN || !logo);
88
88
  }, [isControls, currentStep, logo]);
@@ -3,12 +3,11 @@ import {
3
3
  __async
4
4
  } from "../../../chunk-MMUBH76A.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { safeStyled } from "@getpara/react-common";
6
+ import { ACCOUNT_TYPES, safeStyled } from "@getpara/react-common";
7
7
  import { useModalStore } from "../../stores/index.js";
8
8
  import { ModalStep } from "../../utils/steps.js";
9
9
  import { getTileButtonFlex } from "../../utils/getTileButtonFlex.js";
10
10
  import { StyledCpslTileButton } from "../common.js";
11
- import { ACCOUNT_TYPES } from "../../constants/oAuthLogos.js";
12
11
  import { useStore } from "../../../provider/stores/useStore.js";
13
12
  import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
14
13
  const HAS_MORE_LENGTH = 3;
@@ -1,30 +1,51 @@
1
1
  "use client";
2
2
  import "../../../chunk-MMUBH76A.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
- import { useEffect, useRef } from "react";
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 { safeStyled, useCopyToClipboard } from "@getpara/react-common";
7
+ import { getExternalWalletIcon, 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
- import * as common from "../common.js";
10
+ import { truncateAddress } from "@getpara/web-sdk";
11
11
  const getValue = (id, type) => {
12
12
  return id && type ? `${id}~${type}` : void 0;
13
13
  };
14
- const Wallet = ({ wallet, withCopy, slot }) => {
14
+ const Wallet = ({
15
+ wallet,
16
+ withCopy,
17
+ slot,
18
+ withIcon,
19
+ isMenu
20
+ }) => {
15
21
  const para = useInternalClient();
16
22
  const [isCopied, copy] = useCopyToClipboard();
17
- return /* @__PURE__ */ jsxs(WalletContainer, { slot, style: { flex: "1" }, children: [
23
+ const { name, icon, src } = useMemo(() => {
24
+ var _a;
25
+ let name2, icon2, src2;
26
+ if (wallet.isExternal) {
27
+ name2 = (_a = wallet.ensName) != null ? _a : truncateAddress(wallet.address, wallet.type, { prefix: para.cosmosPrefix });
28
+ src2 = wallet.ensAvatar;
29
+ icon2 = getExternalWalletIcon(wallet.externalProviderId);
30
+ } else {
31
+ name2 = `${para.partnerName} Wallet`;
32
+ src2 = para.partnerLogo;
33
+ icon2 = "wallet02";
34
+ }
35
+ return { name: name2, icon: icon2, src: src2 };
36
+ }, [wallet, para.partnerName, para.partnerLogo, para.externalWallets]);
37
+ return /* @__PURE__ */ jsxs(WalletContainer, { slot, style: isMenu ? void 0 : { flex: "0" }, children: [
38
+ withIcon && /* @__PURE__ */ jsx(WalletIcon, { icon, src, size: "32px", inset: "6px" }),
18
39
  /* @__PURE__ */ jsx(
19
- WalletTypeIcon,
40
+ CpslText,
20
41
  {
21
- externalWallet: wallet.isExternal ? wallet.externalProviderId : void 0,
22
- walletType: wallet.type,
23
- size: "32px",
24
- inset: "6px"
42
+ variant: slot === "selected-item" ? "headingXS" : "bodyM",
43
+ weight: "semiBold",
44
+ color: "contrast",
45
+ style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", flex: isMenu ? "1" : void 0 },
46
+ children: name
25
47
  }
26
48
  ),
27
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "contrast", style: { flex: "1" }, children: para.getDisplayAddress(wallet.id, { truncate: true, addressType: wallet.type }) }),
28
49
  withCopy && /* @__PURE__ */ jsx(
29
50
  CopyButton,
30
51
  {
@@ -42,48 +63,49 @@ const Wallet = ({ wallet, withCopy, slot }) => {
42
63
  ] });
43
64
  };
44
65
  const WalletSelect = () => {
66
+ var _a, _b, _c;
45
67
  const containerRef = useRef(null);
46
68
  const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
47
69
  const { setSelectedWallet } = useWalletState();
48
70
  const { data: activeWallet } = useWallet();
49
71
  const { embedded } = useAccount();
50
- const availableWallets = embedded == null ? void 0 : embedded.wallets;
72
+ const firstEmbeddedWallet = (_b = (_a = embedded == null ? void 0 : embedded.wallets) == null ? void 0 : _a.filter((wallet) => !wallet.isExternal)) == null ? void 0 : _b[0];
73
+ const availableExternalWallets = ((_c = embedded == null ? void 0 : embedded.wallets) == null ? void 0 : _c.filter((wallet) => wallet.isExternal)) || [];
74
+ const availableWallets = [...firstEmbeddedWallet ? [firstEmbeddedWallet] : [], ...availableExternalWallets];
51
75
  const isMultiWallet = availableWallets && availableWallets.length > 1;
52
- const ActiveWalletNode = activeWallet ? /* @__PURE__ */ jsx(Wallet, { withCopy: true, wallet: activeWallet, slot: "selected-item" }) : null;
76
+ const ActiveWalletNode = activeWallet ? /* @__PURE__ */ jsx(Wallet, { wallet: activeWallet, slot: "selected-item", withCopy: activeWallet.isExternal }) : null;
53
77
  useEffect(() => {
54
78
  if (dropdownMaxHeight && (activeWallet == null ? void 0 : activeWallet.address)) {
55
79
  resize();
56
80
  }
57
81
  }, [activeWallet, availableWallets, dropdownMaxHeight]);
58
- return /* @__PURE__ */ jsxs(Container, { children: [
59
- isMultiWallet && /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "secondary", weight: "semiBold", children: "Select Wallet" }),
60
- /* @__PURE__ */ jsx(SelectContainer, { ref: containerRef, id: "addressInputContainer", children: /* @__PURE__ */ jsxs(
61
- Select,
62
- {
63
- selectedValue: getValue(activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type),
64
- onCpslSelectValueChange: (e) => {
65
- const [id, type] = e.detail.split("~");
66
- setSelectedWallet({ id, type });
67
- },
68
- showFormattedSelectedItem: true,
69
- placeholder: "Choose wallet...",
70
- anchorElId: "addressInputContainer",
71
- dropdownMaxHeight,
72
- $width: dropdownWidth != null ? dropdownWidth : 0,
73
- $top: (mobileAnchor != null ? mobileAnchor : 0) + 16 + 1,
74
- selectedItemVariant: "bodyXS",
75
- icon: isMultiWallet ? "chevronUp" : null,
76
- disabled: !isMultiWallet,
77
- children: [
78
- activeWallet && ActiveWalletNode,
79
- (availableWallets || []).map(({ address, name: _name, id, type }) => {
80
- const key = getValue(id, type);
81
- return /* @__PURE__ */ jsx(SelectItem, { slot: "items", value: key, children: /* @__PURE__ */ jsx(Wallet, { wallet: { address, name: _name, id, type } }) }, key);
82
- })
83
- ]
84
- }
85
- ) })
86
- ] });
82
+ return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(SelectContainer, { ref: containerRef, id: "addressInputContainer", children: /* @__PURE__ */ jsxs(
83
+ Select,
84
+ {
85
+ selectedValue: getValue(activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type),
86
+ onCpslSelectValueChange: (e) => {
87
+ const [id, type] = e.detail.split("~");
88
+ setSelectedWallet({ id, type });
89
+ },
90
+ showFormattedSelectedItem: true,
91
+ placeholder: "Choose wallet...",
92
+ anchorElId: "addressInputContainer",
93
+ dropdownMaxHeight,
94
+ $width: dropdownWidth != null ? dropdownWidth : 0,
95
+ $top: (mobileAnchor != null ? mobileAnchor : 0) + 16 + 1,
96
+ selectedItemVariant: "bodyXS",
97
+ icon: isMultiWallet ? "chevronUp" : null,
98
+ disabled: !isMultiWallet,
99
+ children: [
100
+ activeWallet && ActiveWalletNode,
101
+ firstEmbeddedWallet && /* @__PURE__ */ jsx(SelectItem, { slot: "items", value: getValue(firstEmbeddedWallet == null ? void 0 : firstEmbeddedWallet.id, firstEmbeddedWallet == null ? void 0 : firstEmbeddedWallet.type), children: /* @__PURE__ */ jsx(Wallet, { isMenu: true, wallet: firstEmbeddedWallet, withIcon: true }) }, "embedded"),
102
+ (availableExternalWallets || []).map((wallet) => {
103
+ const key = getValue(wallet.id, wallet.type);
104
+ return /* @__PURE__ */ jsx(SelectItem, { slot: "items", value: key, children: /* @__PURE__ */ jsx(Wallet, { isMenu: true, wallet, withIcon: true, withCopy: true }) }, key);
105
+ })
106
+ ]
107
+ }
108
+ ) }) });
87
109
  };
88
110
  const Container = safeStyled.div`
89
111
  display: flex;
@@ -95,12 +117,19 @@ const WalletContainer = safeStyled.div`
95
117
  display: flex;
96
118
  align-items: center;
97
119
  gap: 8px;
120
+ width: 100%;
98
121
  `;
99
122
  const Select = safeStyled(CpslSelect)`
100
123
  --icon-width: 32px;
101
124
  --icon-height: 32px;
102
- --container-border-color: var(--cpsl-color-background-16);
125
+ --container-border-color: transparent;
126
+ --container-background-color: transparent;
127
+ --container-border-width: 0px;
103
128
  --container-background-color-disabled: var(--container-background-color);
129
+ --container-box-shadow: none !important;
130
+ --dropdown-border-width: 0px;
131
+ --dropdown-background-color: var(--cpsl-color-background-4);
132
+
104
133
  width: 286px;
105
134
  position: relative;
106
135
 
@@ -108,6 +137,10 @@ const Select = safeStyled(CpslSelect)`
108
137
  white-space: nowrap;
109
138
  }
110
139
 
140
+ &::part(select-container) {
141
+ justify-content: center;
142
+ }
143
+
111
144
  &::part(dropdown) {
112
145
  min-width: ${({ $width }) => `${$width - 2}px`};
113
146
  }
@@ -125,6 +158,9 @@ const SelectItem = safeStyled(CpslSelectItem)`
125
158
  --container-padding-end: 12px;
126
159
  --container-padding-top: 8px;
127
160
  --container-padding-bottom: 8px;
161
+ --container-background-color: var(--cpsl-color-background-4);
162
+ --container-hover-background-color: var(--cpsl-color-background-8);
163
+ width: 100%;
128
164
  `;
129
165
  const SelectContainer = safeStyled.div`
130
166
  position: relative;
@@ -132,12 +168,11 @@ const SelectContainer = safeStyled.div`
132
168
  align-items: center;
133
169
  gap: 8px;
134
170
  border-radius: var(--cpsl-border-radius-tile-button);
135
- background-color: var(--cpsl-color-background-4);
171
+ background-color: transparent;
136
172
  `;
137
- const WalletTypeIcon = safeStyled(common.WalletTypeIcon)`
138
- --border: 1px solid var(--cpsl-color-background-8);
139
- --background: var(--cpsl-color-background-0);
140
- --border-radius: 4px;
173
+ const WalletIcon = safeStyled(CpslIcon)` --icon-border: 1px solid var(--cpsl-color-background-8);
174
+ --icon-background: var(--cpsl-color-background-0);
175
+ --icon-border-radius: 4px;
141
176
  `;
142
177
  const CopyButton = safeStyled(CpslButton)`
143
178
  cpsl-icon {
@@ -0,0 +1,11 @@
1
+ export declare const WalletSelectOld: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Select: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
3
+ 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;
4
+ }, {
5
+ $width: number;
6
+ $top?: number;
7
+ }>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
8
+ export declare const SelectItem: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
9
+ 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;
10
+ }, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
11
+ export declare const SelectContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,158 @@
1
+ "use client";
2
+ import "../../../chunk-MMUBH76A.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useEffect, useRef } from "react";
5
+ import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
6
+ import { useDropdownPosition } from "../AuthInput/hooks/useDropdownPosition.js";
7
+ import { safeStyled, useCopyToClipboard } from "@getpara/react-common";
8
+ import { useAccount, useWallet, useWalletState } from "../../../provider/index.js";
9
+ import { CpslButton, CpslIcon, CpslSelect, CpslSelectItem, CpslText } from "@getpara/react-components";
10
+ import * as common from "../common.js";
11
+ const getValue = (id, type) => {
12
+ return id && type ? `${id}~${type}` : void 0;
13
+ };
14
+ const Wallet = ({
15
+ wallet,
16
+ withCopy,
17
+ slot,
18
+ withIcon
19
+ }) => {
20
+ const para = useInternalClient();
21
+ const [isCopied, copy] = useCopyToClipboard();
22
+ return /* @__PURE__ */ jsxs(WalletContainer, { slot, style: { flex: "1" }, children: [
23
+ withIcon && /* @__PURE__ */ jsx(
24
+ WalletTypeIcon,
25
+ {
26
+ externalWallet: wallet.isExternal ? wallet.externalProviderId : void 0,
27
+ walletType: wallet.type,
28
+ size: "32px",
29
+ inset: "6px"
30
+ }
31
+ ),
32
+ /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "contrast", style: { flex: "1" }, children: para.getDisplayAddress(wallet.id, { truncate: true, addressType: wallet.type }) }),
33
+ withCopy && /* @__PURE__ */ jsx(
34
+ CopyButton,
35
+ {
36
+ id: "ignore-click",
37
+ size: "small",
38
+ variant: "ghost",
39
+ onClick: (e) => {
40
+ e.stopPropagation();
41
+ e.preventDefault();
42
+ copy(para.getDisplayAddress(wallet.id, { addressType: wallet.type }));
43
+ },
44
+ children: /* @__PURE__ */ jsx(CpslIcon, { id: "ignore-click", slot: "start", icon: isCopied ? "check" : "copy" })
45
+ }
46
+ )
47
+ ] });
48
+ };
49
+ const WalletSelectOld = () => {
50
+ const containerRef = useRef(null);
51
+ const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
52
+ const { setSelectedWallet } = useWalletState();
53
+ const { data: activeWallet } = useWallet();
54
+ const { embedded } = useAccount();
55
+ const availableWallets = embedded == null ? void 0 : embedded.wallets;
56
+ const isMultiWallet = availableWallets && availableWallets.length > 1;
57
+ const ActiveWalletNode = activeWallet ? /* @__PURE__ */ jsx(Wallet, { withCopy: true, wallet: activeWallet, slot: "selected-item", withIcon: true }) : null;
58
+ useEffect(() => {
59
+ if (dropdownMaxHeight && (activeWallet == null ? void 0 : activeWallet.address)) {
60
+ resize();
61
+ }
62
+ }, [activeWallet, availableWallets, dropdownMaxHeight]);
63
+ return /* @__PURE__ */ jsxs(Container, { children: [
64
+ isMultiWallet && /* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "secondary", weight: "semiBold", children: "Select Wallet" }),
65
+ /* @__PURE__ */ jsx(SelectContainer, { ref: containerRef, id: "addressInputContainer", children: /* @__PURE__ */ jsxs(
66
+ Select,
67
+ {
68
+ selectedValue: getValue(activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type),
69
+ onCpslSelectValueChange: (e) => {
70
+ const [id, type] = e.detail.split("~");
71
+ setSelectedWallet({ id, type });
72
+ },
73
+ showFormattedSelectedItem: true,
74
+ placeholder: "Choose wallet...",
75
+ anchorElId: "addressInputContainer",
76
+ dropdownMaxHeight,
77
+ $width: dropdownWidth != null ? dropdownWidth : 0,
78
+ $top: (mobileAnchor != null ? mobileAnchor : 0) + 16 + 1,
79
+ selectedItemVariant: "bodyXS",
80
+ icon: isMultiWallet ? "chevronUp" : null,
81
+ disabled: !isMultiWallet,
82
+ children: [
83
+ activeWallet && ActiveWalletNode,
84
+ (availableWallets || []).map((wallet) => {
85
+ const key = getValue(wallet.id, wallet.type);
86
+ return /* @__PURE__ */ jsx(SelectItem, { slot: "items", value: key, children: /* @__PURE__ */ jsx(Wallet, { wallet, withIcon: true }) }, key);
87
+ })
88
+ ]
89
+ }
90
+ ) })
91
+ ] });
92
+ };
93
+ const Container = safeStyled.div`
94
+ display: flex;
95
+ flex-direction: column;
96
+ gap: 8px;
97
+ align-items: center;
98
+ `;
99
+ const WalletContainer = safeStyled.div`
100
+ display: flex;
101
+ align-items: center;
102
+ gap: 8px;
103
+ `;
104
+ const Select = safeStyled(CpslSelect)`
105
+ --icon-width: 32px;
106
+ --icon-height: 32px;
107
+ --container-border-color: var(--cpsl-color-background-16);
108
+ --container-background-color-disabled: var(--container-background-color);
109
+ width: 286px;
110
+ position: relative;
111
+
112
+ &::part(selected-text) {
113
+ white-space: nowrap;
114
+ }
115
+
116
+ &::part(dropdown) {
117
+ min-width: ${({ $width }) => `${$width - 2}px`};
118
+ }
119
+
120
+ &::part(icon) {
121
+ --icon-color: var(--cpsl-color-text-primary);
122
+ }
123
+ `;
124
+ const SelectItem = safeStyled(CpslSelectItem)`
125
+ --outer-container-padding-start: 0px;
126
+ --outer-container-padding-end: 0px;
127
+ --outer-container-padding-top: 0px;
128
+ --outer-container-padding-bottom: 0px;
129
+ --container-padding-start: 12px;
130
+ --container-padding-end: 12px;
131
+ --container-padding-top: 8px;
132
+ --container-padding-bottom: 8px;
133
+ `;
134
+ const SelectContainer = safeStyled.div`
135
+ position: relative;
136
+ display: flex;
137
+ align-items: center;
138
+ gap: 8px;
139
+ border-radius: var(--cpsl-border-radius-tile-button);
140
+ background-color: var(--cpsl-color-background-4);
141
+ `;
142
+ const WalletTypeIcon = safeStyled(common.WalletTypeIcon)`
143
+ --border: 1px solid var(--cpsl-color-background-8);
144
+ --background: var(--cpsl-color-background-0);
145
+ --border-radius: 4px;
146
+ `;
147
+ const CopyButton = safeStyled(CpslButton)`
148
+ cpsl-icon {
149
+ --height: 24px;
150
+ --width: 24px;
151
+ }
152
+ `;
153
+ export {
154
+ Select,
155
+ SelectContainer,
156
+ SelectItem,
157
+ WalletSelectOld
158
+ };
@@ -34,7 +34,7 @@ export declare function AssetIcon({ asset, size }: {
34
34
  size?: string;
35
35
  }): import("react/jsx-runtime").JSX.Element;
36
36
  export declare function NetworkIcon({ network, size }: {
37
- network: Network;
37
+ network?: Network;
38
38
  size?: string;
39
39
  }): import("react/jsx-runtime").JSX.Element;
40
40
  export declare function WalletTypeIcon({ className, walletType, externalWallet, ...props }: {
@@ -6,10 +6,9 @@ import {
6
6
  } from "../../chunk-MMUBH76A.js";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { CpslIcon, CpslInput, CpslSelect, CpslSelectItem, CpslText, CpslTileButton } from "@getpara/react-components";
9
- import { safeStyled } from "@getpara/react-common";
9
+ import { ACCOUNT_TYPES, safeStyled } from "@getpara/react-common";
10
10
  import { MOBILE_SIZE, NETWORKS, ON_RAMP_ASSETS, WALLET_TYPES_METADATA } from "../constants/constants.js";
11
11
  import { useStore } from "../../provider/stores/useStore.js";
12
- import { ACCOUNT_TYPES } from "../constants/oAuthLogos.js";
13
12
  import { useEffect, useRef, useState } from "react";
14
13
  const SpinnerContainer = safeStyled.div`
15
14
  display: flex;
@@ -148,12 +147,25 @@ function AssetIcon({ asset, size }) {
148
147
  return /* @__PURE__ */ jsx(StyledIcon, { size, icon: data.icon, inset: data.isCircular ? void 0 : "15%", invert: isDark && data.isDark });
149
148
  }
150
149
  function NetworkIcon({ network, size }) {
150
+ var _a;
151
151
  const isDark = useStore((state) => {
152
- var _a, _b;
153
- return ((_b = (_a = state.modalConfig) == null ? void 0 : _a.theme) == null ? void 0 : _b.mode) === "dark";
152
+ var _a2, _b;
153
+ return ((_b = (_a2 = state.modalConfig) == null ? void 0 : _a2.theme) == null ? void 0 : _b.mode) === "dark";
154
154
  });
155
- const data = NETWORKS[network];
156
- return /* @__PURE__ */ jsx(StyledIcon, { size, icon: data.icon, inset: data.isCircular ? void 0 : "15%", invert: isDark && data.isDark });
155
+ const data = (_a = NETWORKS[network != null ? network : ""]) != null ? _a : {
156
+ icon: "globe",
157
+ isPlain: true
158
+ };
159
+ return /* @__PURE__ */ jsx(
160
+ StyledIcon,
161
+ {
162
+ size,
163
+ icon: data.icon,
164
+ inset: data.isCircular ? void 0 : "15%",
165
+ color: (data == null ? void 0 : data.isPlain) ? "var(--cpsl-color-text-contrast)" : void 0,
166
+ invert: isDark && data.isDark
167
+ }
168
+ );
157
169
  }
158
170
  function WalletTypeIcon(_c) {
159
171
  var _d = _c, {
@@ -1,7 +1,7 @@
1
1
  import { Network, OnRampAsset, OnRampMethod, OnRampProvider, TWalletType } from '@getpara/core-sdk';
2
2
  import { IconType } from '@getpara/react-components';
3
3
  import { Transition, Variants } from 'framer-motion';
4
- import { DisplayMetadata } from '../types/commonTypes.js';
4
+ import { DisplayMetadata } from '@getpara/react-common';
5
5
  export declare const PARA_CONNECT = "https://connect.getpara.com/";
6
6
  export declare const PARA_TERMS_AND_CONDITIONS = "https://getpara.com/terms";
7
7
  export type OnRampProviderConfig = DisplayMetadata & {
@@ -25,7 +25,7 @@ export declare function getNetworkName(str: Network | string): string;
25
25
  export declare function getNetworkIcon(str: Network | string): IconType;
26
26
  export declare function getAssetCode(str: OnRampAsset | string): string;
27
27
  export declare function getAssetName(str: OnRampAsset | string): string;
28
- export declare function getAssetIcon(str: OnRampAsset | string): "key" | "phone" | "farcaster" | "telegram" | "discord" | "x" | "search" | "wallet" | "cosmos" | "solana" | "para" | "walletConnect" | "close" | "copy" | "safe" | "alertCircle" | "alertTriangle" | "alignVerticalCenter" | "angelListBrand" | "angelList" | "appleBrand" | "apple" | "arbitrumBrand" | "arrowCircleBrokenDownLeft" | "arrowCircleDownFilled" | "arrowCircleDown" | "arrowNarrow" | "arrow" | "asterisk" | "backpack" | "backupKit" | "bank" | "baseBrand" | "beraBrand" | "brush" | "celoBrand" | "checkCircleFilled" | "checkCircle" | "checkSquare" | "check" | "chevronDown" | "chevronRight" | "chevronSelectorVertical" | "chevronUp" | "clock" | "clubhouseBrand" | "clubhouse" | "code" | "coinbase" | "copy07" | "cosmosCircle" | "cosmostation" | "creditCard02" | "creditCard" | "cube03" | "cubeOutline" | "cube" | "currencyDollar" | "decentBrand" | "decent" | "dell" | "discordBrand" | "dot" | "dotsSquare" | "dots" | "downloadCloud" | "download" | "dribbbleBrand" | "dribbble" | "earth" | "edit02" | "emptyCircle" | "ethCircle" | "ethereum" | "eyeOff" | "eye" | "facebookBrand" | "facebook" | "farcasterBrand" | "figmaBrand" | "figma" | "file" | "folder" | "githubBrand" | "github" | "globe" | "glow" | "googleBrand" | "google" | "gridDots" | "haha" | "helpCircle" | "heroAlertCircle" | "heroCheckmarkCapsule" | "heroCheckmark" | "heroEmail" | "heroExternalConnection" | "heroLock" | "heroPasskey" | "heroPhone" | "heroPlusCircleCapsule" | "heroPlusCircle" | "heroWallet" | "home" | "hp" | "image" | "infoCircle" | "instagramBrand" | "instagram" | "keplr" | "laptop" | "leap" | "lenovo" | "lg" | "lightning01" | "lightning" | "linkExternal" | "linkedinBrand" | "linkedin" | "lockKeyholeCircle" | "logOut" | "mail" | "menu" | "metamask" | "monitor" | "moonpayBrand" | "moreLoginOptions" | "motorola" | "nobleBrand" | "okx" | "optimismBrand" | "paraArrow" | "paraBlackBg" | "paraBrand" | "paraIconBrand" | "paraIconQr" | "paraIcon" | "paraLogo" | "paraRingsDark" | "paraRings" | "passcode" | "phantom" | "pintrestBrand" | "pintrest" | "plusCircle" | "plus" | "polygonBrand" | "polygon" | "puzzlePiece" | "qrCode02" | "qrCode" | "rabby" | "rainbow" | "rampNetworkBrand" | "rampNetwork" | "redditBrand" | "reddit" | "refresh" | "samsung" | "send" | "settings" | "share" | "shield" | "signalBrand" | "signal" | "sliders" | "snapchatBrand" | "snapchat" | "solanaCircle" | "solflare" | "spacingHeight" | "star04Filled" | "star05" | "stars01Filled" | "stars02" | "stars" | "stopSquare" | "stripeBrand" | "telegramBrand" | "tetherBrand" | "tikTokBrand" | "tikTok" | "trash" | "tumblrBrand" | "tumblr" | "twitterBrand" | "twitter" | "usdcBrand" | "user01" | "userCircle" | "userPlus" | "user" | "valora" | "wallet02" | "youtubeBrand" | "youtube" | "zerion" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BQ2" | "BQ3" | "BR" | "BS" | "BT" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CD2" | "CF" | "CH" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DS" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB2" | "GB" | "GD" | "GE" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GQ" | "GR" | "GT" | "GU" | "GW" | "GY" | "HK" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SE" | "SG" | "SI" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "US" | "UY" | "UZ" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WS" | "YE" | "ZA" | "ZM" | "ZW";
28
+ export declare function getAssetIcon(str: OnRampAsset | string): "key" | "phone" | "farcaster" | "telegram" | "discord" | "x" | "search" | "wallet" | "cosmos" | "solana" | "para" | "walletConnect" | "close" | "copy" | "safe" | "stripeBrand" | "alertCircle" | "alertTriangle" | "alignVerticalCenter" | "angelListBrand" | "angelList" | "appleBrand" | "apple" | "arbitrumBrand" | "arrowCircleBrokenDownLeft" | "arrowCircleDownFilled" | "arrowCircleDown" | "arrowNarrow" | "arrow" | "asterisk" | "backpack" | "backupKit" | "bank" | "baseBrand" | "beraBrand" | "brush" | "celoBrand" | "checkCircleFilled" | "checkCircle" | "checkSquare" | "check" | "chevronDown" | "chevronRight" | "chevronSelectorVertical" | "chevronUp" | "clock" | "clubhouseBrand" | "clubhouse" | "code" | "coinbase" | "copy07" | "cosmosCircle" | "cosmostation" | "creditCard02" | "creditCard" | "cube03" | "cubeOutline" | "cube" | "currencyDollar" | "decentBrand" | "decent" | "dell" | "discordBrand" | "dot" | "dotsSquare" | "dots" | "downloadCloud" | "download" | "dribbbleBrand" | "dribbble" | "earth" | "edit02" | "emptyCircle" | "ethCircle" | "ethereum" | "eyeOff" | "eye" | "facebookBrand" | "facebook" | "farcasterBrand" | "figmaBrand" | "figma" | "file" | "folder" | "githubBrand" | "github" | "globe" | "glow" | "googleBrand" | "google" | "gridDots" | "haha" | "helpCircle" | "heroAlertCircle" | "heroCheckmarkCapsule" | "heroCheckmark" | "heroEmail" | "heroExternalConnection" | "heroLock" | "heroPasskey" | "heroPhone" | "heroPlusCircleCapsule" | "heroPlusCircle" | "heroWallet" | "home" | "hp" | "image" | "infoCircle" | "instagramBrand" | "instagram" | "keplr" | "laptop" | "leap" | "lenovo" | "lg" | "lightning01" | "lightning" | "linkExternal" | "linkedinBrand" | "linkedin" | "lockKeyholeCircle" | "logOut" | "mail" | "menu" | "metamask" | "monitor" | "moonpayBrand" | "moreLoginOptions" | "motorola" | "nobleBrand" | "okx" | "optimismBrand" | "paraArrow" | "paraBlackBg" | "paraBrand" | "paraIconBrand" | "paraIconQr" | "paraIcon" | "paraLogo" | "paraRingsDark" | "paraRings" | "passcode" | "phantom" | "pintrestBrand" | "pintrest" | "plusCircle" | "plus" | "polygonBrand" | "polygon" | "puzzlePiece" | "qrCode02" | "qrCode" | "rabby" | "rainbow" | "rampNetworkBrand" | "rampNetwork" | "redditBrand" | "reddit" | "refresh" | "samsung" | "send" | "settings" | "share" | "shield" | "signalBrand" | "signal" | "sliders" | "snapchatBrand" | "snapchat" | "solanaCircle" | "solflare" | "spacingHeight" | "star04Filled" | "star05" | "stars01Filled" | "stars02" | "stars" | "stopSquare" | "telegramBrand" | "tetherBrand" | "tikTokBrand" | "tikTok" | "trash" | "tumblrBrand" | "tumblr" | "twitterBrand" | "twitter" | "usdcBrand" | "user01" | "userCircle" | "userPlus" | "user" | "valora" | "wallet02" | "youtubeBrand" | "youtube" | "zerion" | "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BQ2" | "BQ3" | "BR" | "BS" | "BT" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CD2" | "CF" | "CH" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DS" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB2" | "GB" | "GD" | "GE" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GQ" | "GR" | "GT" | "GU" | "GW" | "GY" | "HK" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SE" | "SG" | "SI" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "US" | "UY" | "UZ" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WS" | "YE" | "ZA" | "ZM" | "ZW";
29
29
  export declare const MOBILE_SIZE = 480;
30
30
  export declare const NETWORK_NOT_SUPPORTED_ERROR = "network not supported";
31
31
  export declare const EMAIL_REGEX: RegExp;
@@ -126,7 +126,7 @@ const BODY_MOTION_VARIANTS = {
126
126
  const BODY_TRANSITION = {
127
127
  duration: 0.2
128
128
  };
129
- const SDK_VERSION = "2.0.0-alpha.42";
129
+ const SDK_VERSION = "2.0.0-alpha.43";
130
130
  export {
131
131
  BODY_MOTION_VARIANTS,
132
132
  BODY_TRANSITION,
@@ -14,7 +14,7 @@ function openPopup({
14
14
  let popUpHeight;
15
15
  switch (type) {
16
16
  case "LOGIN_PASSWORD": {
17
- popUpHeight = 460;
17
+ popUpHeight = 798;
18
18
  break;
19
19
  }
20
20
  case "LOGIN_PASSKEY": {
@@ -33,7 +33,7 @@ function pickCosmosAccount(account) {
33
33
  const useAccount = ({ cosmos } = {}) => {
34
34
  var _a, _b, _c, _d, _e, _f, _g, _h;
35
35
  const client = useInternalClient();
36
- const { data: isFullyLoggedIn, isSuccess } = useIsFullyLoggedIn();
36
+ const { data: isFullyLoggedIn, isSuccess, isLoading: isFullyLoggedInLoading } = useIsFullyLoggedIn();
37
37
  const evmContext = useStore((state) => state.evmContext);
38
38
  const { useAccount: useEvmAccount } = useContext(evmContext);
39
39
  const evmAccount = useEvmAccount();
@@ -56,6 +56,7 @@ const useAccount = ({ cosmos } = {}) => {
56
56
  queryKey: [
57
57
  ACCOUNT_BASE_KEY,
58
58
  isFullyLoggedIn != null ? isFullyLoggedIn : null,
59
+ isFullyLoggedInLoading,
59
60
  (_h = client == null ? void 0 : client.userId) != null ? _h : null,
60
61
  evmQueryKeys,
61
62
  cosmosQueryKeys,
@@ -133,7 +134,7 @@ const useAccount = ({ cosmos } = {}) => {
133
134
  solana: { isConnected: false }
134
135
  }
135
136
  };
136
- return __spreadProps(__spreadValues({}, data != null ? data : defaultResp), { isLoading });
137
+ return __spreadProps(__spreadValues({}, data != null ? data : defaultResp), { isLoading: isFullyLoggedInLoading || isLoading });
137
138
  };
138
139
  export {
139
140
  ACCOUNT_BASE_KEY,
@@ -10,7 +10,6 @@ const useIsFullyLoggedIn = () => {
10
10
  const client = useInternalClient();
11
11
  return useQuery({
12
12
  enabled: !!(client == null ? void 0 : client.isReady),
13
- staleTime: 5e3,
14
13
  queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY, (_a = client == null ? void 0 : client.userId) != null ? _a : null],
15
14
  queryFn: () => __async(void 0, null, function* () {
16
15
  var _a2;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.0.0-alpha.42",
3
+ "version": "2.0.0-alpha.43",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.0.0-alpha.42",
9
- "@getpara/react-components": "2.0.0-alpha.42",
10
- "@getpara/web-sdk": "2.0.0-alpha.42",
8
+ "@getpara/react-common": "2.0.0-alpha.43",
9
+ "@getpara/react-components": "2.0.0-alpha.43",
10
+ "@getpara/web-sdk": "2.0.0-alpha.43",
11
11
  "date-fns": "^3.6.0",
12
12
  "framer-motion": "^11.3.31",
13
13
  "libphonenumber-js": "^1.11.7",
@@ -16,9 +16,9 @@
16
16
  "zustand-sync-tabs": "^0.2.2"
17
17
  },
18
18
  "devDependencies": {
19
- "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.42",
20
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.42",
21
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.42",
19
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.43",
20
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.43",
21
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.43",
22
22
  "@tanstack/react-query": "^5.74.0",
23
23
  "@testing-library/dom": "^10.4.0",
24
24
  "@testing-library/react": "^16.3.0",
@@ -38,7 +38,7 @@
38
38
  "package.json",
39
39
  "styles.css"
40
40
  ],
41
- "gitHead": "6f44dc050550a1f567088c81b3ae06c7f1f8ebcb",
41
+ "gitHead": "6c4b7915c54f51ca0d4abb5c947e5997508669d1",
42
42
  "main": "dist/index.js",
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": ">=5.0.0",
@@ -1,12 +0,0 @@
1
- import { IconType } from '@getpara/react-components';
2
- import { TLinkedAccountType } from '@getpara/web-sdk';
3
- import { DisplayMetadata } from '../types/commonTypes.js';
4
- export declare const ACCOUNT_TYPES: {
5
- [key in TLinkedAccountType | string]: DisplayMetadata & {
6
- isExternalWallet?: boolean;
7
- };
8
- };
9
- export declare function getAccountTypeName(type: TLinkedAccountType | string | undefined, { inline }?: {
10
- inline?: boolean;
11
- }): string | undefined;
12
- export declare function getAccountTypeLogo(type: TLinkedAccountType | undefined): IconType | undefined;
@@ -1,160 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- const ACCOUNT_TYPES = {
4
- "EMAIL": {
5
- icon: "mail",
6
- name: "Email",
7
- inlineText: "email address",
8
- isPlain: true
9
- },
10
- "PHONE": {
11
- icon: "phone",
12
- name: "Phone",
13
- inlineText: "phone number",
14
- isPlain: true
15
- },
16
- "EXTERNAL_WALLET": {
17
- icon: "wallet",
18
- name: "External Wallet",
19
- inlineText: "external wallet",
20
- isPlain: true
21
- },
22
- "GOOGLE": {
23
- icon: "google",
24
- iconBranded: "googleBrand",
25
- name: "Google"
26
- },
27
- "TWITTER": {
28
- icon: "twitter",
29
- // Not using branded here to ensure the icon looks correct in dark mode
30
- iconBranded: "twitter",
31
- name: "X / Twitter",
32
- inlineText: "X account",
33
- isDark: true
34
- },
35
- "APPLE": {
36
- icon: "apple",
37
- // Not using branded here to ensure the icon looks correct in dark mode
38
- iconBranded: "apple",
39
- name: "Apple",
40
- isDark: true
41
- },
42
- "DISCORD": {
43
- icon: "discord",
44
- iconBranded: "discordBrand",
45
- name: "Discord"
46
- },
47
- "FACEBOOK": {
48
- icon: "facebook",
49
- iconBranded: "facebookBrand",
50
- name: "Facebook"
51
- },
52
- "FARCASTER": {
53
- icon: "farcaster",
54
- iconBranded: "farcasterBrand",
55
- name: "Farcaster"
56
- },
57
- "TELEGRAM": {
58
- icon: "telegram",
59
- iconBranded: "telegramBrand",
60
- name: "Telegram"
61
- },
62
- "MetaMask": {
63
- icon: "metamask",
64
- name: "MetaMask",
65
- isExternalWallet: true
66
- },
67
- "Rainbow": {
68
- icon: "rainbow",
69
- name: "Rainbow",
70
- isExternalWallet: true
71
- },
72
- "Coinbase Wallet": {
73
- icon: "coinbase",
74
- name: "Coinbase Wallet",
75
- isExternalWallet: true
76
- },
77
- "WalletConnect": {
78
- icon: "walletConnect",
79
- name: "WalletConnect",
80
- isExternalWallet: true
81
- },
82
- "Zerion": {
83
- icon: "zerion",
84
- name: "Zerion",
85
- isExternalWallet: true
86
- },
87
- "Safe": {
88
- icon: "safe",
89
- name: "Safe",
90
- isExternalWallet: true
91
- },
92
- "Rabby": {
93
- icon: "rabby",
94
- name: "Rabby",
95
- isExternalWallet: true
96
- },
97
- "OKX Wallet": {
98
- icon: "okx",
99
- name: "OKX Wallet",
100
- isExternalWallet: true
101
- },
102
- "Phantom": {
103
- icon: "phantom",
104
- name: "Phantom",
105
- isExternalWallet: true
106
- },
107
- "Glow": {
108
- icon: "glow",
109
- name: "Glow",
110
- isExternalWallet: true
111
- },
112
- "Backpack": {
113
- icon: "backpack",
114
- name: "Backpack",
115
- isExternalWallet: true
116
- },
117
- "Keplr": {
118
- icon: "keplr",
119
- name: "Keplr",
120
- isExternalWallet: true
121
- },
122
- "Leap": {
123
- icon: "leap",
124
- name: "Leap",
125
- isExternalWallet: true
126
- },
127
- "HaHa": {
128
- icon: "haha",
129
- name: "HaHa",
130
- isExternalWallet: true
131
- },
132
- "Cosmostation": {
133
- icon: "cosmostation",
134
- name: "Cosmostation",
135
- isExternalWallet: true
136
- },
137
- "Solflare": {
138
- icon: "solflare",
139
- name: "Solflare",
140
- isExternalWallet: true
141
- },
142
- "Valora": {
143
- icon: "valora",
144
- name: "Valora",
145
- isExternalWallet: true
146
- }
147
- };
148
- function getAccountTypeName(type, { inline = false } = {}) {
149
- var _a;
150
- const data = type ? ACCOUNT_TYPES[type] : void 0;
151
- return data ? inline ? (_a = data.inlineText) != null ? _a : `${data.name} ${data.isExternalWallet ? "wallet" : "account"}` : data.name : void 0;
152
- }
153
- function getAccountTypeLogo(type) {
154
- return type ? ACCOUNT_TYPES[type].iconBranded || ACCOUNT_TYPES[type].icon : void 0;
155
- }
156
- export {
157
- ACCOUNT_TYPES,
158
- getAccountTypeLogo,
159
- getAccountTypeName
160
- };
@@ -1,15 +0,0 @@
1
- import { IconType } from '@getpara/react-components';
2
- export type Tab<T> = {
3
- label: string;
4
- value: T;
5
- icon: IconType;
6
- };
7
- export type DisplayMetadata = {
8
- name: string;
9
- inlineText?: string;
10
- icon: IconType;
11
- iconBranded?: IconType;
12
- isDark?: boolean;
13
- isCircular?: boolean;
14
- isPlain?: boolean;
15
- };
@@ -1 +0,0 @@
1
- "use client";
@@ -1,5 +0,0 @@
1
- import { TExternalWallet } from '@getpara/web-sdk';
2
- import { IconType } from '@getpara/react-components';
3
- export declare function getExternalWalletIcon(internalId: TExternalWallet | string | undefined, { branded }?: {
4
- branded?: boolean;
5
- }): IconType | undefined;
@@ -1,17 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- import { ACCOUNT_TYPES } from "../constants/oAuthLogos.js";
4
- function getExternalWalletIcon(internalId, { branded = false } = {}) {
5
- var _a;
6
- if (!internalId) {
7
- return "wallet02";
8
- }
9
- const data = (_a = ACCOUNT_TYPES) == null ? void 0 : _a[internalId];
10
- if (!data) {
11
- return "wallet02";
12
- }
13
- return branded ? data.iconBranded || data.icon : data.icon;
14
- }
15
- export {
16
- getExternalWalletIcon
17
- };