@getpara/react-sdk-lite 2.0.0-alpha.43 → 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.
- package/dist/modal/constants/constants.js +1 -1
- package/dist/modal/stores/modal/useModalStore.js +2 -1
- package/dist/provider/ParaProviderMin.js +3 -3
- package/dist/provider/providers/ExternalWalletProvider.js +4 -0
- package/dist/provider/stores/useStore.js +2 -1
- package/dist/provider/types/provider.d.ts +1 -1
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +1 -1
- package/dist/provider/utils/paraConfigTypeGuards.js +1 -1
- package/package.json +8 -8
|
@@ -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:
|
|
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) || (
|
|
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) || (
|
|
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 =
|
|
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,6 +12,8 @@ import { ModalStep } from "../../modal/index.js";
|
|
|
12
12
|
import { useModalStore } from "../../modal/stores/index.js";
|
|
13
13
|
import { useAccount, useModal, useParaStatus, useVerifyExternalWallet, useWalletState } from "../hooks/index.js";
|
|
14
14
|
import { useAuthActions } from "./AuthProvider.js";
|
|
15
|
+
import { IS_FULLY_LOGGED_IN_BASE_KEY } from "../hooks/queries/useIsFullyLoggedIn.js";
|
|
16
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
15
17
|
const useWalletDisplayHelpers = (wallet) => {
|
|
16
18
|
const isUsingMobileConnector = useModalStore((state) => state.isUsingMobileConnector);
|
|
17
19
|
return {
|
|
@@ -111,6 +113,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
111
113
|
const { setSelectedWallet } = useWalletState();
|
|
112
114
|
const { onNewAuthState } = useAuthActions();
|
|
113
115
|
const { verifyExternalWalletAsync } = useVerifyExternalWallet();
|
|
116
|
+
const queryClient = useQueryClient();
|
|
114
117
|
const [qrUri, setQrUri] = useState();
|
|
115
118
|
const [chainIdSwitchingTo, setChainIdSwitchingTo] = useState();
|
|
116
119
|
const [isSigningMessage, setIsSigningMessage] = useState(false);
|
|
@@ -301,6 +304,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
301
304
|
}
|
|
302
305
|
try {
|
|
303
306
|
const d = yield verifyExternalWalletAsync(verifyExternalWalletParams);
|
|
307
|
+
yield queryClient.refetchQueries({ queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY] });
|
|
304
308
|
if (wallet2 && (externalWalletsWithFullAuth == null ? void 0 : externalWalletsWithFullAuth.includes((_a = wallet2.name) == null ? void 0 : _a.toUpperCase()))) {
|
|
305
309
|
yield onNewAuthState(d);
|
|
306
310
|
} 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:
|
|
21
|
+
name: `${PARA_STORAGE_PREFIX}provider-state`,
|
|
21
22
|
storage: createJSONStorage(() => localStorage),
|
|
22
23
|
partialize: (state) => ({
|
|
23
24
|
selectedWalletId: state.selectedWalletId,
|
|
@@ -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" && "
|
|
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.
|
|
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.
|
|
9
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
10
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
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.
|
|
20
|
-
"@getpara/evm-wallet-connectors": "2.0.0-alpha.
|
|
21
|
-
"@getpara/solana-wallet-connectors": "2.0.0-alpha.
|
|
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": "
|
|
41
|
+
"gitHead": "0a049e7d4e48caae1347619fd8c0518793fbc53c",
|
|
42
42
|
"main": "dist/index.js",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@tanstack/react-query": ">=5.0.0",
|