@getpara/react-sdk 1.15.1 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ import { SDK_VERSION } from "./constants/constants.js";
26
26
  defineCustomElements();
27
27
  const ParaModal = forwardRef(
28
28
  (_a, ref) => {
29
- var _b = _a, { para, isOpen, externalWalletsWithParaAuth, rpcUrl: rpcUrlFromProps } = _b, rest = __objRest(_b, ["para", "isOpen", "externalWalletsWithParaAuth", "rpcUrl"]);
29
+ var _b = _a, { para, isOpen, createLinkedEmbeddedForExternalWallets, externalWalletsWithParaAuth, rpcUrl: rpcUrlFromProps } = _b, rest = __objRest(_b, ["para", "isOpen", "createLinkedEmbeddedForExternalWallets", "externalWalletsWithParaAuth", "rpcUrl"]);
30
30
  const [isInitialized, setIsInitialized] = useState(false);
31
31
  const setClient = useStore((state) => state.setClient);
32
32
  const client = useStore((state) => state.client);
@@ -38,10 +38,7 @@ const ParaModal = forwardRef(
38
38
  const trackAnalytics = () => __async(void 0, null, function* () {
39
39
  try {
40
40
  yield para.ctx.client.trackReactSdkAnalytics({
41
- props: __spreadValues({
42
- externalWalletsWithParaAuth,
43
- rpcUrlFromProps
44
- }, rest),
41
+ props: __spreadValues({ externalWalletsWithParaAuth, createLinkedEmbeddedForExternalWallets, rpcUrlFromProps }, rest),
45
42
  reactSdkVersion: SDK_VERSION
46
43
  });
47
44
  } catch (_) {
@@ -50,8 +47,10 @@ const ParaModal = forwardRef(
50
47
  trackAnalytics();
51
48
  }, []);
52
49
  useEffect(() => {
53
- updateExternalWalletProviderState({ fullAuthWallets: externalWalletsWithParaAuth });
54
- }, [externalWalletsWithParaAuth]);
50
+ updateExternalWalletProviderState({
51
+ fullAuthWallets: createLinkedEmbeddedForExternalWallets || externalWalletsWithParaAuth
52
+ });
53
+ }, [createLinkedEmbeddedForExternalWallets, externalWalletsWithParaAuth]);
55
54
  useEffect(() => {
56
55
  if (!client) {
57
56
  setClient(para);
@@ -74,7 +73,14 @@ const ParaModal = forwardRef(
74
73
  if (!isInitialized) {
75
74
  return null;
76
75
  }
77
- return /* @__PURE__ */ jsx(ParaModalInner, __spreadValues({ ref, para, externalWalletsWithParaAuth }, rest));
76
+ return /* @__PURE__ */ jsx(
77
+ ParaModalInner,
78
+ __spreadValues({
79
+ ref,
80
+ para,
81
+ createLinkedEmbeddedForExternalWallets: createLinkedEmbeddedForExternalWallets || externalWalletsWithParaAuth
82
+ }, rest)
83
+ );
78
84
  }
79
85
  );
80
86
  const ParaModalInner = forwardRef(
@@ -95,7 +101,7 @@ const ParaModalInner = forwardRef(
95
101
  onModalStepChange,
96
102
  hideWallets = false,
97
103
  onClose,
98
- externalWalletsWithParaAuth
104
+ createLinkedEmbeddedForExternalWallets
99
105
  } = _d, rest = __objRest(_d, [
100
106
  "theme",
101
107
  "appName",
@@ -112,7 +118,7 @@ const ParaModalInner = forwardRef(
112
118
  "onModalStepChange",
113
119
  "hideWallets",
114
120
  "onClose",
115
- "externalWalletsWithParaAuth"
121
+ "createLinkedEmbeddedForExternalWallets"
116
122
  ]);
117
123
  const modalContentRef = useRef(null);
118
124
  const updateThemeState = useThemeStore((state) => state.updateState);
@@ -337,30 +343,37 @@ const ParaModalInner = forwardRef(
337
343
  }
338
344
  return null;
339
345
  }
340
- return /* @__PURE__ */ jsx(ExternalWalletsWrapper, { wallets: externalWallets, externalWalletsWithFullAuth: externalWalletsWithParaAuth, children: /* @__PURE__ */ jsx(
341
- StyledAuthModal,
346
+ return /* @__PURE__ */ jsx(
347
+ ExternalWalletsWrapper,
342
348
  {
343
- enterTransitionDuration: DEFAULTS.ANIMATION_DURATION,
344
- exitTransitionDuration: DEFAULTS.ANIMATION_DURATION,
345
- open: isOpen,
346
- onCpslModalExited: handleModalExited,
347
- onCpslModalEntering: handleModalEntering,
348
- onCpslModalRequestClose: handleClose,
349
- noOverlay: bareModal,
350
- className,
351
- "data-testid": "modal",
352
- $embeddedModal: embeddedModal,
353
- children: isModalMounted && (isInit && embeddedModal || !embeddedModal) && /* @__PURE__ */ jsx(
354
- ModalContent,
355
- __spreadValues({
356
- oAuthMethods,
357
- disableEmailLogin,
358
- disablePhoneLogin,
359
- onClose: handleClose
360
- }, rest)
349
+ wallets: externalWallets,
350
+ createLinkedEmbeddedForExternalWallets,
351
+ children: /* @__PURE__ */ jsx(
352
+ StyledAuthModal,
353
+ {
354
+ enterTransitionDuration: DEFAULTS.ANIMATION_DURATION,
355
+ exitTransitionDuration: DEFAULTS.ANIMATION_DURATION,
356
+ open: isOpen,
357
+ onCpslModalExited: handleModalExited,
358
+ onCpslModalEntering: handleModalEntering,
359
+ onCpslModalRequestClose: handleClose,
360
+ noOverlay: bareModal,
361
+ className,
362
+ "data-testid": "modal",
363
+ $embeddedModal: embeddedModal,
364
+ children: isModalMounted && (isInit && embeddedModal || !embeddedModal) && /* @__PURE__ */ jsx(
365
+ ModalContent,
366
+ __spreadValues({
367
+ oAuthMethods,
368
+ disableEmailLogin,
369
+ disablePhoneLogin,
370
+ onClose: handleClose
371
+ }, rest)
372
+ )
373
+ }
361
374
  )
362
375
  }
363
- ) });
376
+ );
364
377
  }
365
378
  );
366
379
  const StyledAuthModal = styled(CpslAuthModal)`
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
2
2
  import { TExternalWallet } from '../../types/externalWallets.js';
3
3
  interface ExternalWalletsWrapperProps extends PropsWithChildren {
4
4
  wallets?: TExternalWallet[];
5
- externalWalletsWithFullAuth?: TExternalWallet[];
5
+ createLinkedEmbeddedForExternalWallets?: TExternalWallet[];
6
6
  }
7
- export declare const ExternalWalletsWrapper: ({ children, wallets, externalWalletsWithFullAuth }: ExternalWalletsWrapperProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const ExternalWalletsWrapper: ({ children, wallets, createLinkedEmbeddedForExternalWallets, }: ExternalWalletsWrapperProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -21,7 +21,11 @@ import {
21
21
  import { useModalStore, useUserInfoStore } from "../../stores/index.js";
22
22
  import { useExternalWalletProviderStore } from "../../stores/externalWalletProvider/useExternalWalletProviderStore.js";
23
23
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
24
- const ExternalWalletsWrapper = ({ children, wallets, externalWalletsWithFullAuth }) => {
24
+ const ExternalWalletsWrapper = ({
25
+ children,
26
+ wallets,
27
+ createLinkedEmbeddedForExternalWallets
28
+ }) => {
25
29
  const para = useInternalClient();
26
30
  const resetModalState = useModalStore((state) => state.resetState);
27
31
  const resetUserInfoState = useUserInfoStore((state) => state.resetState);
@@ -114,7 +118,7 @@ const ExternalWalletsWrapper = ({ children, wallets, externalWalletsWithFullAuth
114
118
  solanaContext,
115
119
  cosmosContext,
116
120
  walletSort: wallets,
117
- externalWalletsWithFullAuth,
121
+ createLinkedEmbeddedForExternalWallets,
118
122
  children
119
123
  }
120
124
  ) }) }) });
@@ -119,7 +119,7 @@ const BODY_MOTION_VARIANTS = {
119
119
  const BODY_TRANSITION = {
120
120
  duration: 0.2
121
121
  };
122
- const SDK_VERSION = "1.15.1";
122
+ const SDK_VERSION = "1.17.0";
123
123
  export {
124
124
  BODY_MOTION_VARIANTS,
125
125
  BODY_TRANSITION,
@@ -59,9 +59,9 @@ interface ExternalWalletProviderProps {
59
59
  evmContext: Context<EvmExternalWalletContextType>;
60
60
  solanaContext: Context<SolanaExternalWalletContextType>;
61
61
  cosmosContext: Context<CosmosExternalWalletContextType>;
62
- externalWalletsWithFullAuth?: TExternalWallet[];
62
+ createLinkedEmbeddedForExternalWallets?: TExternalWallet[];
63
63
  }
64
- export declare function ExternalWalletProvider({ children, evmContext, solanaContext, cosmosContext, walletSort, externalWalletsWithFullAuth, }: ExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
64
+ export declare function ExternalWalletProvider({ children, evmContext, solanaContext, cosmosContext, walletSort, createLinkedEmbeddedForExternalWallets, }: ExternalWalletProviderProps): import("react/jsx-runtime").JSX.Element;
65
65
  export declare const useExternalWallets: () => {
66
66
  wallets: CommonWallet[];
67
67
  chains: CommonChain[];
@@ -41,7 +41,7 @@ function ExternalWalletProvider({
41
41
  solanaContext,
42
42
  cosmosContext,
43
43
  walletSort,
44
- externalWalletsWithFullAuth
44
+ createLinkedEmbeddedForExternalWallets
45
45
  }) {
46
46
  const {
47
47
  wallets: evmWallets,
@@ -283,7 +283,7 @@ function ExternalWalletProvider({
283
283
  return;
284
284
  }
285
285
  } else if (address) {
286
- if (!para.externalWalletConnectionOnly && (externalWalletsWithFullAuth == null ? void 0 : externalWalletsWithFullAuth.includes(wallet2.id.toUpperCase()))) {
286
+ if (!para.externalWalletConnectionOnly && (createLinkedEmbeddedForExternalWallets == null ? void 0 : createLinkedEmbeddedForExternalWallets.includes(wallet2.id.toUpperCase()))) {
287
287
  yield completeFullAuth(address, wallet2.type, userExists, isVerified, bufferAddress);
288
288
  } else {
289
289
  setStep(ModalStep.LOGIN_DONE);
@@ -292,7 +292,7 @@ function ExternalWalletProvider({
292
292
  setIsExternalWalletConnecting(false);
293
293
  }
294
294
  }),
295
- [isExternalWalletConnecting, externalWalletsWithFullAuth]
295
+ [isExternalWalletConnecting, createLinkedEmbeddedForExternalWallets]
296
296
  );
297
297
  const disconnectExternalWallet = () => __async(this, null, function* () {
298
298
  yield para.logout();
@@ -11,7 +11,8 @@ export declare enum EvmWallet {
11
11
  export declare enum SolanaWallet {
12
12
  PHANTOM = "PHANTOM",
13
13
  GLOW = "GLOW",
14
- BACKPACK = "BACKPACK"
14
+ BACKPACK = "BACKPACK",
15
+ SOLFLARE = "SOLFLARE"
15
16
  }
16
17
  export declare enum CosmosWallet {
17
18
  KEPLR = "KEPLR",
@@ -23,6 +24,7 @@ export declare const ExternalWallet: {
23
24
  PHANTOM: SolanaWallet.PHANTOM;
24
25
  GLOW: SolanaWallet.GLOW;
25
26
  BACKPACK: SolanaWallet.BACKPACK;
27
+ SOLFLARE: SolanaWallet.SOLFLARE;
26
28
  METAMASK: EvmWallet.METAMASK;
27
29
  RAINBOW: EvmWallet.RAINBOW;
28
30
  COINBASE: EvmWallet.COINBASE;
@@ -17,6 +17,7 @@ var SolanaWallet = /* @__PURE__ */ ((SolanaWallet2) => {
17
17
  SolanaWallet2["PHANTOM"] = "PHANTOM";
18
18
  SolanaWallet2["GLOW"] = "GLOW";
19
19
  SolanaWallet2["BACKPACK"] = "BACKPACK";
20
+ SolanaWallet2["SOLFLARE"] = "SOLFLARE";
20
21
  return SolanaWallet2;
21
22
  })(SolanaWallet || {});
22
23
  var CosmosWallet = /* @__PURE__ */ ((CosmosWallet2) => {
@@ -117,11 +117,19 @@ export interface ParaModalProps {
117
117
  */
118
118
  externalWallets?: TExternalWallet[];
119
119
  /**
120
+ * @deprecated Use `createLinkedEmbeddedForExternalWallets` instead.
121
+ *
120
122
  * Which external wallets to include full Para authentication for.
121
123
  *
122
124
  * These wallets should also be included in the externalWallets list in order to be displayed in the modal.
123
125
  */
124
126
  externalWalletsWithParaAuth?: TExternalWallet[];
127
+ /**
128
+ * Which external wallets to include full Para authentication for.
129
+ *
130
+ * These wallets should also be included in the externalWallets list in order to be displayed in the modal.
131
+ */
132
+ createLinkedEmbeddedForExternalWallets?: TExternalWallet[];
125
133
  /**
126
134
  * How the modal should order the components on the main auth screen.
127
135
  * Only the first method of each type (auth or external) will be used.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk",
3
- "version": "1.15.1",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,9 +12,9 @@
12
12
  "*.css"
13
13
  ],
14
14
  "dependencies": {
15
- "@getpara/react-common": "1.15.1",
16
- "@getpara/react-components": "1.15.1",
17
- "@getpara/web-sdk": "1.15.1",
15
+ "@getpara/react-common": "1.17.0",
16
+ "@getpara/react-components": "1.17.0",
17
+ "@getpara/web-sdk": "1.17.0",
18
18
  "@tanstack/react-query": "^5.0.0",
19
19
  "date-fns": "^3.6.0",
20
20
  "framer-motion": "11.3.28",
@@ -51,5 +51,5 @@
51
51
  "resolutions": {
52
52
  "styled-components": "^6"
53
53
  },
54
- "gitHead": "591a28303fdd9abd944d512e7dfdb73759a32ed8"
54
+ "gitHead": "857cb45a49040c475fa7431f36134b0d5cb630f5"
55
55
  }