@getpara/react-sdk-lite 2.0.0-alpha.44 → 2.0.0-alpha.45

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.
@@ -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.44";
129
+ const SDK_VERSION = "2.0.0-alpha.45";
130
130
  export {
131
131
  BODY_MOTION_VARIANTS,
132
132
  BODY_TRANSITION,
@@ -4,6 +4,7 @@ import {
4
4
  } from "../../../chunk-MMUBH76A.js";
5
5
  import { create } from "zustand";
6
6
  import { persist, createJSONStorage } from "zustand/middleware";
7
+ import { PARA_STORAGE_PREFIX } from "@getpara/core-sdk";
7
8
  import { ModalStep } from "../../utils/steps.js";
8
9
  import { getActions } from "./actions.js";
9
10
  import {
@@ -55,7 +56,7 @@ const useModalStore = create()(
55
56
  }, DEFAULT_MODAL_STATE), getActions(set, get)),
56
57
  {
57
58
  version: 1,
58
- name: "@PARA/modalState",
59
+ name: `${PARA_STORAGE_PREFIX}modalState`,
59
60
  storage: createJSONStorage(() => localStorage),
60
61
  partialize: (state) => ({
61
62
  step: state.step,
@@ -67,7 +67,7 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
67
67
  useEffect(() => {
68
68
  var _a, _b;
69
69
  if (includeWalletVerification !== (externalWalletConfig == null ? void 0 : externalWalletConfig.includeWalletVerification)) {
70
- if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isConfigType(paraClientConfig) ? (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly : paraClientConfig.externalWalletConnectionOnly)) {
70
+ if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly)) {
71
71
  console.warn("includeWalletVerification has no effect when using connection only external wallets");
72
72
  setIncludeWalletVerification(false);
73
73
  } else {
@@ -84,7 +84,7 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
84
84
  useEffect(() => {
85
85
  var _a, _b;
86
86
  if (externalWalletsWithFullAuth !== (externalWalletConfig == null ? void 0 : externalWalletConfig.createLinkedEmbeddedForExternalWallets)) {
87
- if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isConfigType(paraClientConfig) ? (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly : paraClientConfig.externalWalletConnectionOnly)) {
87
+ if ((externalWalletConfig == null ? void 0 : externalWalletConfig.connectionOnly) || (isParaWeb(paraClientConfig) ? paraClientConfig.externalWalletConnectionOnly : (_a = paraClientConfig.opts) == null ? void 0 : _a.externalWalletConnectionOnly)) {
88
88
  console.warn("createLinkedEmbeddedForExternalWallets has no effect when using connection only external wallets");
89
89
  setExternalWalletsWithFullAuth([]);
90
90
  } else {
@@ -98,7 +98,7 @@ const ParaProviderMin = forwardRef(({ children, paraClientConfig, callbacks, con
98
98
  if (!isConfigType(paraClientConfig) && !isParaWeb(paraClientConfig)) {
99
99
  throw new Error("Invalid Para config");
100
100
  }
101
- const newClient = isConfigType(paraClientConfig) ? new ParaWeb(paraClientConfig.env, paraClientConfig.apiKey, paraClientConfig.opts) : paraClientConfig;
101
+ const newClient = isParaWeb(paraClientConfig) ? paraClientConfig : new ParaWeb(paraClientConfig.env, paraClientConfig.apiKey, paraClientConfig.opts);
102
102
  if (newClient.isReady) {
103
103
  setIsClientReady(true);
104
104
  } else {
@@ -12,12 +12,13 @@ import {
12
12
  } from "./slices/index.js";
13
13
  import { createJSONStorage, persist } from "zustand/middleware";
14
14
  import { createConfigSlice } from "./slices/config.js";
15
+ import { PARA_STORAGE_PREFIX } from "@getpara/core-sdk";
15
16
  const vanillaStore = createStore()(
16
17
  persist(
17
18
  (...a) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createClientSlice(...a)), createModalSlice(...a)), createWalletSlice(...a)), createExternalWalletsSlice(...a)), createConfigSlice(...a)), createAnalyticsSlice(...a)),
18
19
  {
19
20
  version: 1,
20
- name: "@PARA/provider-state",
21
+ name: `${PARA_STORAGE_PREFIX}provider-state`,
21
22
  storage: createJSONStorage(() => localStorage),
22
23
  partialize: (state) => ({
23
24
  selectedWalletId: state.selectedWalletId,
@@ -138,7 +138,7 @@ export interface ParaProviderProps<chains extends readonly [Chain, ...Chain[]],
138
138
  /**
139
139
  * Environment for your Para instance.
140
140
  */
141
- env: Environment;
141
+ env?: Environment;
142
142
  /**
143
143
  * API key for you Para instance.
144
144
  *
@@ -1,7 +1,7 @@
1
1
  import ParaWeb, { ConstructorOpts, Environment } from '@getpara/web-sdk';
2
2
  export declare function isConfigType(obj: any): obj is {
3
- env: Environment;
4
3
  apiKey: string;
4
+ env: Environment | undefined;
5
5
  opts?: ConstructorOpts;
6
6
  };
7
7
  export declare function isParaWeb(obj: any): obj is ParaWeb;
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-MMUBH76A.js";
3
3
  import ParaWeb from "@getpara/web-sdk";
4
4
  function isConfigType(obj) {
5
- return !!obj && typeof obj === "object" && "env" in obj && "apiKey" in obj;
5
+ return !!obj && typeof obj === "object" && "apiKey" in obj;
6
6
  }
7
7
  function isParaWeb(obj) {
8
8
  return obj instanceof ParaWeb;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.0.0-alpha.44",
3
+ "version": "2.0.0-alpha.45",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.0.0-alpha.44",
9
- "@getpara/react-components": "2.0.0-alpha.44",
10
- "@getpara/web-sdk": "2.0.0-alpha.44",
8
+ "@getpara/react-common": "2.0.0-alpha.45",
9
+ "@getpara/react-components": "2.0.0-alpha.45",
10
+ "@getpara/web-sdk": "2.0.0-alpha.45",
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.44",
20
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.44",
21
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.44",
19
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.45",
20
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.45",
21
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.45",
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": "b4b97e2443de5eef177eba429426e4e41d9a3d9a",
41
+ "gitHead": "0a049e7d4e48caae1347619fd8c0518793fbc53c",
42
42
  "main": "dist/index.js",
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": ">=5.0.0",