@getpara/react-sdk-lite 2.0.0-alpha.33 → 2.0.0-alpha.35

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 (104) hide show
  1. package/dist/modal/components/Account/AccountProfile.js +22 -4
  2. package/dist/modal/components/Account/AccountProfileLink.js +10 -5
  3. package/dist/modal/components/Account/AccountProfileLinkOptions.js +21 -13
  4. package/dist/modal/components/Account/AccountProfileUnlink.js +6 -4
  5. package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +1 -1
  6. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +3 -54
  7. package/dist/modal/components/AddFunds/AddFundsProvider.js +2 -6
  8. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +2 -2
  9. package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +6 -6
  10. package/dist/modal/components/ExternalWallets/ExternalWallets.js +5 -5
  11. package/dist/modal/components/OAuth/OAuth.js +3 -5
  12. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +2 -2
  13. package/dist/modal/components/common.d.ts +7 -5
  14. package/dist/modal/components/common.js +5 -4
  15. package/dist/modal/constants/constants.js +1 -1
  16. package/dist/modal/constants/oAuthLogos.d.ts +2 -3
  17. package/dist/modal/constants/oAuthLogos.js +28 -28
  18. package/dist/modal/stores/modal/actions.js +2 -2
  19. package/dist/modal/stores/modal/useModalStore.d.ts +8 -2
  20. package/dist/modal/stores/modal/useModalStore.js +1 -1
  21. package/dist/provider/components/ExternalWalletWrapper.js +3 -26
  22. package/dist/provider/hooks/mutations/index.d.ts +28 -2
  23. package/dist/provider/hooks/mutations/index.js +57 -3
  24. package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +40 -0
  25. package/dist/provider/hooks/mutations/useClaimPregenWallets.js +28 -0
  26. package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +33 -0
  27. package/dist/provider/hooks/mutations/useCreateGuestWallets.js +28 -0
  28. package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +120 -0
  29. package/dist/provider/hooks/mutations/useCreatePregenWallet.js +28 -0
  30. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +42 -0
  31. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +28 -0
  32. package/dist/provider/hooks/mutations/useCreateWallet.d.ts +42 -0
  33. package/dist/provider/hooks/mutations/useCreateWallet.js +28 -0
  34. package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +54 -0
  35. package/dist/provider/hooks/mutations/useCreateWalletPerType.js +28 -0
  36. package/dist/provider/hooks/mutations/useEnable2fa.d.ts +39 -0
  37. package/dist/provider/hooks/mutations/useEnable2fa.js +28 -0
  38. package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +40 -0
  39. package/dist/provider/hooks/mutations/useHasPregenWallet.js +28 -0
  40. package/dist/provider/hooks/mutations/useIssueJwt.d.ts +48 -0
  41. package/dist/provider/hooks/mutations/useIssueJwt.js +28 -0
  42. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +34 -0
  43. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +28 -0
  44. package/dist/provider/hooks/mutations/useLinkAccount.d.ts +30 -1
  45. package/dist/provider/hooks/mutations/useLinkAccount.js +3 -1
  46. package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +46 -0
  47. package/dist/provider/hooks/mutations/useLoginExternalWallet.js +28 -0
  48. package/dist/provider/hooks/mutations/useLogout.d.ts +39 -0
  49. package/dist/provider/hooks/mutations/useLogout.js +28 -0
  50. package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +40 -0
  51. package/dist/provider/hooks/mutations/useResendVerificationCode.js +28 -0
  52. package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
  53. package/dist/provider/hooks/mutations/useSetup2fa.js +28 -0
  54. package/dist/provider/hooks/mutations/useSignMessage.d.ts +58 -0
  55. package/dist/provider/hooks/mutations/useSignMessage.js +28 -0
  56. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +58 -0
  57. package/dist/provider/hooks/mutations/useSignTransaction.js +28 -0
  58. package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +46 -0
  59. package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +28 -0
  60. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +42 -0
  61. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +28 -0
  62. package/dist/provider/hooks/mutations/useVerify2fa.d.ts +57 -0
  63. package/dist/provider/hooks/mutations/useVerify2fa.js +28 -0
  64. package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +93 -0
  65. package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +28 -0
  66. package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +55 -0
  67. package/dist/provider/hooks/mutations/useVerifyFarcaster.js +28 -0
  68. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +84 -0
  69. package/dist/provider/hooks/mutations/useVerifyNewAccount.js +28 -0
  70. package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +64 -0
  71. package/dist/provider/hooks/mutations/useVerifyOAuth.js +28 -0
  72. package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +46 -0
  73. package/dist/provider/hooks/mutations/useVerifyTelegram.js +28 -0
  74. package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +57 -0
  75. package/dist/provider/hooks/mutations/useWaitForLogin.js +28 -0
  76. package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +45 -0
  77. package/dist/provider/hooks/mutations/useWaitForSignup.js +28 -0
  78. package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +54 -0
  79. package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +28 -0
  80. package/dist/provider/hooks/mutations/utils.d.ts +2 -7
  81. package/dist/provider/hooks/mutations/utils.js +0 -24
  82. package/dist/provider/hooks/queries/index.d.ts +2 -1
  83. package/dist/provider/hooks/queries/index.js +4 -1
  84. package/dist/provider/hooks/queries/useAccountLinkInProgress.d.ts +6 -0
  85. package/dist/provider/hooks/queries/useAccountLinkInProgress.js +24 -0
  86. package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +11 -0
  87. package/dist/provider/hooks/queries/useLinkedAccounts.js +24 -0
  88. package/dist/provider/providers/AccountLinkProvider.d.ts +4 -4
  89. package/dist/provider/providers/AccountLinkProvider.js +17 -13
  90. package/dist/provider/providers/AuthProvider.d.ts +0 -1
  91. package/dist/provider/providers/AuthProvider.js +18 -45
  92. package/dist/provider/providers/ExternalWalletProvider.d.ts +6 -5
  93. package/dist/provider/providers/ExternalWalletProvider.js +21 -26
  94. package/dist/provider/utils/externalWalletDefaults.d.ts +6 -0
  95. package/dist/provider/utils/externalWalletDefaults.js +33 -0
  96. package/dist/provider/utils/renameMutations.d.ts +9 -5
  97. package/dist/provider/utils/renameMutations.js +3 -5
  98. package/package.json +8 -8
  99. package/dist/provider/hooks/mutations/core.d.ts +0 -27
  100. package/dist/provider/hooks/mutations/core.js +0 -66
  101. package/dist/provider/hooks/queries/core.d.ts +0 -4
  102. package/dist/provider/hooks/queries/core.js +0 -16
  103. package/dist/provider/hooks/queries/utils.d.ts +0 -7
  104. package/dist/provider/hooks/queries/utils.js +0 -25
@@ -12,7 +12,8 @@ import { getWalletDisplayName } from "../../utils/getWalletDisplayName.js";
12
12
  import { truncateAddress } from "@getpara/web-sdk";
13
13
  import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
14
14
  import { safeStyled, useCopyToClipboard } from "@getpara/react-common";
15
- import { getAccountTypeName } from "../../constants/oAuthLogos.js";
15
+ import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
16
+ import { ACCOUNT_TYPES } from "../../constants/oAuthLogos.js";
16
17
  const Entry = ({
17
18
  identifier,
18
19
  icon,
@@ -48,6 +49,7 @@ const AccountProfile = () => {
48
49
  var _a, _b, _c, _d, _e, _f;
49
50
  const para = useClient();
50
51
  const { data: linkedAccounts } = useLinkedAccounts();
52
+ const { wallets } = useExternalWallets();
51
53
  const { isEnabled, linkAccount, unlinkAccount } = useAccountLinking();
52
54
  if (!para) {
53
55
  return null;
@@ -60,7 +62,7 @@ const AccountProfile = () => {
60
62
  Entry,
61
63
  {
62
64
  icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: externalWallet.providerId, size: "24px" }),
63
- name: (_c = (_b = externalWallet.ensName) != null ? _b : getAccountTypeName(externalWallet.providerId)) != null ? _c : "",
65
+ name: (_c = (_b = externalWallet.ensName) != null ? _b : externalWallet.provider) != null ? _c : "",
64
66
  address: (_d = externalWallet.addressBech32) != null ? _d : externalWallet.address,
65
67
  addressShort: truncateAddress((_e = externalWallet.addressBech32) != null ? _e : externalWallet.address, externalWallet.type, {
66
68
  prefix: para.cosmosPrefix
@@ -90,11 +92,26 @@ const AccountProfile = () => {
90
92
  ].map((linkedAccount) => {
91
93
  var _a2, _b2, _c2, _d2, _e2;
92
94
  const { identifier, displayName, type, isPrimary = false, externalWallet: externalWallet2 } = linkedAccount;
95
+ const externalWalletConnector = wallets.find((wallet) => wallet.id === (externalWallet2 == null ? void 0 : externalWallet2.providerId));
96
+ let accountType = type;
97
+ let src = void 0;
98
+ if (externalWallet2) {
99
+ if (externalWalletConnector) {
100
+ accountType = void 0;
101
+ src = externalWalletConnector.iconUrl;
102
+ } else if (externalWallet2.providerId && ACCOUNT_TYPES[externalWallet2.providerId]) {
103
+ accountType = externalWallet2.providerId;
104
+ src = void 0;
105
+ } else {
106
+ accountType = "EXTERNAL_WALLET";
107
+ src = void 0;
108
+ }
109
+ }
93
110
  return /* @__PURE__ */ jsx(
94
111
  Entry,
95
112
  {
96
- icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: (_a2 = externalWallet2 == null ? void 0 : externalWallet2.providerId) != null ? _a2 : type, size: "24px" }),
97
- name: externalWallet2 ? (_c2 = (_b2 = externalWallet2.ensName) != null ? _b2 : getAccountTypeName(externalWallet2.providerId)) != null ? _c2 : "" : displayName != null ? displayName : identifier,
113
+ icon: /* @__PURE__ */ jsx(AccountTypeIcon, { accountType, src, size: "24px" }),
114
+ name: externalWallet2 ? (_c2 = (_b2 = (_a2 = externalWallet2.ensName) != null ? _a2 : externalWalletConnector == null ? void 0 : externalWalletConnector.name) != null ? _b2 : externalWallet2.provider) != null ? _c2 : "" : displayName != null ? displayName : identifier,
98
115
  address: (_d2 = externalWallet2 == null ? void 0 : externalWallet2.addressBech32) != null ? _d2 : externalWallet2 == null ? void 0 : externalWallet2.address,
99
116
  addressShort: externalWallet2 ? truncateAddress((_e2 = externalWallet2.addressBech32) != null ? _e2 : externalWallet2.address, externalWallet2.type, {
100
117
  prefix: para.cosmosPrefix
@@ -126,6 +143,7 @@ const Section = safeStyled.div`
126
143
  const Content = safeStyled(Section)``;
127
144
  const Title = safeStyled(CpslText)``;
128
145
  const EntryContainer = safeStyled.div`
146
+ overflow: hidden;
129
147
  position: relative;
130
148
  width: 100%;
131
149
  display: flex;
@@ -29,7 +29,7 @@ function AccountProfileLink() {
29
29
  linkAccount,
30
30
  isLinkAccountPending,
31
31
  resetMutations
32
- } = useAccountLinking(), { wallets } = useExternalWallets(), { mutate: resendVerificationCode } = useResendVerificationCode(), accountLinkType = accountLinkInProgress == null ? void 0 : accountLinkInProgress.type, externalWalletProvider = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId, externalWalletType = (_d = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletType) != null ? _d : (_c = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _c.type, accountLinkIcon = externalWalletProvider != null ? externalWalletProvider : accountLinkType, isTelegram = accountLinkType === "TELEGRAM", {
32
+ } = useAccountLinking(), { wallets } = useExternalWallets(), { resendVerificationCode } = useResendVerificationCode(), accountLinkType = accountLinkInProgress == null ? void 0 : accountLinkInProgress.type, externalWalletProvider = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId, externalWalletType = (_d = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletType) != null ? _d : (_c = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _c.type, externalWallet = wallets.find((w) => w.id === externalWalletProvider), isTelegram = accountLinkType === "TELEGRAM", {
33
33
  url,
34
34
  status: telegramStatus,
35
35
  isLoaded,
@@ -67,12 +67,17 @@ function AccountProfileLink() {
67
67
  HeroSpinner,
68
68
  {
69
69
  status,
70
- icon: status === "success" ? /* @__PURE__ */ jsx(HeroSuccessIcon, {}) : /* @__PURE__ */ jsx(HeroAccountTypeIcon, { accountType: accountLinkIcon }),
70
+ icon: status === "success" ? /* @__PURE__ */ jsx(HeroSuccessIcon, {}) : /* @__PURE__ */ jsx(
71
+ HeroAccountTypeIcon,
72
+ {
73
+ accountType: externalWallet ? void 0 : accountLinkType,
74
+ src: externalWallet ? externalWallet.iconUrl : void 0
75
+ }
76
+ ),
71
77
  text: message
72
78
  }
73
79
  );
74
- ``;
75
- const onTryAgain = externalWalletProvider && externalWalletType ? () => linkAccount({ externalWallet: { internalId: externalWalletProvider, type: externalWalletType } }) : accountLinkType && accountLinkType !== "EXTERNAL_WALLET" ? () => linkAccount({ type: accountLinkType }) : void 0;
80
+ const onTryAgain = externalWalletProvider && externalWalletType ? () => linkAccount({ externalWallet: { provider: externalWalletProvider, type: externalWalletType } }) : accountLinkType && accountLinkType !== "EXTERNAL_WALLET" ? () => linkAccount({ type: accountLinkType }) : void 0;
76
81
  const tryAgain = onTryAgain ? /* @__PURE__ */ jsxs(CpslButton, { variant: "secondary", fullWidth: true, onClick: onTryAgain, children: [
77
82
  /* @__PURE__ */ jsx(CpslIcon, { icon: "refresh", slot: "start" }),
78
83
  "Try Again"
@@ -148,7 +153,7 @@ function AccountProfileLink() {
148
153
  wallet: commonWallet,
149
154
  isSelfFetching: true,
150
155
  onConnectWc: (w) => __async(this, null, function* () {
151
- yield linkAccount({ externalWallet: { internalId: w.internalId, type: w.type } });
156
+ yield linkAccount({ externalWallet: { provider: w.id, type: w.type } });
152
157
  })
153
158
  }
154
159
  );
@@ -8,12 +8,8 @@ import { getAccountTypeName } from "../../constants/oAuthLogos.js";
8
8
  import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
9
9
  import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
10
10
  import { useEffect, useMemo } from "react";
11
- import { EXTERNAL_WALLET_TYPES } from "@getpara/web-sdk";
12
11
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
13
12
  import { safeStyled } from "@getpara/react-common";
14
- function isExternalWallet(str) {
15
- return EXTERNAL_WALLET_TYPES.includes(str);
16
- }
17
13
  function AccountProfileLinkOptions() {
18
14
  const para = useInternalClient();
19
15
  const { accountLinkOptions, linkAccount, isLinkAccountPending, linkAccountError, setLinkAccountError, resetMutations } = useAccountLinking();
@@ -27,14 +23,14 @@ function AccountProfileLinkOptions() {
27
23
  const options = useMemo(() => {
28
24
  const baseOptions = externalWalletIndex >= 0 ? [
29
25
  ...accountLinkOptions.slice(0, externalWalletIndex),
30
- ...EXTERNAL_WALLET_TYPES,
26
+ ...wallets.map((wallet) => wallet.id),
31
27
  ...accountLinkOptions.slice(externalWalletIndex + 1)
32
28
  ] : accountLinkOptions;
33
29
  return Array.from(
34
30
  new Set(
35
31
  baseOptions.filter((option) => {
36
- if (!isExternalWallet(option) || (connectedWallet == null ? void 0 : connectedWallet.internalId) !== option && wallets.some(({ type, internalId, installed, isMobile }) => {
37
- return (installed || isMobile) && (para == null ? void 0 : para.supportedWalletTypes.some((obj) => obj.type === type)) && internalId === option;
32
+ if (!wallets.some((wallet) => wallet.id === option) || (connectedWallet == null ? void 0 : connectedWallet.id) !== option && wallets.some(({ type, id, installed, isMobile }) => {
33
+ return (installed || isMobile) && (para == null ? void 0 : para.supportedWalletTypes.some((obj) => obj.type === type)) && id === option;
38
34
  })) {
39
35
  return true;
40
36
  }
@@ -47,8 +43,8 @@ function AccountProfileLinkOptions() {
47
43
  resetMutations();
48
44
  setLinkAccountError(null);
49
45
  }, []);
50
- const getExternalWalletType = (internalId) => {
51
- const allWallets = wallets.filter((wallet) => wallet.internalId === internalId);
46
+ const getExternalWalletType = (id) => {
47
+ const allWallets = wallets.filter((wallet) => wallet.id === id);
52
48
  if (allWallets.length === 1) {
53
49
  return allWallets[0].type;
54
50
  }
@@ -73,18 +69,30 @@ function AccountProfileLinkOptions() {
73
69
  isOptions && /* @__PURE__ */ jsx(CpslDivider, { children: "or" })
74
70
  ] }),
75
71
  isOptions && /* @__PURE__ */ jsx(GradientScroll, { height: "320px", children: options.filter((option) => option !== "EMAIL" && option !== "PHONE").map((option) => {
76
- const isWallet = isExternalWallet(option);
72
+ const externalWallet = wallets.find((wallet) => wallet.id === option);
77
73
  return /* @__PURE__ */ jsxs(
78
74
  Option,
79
75
  {
80
76
  fullWidth: true,
81
77
  variant: "tertiary",
82
78
  onClick: () => linkAccount(
83
- isWallet ? { externalWallet: { internalId: option, type: getExternalWalletType(option) } } : { type: option }
79
+ !!externalWallet ? {
80
+ externalWallet: {
81
+ provider: externalWallet.id,
82
+ type: getExternalWalletType(externalWallet.id)
83
+ }
84
+ } : { type: option }
84
85
  ),
85
86
  children: [
86
- /* @__PURE__ */ jsx(AccountTypeIcon, { accountType: option, size: "24px" }),
87
- /* @__PURE__ */ jsx(CpslText, { color: "contrast", variant: "bodyM", children: getAccountTypeName(option) })
87
+ /* @__PURE__ */ jsx(
88
+ AccountTypeIcon,
89
+ {
90
+ accountType: externalWallet ? void 0 : option,
91
+ src: externalWallet ? externalWallet.iconUrl : void 0,
92
+ size: "24px"
93
+ }
94
+ ),
95
+ /* @__PURE__ */ jsx(CpslText, { color: "contrast", variant: "bodyM", children: externalWallet ? externalWallet.name : getAccountTypeName(option) })
88
96
  ]
89
97
  },
90
98
  option
@@ -9,19 +9,21 @@ import { useAccountLinking } from "../../../provider/providers/AccountLinkProvid
9
9
  import { safeStyled } from "@getpara/react-common";
10
10
  function AccountProfileUnlink() {
11
11
  var _a, _b;
12
- 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);
12
+ 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);
13
13
  useEffect(() => {
14
14
  var _a2, _b2;
15
15
  if (unlinkingAccount) {
16
- setAccountType((_b2 = (_a2 = unlinkingAccount == null ? void 0 : unlinkingAccount.externalWallet) == null ? void 0 : _a2.providerId) != null ? _b2 : unlinkingAccount == null ? void 0 : unlinkingAccount.type);
16
+ setAccountType((_b2 = (_a2 = unlinkingAccount == null ? void 0 : unlinkingAccount.externalWallet) == null ? void 0 : _a2.provider) != null ? _b2 : unlinkingAccount == null ? void 0 : unlinkingAccount.type);
17
+ setIsUnlinkingExternalWallet(!!(unlinkingAccount == null ? void 0 : unlinkingAccount.externalWallet));
17
18
  }
18
19
  }, [unlinkingAccount]);
19
20
  return /* @__PURE__ */ jsxs(Content, { children: [
20
21
  /* @__PURE__ */ jsxs(Upper, { children: [
21
22
  /* @__PURE__ */ jsx(AccountTypeIcon, { accountType, size: "80px", inset: "5px" }),
22
23
  /* @__PURE__ */ jsxs(Message, { variant: "bodyM", weight: "semiBold", color: "contrast", children: [
23
- "Are you sure you want to unlink your ",
24
- getAccountTypeName(accountType, { inline: true }),
24
+ "Are you sure you want to unlink your",
25
+ " ",
26
+ isUnlinkingExternalWallet ? accountType : getAccountTypeName(accountType, { inline: true }),
25
27
  "?"
26
28
  ] })
27
29
  ] }),
@@ -1 +1 @@
1
- export declare const AddFundsAwaiting: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const AddFundsAwaiting: () => null;
@@ -1,63 +1,15 @@
1
1
  "use client";
2
- import {
3
- __spreadProps,
4
- __spreadValues
5
- } from "../../../chunk-MMUBH76A.js";
6
- import { jsx } from "react/jsx-runtime";
7
- import { StepContainer } from "../common.js";
8
- import { OnRampProvider } from "@getpara/web-sdk";
2
+ import "../../../chunk-MMUBH76A.js";
9
3
  import { useModalStore } from "../../stores/index.js";
10
- import { lazy, useEffect, useMemo, useState } from "react";
4
+ import { useEffect } from "react";
11
5
  import { ModalStep } from "../../utils/steps.js";
12
- import { RampEmbed } from "@getpara/react-common";
13
- import { safeStyled } from "@getpara/react-common";
14
- import { useGoBack } from "../../hooks/useGoBack.js";
15
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
16
- import { useStore } from "../../../provider/stores/useStore.js";
17
6
  const STEPS = {
18
7
  CANCELLED: ModalStep.ADD_FUNDS_FAILURE,
19
8
  FINISHED: ModalStep.ADD_FUNDS_SUCCESS
20
9
  };
21
10
  const AddFundsAwaiting = () => {
22
11
  const setStep = useModalStore((state) => state.setStep);
23
- const goBack = useGoBack();
24
- const onRampConfig = useModalStore((state) => state.onRampConfig);
25
12
  const onRampPurchase = useModalStore((state) => state.onRampPurchase);
26
- const setOnRampPurchase = useModalStore((state) => state.setOnRampPurchase);
27
- const para = useInternalClient();
28
- const appName = useStore((state) => state.appName);
29
- const isDark = useStore((state) => state.isDarkTheme);
30
- const [MoonPayEmbed, setMoonPayEmbed] = useState();
31
- const props = {
32
- para,
33
- appName,
34
- onRampConfig,
35
- onRampPurchase,
36
- isDark,
37
- isEmbedded: true,
38
- setOnRampPurchase,
39
- onClose: goBack
40
- };
41
- useEffect(() => {
42
- const _MoonPayEmbed = lazy(() => import("./MoonPayEmbed.js"));
43
- if (_MoonPayEmbed) {
44
- setMoonPayEmbed(_MoonPayEmbed);
45
- }
46
- }, []);
47
- const onRampEmbed = useMemo(() => {
48
- var _a, _b;
49
- if (!(onRampPurchase == null ? void 0 : onRampPurchase.id) || !props.onRampConfig) {
50
- return null;
51
- }
52
- switch (onRampPurchase == null ? void 0 : onRampPurchase.provider) {
53
- case OnRampProvider.MOONPAY:
54
- return !MoonPayEmbed || typeof window === "undefined" ? null : /* @__PURE__ */ jsx(MoonPayEmbed, __spreadProps(__spreadValues({}, props), { onRampConfig: props.onRampConfig }));
55
- case OnRampProvider.RAMP:
56
- return /* @__PURE__ */ jsx(RampEmbed, __spreadProps(__spreadValues({}, props), { apiKey: (_b = (_a = props.onRampConfig) == null ? void 0 : _a.rampApiKey) != null ? _b : "", onRampConfig: props.onRampConfig }));
57
- default:
58
- return null;
59
- }
60
- }, [onRampPurchase == null ? void 0 : onRampPurchase.provider, MoonPayEmbed]);
61
13
  useEffect(() => {
62
14
  let timeoutId;
63
15
  if ((onRampPurchase == null ? void 0 : onRampPurchase.status) && ["CANCELLED", "FINISHED"].includes(onRampPurchase.status)) {
@@ -68,11 +20,8 @@ const AddFundsAwaiting = () => {
68
20
  }
69
21
  return () => clearTimeout(timeoutId);
70
22
  }, [onRampPurchase == null ? void 0 : onRampPurchase.status]);
71
- return /* @__PURE__ */ jsx(Container, { $wide: true, children: onRampEmbed });
23
+ return null;
72
24
  };
73
- const Container = safeStyled(StepContainer)`
74
- flex: 1;
75
- `;
76
25
  export {
77
26
  AddFundsAwaiting
78
27
  };
@@ -14,8 +14,7 @@ import { useStore } from "../../../provider/stores/useStore.js";
14
14
  import { motion, AnimatePresence } from "framer-motion";
15
15
  import { OnRampProviderButton } from "../OnRampComponents/OnRampProviderButton.js";
16
16
  import { useWallet } from "../../../provider/index.js";
17
- import { EnabledFlow, OnRampProvider, OnRampPurchaseType } from "@getpara/web-sdk";
18
- import { ModalStep } from "../../utils/steps.js";
17
+ import { EnabledFlow, OnRampPurchaseType } from "@getpara/web-sdk";
19
18
  import { contentMotionProps } from "./common.js";
20
19
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
21
20
  function AddFundsProvider() {
@@ -26,7 +25,6 @@ function AddFundsProvider() {
26
25
  });
27
26
  const onRampConfig = useModalStore((state) => state.onRampConfig);
28
27
  const setOnRampPurchase = useModalStore((state) => state.setOnRampPurchase);
29
- const setModalStep = useModalStore((state) => state.setStep);
30
28
  const { asset, network, fiatQuantity, isProviderAllowed, tab } = useAddFunds();
31
29
  const { data: activeWallet } = useWallet();
32
30
  return /* @__PURE__ */ jsxs(Container, __spreadProps(__spreadValues({}, contentMotionProps), { children: [
@@ -53,11 +51,10 @@ function AddFundsProvider() {
53
51
  index,
54
52
  onClick: () => __async(this, null, function* () {
55
53
  if (!(activeWallet == null ? void 0 : activeWallet.type)) return;
56
- const isPopup = id !== OnRampProvider.RAMP;
57
54
  const { onRampPurchase: newOnRampPurchase } = yield para.initiateOnRampTransaction({
58
55
  walletId: activeWallet.isExternal ? void 0 : activeWallet.id,
59
56
  externalWalletAddress: activeWallet.isExternal ? activeWallet.id : void 0,
60
- shouldOpenPopup: isPopup,
57
+ shouldOpenPopup: true,
61
58
  params: {
62
59
  type: tab === EnabledFlow.BUY ? OnRampPurchaseType.BUY : OnRampPurchaseType.SELL,
63
60
  walletType: activeWallet.type,
@@ -69,7 +66,6 @@ function AddFundsProvider() {
69
66
  }
70
67
  });
71
68
  setOnRampPurchase(__spreadProps(__spreadValues({}, newOnRampPurchase), { fiat: "USD" }));
72
- !isPopup && setModalStep(ModalStep.ADD_FUNDS_AWAITING);
73
69
  })
74
70
  },
75
71
  id
@@ -117,7 +117,7 @@ const AuthMainStepContent = ({
117
117
  GuestMode,
118
118
  {
119
119
  href: "#",
120
- isDark,
120
+ $isDark: isDark,
121
121
  onClick: (e) => {
122
122
  e.preventDefault();
123
123
  createGuestWallets();
@@ -153,7 +153,7 @@ const GuestMode = safeStyled.a`
153
153
  align-items: center;
154
154
  width: 100%;
155
155
  height: 50px;
156
- color: ${({ isDark }) => isDark ? "white" : "black"};
156
+ color: ${({ $isDark }) => $isDark ? "white" : "black"};
157
157
  text-decoration: none;
158
158
  font-size: 16px;
159
159
  font-weight: 500;
@@ -11,23 +11,23 @@ import { useAccountLinking } from "../../../provider/providers/AccountLinkProvid
11
11
  const ExternalWalletNetworkSelectStep = () => {
12
12
  var _a, _b;
13
13
  const setStep = useModalStore((state) => state.setStep);
14
- const selectedExternalWalletId = useModalStore((state) => state.selectedExternalWalletId);
15
- const setSelectedExternalWalletId = useModalStore((state) => state.setSelectedExternalWalletId);
14
+ const selectedExternalWallet = useModalStore((state) => state.selectedExternalWallet);
15
+ const setSelectedExternalWallet = useModalStore((state) => state.setSelectedExternalWallet);
16
16
  const { wallets, connectExternalWallet } = useExternalWallets();
17
17
  const { accountLinkInProgress, linkAccount } = useAccountLinking();
18
18
  const externalWalletProvider = (_b = accountLinkInProgress == null ? void 0 : accountLinkInProgress.pendingWalletProvider) != null ? _b : (_a = accountLinkInProgress == null ? void 0 : accountLinkInProgress.externalWallet) == null ? void 0 : _a.providerId;
19
- if (!accountLinkInProgress && !selectedExternalWalletId) {
19
+ if (!accountLinkInProgress && !selectedExternalWallet) {
20
20
  setStep(ModalStep.ACCOUNT_MAIN);
21
21
  return null;
22
22
  }
23
- const availableWallets = wallets.filter((w) => w.internalId === (externalWalletProvider != null ? externalWalletProvider : selectedExternalWalletId));
23
+ const availableWallets = wallets.filter((w) => w.id === (externalWalletProvider != null ? externalWalletProvider : selectedExternalWallet == null ? void 0 : selectedExternalWallet.id));
24
24
  const firstWallet = availableWallets[0];
25
25
  const handleWalletClick = (wallet) => () => {
26
26
  if (accountLinkInProgress) {
27
- linkAccount({ externalWallet: wallet });
27
+ linkAccount({ externalWallet: { provider: wallet.id } });
28
28
  return;
29
29
  }
30
- setSelectedExternalWalletId(wallet.internalId);
30
+ setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
31
31
  setStep(ModalStep.EX_WALLET_SELECTED);
32
32
  if (wallet.installed || wallet.internalId === "FARCASTER") {
33
33
  connectExternalWallet(wallet);
@@ -14,7 +14,7 @@ import { useExternalWallets } from "../../../provider/providers/ExternalWalletPr
14
14
  const HAS_MORE_LENGTH = 3;
15
15
  const ExternalWallets = () => {
16
16
  const { wallets: allWallets, connectExternalWallet } = useExternalWallets();
17
- const setSelectedExternalWalletId = useModalStore((state) => state.setSelectedExternalWalletId);
17
+ const setSelectedExternalWallet = useModalStore((state) => state.setSelectedExternalWallet);
18
18
  const setStep = useModalStore((state) => state.setStep);
19
19
  const showAll = useModalStore((state) => state.step === ModalStep.EX_WALLET_MORE);
20
20
  const authLayout = useModalStore((state) => state.authLayout);
@@ -34,11 +34,11 @@ const ExternalWallets = () => {
34
34
  const handleWalletClick = (wallet) => () => {
35
35
  const shouldShowNetworkSelection = allWallets.filter((w) => w.id === wallet.id).length > 1;
36
36
  if (shouldShowNetworkSelection) {
37
- setSelectedExternalWalletId(wallet.internalId);
37
+ setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
38
38
  setStep(ModalStep.EX_WALLET_NETWORK_SELECT);
39
39
  return;
40
40
  }
41
- setSelectedExternalWalletId(wallet.internalId);
41
+ setSelectedExternalWallet({ id: wallet.id, type: wallet.type });
42
42
  setStep(ModalStep.EX_WALLET_SELECTED);
43
43
  if (wallet.installed) {
44
44
  connectExternalWallet(wallet);
@@ -141,8 +141,8 @@ const Badge = safeStyled.div`
141
141
  }
142
142
  `;
143
143
  const InstalledIndicator = safeStyled.span`
144
- width: 8px;
145
- height: 8px;
144
+ width: 4px;
145
+ height: 4px;
146
146
  border-radius: 100%;
147
147
  background-color: var(--cpsl-color-utility-green);
148
148
  `;
@@ -17,7 +17,7 @@ const OAuth = ({ methods }) => {
17
17
  const isDark = useStore((state) => state.isDarkTheme);
18
18
  const setStep = useModalStore((state) => state.setStep);
19
19
  const showAll = useModalStore((state) => state.step === ModalStep.AUTH_MORE || state.step === ModalStep.AUTH_GUEST_SIGNUP);
20
- const { verifyFarcaster, verifyOAuth, isOAuthReady } = useAuthActions();
20
+ const { verifyFarcaster, verifyOAuth } = useAuthActions();
21
21
  const hasMore = methods.length > HAS_MORE_LENGTH;
22
22
  const methodsToShow = showAll || !hasMore ? methods : methods.slice(0, HAS_MORE_LENGTH - 1);
23
23
  const handleShowAll = () => {
@@ -47,8 +47,7 @@ const OAuth = ({ methods }) => {
47
47
  icon: ACCOUNT_TYPES[method][useBrandedLogos ? "logoBranded" : "logo"],
48
48
  onClick: handleMethodClick(method),
49
49
  $index: index,
50
- $totalItems: showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length,
51
- disabled: !isOAuthReady
50
+ $totalItems: showMoreButton ? HAS_MORE_LENGTH : methodsToShow.length
52
51
  },
53
52
  method
54
53
  )),
@@ -59,8 +58,7 @@ const OAuth = ({ methods }) => {
59
58
  icon: "moreLoginOptions",
60
59
  onClick: handleShowAll,
61
60
  $index: HAS_MORE_LENGTH - 1,
62
- $totalItems: HAS_MORE_LENGTH,
63
- disabled: !isOAuthReady
61
+ $totalItems: HAS_MORE_LENGTH
64
62
  }
65
63
  )
66
64
  ] });
@@ -125,7 +125,7 @@ const VerificationCode = ({ authInfo, onResend, onSubmit, status, error }) => {
125
125
  };
126
126
  const VerificationCodeStep = () => {
127
127
  const { verifyNewAccount, verifyNewAccountStatus, verifyNewAccountError } = useAuthActions();
128
- const { mutateAsync: resendVerificationCode } = useResendVerificationCode();
128
+ const { resendVerificationCodeAsync } = useResendVerificationCode();
129
129
  const para = useInternalClient();
130
130
  if (!para.authInfo) {
131
131
  return null;
@@ -136,7 +136,7 @@ const VerificationCodeStep = () => {
136
136
  authInfo: para.authInfo,
137
137
  onSubmit: verifyNewAccount,
138
138
  onResend: () => {
139
- resendVerificationCode({ type: "SIGNUP" });
139
+ resendVerificationCodeAsync({ type: "SIGNUP" });
140
140
  },
141
141
  status: verifyNewAccountStatus,
142
142
  error: verifyNewAccountError
@@ -1,5 +1,5 @@
1
1
  import { CpslInput, CpslText, CpslTileButton } from '@getpara/react-components';
2
- import { Network, OnRampAsset, TExternalWallet, TLinkedAccountType } from '@getpara/web-sdk';
2
+ import { Network, OnRampAsset, TLinkedAccountType } from '@getpara/web-sdk';
3
3
  import { PropsWithChildren } from 'react';
4
4
  export declare const SpinnerContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
5
  export declare const QRContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -41,13 +41,15 @@ export declare const ErrorContainer: import("styled-components/dist/types.js").I
41
41
  export declare const ErrorIcon: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
42
42
  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;
43
43
  }, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
44
- export declare function AccountTypeIcon({ accountType, size, inset, }: {
45
- accountType?: TLinkedAccountType | TExternalWallet;
44
+ export declare function AccountTypeIcon({ accountType, size, inset, src, }: {
45
+ accountType?: TLinkedAccountType | string;
46
46
  size?: string;
47
47
  inset?: string;
48
+ src?: string;
48
49
  }): import("react/jsx-runtime").JSX.Element | null;
49
- export declare function HeroAccountTypeIcon({ accountType }: {
50
- accountType: TLinkedAccountType | TExternalWallet;
50
+ export declare function HeroAccountTypeIcon({ accountType, src }: {
51
+ accountType?: TLinkedAccountType | string;
52
+ src?: string;
51
53
  }): import("react/jsx-runtime").JSX.Element;
52
54
  export declare function HeroSuccessIcon(): import("react/jsx-runtime").JSX.Element;
53
55
  export declare function GradientScroll({ height, gap, children }: PropsWithChildren<{
@@ -157,7 +157,8 @@ const ErrorIcon = safeStyled(CpslIcon)`
157
157
  function AccountTypeIcon({
158
158
  accountType,
159
159
  size,
160
- inset
160
+ inset,
161
+ src
161
162
  }) {
162
163
  var _a;
163
164
  const isDark = useStore((state) => {
@@ -165,13 +166,13 @@ function AccountTypeIcon({
165
166
  return ((_b = (_a2 = state.modalConfig) == null ? void 0 : _a2.theme) == null ? void 0 : _b.mode) === "dark";
166
167
  });
167
168
  const data = accountType ? ACCOUNT_TYPES[accountType] : null;
168
- return data ? /* @__PURE__ */ jsx(CpslIcon, { size, inset, icon: (_a = data.logoBranded) != null ? _a : data.logo, invert: isDark && data.isDark }) : null;
169
+ return data || src ? /* @__PURE__ */ jsx(CpslIcon, { size, inset, icon: (_a = data == null ? void 0 : data.logoBranded) != null ? _a : data == null ? void 0 : data.logo, src, invert: isDark && (data == null ? void 0 : data.isDark) }) : null;
169
170
  }
170
- function HeroAccountTypeIcon({ accountType }) {
171
+ function HeroAccountTypeIcon({ accountType, src }) {
171
172
  if (accountType === "EMAIL" || accountType === "PHONE") {
172
173
  return /* @__PURE__ */ jsx(HeroGenericIcon, { accountType });
173
174
  }
174
- return /* @__PURE__ */ jsx(AccountTypeIcon, { accountType, size: "60px" });
175
+ return /* @__PURE__ */ jsx(AccountTypeIcon, { accountType, size: "60px", src });
175
176
  }
176
177
  function HeroSuccessIcon() {
177
178
  return /* @__PURE__ */ jsx(CpslIcon, { icon: "checkCircleFilled", size: "80px", style: { ["--icon-color"]: "var(--cpsl-color-utility-green" } });
@@ -121,7 +121,7 @@ const BODY_MOTION_VARIANTS = {
121
121
  const BODY_TRANSITION = {
122
122
  duration: 0.2
123
123
  };
124
- const SDK_VERSION = "2.0.0-alpha.33";
124
+ const SDK_VERSION = "2.0.0-alpha.35";
125
125
  export {
126
126
  BODY_MOTION_VARIANTS,
127
127
  BODY_TRANSITION,
@@ -1,8 +1,7 @@
1
- import { TExternalWallet } from '@getpara/web-sdk';
2
1
  import { IconType } from '@getpara/react-components';
3
2
  import { TLinkedAccountType } from '@getpara/web-sdk';
4
3
  export declare const ACCOUNT_TYPES: {
5
- [key in TLinkedAccountType | TExternalWallet]: {
4
+ [key in TLinkedAccountType | string]: {
6
5
  logo: IconType;
7
6
  logoBranded?: IconType;
8
7
  name: string;
@@ -11,7 +10,7 @@ export declare const ACCOUNT_TYPES: {
11
10
  isExternalWallet?: boolean;
12
11
  };
13
12
  };
14
- export declare function getAccountTypeName(type: TLinkedAccountType | TExternalWallet | undefined, { inline }?: {
13
+ export declare function getAccountTypeName(type: TLinkedAccountType | string | undefined, { inline }?: {
15
14
  inline?: boolean;
16
15
  }): string | undefined;
17
16
  export declare function getAccountTypeLogo(type: TLinkedAccountType | undefined): IconType | undefined;