@getpara/react-sdk 1.12.1-dev.2 → 1.13.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.
@@ -22,6 +22,7 @@ import { useStore } from "../provider/stores/useStore.js";
22
22
  import { getExternalWalletDisplayName } from "@getpara/react-common";
23
23
  import { useInternalClient } from "../provider/hooks/utils/useInternalClient.js";
24
24
  import { useExternalWalletProviderStore } from "./stores/externalWalletProvider/useExternalWalletProviderStore.js";
25
+ import { SDK_VERSION } from "./constants/constants.js";
25
26
  defineCustomElements();
26
27
  const ParaModal = forwardRef(
27
28
  (_a, ref) => {
@@ -33,6 +34,21 @@ const ParaModal = forwardRef(
33
34
  const setRpcUrl = useStore((state) => state.setRpcUrl);
34
35
  const { closeModal, openModal } = useModal();
35
36
  const updateExternalWalletProviderState = useExternalWalletProviderStore((state) => state.updateState);
37
+ useEffect(() => {
38
+ const trackAnalytics = () => __async(void 0, null, function* () {
39
+ try {
40
+ yield para.ctx.client.trackReactSdkAnalytics({
41
+ props: __spreadValues({
42
+ externalWalletsWithParaAuth,
43
+ rpcUrlFromProps
44
+ }, rest),
45
+ reactSdkVersion: SDK_VERSION
46
+ });
47
+ } catch (_) {
48
+ }
49
+ });
50
+ trackAnalytics();
51
+ }, []);
36
52
  useEffect(() => {
37
53
  updateExternalWalletProviderState({ fullAuthWallets: externalWalletsWithParaAuth });
38
54
  }, [externalWalletsWithParaAuth]);
@@ -36,4 +36,5 @@ export declare const NETWORK_NOT_SUPPORTED_ERROR = "network not supported";
36
36
  export declare const EMAIL_REGEX: RegExp;
37
37
  export declare const BODY_MOTION_VARIANTS: Variants;
38
38
  export declare const BODY_TRANSITION: Transition;
39
+ export declare const SDK_VERSION: string;
39
40
  export {};
@@ -119,6 +119,7 @@ const BODY_MOTION_VARIANTS = {
119
119
  const BODY_TRANSITION = {
120
120
  duration: 0.2
121
121
  };
122
+ const SDK_VERSION = "1.13.0";
122
123
  export {
123
124
  BODY_MOTION_VARIANTS,
124
125
  BODY_TRANSITION,
@@ -130,6 +131,7 @@ export {
130
131
  ON_RAMP_PROVIDERS,
131
132
  PARA_CONNECT,
132
133
  PARA_TERMS_AND_CONDITIONS,
134
+ SDK_VERSION,
133
135
  getAssetCode,
134
136
  getAssetIcon,
135
137
  getAssetName,
@@ -1,7 +1,6 @@
1
1
  import ParaWeb from '@getpara/web-sdk';
2
2
  export declare const getAccount: (para?: ParaWeb) => Promise<{
3
3
  isConnected: boolean;
4
- isGuestMode: boolean;
5
4
  email: any;
6
5
  phone: any;
7
6
  wallets: any;
@@ -6,7 +6,6 @@ const getAccount = (para) => __async(void 0, null, function* () {
6
6
  const isLoggedIn = yield para == null ? void 0 : para.isFullyLoggedIn();
7
7
  const resp = {
8
8
  isConnected: !!isLoggedIn,
9
- isGuestMode: para == null ? void 0 : para.isGuestMode,
10
9
  email: void 0,
11
10
  phone: void 0,
12
11
  wallets: void 0
@@ -8,4 +8,3 @@ export { useLogout } from './useLogout.js';
8
8
  export { useKeepSessionAlive } from './useKeepSessionAlive.js';
9
9
  export { useSignMessage } from './useSignMessage.js';
10
10
  export { useSignTransaction } from './useSignTransaction.js';
11
- export { useCreateGuestWallets } from './useCreateGuestWallets.js';
@@ -10,10 +10,8 @@ import { useLogout } from "./useLogout.js";
10
10
  import { useKeepSessionAlive } from "./useKeepSessionAlive.js";
11
11
  import { useSignMessage } from "./useSignMessage.js";
12
12
  import { useSignTransaction } from "./useSignTransaction.js";
13
- import { useCreateGuestWallets } from "./useCreateGuestWallets.js";
14
13
  export {
15
14
  useCheckIfUserExists,
16
- useCreateGuestWallets,
17
15
  useCreateUser,
18
16
  useInitiateLogin,
19
17
  useKeepSessionAlive,
@@ -4,7 +4,6 @@ export declare const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
4
4
  */
5
5
  export declare const useAccount: () => import("@tanstack/react-query").UseQueryResult<{
6
6
  isConnected: boolean;
7
- isGuestMode: boolean;
8
7
  email: any;
9
8
  phone: any;
10
9
  wallets: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk",
3
- "version": "1.12.1-dev.2",
3
+ "version": "1.13.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.12.1-dev.0",
16
- "@getpara/react-components": "1.12.0",
17
- "@getpara/web-sdk": "1.12.0",
15
+ "@getpara/react-common": "1.13.0",
16
+ "@getpara/react-components": "1.13.0",
17
+ "@getpara/web-sdk": "1.13.0",
18
18
  "@tanstack/react-query": "^5.0.0",
19
19
  "date-fns": "^3.6.0",
20
20
  "framer-motion": "11.3.28",
@@ -23,6 +23,12 @@
23
23
  "zustand": "^4.5.2",
24
24
  "zustand-sync-tabs": "^0.2.2"
25
25
  },
26
+ "scripts": {
27
+ "post-build": "./scripts/post-build.sh",
28
+ "build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs && yarn post-build",
29
+ "typegen": "tsc --emitDeclarationOnly",
30
+ "test": "vitest run --coverage"
31
+ },
26
32
  "devDependencies": {
27
33
  "@testing-library/dom": "^10.4.0",
28
34
  "@testing-library/react": "^16.3.0",
@@ -51,11 +57,5 @@
51
57
  "resolutions": {
52
58
  "styled-components": "^6"
53
59
  },
54
- "gitHead": "e6e791d4e4f9afd94f2093d6045d686b85e5a682",
55
- "scripts": {
56
- "post-build": "./scripts/post-build.sh",
57
- "build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs && yarn post-build",
58
- "typegen": "tsc --emitDeclarationOnly",
59
- "test": "vitest run --coverage"
60
- }
61
- }
60
+ "gitHead": "cfc12a88a622907b3fbde326c891060fa53a2d32"
61
+ }
@@ -1,2 +0,0 @@
1
- import ParaWeb, { CreateGuestWalletsParams } from '@getpara/web-sdk';
2
- export declare const createGuestWallets: (para?: ParaWeb, args?: CreateGuestWalletsParams) => Promise<import("@getpara/web-sdk").Wallet[]>;
@@ -1,13 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- const createGuestWallets = (para, args) => __async(void 0, null, function* () {
6
- if (!para) {
7
- throw new Error("no para instance");
8
- }
9
- return yield para.createGuestWallets(args);
10
- });
11
- export {
12
- createGuestWallets
13
- };
@@ -1,15 +0,0 @@
1
- import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
2
- import { createGuestWallets } from '../../actions/createGuestWallets.js';
3
- import { Compute } from '../../types/utils.js';
4
- import { UseMutationReturnType } from '../../types/query.js';
5
- import { CreateGuestWalletsParams } from '@getpara/web-sdk';
6
- type Data = Awaited<ReturnType<typeof createGuestWallets>>;
7
- type UseCreateGuestWalletsReturnType<TData = Data, TError = Error, TVariables = CreateGuestWalletsParams, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
8
- createGuestWallets: UseMutateFunction<TData, TError, TVariables, TContext>;
9
- createGuestWalletsAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
10
- }>;
11
- /**
12
- * Hook for creating guest mode wallets
13
- */
14
- export declare const useCreateGuestWallets: () => UseCreateGuestWalletsReturnType<import("@getpara/web-sdk").Wallet[], Error, CreateGuestWalletsParams, unknown>;
15
- export {};
@@ -1,23 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { useMutation } from "@tanstack/react-query";
6
- import { useClient } from "../index.js";
7
- import { createGuestWallets } from "../../actions/createGuestWallets.js";
8
- import { renameMutations } from "../../utils/renameMutations.js";
9
- const useCreateGuestWallets = () => {
10
- const client = useClient();
11
- const mutation = useMutation({
12
- mutationFn: (args) => __async(void 0, null, function* () {
13
- return yield createGuestWallets(client, args);
14
- })
15
- });
16
- return renameMutations(
17
- mutation,
18
- "createGuestWallets"
19
- );
20
- };
21
- export {
22
- useCreateGuestWallets
23
- };